*** empty log message ***

This commit is contained in:
hyung-hwan 2005-07-17 16:06:28 +00:00
parent e519a026ef
commit 969cd186f6
2 changed files with 62 additions and 0 deletions

33
ase/stx/symtab.c Normal file
View File

@ -0,0 +1,33 @@
/*
* $Id: symtab.c,v 1.1 2005-07-17 16:06:28 bacon Exp $
*/
#include <xp/stx/symtab.h>
#include <xp/bas/memory.h>
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)
{
}

29
ase/stx/symtab.h Normal file
View File

@ -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 <xp/stx/stx.h>
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