2006-01-29 18:28:14 +00:00
|
|
|
/*
|
2006-08-03 06:06:27 +00:00
|
|
|
* $Id: tab.h,v 1.10 2006-08-03 06:06:27 bacon Exp $
|
2006-01-29 18:28:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _XP_AWK_TAB_H_
|
|
|
|
#define _XP_AWK_TAB_H_
|
|
|
|
|
2006-03-03 11:51:48 +00:00
|
|
|
#ifndef _XP_AWK_AWK_H_
|
|
|
|
#error Never include this file directly. Include <xp/awk/awk.h> instead
|
|
|
|
#endif
|
|
|
|
|
2006-04-14 10:56:42 +00:00
|
|
|
/* TODO: you have to turn this into a hash table.
|
|
|
|
as of now, this is an arrayed table. */
|
2006-01-29 18:28:14 +00:00
|
|
|
|
|
|
|
typedef struct xp_awk_tab_t xp_awk_tab_t;
|
|
|
|
|
|
|
|
struct xp_awk_tab_t
|
|
|
|
{
|
2006-08-03 06:06:27 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
xp_char_t* name;
|
|
|
|
xp_size_t name_len;
|
|
|
|
}* buf;
|
|
|
|
//xp_char_t** buf;
|
2006-01-29 18:28:14 +00:00
|
|
|
xp_size_t size;
|
|
|
|
xp_size_t capa;
|
|
|
|
xp_bool_t __dynamic;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
xp_awk_tab_t* xp_awk_tab_open (xp_awk_tab_t* tab);
|
|
|
|
void xp_awk_tab_close (xp_awk_tab_t* tab);
|
|
|
|
|
|
|
|
xp_size_t xp_awk_tab_getsize (xp_awk_tab_t* tab);
|
|
|
|
xp_size_t xp_awk_tab_getcapa (xp_awk_tab_t* tab);
|
|
|
|
xp_awk_tab_t* xp_awk_tab_setcapa (xp_awk_tab_t* tab, xp_size_t capa);
|
|
|
|
|
|
|
|
void xp_awk_tab_clear (xp_awk_tab_t* tab);
|
|
|
|
|
2006-03-07 15:55:14 +00:00
|
|
|
xp_size_t xp_awk_tab_insert (
|
2006-08-03 06:06:27 +00:00
|
|
|
xp_awk_tab_t* tab, xp_size_t index,
|
|
|
|
const xp_char_t* str, xp_size_t len);
|
|
|
|
|
2006-03-07 15:55:14 +00:00
|
|
|
xp_size_t xp_awk_tab_remove (
|
2006-01-29 18:28:14 +00:00
|
|
|
xp_awk_tab_t* tab, xp_size_t index, xp_size_t count);
|
|
|
|
|
2006-08-03 06:06:27 +00:00
|
|
|
xp_size_t xp_awk_tab_add (
|
|
|
|
xp_awk_tab_t* tab, const xp_char_t* str, xp_size_t len);
|
2006-03-07 15:55:14 +00:00
|
|
|
|
2006-01-29 18:28:14 +00:00
|
|
|
xp_size_t xp_awk_tab_find (
|
2006-08-03 06:06:27 +00:00
|
|
|
xp_awk_tab_t* tab, xp_size_t index,
|
|
|
|
const xp_char_t* str, xp_size_t len);
|
2006-02-05 13:45:59 +00:00
|
|
|
xp_size_t xp_awk_tab_rfind (
|
2006-08-03 06:06:27 +00:00
|
|
|
xp_awk_tab_t* tab, xp_size_t index,
|
|
|
|
const xp_char_t* str, xp_size_t len);
|
2006-02-05 14:21:18 +00:00
|
|
|
xp_size_t xp_awk_tab_rrfind (
|
2006-08-03 06:06:27 +00:00
|
|
|
xp_awk_tab_t* tab, xp_size_t index,
|
|
|
|
const xp_char_t* str, xp_size_t len);
|
2006-02-05 14:21:18 +00:00
|
|
|
|
2006-01-29 18:28:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|