fixed minor bugs

This commit is contained in:
2008-12-16 03:56:48 +00:00
parent f675b072d6
commit 44717bbb4f
21 changed files with 171 additions and 299 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.h 478 2008-12-12 09:42:32Z baconevi $
* $Id: awk.h 496 2008-12-15 09:56:48Z baconevi $
*
* {License}
*/
@ -606,8 +606,8 @@ extern ase_awk_val_t* ase_awk_val_one;
* SYNOPSIS
*/
ase_awk_t* ase_awk_open (
ase_mmgr_t* mmgr /* a memory manager */,
ase_size_t ext /* size of extension area in bytes */
ase_mmgr_t* mmgr /* a memory manager */,
ase_size_t xtnsize /* size of extension area in bytes */
);
/******/
@ -648,19 +648,19 @@ void ase_awk_setmmgr (
ase_mmgr_t* mmgr
);
/****f* ase.awk/ase_awk_getextension
/****f* ase.awk/ase_awk_getxtn
* NAME
* ase_awk_getextension - get the extension
* ase_awk_getxtn - get the extension
*
* DESCRIPTION
* The extension area is allocated in the ase_awk_open() function when it is
* given a positive extension size. The pointer to the beginning of the area
* can be acquired using the ase_awk_getextension() function and be utilized
* can be acquired using the ase_awk_getxtn() function and be utilized
* for various purposes.
*
* SYNOPSIS
*/
void* ase_awk_getextension (
void* ase_awk_getxtn (
ase_awk_t* awk /* an awk object */
);
/******/
@ -832,7 +832,9 @@ int ase_awk_parse (
*
* SYNOPSIS
*/
ase_awk_t* ase_awk_opensimple (void);
ase_awk_t* ase_awk_opensimple (
ase_size_t xtnsize /* size of extension area in bytes */
);
/******/
/****f* ase.awk/ase_awk_parsesimple
@ -856,8 +858,9 @@ int ase_awk_parsesimple (
* SYNOPSIS
*/
int ase_awk_runsimple (
ase_awk_t* awk,
ase_char_t** icf /* input console files */
ase_awk_t* awk,
ase_char_t** icf /* input console files */,
ase_awk_runcbs_t* cbs /* callbacks */
);
/******/
@ -1155,36 +1158,4 @@ int ase_awk_strtonum (
}
#endif
struct ase_ns_awk_t
{
ase_awk_t* (*open) (ase_mmgr_t*, ase_size_t ext);
int (*close) (ase_awk_t*);
ase_mmgr_t* (*getmmgr) (ase_awk_t*);
void (*setmmgr) (ase_awk_t*, ase_mmgr_t*);
void* (*getextension) (ase_awk_t*);
ase_ccls_t* (*getccls) (ase_awk_t*);
void (*setccls) (ase_awk_t*, ase_ccls_t*);
ase_awk_prmfns_t* (*getprmfns) (ase_awk_t*);
void (*setprmfns) (ase_awk_t*, ase_awk_prmfns_t*);
int (*parse) (ase_awk_t*, ase_awk_srcios_t*);
};
#define ase_ns_awk_d \
{ \
ase_awk_open, \
ase_awk_close, \
ase_awk_getmmgr, \
ase_awk_setmmgr, \
ase_awk_getextension, \
ase_awk_getccls, \
ase_awk_setccls, \
ase_awk_getprmfns, \
ase_awk_setprmfns, \
ase_awk_parse \
}
#endif

View File

@ -148,7 +148,7 @@ ase_dll_freeer_t ase_dll_getfreeer (
* NAME Gets the pointer to the extension area
* RETURN the pointer to the extension area
*/
void* ase_dll_getextension (
void* ase_dll_getxtn (
ase_dll_t* dll /* a singly linked list */
);

View File

@ -43,13 +43,14 @@ typedef enum ase_lda_walk_t ase_lda_walk_t;
#define ASE_LDA_DLEN(lda,index) ((lda)->node[index]->dlen)
#define ASE_LDA_MMGR(lda) ((lda)->mmgr)
#define ASE_LDA_XTN(lda) ((void*)(((ase_lda_t*)lda) + 1))
#define ASE_LDA_COPIER(lda) ((lda)->copier)
#define ASE_LDA_FREEER(lda) ((lda)->freeer)
#define ASE_LDA_COMPER(lda) ((lda)->comper)
#define ASE_LDA_KEEPER(lda) ((lda)->keeper)
#define ASE_LDA_SIZER(lda) ((lda)->sizer)
#define ASE_LDA_EXTENSION(lda) ((void*)(((ase_lda_t*)lda) + 1))
/****b* ase.cmn.lda/ase_lda_copier_t
@ -244,16 +245,16 @@ void ase_lda_fini (
);
/******/
/****f* ase.cmn.lda/ase_lda_getextension
/****f* ase.cmn.lda/ase_lda_getxtn
* NAME
* ase_lda_getextension - get the pointer to the extension
* ase_lda_getxtn - get the pointer to the extension
*
* DESCRIPTION
* The ase_lda_getextension() function returns the pointer to the extension.
* The ase_lda_getxtn() function returns the pointer to the extension.
*
* SYNOPSIS
*/
void* ase_lda_getextension (
void* ase_lda_getxtn (
ase_lda_t* lda /* a linear dynamic array */
);
/******/

View File

@ -1,5 +1,5 @@
/*
* $Id: map.h 483 2008-12-14 13:25:42Z baconevi $
* $Id: map.h 496 2008-12-15 09:56:48Z baconevi $
*
* {License}
*/
@ -223,6 +223,8 @@ struct ase_map_t
/*****/
#define ASE_MAP_MMGR(m) ((m)->mmgr)
#define ASE_MAP_XTN(m) ((void*)(((ase_map_t*)m) + 1))
#define ASE_MAP_KCOPIER(m) ((m)->copier[ASE_MAP_KEY])
#define ASE_MAP_VCOPIER(m) ((m)->copier[ASE_MAP_VAL])
#define ASE_MAP_KFREEER(m) ((m)->freeer[ASE_MAP_KEY])
@ -231,7 +233,6 @@ struct ase_map_t
#define ASE_MAP_COMPER(m) ((m)->comper)
#define ASE_MAP_KEEPER(m) ((m)->keeper)
#define ASE_MAP_SIZER(m) ((m)->sizer)
#define ASE_MAP_EXTENSION(m) ((void*)(((ase_map_t*)m) + 1))
#define ASE_MAP_FACTOR(m) ((m)->factor)
#define ASE_MAP_KSCALE(m) ((m)->scale[ASE_MAP_KEY])
@ -257,7 +258,7 @@ extern "C" {
* than 0. The load factor should be between 0 and 100 inclusive and the load
* factor of 0 disables bucket resizing. If you need extra space associated
* with a map, you may pass a non-zero value as the second parameter.
* The ASE_MAP_EXTENSION() macro and the ase_map_getextension() function
* The ASE_MAP_XTN() macro and the ase_map_getxtn() function
* return the pointer to the beginning of the extension.
*
* RETURN
@ -265,7 +266,7 @@ extern "C" {
* ASE_NULL on failure.
*
* SEE ALSO
* ASE_MAP_EXTENSION, ase_map_getextension
* ASE_MAP_XTN, ase_map_getxtn
*
* SYNOPSIS
*/
@ -303,7 +304,7 @@ void ase_map_fini (
ase_map_t* map
);
void* ase_map_getextension (
void* ase_map_getxtn (
ase_map_t* map
);

View File

@ -166,6 +166,7 @@ struct ase_sll_node_t
#define ASE_SLL_COPIER_INLINE ((ase_sll_copier_t)2)
#define ASE_SLL_MMGR(sll) ((sll)->mmgr)
#define ASE_SLL_XTN(s) ((void*)(((ase_sll_t*)s) + 1))
#define ASE_SLL_COPIER(sll) ((sll)->copier)
#define ASE_SLL_FREEER(sll) ((sll)->freeer)
#define ASE_SLL_COMPER(sll) ((sll)->comper)
@ -261,16 +262,16 @@ void ase_sll_fini (
);
/******/
/****f* ase.cmn.sll/ase_sll_getextension
/****f* ase.cmn.sll/ase_sll_getxtn
* NAME
* ase_sll_getextension - get the pointer to the extension
* ase_sll_getxtn - get the pointer to the extension
*
* DESCRIPTION
* The ase_sll_getextension() function returns the pointer to the extension.
* The ase_sll_getxtn() function returns the pointer to the extension.
*
* SYNOPSIS
*/
void* ase_sll_getextension (
void* ase_sll_getxtn (
ase_sll_t* sll /* a singly linked list */
);
/******/

View File

@ -1,5 +1,5 @@
/*
* $Id: str.h 455 2008-11-26 09:05:00Z baconevi $
* $Id: str.h 496 2008-12-15 09:56:48Z baconevi $
*
* {License}
*/
@ -34,8 +34,8 @@
#define ASE_STR_CHAR(s,idx) ((s)->ptr[idx])
#define ASE_STR_MMGR(s) ((s)->mmgr)
#define ASE_STR_XTN(s) ((void*)(((ase_str_t*)s) + 1))
#define ASE_STR_SIZER(s) ((s)->sizer)
#define ASE_STR_EXTENSION(s) ((void*)(((ase_str_t*)s) + 1))
typedef struct ase_str_t ase_str_t;
typedef ase_size_t (*ase_str_sizer_t) (ase_str_t* data, ase_size_t hint);
@ -273,7 +273,7 @@ int ase_str_yield (
);
/******/
void* ase_str_getextension (
void* ase_str_getxtn (
ase_str_t* str
);

View File

@ -46,6 +46,7 @@ enum
#define ASE_TIO_MMGR(tio) ((tio)->mmgr)
#define ASE_TIO_XTN(s) ((void*)(((ase_tio_t*)s) + 1))
#define ASE_TIO_ERRNUM(tio) ((tio)->errnum)
/*
@ -115,7 +116,7 @@ int ase_tio_fini (
ase_tio_t* tio
);
void* ase_tio_getextension (
void* ase_tio_getxtn (
ase_tio_t* tio
);