zeek/tools/bifcl/include/bif_arg.h
Jon Siwek a86b98bb9e bifcl: Move headers into include/ subdir
This avoids potential problems with libc++ 8+ on case-insensitive file
systems due to inclusion of a new header called <version> which will end
up conflicting with the VERSION file if the search path includes the
project root.
2025-08-20 08:52:24 -07:00

51 lines
974 B
C++

#ifndef bif_arg_h
#define bif_arg_h
#include <stdio.h>
enum builtin_func_arg_type {
#define DEFINE_BIF_TYPE(id, bif_type, bro_type, c_type, accessor, constructor) \
id,
#include "bif_type.def"
#undef DEFINE_BIF_TYPE
/*
TYPE_ANY,
TYPE_BOOL,
TYPE_COUNT,
TYPE_INT,
TYPE_STRING,
TYPE_PATTERN,
TYPE_PORT,
TYPE_OTHER,
*/
};
extern const char* builtin_func_arg_type_bro_name[];
class BuiltinFuncArg {
public:
BuiltinFuncArg(const char* arg_name, int arg_type);
BuiltinFuncArg(const char* arg_name, const char* arg_type_str,
const char* arg_attr_str = "");
void SetAttrStr(const char* arg_attr_str)
{
attr_str = arg_attr_str;
};
const char* Name() const { return name; }
int Type() const { return type; }
void PrintBro(FILE* fp);
void PrintCDef(FILE* fp, int n);
void PrintCArg(FILE* fp, int n);
void PrintBroValConstructor(FILE* fp);
protected:
const char* name;
int type;
const char* type_str;
const char* attr_str;
};
#endif