1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
765 B
C

/*
* trie.h: declaration of functions workong with trie
*/
#ifndef TRIE_H
#define TRIE_H
#include <stdbool.h>
#include <stdint.h>
#include "grow.h"
struct trie {
int64_t val;
struct trie *children[37]; //Alphabet: A-Z0-9_
bool def;
struct grow *tasks;
};
enum trie_ret_status {OK, UNDEF};
struct trie_retval {
int64_t val;
bool def;
struct grow *tasks;
};
struct trie_list {
int64_t val;
char *name;
};
struct trie_retval trie_lookup(char string[]);
bool trie_set (char string[], int64_t val);
bool trie_unset (char string[]);
struct grow *trie_list(void);
bool trie_assoc(char var[], uint64_t task);
bool trie_unassoc(char var[], uint64_t task);
bool trie_load(const char fn[]);
bool trie_save(const char fn[]);
void trie_flush(void);
#endif