00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef LUTI_H
00023
00024
00025
00026
00027
00028
00029 #include <assert.h>
00030
00031
00032 #include "loi.h"
00033
00034
00035 extern LogLevel log_lev;
00036 #define LOG_DO( lev ) ((lev) <= log_lev)
00037 #define LOG_DONT( lev ) ((lev) > log_lev)
00038
00053 extern int log_msg ( int code, const char *fmt, ... );
00054 #ifndef NDEBUG
00055 # define LOG_DBG log_msg
00056 #else
00057 # ifdef __GNUC__
00058 # define LOG_DBG( args... )
00059 # else
00060 # define LOG_DBG (void)
00061 # endif
00062 #endif
00063
00064 #define LOG_OTO( to, args ) do { ret = log_msg args; goto to; } while (0)
00065
00066
00067 #define LOG_STR( rec, desc ) log_str( LOG_TRACE, rec, desc )
00068 #define LOG_HEX( mem, len ) log_hex( LOG_TRACE, mem, len )
00069
00074 extern void log_str ( LogLevel level, int *rec, const char **desc );
00075
00076
00077
00078
00079
00080
00081 extern void log_rec (int level,
00082 Rec *rec, const char *msg, const char *delim);
00083
00088 extern void log_hex ( LogLevel level, const void *mem, int len );
00089
00093 extern void *lmalloc ( int size );
00094
00095
00096
00097
00098
00099
00100
00101 extern int lprint ( void *buf, int i );
00102
00103
00104
00105 typedef struct OpenIsisLT *LutiLT;
00106
00107
00108 extern LutiLT luti_ltnew ();
00109
00110 extern void luti_ltdel (LutiLT lt);
00111
00112 extern void luti_ltadd (LutiLT lt, const char *name, int id);
00113
00114 extern int luti_ltget (LutiLT lt, const char *name);
00115
00116 extern void luti_ltrmv (LutiLT lt, const char *name);
00117
00118
00119 extern Fdt* luti_fdt_from_rec (Rec *rec);
00120
00121
00122 extern const char* luti_parse_path (
00123 const char *path, const Fdt *fdt, Fd **fd, int *tag, int *occ);
00124
00125
00126 extern Rec* luti_unwrap (Rec *env, int *pos, int tag, int dbid);
00127
00128
00129 extern Rec* luti_getembed (
00130 Rec *env, const char *path, const Fdt *fdt);
00131
00132
00133 extern Rec* luti_wrap (Rec *env, Rec *rec, int tag);
00134
00135
00136 extern Rec* luti_append (Rec *tgt, Rec *src);
00137
00143 extern int luti_ptrincr (
00144 void *base, int *num, int incr, int siz, int maxnum);
00145
00148 extern void luti_free (void **arr, int num);
00149
00155 extern int luti_true (const char *str, int len);
00156
00161 extern int lhash ( const char *str, int len );
00162
00163 extern const char luti_hex[16];
00164
00165 #define LUTI_H
00166 #endif