diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/lib/pqueue.h | 2 | ||||
-rw-r--r-- | inc/map.h | 3 | ||||
-rw-r--r-- | inc/parse.h | 13 | ||||
-rw-r--r-- | inc/schedule.h | 10 |
4 files changed, 23 insertions, 5 deletions
diff --git a/inc/lib/pqueue.h b/inc/lib/pqueue.h index 860a366..c576ee3 100644 --- a/inc/lib/pqueue.h +++ b/inc/lib/pqueue.h @@ -75,7 +75,7 @@ struct pqueue { * @return the handle or NULL for insufficent memory */ struct pqueue *pqueue_init(size_t n, pqueue_cmp_pri_f cmppri, - pqueue_get_pri_f getpri, pqueue_set_pos_f set_pos); + pqueue_get_pri_f getpri, pqueue_set_pos_f setpos); /** * free all memory used by the queue @@ -5,10 +5,13 @@ #define CALM_MAP_H #include <lib/hash.h> +#include <lib/pqueue.h> struct term *map_get(hash_t hash); void map_set(struct term *term, hash_t hash); void map_initialize(void); void map_destroy(void); +struct pqueue *map_to_pqueue(pqueue_cmp_pri_f cmppri, pqueue_get_pri_f getpri, + pqueue_set_pos_f set_pos); #endif diff --git a/inc/parse.h b/inc/parse.h index c1e21b2..e79fb26 100644 --- a/inc/parse.h +++ b/inc/parse.h @@ -15,11 +15,11 @@ struct term { size_t depth; union { struct { - hash_t term; + struct term *term; } abs; struct { - hash_t lhs; - hash_t rhs; + struct term *lhs; + struct term *rhs; } app; struct { int index; @@ -27,7 +27,12 @@ struct term { } u; }; -hash_t parse_blc(char **term, int depth); +struct term_handle { + struct term *term; + hash_t hash; +}; + +struct term_handle parse_blc(char **term, size_t depth); int parse_get_max_depth(void); #endif diff --git a/inc/schedule.h b/inc/schedule.h new file mode 100644 index 0000000..ad0e054 --- /dev/null +++ b/inc/schedule.h @@ -0,0 +1,10 @@ +// Copyright (c) 2023, Marvin Borner <dev@marvinborner.de> +// SPDX-License-Identifier: MIT + +#ifndef CALM_SCHEDULE_H +#define CALM_SCHEDULE_H + +void schedule_init(void); +void schedule_destroy(void); + +#endif |