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