*** empty log message ***

This commit is contained in:
hyung-hwan 2005-09-17 17:42:21 +00:00
parent 92d04986d6
commit f0448b3e43
3 changed files with 58 additions and 12 deletions

View File

@ -1,17 +1,19 @@
/* /*
* $Id: lisp.c,v 1.10 2005-05-30 07:15:35 bacon Exp $ * $Id: lsp.c,v 1.1 2005-09-17 17:42:21 bacon Exp $
*/ */
#include <xp/lsp/lisp.h> #include <xp/lsp/lisp.h>
#include <xp/bas/memory.h> #include <xp/bas/memory.h>
#include <xp/bas/assert.h> #include <xp/bas/assert.h>
xp_lisp_t* xp_lisp_new (xp_size_t mem_ubound, xp_size_t mem_ubound_inc) xp_lisp_t* xp_lisp_open (xp_lisp_t* lsp, xp_size_t mem_ubound, xp_size_t mem_ubound_inc)
{ {
xp_lisp_t* lsp; if (lsp == XP_NULL) {
lsp = (xp_lisp_t*)xp_malloc(sizeof(xp_lisp_t)); lsp = (xp_lisp_t*)xp_malloc(sizeof(xp_lisp_t));
if (lsp == XP_NULL) return lsp; if (lsp == XP_NULL) return lsp;
lsp->__malloced = xp_true;
}
else lsp->__malloced = xp_false;
lsp->token = xp_lisp_token_new (256); lsp->token = xp_lisp_token_new (256);
if (lsp->token == XP_NULL) { if (lsp->token == XP_NULL) {
@ -52,7 +54,7 @@ void xp_lisp_free (xp_lisp_t* lsp)
xp_lisp_mem_free (lsp->mem); xp_lisp_mem_free (lsp->mem);
xp_lisp_token_free (lsp->token); xp_lisp_token_free (lsp->token);
free (lsp); if (lsp->__malloced) xp_free (lsp);
} }
int xp_lisp_error (xp_lisp_t* lsp, xp_char_t* buf, xp_size_t size) int xp_lisp_error (xp_lisp_t* lsp, xp_char_t* buf, xp_size_t size)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: lisp.h,v 1.5 2005-05-28 13:34:26 bacon Exp $ * $Id: lsp.h,v 1.1 2005-09-17 17:42:21 bacon Exp $
*/ */
#ifndef _XP_LSP_LISP_H_ #ifndef _XP_LSP_LISP_H_
@ -58,6 +58,7 @@ struct xp_lisp_t
/* memory manager */ /* memory manager */
xp_lisp_mem_t* mem; xp_lisp_mem_t* mem;
xp_bool_t __malloced;
}; };
typedef struct xp_lisp_t xp_lisp_t; typedef struct xp_lisp_t xp_lisp_t;
@ -67,8 +68,10 @@ extern "C" {
#endif #endif
/* lsp.c */ /* lsp.c */
xp_lisp_t* xp_lisp_new (xp_size_t mem_ubound, xp_size_t mem_ubound_inc); xp_lisp_t* xp_lisp_open (xp_lisp_t* lisp,
void xp_lisp_free (xp_lisp_t* lsp); xp_size_t mem_ubound, xp_size_t mem_ubound_inc);
void xp_lisp_close (xp_lisp_t* lsp);
int xp_lisp_error (xp_lisp_t* lsp, xp_char_t* buf, xp_size_t size); int xp_lisp_error (xp_lisp_t* lsp, xp_char_t* buf, xp_size_t size);
/* read.c */ /* read.c */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: types.h,v 1.31 2005-08-15 04:14:54 bacon Exp $ * $Id: types.h,v 1.32 2005-09-17 17:42:21 bacon Exp $
*/ */
#ifndef _XP_TYPES_H_ #ifndef _XP_TYPES_H_
@ -13,6 +13,47 @@
#include <xp/config.h> #include <xp/config.h>
#endif #endif
/*
* HEADER: types.h
* The toolkit predefines some of commonly used data types.
*
* GROUP: State Types
*
* TYPE: xp_bool_t
* Boolean type
*
* TYPE: xp_tri_t
* Tri-State type
*
* GROUP: Integral Types
*
* TYPE: xp_byte_t
*
* TYPE: xp_int_t
*
* TYPE: xp_uint_t
*
* TYPE: xp_long_t
*
* TYPE: xp_ulong_t
*
* TYPE: xp_int8_t
*
* TYPE: xp_uint8_t
*
* TYPE: xp_int16_t
*
* TYPE: xp_uint16_t
*
* TYPE: xp_int32_t
*
* TYPE: xp_uint32_t
*
* TYPE: xp_int64_t
*
* TYPE: xp_uint64_t
*/
/* boolean type */ /* boolean type */
/* /*
#ifdef __cplusplus #ifdef __cplusplus