qse/ase/awk/func.h

61 lines
1.2 KiB
C
Raw Normal View History

2006-06-16 14:31:42 +00:00
/*
2006-09-01 07:18:40 +00:00
* $Id: func.h,v 1.11 2006-09-01 07:18:39 bacon Exp $
2006-06-16 14:31:42 +00:00
*/
#ifndef _XP_AWK_FUNC_H_
#define _XP_AWK_FUNC_H_
#ifndef _XP_AWK_AWK_H_
#error Never include this file directly. Include <xp/awk/awk.h> instead
#endif
typedef struct xp_awk_bfn_t xp_awk_bfn_t;
struct xp_awk_bfn_t
{
2006-07-14 05:21:30 +00:00
const xp_char_t* name;
2006-08-03 05:05:48 +00:00
xp_size_t name_len;
2006-06-16 14:31:42 +00:00
int valid; /* the entry is valid when this option is set */
2006-06-21 15:37:51 +00:00
xp_size_t min_args;
xp_size_t max_args;
2006-08-13 16:05:04 +00:00
const xp_char_t* arg_spec;
int (*handler) (xp_awk_t* awk, void* run);
2006-07-13 15:43:39 +00:00
xp_awk_bfn_t* next;
2006-06-16 14:31:42 +00:00
};
2006-07-17 04:17:40 +00:00
enum
{
/* ensure that this matches __sys_bfn in func.c */
XP_AWK_BFN_CLOSE,
2006-08-13 16:05:04 +00:00
XP_AWK_BFN_INDEX,
XP_AWK_BFN_LENGTH,
2006-07-17 04:17:40 +00:00
XP_AWK_BFN_SYSTEM,
XP_AWK_BFN_SIN
};
2006-06-16 14:31:42 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2006-07-14 04:19:22 +00:00
xp_awk_bfn_t* xp_awk_addbfn (
2006-09-01 07:18:40 +00:00
xp_awk_t* awk, const xp_char_t* name, xp_size_t name_len,
int when_valid, xp_size_t min_args, xp_size_t max_args,
const xp_char_t* arg_spec, int (*handler)(xp_awk_t*,void*));
2006-08-13 16:05:04 +00:00
2006-09-01 07:18:40 +00:00
int xp_awk_delbfn (xp_awk_t* awk, const xp_char_t* name, xp_size_t name_len);
2006-08-13 16:05:04 +00:00
2006-07-14 04:19:22 +00:00
void xp_awk_clrbfn (xp_awk_t* awk);
2006-08-13 16:05:04 +00:00
2006-09-01 06:23:58 +00:00
xp_awk_bfn_t* xp_awk_getbfn (
2006-09-01 07:18:40 +00:00
xp_awk_t* awk, const xp_char_t* name, xp_size_t name_len);
2006-06-16 14:31:42 +00:00
#ifdef __cplusplus
}
#endif
#endif