scol_plugin_win.h
00001 00006 /* 00007 // Modifications History 00008 // 00009 //$ LB (13/06/2002) : added the OBJgetNewHandler function to the cbmachine 00010 // $ IRI (19/12/2010) : version windows 00011 // $ IRI (31/01/2011) : add MMneedMemory 00012 */ 00013 00014 #ifdef __cplusplus 00015 extern "C" { 00016 #endif 00017 00018 #ifndef SCOLPLUGIN_H 00019 #define SCOLPLUGIN_H 00020 00021 #include <windows.h> 00022 00023 #include <stdio.h> 00024 #include <stdlib.h> 00025 00026 00027 /* DEFINITIONS DE TYPES ET DE CONSTANTES 00028 ---------------------------------------*/ 00029 #define SizeWord 4 00030 #define SizeHeader 3 00031 00032 #define NIL -1 00033 00034 /* Scol virtual machine */ 00035 struct Mmachine 00036 { 00037 int *tape; /* tape pointer */ 00038 int sizetape; /* size of the tape */ 00039 int pp; /* stack pointer */ 00040 int maxpp; /* max value of pp */ 00041 int topheap; /* top of stack */ 00042 int sigGC; /* GC activation distance */ 00043 int h; /* current header position */ 00044 int err; 00045 int *top; /* top of tape */ 00046 /*$BLG - v5.22: Add*/ 00047 int lckdGC; /* Locked GC flag*/ 00048 }; 00049 00050 typedef struct Mmachine *mmachine; 00051 00052 /* masq for MMmalloc : object table or other buffer */ 00053 #define TYPETAB 1 00054 #define TYPEBUF 0 00055 00056 /* errors definition */ 00057 #define MERREND 1 00058 #define MERROK 0 00059 #define MERRMEM -1 00060 #define MERRTYP -2 00061 #define MERRRET -3 00062 #define MERRNUL -4 00063 #define MERRNF -5 00064 #define MERRLINK -6 00065 #define MERRFULL -7 00066 #define MERRUNKNOWN -8 00067 #define MERRTOOLARGE -9 00068 #define MERREP -10 00069 #define MERRFILE -11 00070 #define MERRCLOSE -12 00071 /*$BLG - v5.22: Add*/ 00072 #define MERRCHNLDWN -13 00073 00074 /* offsets object definition */ 00075 #define OFFSCCUR 0 00076 00077 #define OFFOBJMAG 0 00078 #define OFFOBJCHN 1 00079 #define OFFOBJTYP 2 00080 #define OFFOBJHAND 3 00081 #define OFFOBJTPERE 4 00082 #define OFFOBJHPERE 5 00083 #define OFFOBJREF0 6 00084 #define OFFOBJUSER0 7 00085 00086 /* console messages mask definition */ 00087 #define MSKFOO 1 00088 #define MSKRUNTIME 2 00089 #define MSKWARNING 4 00090 #define MSKTRACE 8 00091 #define MSKDEBUG 16 00092 00093 00094 /* predefined Scol types */ 00095 #define TYPVAR -1 00096 #define TYPCONS -2 00097 #define TYPTYPE -3 00098 #define TYPFIELD -4 00099 #define TYPSTRUC -5 00100 #define TYPCONS0 -6 00101 #define TYPCOM -7 00102 #define TYPCOMV -8 00103 00104 00105 /* Files management in Scol 00106 ------------------------------*/ 00107 00108 #define SIZESIGN 1024 00109 00110 struct Packdir 00111 { 00112 char path[SIZESIGN]; /* end by '/'*/ 00113 int quota; /* -1: read only, 0: unlimited*/ 00114 struct Packdir *next; 00115 }; 00116 typedef struct Packdir *packdir; 00117 00118 #define TYPESNONE 0 00119 #define TYPESLOGIC 1 00120 00121 00122 /* 00123 * Exported Kernel functions to plugin 00124 ----------------------------------------------*/ 00125 00126 struct CBmachine 00127 { 00128 int (*MMpush)(mmachine m, int val); 00129 int (*MMpushNoGC)(mmachine m, int val); 00130 int (*MMpull)(mmachine m); 00131 int (*MMgetPP)(mmachine m); 00132 void (*MMsetPP)(mmachine m,int i); 00133 int (*MMget)(mmachine m,int i); 00134 void (*MMset)(mmachine m,int i,int v); 00135 int (*MMgetglobal)(mmachine m,int i); 00136 void (*MMsetglobal)(mmachine m,int i,int v); 00137 int (*MMgetbase)(mmachine m,int b,int i); 00138 void (*MMsetbase)(mmachine m,int b,int i,int v); 00139 int (*MMfetch)(mmachine m,int s,int i); 00140 void (*MMstore)(mmachine m,int s,int i,int v); 00141 int* (*MMstart)(mmachine m,int s); 00142 int (*MMsize)(mmachine m,int s); 00143 int (*MMtype)(mmachine m,int s); 00144 char* (*MMstartstr)(mmachine m,int s); 00145 int (*MMsizestr)(mmachine m,int s); 00146 void (*MMsetsizestr)(mmachine m,int s,int size); 00147 int (*MMmalloc)(mmachine m, int size, int type); 00148 int (*MMmallocCLR)(mmachine m, int size, int type); 00149 int (*Mpushstrbloc)(mmachine m,char *buf); 00150 int (*MBdeftab)(mmachine m); 00151 int (*MBstrcat)(mmachine m); 00152 int (*PKhardpak)(mmachine m, char *name, 00153 int n, char **namefun, int (**fun)(mmachine z), 00154 int *nargfun, char **typfun); 00155 int (*PKloader)(mmachine m,char *name,char *simplename); 00156 int (*SPfindfile)(packdir p,char *sign,int *size,char *path); 00157 int (*SPaddfile)(packdir p,char *sign,int size,char *path); 00158 int (*SCgetsrvsocket)(mmachine m, int server); 00159 int (*SCgetsocket)(mmachine m, int channel); 00160 int (*Mcutting)(char *comm, char **argv); 00161 void (*MMechostr)(int i,char *buf,...); 00162 size_t (*fread)(void* buf,size_t i,size_t j,FILE *f); 00163 packdir Firstpack; 00164 int (*OBJcreate)(mmachine m,int typ,int handsys,int typpere,int handsyspere); 00165 int (*OBJaddreflex)(mmachine m,int typ, int num); 00166 int (*OBJbeginreflex)(mmachine m,int typ,int handsys,int num); 00167 int (*OBJdel)(mmachine m,int p,int flag); 00168 int (*OBJdestroy)(mmachine m, int typ,int handsys,int objm,int flag); 00169 int (*OBJdelTH)(mmachine m,int typ,int handsys); 00170 int (*OBJcallreflex)(mmachine m,int nbarg); 00171 int (*OBJregister)(int nbrefl,int recrefl,int (*destroy)(mmachine m,int handsys,int objm),char *name); 00172 int (*OBJtypebyname)(char *name); 00173 int (*OBJdefEvent)(int event,int (*cbevent)(mmachine m,int hwnd, unsigned msg, 00174 int wParam,int lParam,int *ret)); 00175 int (*OBJgetUserEvent)(); 00176 void* (*SCgetExtra)(char *funcname); 00177 char* (*stdloadJpg)(char *name,int *w,int *h); 00178 int (*OBJdelTM)(mmachine m,int typ,int q); 00179 int (*OBJfindTH)(mmachine m,int typ,int handsys); 00180 int (*OBJfindTM)(mmachine m,int typ,int objm); 00181 int (*Mpushstrblocn)(mmachine m,char *buf, int n); 00182 int (*Minterpreter)(mmachine m); 00183 int (*Msearchinsyspak)(mmachine m, char *name); 00184 int (*MBstrcatn)(mmachine m); 00185 int (*Buffer2texture)(mmachine m, char *buffer, int width, int height); 00186 void (*MMputs)(int i, const char* text); 00187 00188 /*$ LB (13/06/2002)*/ 00189 int (*OBJgetNewHandler)(); 00190 00191 int (*MMneedMemory)(mmachine m,int size,int realsize); /* $Iri */ 00192 00193 00194 }; 00195 typedef struct CBmachine *cbmachine; 00196 00197 extern cbmachine ww; 00198 00199 #define SCOLinitplugin(X) ww=X 00200 00201 #define MMpush (ww->MMpush) 00202 #define MMpushNoGC (ww->MMpushNoGC) 00203 #define MMpull (ww->MMpull) 00204 #define MMgetPP (ww->MMgetPP) 00205 #define MMsetPP (ww->MMsetPP) 00206 #define MMget (ww->MMget) 00207 #define MMset (ww->MMset) 00208 #define MMgetglobal (ww->MMgetglobal) 00209 #define MMsetglobal (ww->MMsetglobal) 00210 #define MMgetbase (ww->MMgetbase) 00211 #define MMsetbase (ww->MMsetbase) 00212 #define MMfetch (ww->MMfetch) 00213 #define MMstore (ww->MMstore) 00214 #define MMstart (ww->MMstart) 00215 #define MMsize (ww->MMsize) 00216 #define MMtype (ww->MMtype) 00217 #define MMstartstr (ww->MMstartstr) 00218 #define MMsizestr (ww->MMsizestr) 00219 #define MMsetsizestr (ww->MMsetsizestr) 00220 #define MMmalloc (ww->MMmalloc) 00221 #define MMmallocCLR (ww->MMmallocCLR) 00222 #define Mpushstrbloc (ww->Mpushstrbloc) 00223 #define MBdeftab (ww->MBdeftab) 00224 #define MBstrcat (ww->MBstrcat) 00225 #define PKhardpak (ww->PKhardpak) 00226 #define PKloader (ww->PKloader) 00227 #define SPfindfile (ww->SPfindfile) 00228 #define SPaddfile (ww->SPaddfile) 00229 #define SCgetsrvsocket (ww->SCgetsrvsocket) 00230 #define SCgetsocket (ww->SCgetsocket) 00231 #define Mcutting (ww->Mcutting) 00232 #define MMechostr (ww->MMechostr) 00233 /*#define fread (ww->fread)*/ 00234 #define Firstpack (ww->Firstpack) 00235 #define OBJcreate (ww->OBJcreate) 00236 #define OBJaddreflex (ww->OBJaddreflex) 00237 #define OBJbeginreflex (ww->OBJbeginreflex) 00238 #define OBJdel (ww->OBJdel) 00239 #define OBJdestroy (ww->OBJdestroy) 00240 #define OBJdelTH (ww->OBJdelTH) 00241 #define OBJcallreflex (ww->OBJcallreflex) 00242 #define OBJregister (ww->OBJregister) 00243 #define OBJtypebyname (ww->OBJtypebyname) 00244 #define OBJdefEvent (ww->OBJdefEvent) 00245 #define OBJgetUserEvent (ww->OBJgetUserEvent) 00246 #define SCgetExtra (ww->SCgetExtra) 00247 #define stdloadJpg (ww->stdloadJpg) 00248 #define OBJdelTM (ww->OBJdelTM) 00249 #define OBJfindTH (ww->OBJfindTH) 00250 #define OBJfindTM (ww->OBJfindTM) 00251 #define Mpushstrblocn (ww->Mpushstrblocn) 00252 #define Minterpreter (ww->Minterpreter) 00253 #define Msearchinsyspak (ww->Msearchinsyspak) 00254 #define MBstrcatn (ww->MBstrcatn) 00255 #define Buf2Tex (ww->Buffer2texture) 00256 #define MMputs (ww->MMputs) 00257 00258 /*$ LB (13/06/2002)*/ 00259 #define OBJgetNewHandler (ww->OBJgetNewHandler) 00260 00261 #define MMneedMemory (ww->MMneedMemory) /* $Iri */ 00262 00263 00264 #endif 00265
Generated on Tue Mar 15 13:59:36 2011 for sqlite3 by 1.6.3