/* * rpn.c: evalutor of RPN formulas */ #include #include #include #include "config.h" #include "rpn.h" #include "trie.h" // Growing stack implementation struct grow { struct trie_retval *arr; int64_t elems; int64_t alloc; } static struct grow *grow_init(void) { struct grow *g = malloc(sizeof(struct grow)); if (g == NULL) { syslog(cfg_log_facility | LOG_ERR, "rpn: Could not initialize growing array: %m"); return NULL; } g -> arr = NULL; g -> elems = 0; g -> alloc = 0; return g; } static bool grow_push (int64_t val, struct grow *stack) { if (stack -> alloc <= stack -> elems) { stack } } bool rpn_eval (char rpn[]) { }