00001 #pragma once
00002 #ifndef SEXP_DATATYPE
00003 #define SEXP_DATATYPE
00004
00005 #include <stdarg.h>
00006 #include <stdint.h>
00007 #include <sexp.h>
00008
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012
00013 typedef void (*SEXP_datatype_opfn_t) (const SEXP_t *, void *, ...);
00014
00015 typedef struct {
00016 uint8_t opnum;
00017 uint8_t arity;
00018 SEXP_datatype_opfn_t fn_string;
00019 SEXP_datatype_opfn_t fn_number;
00020 SEXP_datatype_opfn_t fn_list;
00021 } SEXP_datatype_op_t;
00022
00023 typedef struct SEXP_datatype SEXP_datatype_t;
00024 typedef struct SEXP_datatypetbl SEXP_datatypetbl_t;
00025
00026 extern SEXP_datatypetbl_t g_datatypes;
00027
00028
00029
00030 int SEXP_datatype_register (SEXP_datatypetbl_t *t, const char *datatype, SEXP_datatype_op_t *op, uint8_t opnummax);
00031
00032
00033 int SEXP_datatype_op (uint8_t op, const SEXP_t *sexp, void *res, ...);
00034 int SEXP_datatype_op_safe (const char *datatype, uint8_t op, const SEXP_t *sexp, void *res, ...);
00035
00036 #ifdef __cplusplus
00037 }
00038 #endif
00039
00040 #endif