2006-06-16 14:31:42 +00:00
|
|
|
/*
|
2006-11-13 09:37:00 +00:00
|
|
|
* $Id: func.h,v 1.15 2006-11-13 09:37:00 bacon Exp $
|
2006-06-16 14:31:42 +00:00
|
|
|
*/
|
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
#ifndef _ASE_AWK_FUNC_H_
|
|
|
|
#define _ASE_AWK_FUNC_H_
|
2006-06-16 14:31:42 +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-06-16 14:31:42 +00:00
|
|
|
#endif
|
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
typedef struct ase_awk_bfn_t ase_awk_bfn_t;
|
2006-06-16 14:31:42 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
struct ase_awk_bfn_t
|
2006-06-16 14:31:42 +00:00
|
|
|
{
|
2006-10-24 04:10:12 +00:00
|
|
|
const ase_char_t* name;
|
|
|
|
ase_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-24 04:10:12 +00:00
|
|
|
ase_size_t min_args;
|
|
|
|
ase_size_t max_args;
|
|
|
|
const ase_char_t* arg_spec;
|
|
|
|
int (*handler) (ase_awk_run_t* run);
|
2006-07-13 15:43:39 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_awk_bfn_t* next;
|
2006-06-16 14:31:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_awk_bfn_t* ase_awk_addbfn (
|
|
|
|
ase_awk_t* awk, const ase_char_t* name, ase_size_t name_len,
|
|
|
|
int when_valid, ase_size_t min_args, ase_size_t max_args,
|
|
|
|
const ase_char_t* arg_spec, int (*handler)(ase_awk_run_t*));
|
2006-08-13 16:05:04 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
int ase_awk_delbfn (ase_awk_t* awk, const ase_char_t* name, ase_size_t name_len);
|
2006-08-13 16:05:04 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
void ase_awk_clrbfn (ase_awk_t* awk);
|
2006-08-13 16:05:04 +00:00
|
|
|
|
2006-10-24 04:10:12 +00:00
|
|
|
ase_awk_bfn_t* ase_awk_getbfn (
|
|
|
|
ase_awk_t* awk, const ase_char_t* name, ase_size_t name_len);
|
2006-06-16 14:31:42 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|