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_TYPES_H
00025 #define SEXP_TYPES_H
00026
00027 #include <stdint.h>
00028 #include <seap-debug.h>
00029
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00034 typedef uint8_t SEXP_numtype_t;
00035
00036
00037 #define SEXP_NUM_NONE 0x00
00038 #define SEXP_NUM_BOOL 0x01
00039 #define SEXP_NUM_INT8 0x07
00040 #define SEXP_NUM_UINT8 0x08
00041 #define SEXP_NUM_INT16 0x0f
00042 #define SEXP_NUM_UINT16 0x10
00043 #define SEXP_NUM_INT32 0x1f
00044 #define SEXP_NUM_UINT32 0x20
00045 #define SEXP_NUM_INT64 0x3f
00046 #define SEXP_NUM_UINT64 0x40
00047 #define SEXP_NUM_DOUBLE 0x41
00048
00049
00050
00051 #define SEXP_NUM_BOOLEAN SEXP_NUM_BOOL
00052 #define SEXP_NUM_CHAR SEXP_NUM_INT8
00053 #define SEXP_NUM_UCHAR SEXP_NUM_UINT8
00054 #define SEXP_NUM_SHORTINT SEXP_NUM_INT16
00055 #define SEXP_NUM_USHORTINT SEXP_NUM_UINT16
00056 #define SEXP_NUM_SHORTUINT SEXP_NUM_UINT16
00057 #define SEXP_NUM_INT SEXP_NUM_INT32
00058 #define SEXP_NUM_LONGINT SEXP_NUM_INT32
00059 #define SEXP_NUM_UINT SEXP_NUM_UINT32
00060 #define SEXP_NUM_ULONGINT SEXP_NUM_UINT32
00061 #define SEXP_NUM_LONGUINT SEXP_NUM_UINT32
00062 #define SEXP_NUM_LONLONGINT SEXP_NUM_INT64
00063 #define SEXP_NUM_ULONGLONGINT SEXP_NUM_UINT64
00064 #define SEXP_NUM_LONGLONGUINT SEXP_NUM_UINT64
00065 #define SEXP_NUM_FLOAT SEXP_NUM_DOUBLE
00066
00067 #if 0
00068 # define NUM_FRACT 0x0a
00069 # define NUM_BIGNUM 0x0b
00070 #endif
00071
00072
00073 typedef uint8_t SEXP_format_t;
00074
00075 #define SEXP_FMT_UNDEFINED 0
00076 #define SEXP_FMT_TRANSPORT 1
00077 #define SEXP_FMT_CANONICAL 2
00078 #define SEXP_FMT_ADVANCED 3
00079 #define SEXP_FMT_AUTODETECT 4
00080
00081 #include <assert.h>
00082 #ifndef _A
00083 # define _A(x) assert(x)
00084 #endif
00085
00086 #define SEXP_TYPE_EMPTY 0
00087 #define SEXP_TYPE_STRING 1
00088 #define SEXP_TYPE_NUMBER 2
00089 #define SEXP_TYPE_LIST 3
00090
00091 typedef uint8_t SEXP_type_t;
00092
00093 struct SEXP {
00094 #if !defined(NDEBUG) || defined(VALIDATE_SEXP)
00095 volatile uint16_t __magic0;
00096 #endif
00097
00098 void *s_type;
00099 uintptr_t s_valp;
00100
00101 #if !defined(NDEBUG) || defined(VALIDATE_SEXP)
00102 volatile uint16_t __magic1;
00103 #endif
00104 };
00105
00106 typedef struct SEXP SEXP_t;
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112 #endif