Changeset 326 for trunk/nom/src/nomgc.c
- Timestamp:
- Apr 9, 2008, 10:22:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nom/src/nomgc.c
r286 r326 37 37 */ 38 38 39 #define INCL_DOS 40 #define INCL_DOSERRORS 41 #define INCL_DOSMEMMGR 42 #include <os2.h> 39 #ifdef __OS2__ 40 # define INCL_DOS 41 # define INCL_DOSERRORS 42 # define INCL_DOSMEMMGR 43 # include <os2.h> 44 #endif /* __OS2__ */ 43 45 44 46 #include <stdio.h> … … 83 85 memory functions as the GLIB default allocation function. 84 86 */ 87 #ifdef __OS2__ 85 88 void _System nomInitGarbageCollection(void* pMemInExe) 89 #else 90 void nomInitGarbageCollection(void* pMemInExe) 91 #endif 86 92 { 87 93 GMemVTable vtbl={0}; … … 98 104 99 105 /* Cretea tree holding the already registered DLLs */ 106 #ifdef _MSC_VER 100 107 treeRegisteredDLL=g_tree_new((GCompareFunc)stricmp); 108 #else 109 treeRegisteredDLL=g_tree_new((GCompareFunc)strcasecmp); 110 #endif 101 111 102 112 bUseGC=TRUE; … … 104 114 105 115 116 #ifdef __OS2__ 106 117 void test() 107 118 { … … 110 121 HMODULE hModule; 111 122 112 if(DosQueryModFromEIP( &hModule, &ulObj, CCHMAXPATH, thePath, &ulOffset, ( ULONG)test)!=0) {123 if(DosQueryModFromEIP( &hModule, &ulObj, CCHMAXPATH, thePath, &ulOffset, (gulong)test)!=0) { 113 124 hModule=0; 114 125 return ; /* Error */ … … 116 127 117 128 } 129 #endif /* __OS2__ */ 118 130 119 131 NOMEXTERN void NOMLINK nomRegisterDataAreaForGC(char* pStart, char* pEnd) … … 122 134 } 123 135 136 #ifdef __OS2__ 137 124 138 static void qsAddDLLToList(HREGDLL hReg, qsLrec_t* rec) 125 139 { 126 if(NULL HANDLE==g_slist_find(hReg->dllList, rec))140 if(NULL==g_slist_find(hReg->dllList, rec)) 127 141 hReg->dllList=g_slist_append(hReg->dllList, rec); 128 142 } … … 160 174 /* g_message("%d Checking: %x -> %04X (%s)", a, pModRec, pModRec->hmte, pModRec->pName); */ 161 175 162 if (NULL HANDLE==pModRec->pObjInfo && pModRec->ctObj > 0)176 if (NULL==pModRec->pObjInfo && pModRec->ctObj > 0) 163 177 { 164 178 pModRec->pObjInfo = (qsLObjrec_t*)((char*)pModRec … … 179 193 } 180 194 195 181 196 /** 182 197 Get the info about the current DLLs from OS/2. Go over all found … … 187 202 NOMEXTERN HREGDLL NOMLINK nomBeginRegisterDLLWithGC(void) 188 203 { 189 ULONGrc;190 HREGDLL hReg=NULL HANDLE;204 gulong rc; 205 HREGDLL hReg=NULL; 191 206 PTIB ptib; 192 207 PPIB ppib; 193 208 char * buf; 194 HREGDLL pRegDLL=NULL HANDLE;209 HREGDLL pRegDLL=NULL; 195 210 196 211 rc = DosGetInfoBlocks(&ptib, &ppib); 197 212 if (rc!=NO_ERROR) 198 return NULL HANDLE;213 return NULL; 199 214 200 215 buf = malloc(BUFSIZE); 201 216 if(!buf) 202 return NULL HANDLE;217 return NULL; 203 218 204 219 pRegDLL =(HREGDLL) malloc(sizeof(REGDLL)); 205 220 if(!pRegDLL){ 206 221 free(buf); 207 return NULL HANDLE;222 return NULL; 208 223 } 209 pRegDLL->dllList=NULL HANDLE;224 pRegDLL->dllList=NULL; 210 225 211 226 memset(buf,0,BUFSIZE); … … 303 318 #define OBJWRITE 0x0002L 304 319 #define OBJINVALID 0x0080L 305 NOMEXTERN BOOLNOMLINK nomRegisterDLLByName(const HREGDLL hRegisterDLL, const char* chrDLLName)320 NOMEXTERN gboolean NOMLINK nomRegisterDLLByName(const HREGDLL hRegisterDLL, const char* chrDLLName) 306 321 { 307 322 GSList* lTemp; … … 316 331 if(pModRec){ 317 332 // g_message("DLL name: %s", pModRec->pName); 318 if(pModRec->pName && (NULL HANDLE!=strstr( pModRec->pName, chrDLLName)))333 if(pModRec->pName && (NULL!=strstr( pModRec->pName, chrDLLName))) 319 334 { 320 335 qsLObjrec_t *pObjInfo; 321 336 //g_message(" --> Found DLL %s", pModRec->pName); 322 337 pObjInfo=pModRec->pObjInfo; 323 if(NULL HANDLE!=pObjInfo)338 if(NULL!=pObjInfo) 324 339 { 325 340 int iObj; … … 344 359 } 345 360 346 347 NOMEXTERN BOOL NOMLINK nomQueryUsingNameIsDLLRegistered(const gchar *chrName) 348 { 349 if(NULLHANDLE!=g_tree_lookup(treeRegisteredDLL, chrName)) 361 //#elif defined(_WIN32) 362 #else /* PORTME */ 363 364 NOMEXTERN HREGDLL NOMLINK nomBeginRegisterDLLWithGC(void) 365 { 366 HREGDLL pRegDLL; 367 368 pRegDLL =(HREGDLL) malloc(sizeof(REGDLL)); 369 if(pRegDLL) 370 pRegDLL->dllList=NULL; 371 return pRegDLL; 372 } 373 374 NOMEXTERN void NOMLINK nomEndRegisterDLLWithGC(const HREGDLL hRegisterDLL ) 375 { 376 } 377 378 NOMEXTERN gboolean NOMLINK nomRegisterDLLByName(const HREGDLL hRegisterDLL, const char* chrDLLName) 379 { 350 380 return TRUE; 381 } 382 383 #endif 384 385 NOMEXTERN gboolean NOMLINK nomQueryUsingNameIsDLLRegistered(const gchar *chrName) 386 { 387 if(NULL!=g_tree_lookup(treeRegisteredDLL, chrName)) 388 return TRUE; 351 389 352 390 return FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.