00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifndef SOI_KEY_INCL
00061
00062
00063
00064
00065
00066 #ifndef SOI_VERSION_INCL
00067 #include <soi_version.h>
00068 #endif
00069
00070 #include <jsoc.h>
00071 #include <stdio.h>
00072 #include "timeio.h"
00073 #include <soi_str.h>
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 typedef struct key {
00085 struct key *next;
00086 char *name;
00087 int type;
00088 void *val;
00089 } KEY;
00090
00091
00092
00093
00094
00095 #define KEYTYP_VOID (0)
00096 #define KEYTYP_STRING (1)
00097 #define KEYTYP_BYTE (-1)
00098 #define KEYTYP_UBYTE (-2)
00099 #define KEYTYP_SHORT (-3)
00100 #define KEYTYP_USHORT (-4)
00101 #define KEYTYP_INT (-5)
00102 #define KEYTYP_UINT (-6)
00103 #define KEYTYP_LONG (-7)
00104 #define KEYTYP_ULONG (-8)
00105 #define KEYTYP_UINT64 (-9)
00106 #define KEYTYP_UINT32 (-10)
00107 #define KEYTYP_FLOAT (-16)
00108 #define KEYTYP_DOUBLE (-17)
00109 #define KEYTYP_FILEP (-32)
00110 #define KEYTYP_TIME (-33)
00111 #define KEYTYP_CMPLX (-34)
00112 #define KEYTYP_LAST (-256)
00113 #define SOI_KEY_VERSION_NUM (1.0)
00114 #define SOI_KEY_INCL 1
00115
00116 #define KEY_MAXSTR (255)
00117
00118
00119
00120
00121
00122 extern void deletekey (KEY **list, char *key);
00123 extern KEY *findkey (KEY *list, char *key);
00124 extern void freekeylist (KEY **list);
00125 extern int getkeytype (KEY *list, char *key);
00126 extern void getkey_any (KEY *list, char *key, void *valptr);
00127 extern char *GETKEY_str(KEY *params, char *key);
00128 extern char *getkey_str (KEY *list, char *key);
00129 extern FILE *getkey_fileptr (KEY *list, char *key);
00130 extern int getkey_byte (KEY *list, char *key);
00131 extern int getkey_ubyte (KEY *list, char *key);
00132 extern int getkey_short (KEY *list, char *key);
00133 extern int getkey_ushort (KEY *list, char *key);
00134 extern int getkey_int (KEY *list, char *key);
00135 extern unsigned int getkey_uint (KEY *list, char *key);
00136 extern long getkey_long (KEY *list, char *key);
00137 extern unsigned long getkey_ulong (KEY *list, char *key);
00138 extern uint32_t getkey_uint32 (KEY *list, char *key);
00139 extern uint64_t getkey_uint64 (KEY *list, char *key);
00140 extern double getkey_float (KEY *list, char *key);
00141 extern double getkey_double (KEY *list, char *key);
00142 extern TIME getkey_time (KEY *list, char *key);
00143 extern TIME getkey_time_interval(KEY *params, char *key);
00144 extern int getkey_flag (KEY *list, char *key);
00145 extern void keyiterate (void (*action)(), KEY *overlist);
00146 extern void add_keys (KEY *inlist, KEY **tolist);
00147 extern void delete_keys (KEY *inlist, KEY **fromlist);
00148 extern KEY *newkeylist ();
00149 extern void setkey_any (KEY **list, char *key, void *val, int type);
00150 extern void setkey_str (KEY **list, char *key, char *val);
00151 extern void addkey (KEY **list, char *key, void *val, int type);
00152 extern void addkey_str (KEY **list, char *key, char *val);
00153 extern void setkey_fileptr (KEY **list, char *key, FILE *val);
00154 extern void setkey_byte (KEY **list, char *key, char val);
00155 extern void setkey_ubyte (KEY **list, char *key, unsigned char val);
00156 extern void setkey_short (KEY **list, char *key, short val);
00157 extern void setkey_ushort (KEY **list, char *key, unsigned short val);
00158 extern void setkey_int (KEY **list, char *key, int val);
00159 extern void setkey_uint (KEY **list, char *key, unsigned int val);
00160 extern void setkey_uint32 (KEY **list, char *key, uint32_t val);
00161 extern void setkey_long (KEY **list, char *key, long val);
00162 extern void setkey_ulong (KEY **list, char *key, unsigned long val);
00163 extern void setkey_uint64 (KEY **list, char *key, uint64_t val);
00164 extern void setkey_float (KEY **list, char *key, float val);
00165 extern void setkey_double (KEY **list, char *key, double val);
00166 extern void setkey_time (KEY **list, char *key, TIME val);
00167 extern char *key_strdup (char *str);
00168
00169 extern char *getkey_overfilename(KEY *params, char *rootkey, char *kind);
00170 extern char *GETKEY_overfilename(KEY *params, char *rootkey, char *kind);
00171 extern char *getkey_infofilename(KEY *params, char *rootkey, char *kind);
00172 extern char *GETKEY_infofilename(KEY *params, char *rootkey, char *kind);
00173
00174 #endif