qse/ase/awk/func.h

62 lines
1.1 KiB
C
Raw Normal View History

2006-06-16 14:31:42 +00:00
/*
2006-11-27 15:11:14 +00:00
* $Id: func.h,v 1.16 2006-11-27 15:10:34 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-11-27 15:11:14 +00:00
struct
{
ase_char_t* ptr;
ase_size_t len;
} name;
2006-06-16 14:31:42 +00:00
int valid; /* the entry is valid when this option is set */
2006-11-27 15:11:14 +00:00
struct
{
ase_size_t min;
ase_size_t max;
ase_char_t* spec;
} arg;
/*
2006-10-24 04:10:12 +00:00
ase_size_t min_args;
ase_size_t max_args;
2006-11-27 15:11:14 +00:00
ase_char_t* arg_spec;
*/
2006-10-24 04:10:12 +00:00
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