From 969cd186f693620bad9e38f7a13fdd094d47fc2b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 17 Jul 2005 16:06:28 +0000 Subject: [PATCH] *** empty log message *** --- ase/stx/symtab.c | 33 +++++++++++++++++++++++++++++++++ ase/stx/symtab.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 ase/stx/symtab.c create mode 100644 ase/stx/symtab.h diff --git a/ase/stx/symtab.c b/ase/stx/symtab.c new file mode 100644 index 00000000..cb184938 --- /dev/null +++ b/ase/stx/symtab.c @@ -0,0 +1,33 @@ +/* + * $Id: symtab.c,v 1.1 2005-07-17 16:06:28 bacon Exp $ + */ + +#include +#include + +xp_stx_symtab_t* xp_stx_symtab_open (xp_stx_symtab_t* symtab) +{ + if (symtab == XP_NULL) { + symtab = (xp_stx_symtab_t*) + xp_malloc (xp_sizeof(xp_stx_symtab_t)); + if (symtab == XP_NULL) return -1; + symtab->__malloced = xp_true; + } + else symtab->__malloced = xp_false; + + symtab->data = XP_NULL; + symtab->capacity = 0; + symtab->size = 0; + + return symtab; +} + +void xp_stx_symtab_close (xp_stx_symtab_t* symtab) +{ + if (symtab->data != XP_NULL) xp_free (symtab->data); + if (symtab->__malloced) xp_free (symtab); +} + +int xp_stx_symtab_get (xp_stx_symtab_t* symtab, const xp_char_t* str) +{ +} diff --git a/ase/stx/symtab.h b/ase/stx/symtab.h new file mode 100644 index 00000000..458fda52 --- /dev/null +++ b/ase/stx/symtab.h @@ -0,0 +1,29 @@ +/* + * $Id: symtab.h,v 1.1 2005-07-17 16:06:28 bacon Exp $ + */ + +#ifndef _XP_STX_SYMTAB_H_ +#define _XP_STX_SYMTAB_H_ + +#include + +struct xp_stx_symtab_t +{ + xp_word_t* data; + xp_word_t capacity; + xp_word_t size; + xp_bool_t __malloced; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +xp_stx_symtab_t* xp_stx_symtab_open (xp_stx_symtab_t* symtab); +void xp_stx_symtab_close (xp_stx_symtab_t* symtab); + +#ifdef __cplusplus +} +#endif + +#endif