git @ Cat's Eye Technologies Collapsiv / master src / collapsiv.h
master

Tree @master (Download .tar.gz)

collapsiv.h @masterraw · history · blame

/*
 * SPDX-FileCopyrightText: (c) 2024 Chris Pressey, Cat's Eye Technologies
 *
 * SPDX-License-Identifier: LicenseRef-BSD-2-Clause-X-Collapsiv
 */

/*
 * collapsiv.h
 */

#ifndef COLLAPSIV_H
#define COLLAPSIV_H

void push_atom(char atom);
void push_pointer(int index);
void make_ctor(int arity);
int is_atom(int index);
int is_pointer(int index);
int is_ctor(int index);
int term_size(int index);
void pop(void);
int compare_terms(int src_index, int dest_index);
int compare_terms_deep(int src_index, int dest_index);
void deduplicate(int index);
void deduplicate_top(void);
void dup(void);
void print_term(int index, int depth);
void dump_stack(void);
void reset_stack(void);

#ifdef COLLAPSIV_TESTING

int get_stack_pointer(void);
int get_stack_entry_type(int index);
char get_stack_entry_atom(int index);
int get_stack_entry_pointer(int index);
int get_stack_entry_arity(int index);

#endif /* defined COLLAPSIV_TESTING */

#endif /* !defined COLLAPSIV_H */