Go to the documentation of this file.00001 #ifndef RPMLUA_H
00002 #define RPMLUA_H
00003
00004 typedef enum rpmluavType_e {
00005 RPMLUAV_NIL = 0,
00006 RPMLUAV_STRING = 1,
00007 RPMLUAV_NUMBER = 2
00008 } rpmluavType;
00009
00010 #if defined(_RPMLUA_INTERNAL)
00011
00012 #include <stdarg.h>
00013 #include <lua.h>
00014
00015 struct rpmlua_s {
00016 struct rpmioItem_s _item;
00017 lua_State *L;
00018 int pushsize;
00019 int storeprint;
00020 size_t printbufsize;
00021 size_t printbufused;
00022
00023 char *printbuf;
00024 };
00025
00026 struct rpmluav_s {
00027 struct rpmioItem_s _item;
00028 rpmluavType keyType;
00029 rpmluavType valueType;
00030 union {
00031 const char *str;
00032 const void *ptr;
00033 double num;
00034 } key;
00035 union {
00036 const char *str;
00037 const void *ptr;
00038 double num;
00039 } value;
00040 int listmode;
00041 };
00042
00043 #endif
00044
00045 typedef struct rpmlua_s * rpmlua;
00046 typedef struct rpmluav_s * rpmluav;
00047
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051
00052
00053 extern const char * rpmluaFiles;
00054
00055
00056 extern const char * rpmluaPath;
00057
00058
00059
00060 rpmlua rpmluaGetGlobalState(void)
00061 ;
00062
00063 rpmlua rpmluaNew(void)
00064
00065 ;
00066
00067
00068 void *rpmluaFree( rpmlua lua)
00069
00070 ;
00071
00072 int rpmluaCheckScript( rpmlua _lua, const char *script,
00073 const char *name)
00074
00075 ;
00076 int rpmluaRunScript( rpmlua _lua, const char *script,
00077 const char *name)
00078
00079 ;
00080
00081 int rpmluaRunScriptFile( rpmlua _lua, const char *filename)
00082
00083 ;
00084
00085 void rpmluaInteractive( rpmlua _lua)
00086
00087 ;
00088
00089
00090 void *rpmluaGetData( rpmlua _lua, const char *key)
00091
00092 ;
00093
00094 void rpmluaSetData( rpmlua _lua, const char *key, const void *data)
00095
00096 ;
00097
00098
00099
00100 const char *rpmluaGetPrintBuffer( rpmlua _lua)
00101
00102 ;
00103 void rpmluaSetPrintBuffer( rpmlua _lua, int flag)
00104
00105 ;
00106
00107 void rpmluaGetVar( rpmlua _lua, rpmluav var)
00108
00109 ;
00110 void rpmluaSetVar( rpmlua _lua, rpmluav var)
00111
00112 ;
00113 void rpmluaDelVar( rpmlua _lua, const char *key, ...)
00114
00115 ;
00116 int rpmluaVarExists( rpmlua _lua, const char *key, ...)
00117
00118 ;
00119 void rpmluaPushTable( rpmlua _lua, const char *key, ...)
00120
00121 ;
00122 void rpmluaPop( rpmlua _lua)
00123
00124 ;
00125
00126
00127 rpmluav rpmluavNew(void)
00128 ;
00129
00130 void * rpmluavFree( rpmluav var)
00131 ;
00132 void rpmluavSetListMode(rpmluav var, int flag)
00133 ;
00134
00135 void rpmluavSetKey(rpmluav var, rpmluavType type, const void *value)
00136 ;
00137
00138
00139 void rpmluavSetValue(rpmluav var, rpmluavType type, const void *value)
00140 ;
00141
00142
00143 void rpmluavGetKey(rpmluav var, rpmluavType *type, void **value)
00144 ;
00145
00146
00147 void rpmluavGetValue(rpmluav var, rpmluavType *type, void **value)
00148 ;
00149
00150
00151
00152 void rpmluavSetKeyNum(rpmluav var, double value)
00153 ;
00154 void rpmluavSetValueNum(rpmluav var, double value)
00155 ;
00156 double rpmluavGetKeyNum(rpmluav var)
00157 ;
00158 double rpmluavGetValueNum(rpmluav var)
00159 ;
00160 int rpmluavKeyIsNum(rpmluav var)
00161 ;
00162 int rpmluavValueIsNum(rpmluav var)
00163 ;
00164
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168
00169 #endif