added the fcb field to the awk value header
This commit is contained in:
parent
8682cc32e7
commit
bd95bb3d2b
@ -157,15 +157,17 @@ typedef qse_floc_t qse_awk_loc_t;
|
|||||||
/*
|
/*
|
||||||
#define QSE_AWK_VAL_HDR \
|
#define QSE_AWK_VAL_HDR \
|
||||||
unsigned int type: 4; \
|
unsigned int type: 4; \
|
||||||
unsigned int ref: 25; \
|
unsigned int ref: 24; \
|
||||||
unsigned int stat: 1; \
|
unsigned int stat: 1; \
|
||||||
unsigned int nstr: 2
|
unsigned int nstr: 2; \
|
||||||
|
unsigned int fcb: 1
|
||||||
*/
|
*/
|
||||||
#define QSE_AWK_VAL_HDR \
|
#define QSE_AWK_VAL_HDR \
|
||||||
qse_uintptr_t v_type: 4; \
|
qse_uintptr_t v_type: 4; \
|
||||||
qse_uintptr_t ref: ((QSE_SIZEOF_UINTPTR_T * 8) - 7); \
|
qse_uintptr_t ref: ((QSE_SIZEOF_UINTPTR_T * 8) - 8); \
|
||||||
qse_uintptr_t stat: 1; \
|
qse_uintptr_t stat: 1; \
|
||||||
qse_uintptr_t nstr: 2
|
qse_uintptr_t nstr: 2; \
|
||||||
|
qse_uintptr_t fcb: 1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The qse_awk_val_t type is an abstract value type. A value commonly contains:
|
* The qse_awk_val_t type is an abstract value type. A value commonly contains:
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
#define CHUNKSIZE QSE_AWK_VAL_CHUNK_SIZE
|
#define CHUNKSIZE QSE_AWK_VAL_CHUNK_SIZE
|
||||||
|
|
||||||
static qse_awk_val_nil_t awk_nil = { QSE_AWK_VAL_NIL, 0, 1, 0 };
|
static qse_awk_val_nil_t awk_nil = { QSE_AWK_VAL_NIL, 0, 1, 0, 0 };
|
||||||
static qse_awk_val_str_t awk_zls = { QSE_AWK_VAL_STR, 0, 1, 0, { QSE_T(""), 0 } };
|
static qse_awk_val_str_t awk_zls = { QSE_AWK_VAL_STR, 0, 1, 0, 0, { QSE_T(""), 0 } };
|
||||||
|
|
||||||
qse_awk_val_t* qse_awk_val_nil = (qse_awk_val_t*)&awk_nil;
|
qse_awk_val_t* qse_awk_val_nil = (qse_awk_val_t*)&awk_nil;
|
||||||
qse_awk_val_t* qse_awk_val_zls = (qse_awk_val_t*)&awk_zls;
|
qse_awk_val_t* qse_awk_val_zls = (qse_awk_val_t*)&awk_zls;
|
||||||
@ -102,6 +102,7 @@ qse_awk_val_t* qse_awk_rtx_makeintval (qse_awk_rtx_t* rtx, qse_awk_int_t v)
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->i_val = v;
|
val->i_val = v;
|
||||||
val->nde = QSE_NULL;
|
val->nde = QSE_NULL;
|
||||||
|
|
||||||
@ -152,6 +153,7 @@ qse_awk_val_t* qse_awk_rtx_makefltval (qse_awk_rtx_t* rtx, qse_awk_flt_t v)
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->val = v;
|
val->val = v;
|
||||||
val->nde = QSE_NULL;
|
val->nde = QSE_NULL;
|
||||||
|
|
||||||
@ -191,6 +193,7 @@ init:
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->val.len = str->len;
|
val->val.len = str->len;
|
||||||
val->val.ptr = (qse_char_t*)(val + 1);
|
val->val.ptr = (qse_char_t*)(val + 1);
|
||||||
if (str->ptr) qse_strncpy (val->val.ptr, str->ptr, str->len);
|
if (str->ptr) qse_strncpy (val->val.ptr, str->ptr, str->len);
|
||||||
@ -332,6 +335,7 @@ init:
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->val.len = len1 + len2;
|
val->val.len = len1 + len2;
|
||||||
val->val.ptr = (qse_char_t*)(val + 1);
|
val->val.ptr = (qse_char_t*)(val + 1);
|
||||||
qse_strncpy (val->val.ptr, str1, len1);
|
qse_strncpy (val->val.ptr, str1, len1);
|
||||||
@ -386,6 +390,7 @@ qse_awk_val_t* qse_awk_rtx_makembsval (qse_awk_rtx_t* rtx, const qse_mchar_t* pt
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->val.len = len;
|
val->val.len = len;
|
||||||
val->val.ptr = (qse_mchar_t*)(val + 1);
|
val->val.ptr = (qse_mchar_t*)(val + 1);
|
||||||
if (ptr) QSE_MEMCPY (val->val.ptr, ptr, xsz);
|
if (ptr) QSE_MEMCPY (val->val.ptr, ptr, xsz);
|
||||||
@ -417,6 +422,7 @@ qse_awk_val_t* qse_awk_rtx_makerexval (qse_awk_rtx_t* rtx, const qse_cstr_t* str
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->str.len = str->len;
|
val->str.len = str->len;
|
||||||
|
|
||||||
val->str.ptr = (qse_char_t*)(val + 1);
|
val->str.ptr = (qse_char_t*)(val + 1);
|
||||||
@ -484,6 +490,7 @@ qse_awk_val_t* qse_awk_rtx_makemapval (qse_awk_rtx_t* rtx)
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->map = qse_htb_open(run, 256, 70, free_mapval, same_mapval, run->awk->mmgr);
|
val->map = qse_htb_open(run, 256, 70, free_mapval, same_mapval, run->awk->mmgr);
|
||||||
if (val->map == QSE_NULL)
|
if (val->map == QSE_NULL)
|
||||||
{
|
{
|
||||||
@ -500,6 +507,7 @@ qse_awk_val_t* qse_awk_rtx_makemapval (qse_awk_rtx_t* rtx)
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->map = (qse_htb_t*)(val + 1);
|
val->map = (qse_htb_t*)(val + 1);
|
||||||
|
|
||||||
if (qse_htb_init(val->map, rtx->awk->mmgr, 256, 70, QSE_SIZEOF(qse_char_t), 1) <= -1)
|
if (qse_htb_init(val->map, rtx->awk->mmgr, 256, 70, QSE_SIZEOF(qse_char_t), 1) <= -1)
|
||||||
@ -660,6 +668,7 @@ qse_awk_val_t* qse_awk_rtx_makerefval (qse_awk_rtx_t* rtx, int id, qse_awk_val_t
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->id = id;
|
val->id = id;
|
||||||
val->adr = adr;
|
val->adr = adr;
|
||||||
|
|
||||||
@ -676,6 +685,7 @@ qse_awk_val_t* qse_awk_rtx_makefunval (qse_awk_rtx_t* rtx, const qse_awk_fun_t*
|
|||||||
val->ref = 0;
|
val->ref = 0;
|
||||||
val->stat = 0;
|
val->stat = 0;
|
||||||
val->nstr = 0;
|
val->nstr = 0;
|
||||||
|
val->fcb = 0;
|
||||||
val->fun = (qse_awk_fun_t*)fun;
|
val->fun = (qse_awk_fun_t*)fun;
|
||||||
|
|
||||||
return (qse_awk_val_t*)val;
|
return (qse_awk_val_t*)val;
|
||||||
|
@ -85,7 +85,8 @@ endif
|
|||||||
if ENABLE_AWKMOD_SED
|
if ENABLE_AWKMOD_SED
|
||||||
libqseawk_sed_la_SOURCES = mod-sed.c mod-sed.h
|
libqseawk_sed_la_SOURCES = mod-sed.c mod-sed.h
|
||||||
libqseawk_sed_la_CPPFLAGS = $(CPPFLAGS_COMMON)
|
libqseawk_sed_la_CPPFLAGS = $(CPPFLAGS_COMMON)
|
||||||
libqseawk_sed_la_LDFLAGS = $(LDFLAGS_COMMON) -L../sed
|
## ../sed must be placed before LDFLAGS_COMMON because it should precede $(libdir)
|
||||||
|
libqseawk_sed_la_LDFLAGS = -L../sed $(LDFLAGS_COMMON)
|
||||||
libqseawk_sed_la_LIBADD = $(LIBADD_COMMON) -lqsesed
|
libqseawk_sed_la_LIBADD = $(LIBADD_COMMON) -lqsesed
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ CPPFLAGS_COMMON = \
|
|||||||
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_LIBADD = $(LIBADD_COMMON) -lmysqlclient_r
|
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_LIBADD = $(LIBADD_COMMON) -lmysqlclient_r
|
||||||
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_SOURCES = mod-sed.c mod-sed.h
|
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_SOURCES = mod-sed.c mod-sed.h
|
||||||
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_CPPFLAGS = $(CPPFLAGS_COMMON)
|
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_CPPFLAGS = $(CPPFLAGS_COMMON)
|
||||||
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_LDFLAGS = $(LDFLAGS_COMMON) -L../sed
|
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_LDFLAGS = -L../sed $(LDFLAGS_COMMON)
|
||||||
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_LIBADD = $(LIBADD_COMMON) -lqsesed
|
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_LIBADD = $(LIBADD_COMMON) -lqsesed
|
||||||
@ENABLE_AWKMOD_UCI_TRUE@libqseawk_uci_la_SOURCES = mod-uci.c mod-uci.h
|
@ENABLE_AWKMOD_UCI_TRUE@libqseawk_uci_la_SOURCES = mod-uci.c mod-uci.h
|
||||||
@ENABLE_AWKMOD_UCI_TRUE@libqseawk_uci_la_CPPFLAGS = $(CPPFLAGS_COMMON)
|
@ENABLE_AWKMOD_UCI_TRUE@libqseawk_uci_la_CPPFLAGS = $(CPPFLAGS_COMMON)
|
||||||
|
Loading…
Reference in New Issue
Block a user