* added qse_cptl_t/qse_xptl_t
* deleted word substitution functions from awk
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dll.h 441 2011-04-22 14:28:43Z hyunghwan.chung $
|
||||
* $Id: dll.h 474 2011-05-23 16:52:37Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -195,9 +195,8 @@ struct qse_dll_node_t
|
||||
/* the first two fields in sync with qse_gdl_t */
|
||||
qse_dll_node_t* prev;
|
||||
qse_dll_node_t* next;
|
||||
|
||||
void* dptr; /**< data pointer */
|
||||
qse_size_t dlen; /**< data length */
|
||||
/* data */
|
||||
qse_xptl_t val;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -220,8 +219,9 @@ struct qse_dll_t
|
||||
#define QSE_DLL_COPIER_INLINE ((qse_dll_copier_t)2)
|
||||
|
||||
#define QSE_DLL_SCALE(dll) ((const int)(dll)->scale)
|
||||
#define QSE_DLL_DPTR(node) ((node)->dptr)
|
||||
#define QSE_DLL_DLEN(node) ((node)->dlen)
|
||||
|
||||
#define QSE_DLL_DPTR(node) ((node)->val.ptr)
|
||||
#define QSE_DLL_DLEN(node) ((node)->val.len)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: htb.h 441 2011-04-22 14:28:43Z hyunghwan.chung $
|
||||
* $Id: htb.h 474 2011-05-23 16:52:37Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -195,10 +195,8 @@ typedef qse_htb_pair_t* (*qse_htb_cbserter_t) (
|
||||
*/
|
||||
struct qse_htb_pair_t
|
||||
{
|
||||
void* kptr; /**< key pointer */
|
||||
qse_size_t klen; /**< key length */
|
||||
void* vptr; /**< value pointer */
|
||||
qse_size_t vlen; /**< value length */
|
||||
qse_xptl_t key;
|
||||
qse_xptl_t val;
|
||||
|
||||
/* management information below */
|
||||
qse_htb_pair_t* next;
|
||||
@ -253,7 +251,6 @@ struct qse_htb_t
|
||||
qse_htb_pair_t** bucket;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The QSE_HTB_COPIER_SIMPLE macros defines a copier that remembers the
|
||||
* pointer and length of data in a pair.
|
||||
@ -276,22 +273,23 @@ struct qse_htb_t
|
||||
/**
|
||||
* The QSE_HTB_SIZE() macro returns the number of pairs in a hash table.
|
||||
*/
|
||||
#define QSE_HTB_SIZE(m) ((const qse_size_t)(m)->size)
|
||||
#define QSE_HTB_SIZE(m) (*(const qse_size_t*)&(m)->size)
|
||||
|
||||
/**
|
||||
* The QSE_HTB_CAPA() macro returns the maximum number of pairs that can be
|
||||
* stored in a hash table without further reorganization.
|
||||
*/
|
||||
#define QSE_HTB_CAPA(m) ((const qse_size_t)(m)->capa)
|
||||
#define QSE_HTB_CAPA(m) (*(const qse_size_t*)&(m)->capa)
|
||||
|
||||
#define QSE_HTB_FACTOR(m) ((const int)(m)->factor)
|
||||
#define QSE_HTB_KSCALE(m) ((const int)(m)->scale[QSE_HTB_KEY])
|
||||
#define QSE_HTB_VSCALE(m) ((const int)(m)->scale[QSE_HTB_VAL])
|
||||
#define QSE_HTB_FACTOR(m) (*(const int*)&(m)->factor)
|
||||
#define QSE_HTB_KSCALE(m) (*(const int*)&(m)->scale[QSE_HTB_KEY])
|
||||
#define QSE_HTB_VSCALE(m) (*(const int*)&(m)->scale[QSE_HTB_VAL])
|
||||
|
||||
#define QSE_HTB_KPTR(p) ((p)->key.ptr)
|
||||
#define QSE_HTB_KLEN(p) ((p)->key.len)
|
||||
#define QSE_HTB_VPTR(p) ((p)->val.ptr)
|
||||
#define QSE_HTB_VLEN(p) ((p)->val.len)
|
||||
|
||||
#define QSE_HTB_KPTR(p) ((p)->kptr)
|
||||
#define QSE_HTB_KLEN(p) ((p)->klen)
|
||||
#define QSE_HTB_VPTR(p) ((p)->vptr)
|
||||
#define QSE_HTB_VLEN(p) ((p)->vlen)
|
||||
#define QSE_HTB_NEXT(p) ((p)->next)
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -641,9 +639,9 @@ qse_size_t qse_htb_dflhash (
|
||||
*/
|
||||
int qse_htb_dflcomp (
|
||||
qse_htb_t* htb,
|
||||
const void* kptr1,
|
||||
const void* kptr1,
|
||||
qse_size_t klen1,
|
||||
const void* kptr2,
|
||||
const void* kptr2,
|
||||
qse_size_t klen2
|
||||
);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: lda.h 441 2011-04-22 14:28:43Z hyunghwan.chung $
|
||||
* $Id: lda.h 474 2011-05-23 16:52:37Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -37,7 +37,7 @@ enum qse_lda_walk_t
|
||||
};
|
||||
|
||||
typedef struct qse_lda_t qse_lda_t;
|
||||
typedef struct qse_lda_node_t qse_lda_node_t;
|
||||
typedef struct qse_lda_slot_t qse_lda_slot_t;
|
||||
typedef enum qse_lda_walk_t qse_lda_walk_t;
|
||||
|
||||
#define QSE_LDA_COPIER_SIMPLE ((qse_lda_copier_t)1)
|
||||
@ -45,12 +45,12 @@ typedef enum qse_lda_walk_t qse_lda_walk_t;
|
||||
|
||||
#define QSE_LDA_NIL ((qse_size_t)-1)
|
||||
|
||||
#define QSE_LDA_SIZE(lda) ((const qse_size_t)(lda)->size)
|
||||
#define QSE_LDA_CAPA(lda) ((const qse_size_t)(lda)->capa)
|
||||
#define QSE_LDA_SIZE(lda) (*(const qse_size_t*)&(lda)->size)
|
||||
#define QSE_LDA_CAPA(lda) (*(const qse_size_t*)&(lda)->capa)
|
||||
|
||||
#define QSE_LDA_NODE(lda,index) ((lda)->node[index])
|
||||
#define QSE_LDA_DPTR(lda,index) ((lda)->node[index]->dptr)
|
||||
#define QSE_LDA_DLEN(lda,index) ((lda)->node[index]->dlen)
|
||||
#define QSE_LDA_DATA(lda,index) ((const qse_xptl_t*)&(lda)->node[index]->val)
|
||||
#define QSE_LDA_DPTR(lda,index) ((lda)->node[index]->val.ptr)
|
||||
#define QSE_LDA_DLEN(lda,index) ((lda)->node[index]->val.len)
|
||||
|
||||
/**
|
||||
* The qse_lda_copier_t type defines a callback function for node construction.
|
||||
@ -139,16 +139,15 @@ struct qse_lda_t
|
||||
qse_byte_t scale; /* scale factor */
|
||||
qse_size_t size; /* number of items */
|
||||
qse_size_t capa; /* capacity */
|
||||
qse_lda_node_t** node;
|
||||
qse_lda_slot_t** node;
|
||||
};
|
||||
|
||||
/**
|
||||
* The qse_lda_node_t type defines a linear dynamic array node
|
||||
* The qse_lda_slot_t type defines a linear dynamic array node
|
||||
*/
|
||||
struct qse_lda_node_t
|
||||
struct qse_lda_slot_t
|
||||
{
|
||||
void* dptr;
|
||||
qse_size_t dlen;
|
||||
qse_xptl_t val;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -286,17 +285,17 @@ qse_lda_t* qse_lda_setcapa (
|
||||
);
|
||||
|
||||
qse_size_t qse_lda_search (
|
||||
qse_lda_t* lda,
|
||||
qse_size_t pos,
|
||||
qse_lda_t* lda,
|
||||
qse_size_t pos,
|
||||
const void* dptr,
|
||||
qse_size_t dlen
|
||||
qse_size_t dlen
|
||||
);
|
||||
|
||||
qse_size_t qse_lda_rsearch (
|
||||
qse_lda_t* lda,
|
||||
qse_size_t pos,
|
||||
qse_lda_t* lda,
|
||||
qse_size_t pos,
|
||||
const void* dptr,
|
||||
qse_size_t dlen
|
||||
qse_size_t dlen
|
||||
);
|
||||
|
||||
qse_size_t qse_lda_upsert (
|
||||
|
@ -170,10 +170,8 @@ typedef qse_rbt_pair_t* (*qse_rbt_cbserter_t) (
|
||||
*/
|
||||
struct qse_rbt_pair_t
|
||||
{
|
||||
void* kptr; /**< key pointer */
|
||||
qse_size_t klen; /**< key length */
|
||||
void* vptr; /**< value pointer */
|
||||
qse_size_t vlen; /**< value length */
|
||||
qse_xptl_t key;
|
||||
qse_xptl_t val;
|
||||
|
||||
/* management information below */
|
||||
enum
|
||||
@ -258,10 +256,11 @@ struct qse_rbt_t
|
||||
#define QSE_RBT_KSCALE(m) ((const int)(m)->scale[QSE_RBT_KEY])
|
||||
#define QSE_RBT_VSCALE(m) ((const int)(m)->scale[QSE_RBT_VAL])
|
||||
|
||||
#define QSE_RBT_KPTR(p) ((p)->kptr)
|
||||
#define QSE_RBT_KLEN(p) ((p)->klen)
|
||||
#define QSE_RBT_VPTR(p) ((p)->vptr)
|
||||
#define QSE_RBT_VLEN(p) ((p)->vlen)
|
||||
#define QSE_RBT_KPTR(p) ((p)->key.ptr)
|
||||
#define QSE_RBT_KLEN(p) ((p)->key.len)
|
||||
#define QSE_RBT_VPTR(p) ((p)->val.ptr)
|
||||
#define QSE_RBT_VLEN(p) ((p)->val.len)
|
||||
|
||||
#define QSE_RBT_NEXT(p) ((p)->next)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: sll.h 441 2011-04-22 14:28:43Z hyunghwan.chung $
|
||||
* $Id: sll.h 474 2011-05-23 16:52:37Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||
This file is part of QSE.
|
||||
@ -124,8 +124,7 @@ struct qse_sll_t
|
||||
struct qse_sll_node_t
|
||||
{
|
||||
qse_sll_node_t* next; /* point to the next node */
|
||||
void* dptr; /* data pointer */
|
||||
qse_size_t dlen; /* data length */
|
||||
qse_xptl_t val;
|
||||
};
|
||||
|
||||
#define QSE_SLL_COPIER_SIMPLE ((qse_sll_copier_t)1)
|
||||
@ -139,12 +138,12 @@ struct qse_sll_node_t
|
||||
/**
|
||||
* The QSE_SLL_DPTR macro gets the data pointer in a node.
|
||||
*/
|
||||
#define QSE_SLL_DPTR(node) ((node)->dptr)
|
||||
#define QSE_SLL_DPTR(node) ((node)->val.ptr)
|
||||
|
||||
/**
|
||||
* The QSE_SLL_DLEN macro gets the length of data in a node.
|
||||
*/
|
||||
#define QSE_SLL_DLEN(node) ((node)->dlen)
|
||||
#define QSE_SLL_DLEN(node) ((node)->val.len)
|
||||
|
||||
/**
|
||||
* The QSE_SLL_NEXT macro gets the next node.
|
||||
|
Reference in New Issue
Block a user