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 typedef void (*SEXP_datatype_opfn_t) (const SEXP_t *, void *, ...);
00010
00011 typedef struct {
00012 uint8_t opnum;
00013 uint8_t arity;
00014 SEXP_datatype_opfn_t fn_string;
00015 SEXP_datatype_opfn_t fn_number;
00016 SEXP_datatype_opfn_t fn_list;
00017 } SEXP_datatype_op_t;
00018
00019 typedef struct SEXP_datatype SEXP_datatype_t;
00020 typedef struct SEXP_datatypetbl SEXP_datatypetbl_t;
00021
00022 extern SEXP_datatypetbl_t g_datatypes;
00023
00024
00025
00026 int SEXP_datatype_register (SEXP_datatypetbl_t *t, const char *datatype, SEXP_datatype_op_t *op, uint8_t opnummax);
00027
00028
00029 int SEXP_datatype_op (uint8_t op, const SEXP_t *sexp, void *res, ...);
00030 int SEXP_datatype_op_safe (const char *datatype, uint8_t op, const SEXP_t *sexp, void *res, ...);
00031
00032 #endif