2006-06-16 14:31:42 +00:00
|
|
|
/*
|
2006-10-22 11:34:53 +00:00
|
|
|
* $Id: func.h,v 1.13 2006-10-22 11:34:53 bacon Exp $
|
2006-06-16 14:31:42 +00:00
|
|
|
*/
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
#ifndef _SSE_AWK_FUNC_H_
|
|
|
|
#define _SSE_AWK_FUNC_H_
|
2006-06-16 14:31:42 +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-06-16 14:31:42 +00:00
|
|
|
#endif
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
typedef struct sse_awk_bfn_t sse_awk_bfn_t;
|
2006-06-16 14:31:42 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
struct sse_awk_bfn_t
|
2006-06-16 14:31:42 +00:00
|
|
|
{
|
2006-10-22 11:34:53 +00:00
|
|
|
const sse_char_t* name;
|
|
|
|
sse_size_t name_len;
|
2006-06-16 14:31:42 +00:00
|
|
|
int valid; /* the entry is valid when this option is set */
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_size_t min_args;
|
|
|
|
sse_size_t max_args;
|
|
|
|
const sse_char_t* arg_spec;
|
|
|
|
int (*handler) (sse_awk_run_t* run);
|
2006-07-13 15:43:39 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_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 */
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
SSE_AWK_BFN_CLOSE,
|
|
|
|
SSE_AWK_BFN_INDEX,
|
|
|
|
SSE_AWK_BFN_LENGTH,
|
|
|
|
SSE_AWK_BFN_SYSTEM,
|
|
|
|
SSE_AWK_BFN_SIN
|
2006-07-17 04:17:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-06-16 14:31:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_awk_bfn_t* sse_awk_addbfn (
|
|
|
|
sse_awk_t* awk, const sse_char_t* name, sse_size_t name_len,
|
|
|
|
int when_valid, sse_size_t min_args, sse_size_t max_args,
|
|
|
|
const sse_char_t* arg_spec, int (*handler)(sse_awk_run_t*));
|
2006-08-13 16:05:04 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
int sse_awk_delbfn (sse_awk_t* awk, const sse_char_t* name, sse_size_t name_len);
|
2006-08-13 16:05:04 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
void sse_awk_clrbfn (sse_awk_t* awk);
|
2006-08-13 16:05:04 +00:00
|
|
|
|
2006-10-22 11:34:53 +00:00
|
|
|
sse_awk_bfn_t* sse_awk_getbfn (
|
|
|
|
sse_awk_t* awk, const sse_char_t* name, sse_size_t name_len);
|
2006-06-16 14:31:42 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|