2006-01-29 18:28:14 +00:00
|
|
|
/*
|
2006-10-22 11:34:53 +00:00
|
|
|
* $Id: tab.h,v 1.13 2006-10-22 11:34:53 bacon Exp $
|
2006-01-29 18:28:14 +00:00
|
|
|
*/
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
#ifndef _SSE_AWK_TAB_H_
|
|
|
|
#define _SSE_AWK_TAB_H_
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
#ifndef _SSE_AWK_AWK_H_
|
|
|
|
#error Never include this file directly. Include <sse/awk/awk.h> instead
|
2006-03-03 11:51:48 +00:00
|
|
|
#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
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
typedef struct sse_awk_tab_t sse_awk_tab_t;
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
struct sse_awk_tab_t
|
2006-01-29 18:28:14 +00:00
|
|
|
{
|
2006-08-03 06:06:27 +00:00
|
|
|
struct
|
|
|
|
{
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_char_t* name;
|
|
|
|
sse_size_t name_len;
|
2006-08-03 06:06:27 +00:00
|
|
|
}* buf;
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t size;
|
|
|
|
sse_size_t capa;
|
|
|
|
sse_awk_t* awk;
|
|
|
|
sse_bool_t __dynamic;
|
2006-01-29 18:28:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_awk_tab_t* sse_awk_tab_open (sse_awk_tab_t* tab, sse_awk_t* awk);
|
|
|
|
void sse_awk_tab_close (sse_awk_tab_t* tab);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t sse_awk_tab_getsize (sse_awk_tab_t* tab);
|
|
|
|
sse_size_t sse_awk_tab_getcapa (sse_awk_tab_t* tab);
|
|
|
|
sse_awk_tab_t* sse_awk_tab_setcapa (sse_awk_tab_t* tab, sse_size_t capa);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
void sse_awk_tab_clear (sse_awk_tab_t* tab);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t sse_awk_tab_insert (
|
|
|
|
sse_awk_tab_t* tab, sse_size_t index,
|
|
|
|
const sse_char_t* str, sse_size_t len);
|
2006-08-03 06:06:27 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t sse_awk_tab_remove (
|
|
|
|
sse_awk_tab_t* tab, sse_size_t index, sse_size_t count);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t sse_awk_tab_add (
|
|
|
|
sse_awk_tab_t* tab, const sse_char_t* str, sse_size_t len);
|
2006-03-07 15:55:14 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t sse_awk_tab_find (
|
|
|
|
sse_awk_tab_t* tab, sse_size_t index,
|
|
|
|
const sse_char_t* str, sse_size_t len);
|
|
|
|
sse_size_t sse_awk_tab_rfind (
|
|
|
|
sse_awk_tab_t* tab, sse_size_t index,
|
|
|
|
const sse_char_t* str, sse_size_t len);
|
|
|
|
sse_size_t sse_awk_tab_rrfind (
|
|
|
|
sse_awk_tab_t* tab, sse_size_t index,
|
|
|
|
const sse_char_t* str, sse_size_t len);
|
2006-02-05 14:21:18 +00:00
|
|
|
|
2006-01-29 18:28:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|