2006-01-29 18:28:14 +00:00
|
|
|
/*
|
2006-10-24 04:10:12 +00:00
|
|
|
* $Id: tab.h,v 1.14 2006-10-24 04:10:12 bacon Exp $
|
2006-01-29 18:28:14 +00:00
|
|
|
*/
|
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
#ifndef _ASE_AWK_TAB_H_
|
|
|
|
#define _ASE_AWK_TAB_H_
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
#ifndef _ASE_AWK_AWK_H_
|
|
|
|
#error Never include this file directly. Include <ase/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-24 04:10:12 +00:00
|
|
|
typedef struct ase_awk_tab_t ase_awk_tab_t;
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
struct ase_awk_tab_t
|
2006-01-29 18:28:14 +00:00
|
|
|
{
|
2006-08-03 06:06:27 +00:00
|
|
|
struct
|
|
|
|
{
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_char_t* name;
|
|
|
|
ase_size_t name_len;
|
2006-08-03 06:06:27 +00:00
|
|
|
}* buf;
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_size_t size;
|
|
|
|
ase_size_t capa;
|
|
|
|
ase_awk_t* awk;
|
|
|
|
ase_bool_t __dynamic;
|
2006-01-29 18:28:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_awk_tab_t* ase_awk_tab_open (ase_awk_tab_t* tab, ase_awk_t* awk);
|
|
|
|
void ase_awk_tab_close (ase_awk_tab_t* tab);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_size_t ase_awk_tab_getsize (ase_awk_tab_t* tab);
|
|
|
|
ase_size_t ase_awk_tab_getcapa (ase_awk_tab_t* tab);
|
|
|
|
ase_awk_tab_t* ase_awk_tab_setcapa (ase_awk_tab_t* tab, ase_size_t capa);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
void ase_awk_tab_clear (ase_awk_tab_t* tab);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_size_t ase_awk_tab_insert (
|
|
|
|
ase_awk_tab_t* tab, ase_size_t index,
|
|
|
|
const ase_char_t* str, ase_size_t len);
|
2006-08-03 06:06:27 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_size_t ase_awk_tab_remove (
|
|
|
|
ase_awk_tab_t* tab, ase_size_t index, ase_size_t count);
|
2006-01-29 18:28:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_size_t ase_awk_tab_add (
|
|
|
|
ase_awk_tab_t* tab, const ase_char_t* str, ase_size_t len);
|
2006-03-07 15:55:14 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_size_t ase_awk_tab_find (
|
|
|
|
ase_awk_tab_t* tab, ase_size_t index,
|
|
|
|
const ase_char_t* str, ase_size_t len);
|
|
|
|
ase_size_t ase_awk_tab_rfind (
|
|
|
|
ase_awk_tab_t* tab, ase_size_t index,
|
|
|
|
const ase_char_t* str, ase_size_t len);
|
|
|
|
ase_size_t ase_awk_tab_rrfind (
|
|
|
|
ase_awk_tab_t* tab, ase_size_t index,
|
|
|
|
const ase_char_t* str, ase_size_t len);
|
2006-02-05 14:21:18 +00:00
|
|
|
|
2006-01-29 18:28:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|