Changeset 326
- Timestamp:
- Apr 9, 2008, 10:22:08 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 21 added
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gc6.8/include/gc_config_macros.h
r132 r326 135 135 #endif 136 136 137 #if defined(__MINGW32__) && defined(GC_DLL)137 #if (defined(__MINGW32__) || defined(__KLIBC__)) && defined(GC_DLL) 138 138 # ifdef GC_BUILD 139 139 # define GC_API __declspec(dllexport) -
trunk/gc6.8/mallocx.c
r132 r326 598 598 #include <limits.h> 599 599 600 #ifdef __OS2__ /* required for linking the testcase */ 601 GC_API 602 #endif 600 603 GC_PTR GC_memalign(size_t align, size_t lb) 601 604 { -
trunk/idl-compiler/c-emitter_c/c_file_emitter.c
r295 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif 35 37 #include <stdlib.h> 36 38 #include <string.h> … … 79 81 80 82 /* Do return type */ 81 fprintf(fh, "NOM _Scope ");83 fprintf(fh, "NOMDLLEXPORT NOM_Scope "); 82 84 emitReturnType(pLocalPI, pif, pm); 83 85 … … 123 125 } 124 126 125 fprintf(fh, "NOM _Scope ");127 fprintf(fh, "NOMDLLEXPORT NOM_Scope "); 126 128 emitReturnType(pLocalPI, pif, pm); 127 129 fprintf(fh, " NOMLINK impl_%s_%s(%s* nomSelf,\n", pif->chrName, pom->chrName, pif->chrName); … … 167 169 168 170 //printInterface(pif); 169 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL HANDLE)171 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL) 170 172 { 171 173 emitCFileHeader(pLocalPI, pif); … … 173 175 emitOverridenMethods(pLocalPI, pif); 174 176 closeOutfile(pLocalPI->outFile); 177 pLocalPI->outFile = NULL; 175 178 } 176 179 g_free(chrTemp); -
trunk/idl-compiler/c/emitter.c
r290 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdlib.h> 36 39 #include <string.h> 37 40 38 #include <glib.h> 39 #include <glib/gprintf.h> 41 #include <glib.h> 42 #include <glib/gprintf.h> 40 43 41 44 #define INCL_FILE … … 86 89 for(b=0;b<pm->uiStar;b++) 87 90 fprintf(fh, "*"); 88 fprintf(fh, " %s,\n", pm->chrName); 91 fprintf(fh, " %s,\n", pm->chrName); 89 92 } 90 93 } … … 101 104 { 102 105 PMETHODPARAM pm=(PMETHODPARAM)g_ptr_array_index(pArray, a); 103 fprintf(fh, " %s,", pm->chrName); 106 fprintf(fh, " %s,", pm->chrName); 104 107 } 105 108 } -
trunk/idl-compiler/c/nom-idl-compiler.c
r310 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #define INCL_DOSPROCESS 35 #define INCL_DOS 36 #define INCL_DOSPROFILE 37 #define INCL_DOSERRORS 38 39 #include <os2.h> 34 #ifdef __OS2__ 35 # define INCL_DOSPROCESS 36 # define INCL_DOS 37 # define INCL_DOSPROFILE 38 # define INCL_DOSERRORS 39 # include <os2.h> 40 #endif /* __OS2__ */ 41 40 42 #include <stdio.h> 41 43 #include <stdlib.h> 42 44 #include <string.h> 43 45 44 #include <io.h> 46 #ifdef HAVE_IO_H 47 # include <io.h> 48 #endif 49 #ifdef HAVE_UNISTD_H 50 # include <unistd.h> 51 #endif 45 52 #include <fcntl.h> 46 #include <sys \stat.h>47 48 #include <glib.h> 53 #include <sys/stat.h> 54 55 #include <glib.h> 49 56 #include <glib/gprintf.h> 50 57 … … 60 67 61 68 /* Command line options */ 62 static GOptionEntry gOptionEntries[] = 69 static GOptionEntry gOptionEntries[] = 63 70 { 64 71 {"directory", 'd', 0, G_OPTION_ARG_FILENAME, &chrOutputDir, "Output directory", NULL}, … … 361 368 This is the root parse function. Here starts the fun. When a token is found in the 362 369 input stream which matches one of the known token types the respective parsing function 363 is called for further processing. In case of an error the parsing function in question 370 is called for further processing. In case of an error the parsing function in question 364 371 prints an error which describes the problem and exits the application. 365 372 … … 370 377 while(g_scanner_peek_next_token(gScanner) != G_TOKEN_EOF) { 371 378 GTokenType token; 379 GTokenValue value; 372 380 373 381 g_scanner_get_next_token(gScanner); 374 382 token=gScanner->token; 375 GTokenValuevalue=gScanner->value;376 383 value=gScanner->value; 384 377 385 switch(token) 378 386 { … … 468 476 filename\n\n"); 469 477 470 /* This prints the standard option help to screen. */ 478 /* This prints the standard option help to screen. */ 471 479 g_option_context_parse (gContext, &argc2, &argv2, &gError); 472 480 } … … 494 502 void funcMsgHandler(GScanner *gScanner, gchar *message, gboolean error) 495 503 { 496 g_printf("%s:%d: error: %s (%d %d)\n", parseInfo.chrCurrentSourceFile, 504 g_printf("%s:%d: error: %s (%d %d)\n", 505 parseInfo.chrCurrentSourceFile ? parseInfo.chrCurrentSourceFile : "<null>", /* glib doesn't check for NULL like printf. */ 497 506 g_scanner_cur_line(gScanner)-parseInfo.uiLineCorrection, message, 498 507 g_scanner_cur_line(gScanner), parseInfo.uiLineCorrection); … … 554 563 } 555 564 #endif 556 565 557 566 /*** Create output path name ****/ 558 567 if(g_path_is_absolute(chrOutputDir)) … … 572 581 else 573 582 fd=open(argv[1], O_RDONLY); 574 583 575 584 if(-1==fd) 576 585 { … … 600 609 while(pSymbols->chrSymbolName) 601 610 { 602 #warning !!! Create a copy here so it is the same as with new symbols added later. 611 #ifndef _MSC_VER 612 # warning !!! Create a copy here so it is the same as with new symbols added later. 613 #endif 603 614 g_scanner_scope_add_symbol(gScanner, ID_SCOPE, pSymbols->chrSymbolName, 604 615 pSymbols); -
trunk/idl-compiler/c/open_outfile.c
r319 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdlib.h> 36 39 #include <string.h> -
trunk/idl-compiler/c/printdata.c
r321 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif 35 37 #include <stdio.h> 36 38 #include <stdlib.h> 37 39 #include <string.h> 38 40 39 #include <io.h> 41 #ifdef HAVE_IO_H 42 # include <io.h> 43 #endif 44 #ifdef HAVE_UNISTD_H 45 # include <unistd.h> 46 #endif 40 47 #include <fcntl.h> 41 #include <sys \stat.h>48 #include <sys/stat.h> 42 49 43 50 #include <glib/gprintf.h> -
trunk/idl-compiler/c/token.c
r321 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #include <os2.h> 35 #ifdef __OS2__ 36 # include <os2.h> 37 #endif /* __OS2__ */ 38 36 39 #include <stdio.h> 37 40 #include "nom.h" -
trunk/idl-compiler/c/util.c
r292 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif 35 37 #include <stdlib.h> 36 38 #include <string.h> … … 62 64 return NULL; 63 65 64 while((pifParent=getParentInterface(pifParent))!=NULL HANDLE)66 while((pifParent=getParentInterface(pifParent))!=NULL) 65 67 { 66 68 int a; … … 100 102 return NULL; 101 103 102 while((pifParent=getParentInterface(pifParent))!=NULL HANDLE)104 while((pifParent=getParentInterface(pifParent))!=NULL) 103 105 { 104 106 int a; -
trunk/idl-compiler/h-emitter_c/h_file_emitter.c
r292 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdlib.h> 36 39 #include <string.h> … … 107 110 108 111 fprintf(fh, "/* Class data structure */\n"); 112 fprintf(fh, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n", pif->chrName); 113 fprintf(fh, "NOMDLLEXPORT\n"); 114 fprintf(fh, "#else\n"); 115 fprintf(fh, "NOMDLLIMPORT\n"); 116 fprintf(fh, "#endif\n"); 109 117 fprintf(fh, "NOMEXTERN struct %sClassDataStructure {\n", pif->chrName); 110 118 … … 116 124 fprintf(fh, " nomMToken %s;\n", pm->chrName); 117 125 } 118 fprintf(fh, "}%sClassData;\n\n", pif->chrName); 119 126 fprintf(fh, "} NOMDLINK %sClassData;\n\n", pif->chrName); 127 128 fprintf(fh, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n", pif->chrName); 129 fprintf(fh, "NOMDLLEXPORT\n"); 130 fprintf(fh, "#else\n"); 131 fprintf(fh, "NOMDLLIMPORT\n"); 132 fprintf(fh, "#endif\n"); 120 133 fprintf(fh, "NOMEXTERN struct %sCClassDataStructure {\n", pif->chrName); 121 134 fprintf(fh, " nomMethodTabs parentMtab;\n"); … … 132 145 if(strcmp(pif->chrName , "NOMObject")) 133 146 { 147 /* FIXME: why is this here too? it's already in nomtk.h... */ 134 148 fprintf(fh, "/* This function is used to check if a given object is valid and the\n"); 135 149 fprintf(fh, " object supports the method */\n"); … … 181 195 pif->chrName, pm->chrName); 182 196 /* Forward declaration of parameter test function */ 197 fprintf(fh, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n", pif->chrName); 198 fprintf(fh, "NOMDLLEXPORT\n"); 199 fprintf(fh, "#else\n"); 200 fprintf(fh, "NOMDLLIMPORT\n"); 201 fprintf(fh, "#endif\n"); 183 202 fprintf(fh, "NOMEXTERN gboolean NOMLINK parmCheckFunc_%s_%s(%s *nomSelf,\n", 184 203 pif->chrName, pm->chrName, pif->chrName); … … 266 285 267 286 fprintf(fh, "/*\n * Class creation function\n */\n"); 287 fprintf(fh, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n", pif->chrName); 288 fprintf(fh, "NOMDLLEXPORT\n"); 289 fprintf(fh, "#else\n"); 290 fprintf(fh, "NOMDLLIMPORT\n"); 291 fprintf(fh, "#endif\n"); 268 292 fprintf(fh, "NOMEXTERN NOMClass * NOMLINK %sNewClass(gulong clsMajorVersion, gulong clsMinorVersion);\n\n", 269 293 pif->chrName); … … 291 315 PINTERFACE pifParent=pif; 292 316 293 while((pifParent=getParentInterface(pifParent))!=NULL HANDLE)317 while((pifParent=getParentInterface(pifParent))!=NULL) 294 318 { 295 319 GPtrArray *pArray; … … 345 369 346 370 //printInterface(pif); 347 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL HANDLE)371 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL) 348 372 { 349 373 emitHFileHeader(pLocalPI, pif); … … 357 381 emitHFileFooter(pLocalPI, pif); 358 382 closeOutfile(pLocalPI->outFile); 383 pLocalPI->outFile = NULL; 359 384 } 360 385 g_free(chrTemp); -
trunk/idl-compiler/ih-emitter_c/ih_file_emitter.c
r293 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdlib.h> 36 39 #include <string.h> … … 80 83 fprintf(fh, " %s;\n", piv->chrName); 81 84 } 82 fprintf(fh, "}%sData;\n\n", pif->chrName); 85 #ifdef _MSC_VER 86 if(!a) 87 fprintf(fh, " int iDummy;\n"); /* HACK ALERT! */ 88 #endif 89 fprintf(fh, "} %sData;\n\n", pif->chrName); 83 90 } 84 91 … … 86 93 { 87 94 FILE* fh=pLocalPI->outFile; 88 GPtrArray *pArray=pif->pInstanceVarArray; ;95 GPtrArray *pArray=pif->pInstanceVarArray; 89 96 int a; 90 97 … … 116 123 117 124 fprintf(fh, "/*** Class data structures ***/\n"); 118 fprintf(fh, " struct %sClassDataStructure %sClassData = {0};\n", pif->chrName, pif->chrName );119 fprintf(fh, " staticstruct %sCClassDataStructure %sCClassData = {0};\n\n",125 fprintf(fh, "NOMDLLEXPORT struct %sClassDataStructure %sClassData = {0};\n", pif->chrName, pif->chrName ); 126 fprintf(fh, "NOMDLLEXPORT struct %sCClassDataStructure %sCClassData = {0};\n\n", 120 127 pif->chrName, pif->chrName); 121 128 } … … 126 133 NOMEXTERN gboolean NOMLINK objectCheckFunc_WPRootFolder(WPRootFolder *nomSelf, gchar* chrMethodName) 127 134 { 128 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf , WPRootFolderClassData.classObject, NULL HANDLE))135 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf , WPRootFolderClassData.classObject, NULL)) 129 136 { 130 137 nomPrintObjectPointerError(nomSelf, "WPRootFolder", chrMethodName); … … 170 177 fprintf(fh, "\",\n"); 171 178 } 179 #ifdef _MSC_VER 180 if(!a) 181 fprintf(fh, " NULL\n"); 182 #endif 172 183 } 173 184 … … 187 198 fprintf(fh, "#if !defined(_decl_impl_%s_%s_)\n", pif->chrName, pm->chrName); 188 199 fprintf(fh, "#define _decl_impl_%s_%s_ 1\n", pif->chrName, pm->chrName); 189 fprintf(fh, "NOM _Scope ");200 fprintf(fh, "NOMDLLEXPORT NOM_Scope "); 190 201 emitReturnType(pLocalPI, pif, pm); 191 202 fprintf(fh, " NOMLINK impl_%s_%s(%s *nomSelf,\n", pif->chrName, pm->chrName, pif->chrName); … … 238 249 } 239 250 240 fprintf(fh, "NOM _Scope ");251 fprintf(fh, "NOMDLLEXPORT NOM_Scope "); 241 252 emitReturnType(pLocalPI, pif, pm); 242 253 fprintf(fh, " NOMLINK impl_%s_%s(%s* nomSelf,\n", pif->chrName, pom->chrName, pif->chrName); … … 271 282 fprintf(fh, "static nomOverridenMethodDesc nomOverridenMethods%s[] = {\n", pif->chrName); 272 283 284 pArray=pif->pOverrideArray; 285 273 286 for(a=0;a<pArray->len;a++) 274 287 { … … 289 302 fprintf(fh, " },\n"); 290 303 } 291 fprintf(fh, "};\n\n"); 304 #ifdef _MSC_VER 305 if(!a) 306 fprintf(fh, " { NULL, NULL, NULL }\n"); 307 #endif 308 fprintf(fh, "};\n\n"); 292 309 } 293 310 … … 316 333 fprintf(fh, "},\n"); 317 334 } 335 #ifdef _MSC_VER 336 if(!a) 337 fprintf(fh, " { NULL, NULL, NULL, NULL, NULL }\n"); 338 #endif 318 339 fprintf(fh, "};\n\n"); 319 340 } … … 344 365 /* Emit the parents. We have to output them sorted beginning from the 345 366 leftmost parent. */ 346 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL HANDLE)367 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL) 347 368 { 348 369 g_ptr_array_add(pArray, (gpointer) pifParent); … … 372 393 PINTERFACE pifParent=pif; 373 394 374 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL HANDLE)395 while(pifParent->chrParent && (pifParent=findInterfaceFromName(pifParent->chrParent))!=NULL) 375 396 ulRet++; 376 397 … … 498 519 } 499 520 fprintf(fh, "#include \"nomgc.h\"\n"); 521 fprintf(fh, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n", pif->chrName); 522 fprintf(fh, "NOMDLLEXPORT\n"); 523 fprintf(fh, "#else\n"); 524 fprintf(fh, "NOMDLLIMPORT\n"); 525 fprintf(fh, "#endif\n"); 500 526 fprintf(fh, "NOMClass* NOMLINK %sNewClass(gulong ulMajor, gulong ulMinor)\n", pif->chrName); 501 527 fprintf(fh, "{\n"); … … 516 542 fprintf(fh, " nomEndRegisterDLLWithGC(hReg);\n"); 517 543 fprintf(fh, " }\n"); 544 fprintf(fh, "#elif defined(_WIN32)\n"); 545 fprintf(fh, " /* FIXME: check this up with the GC. */\n"); 546 fprintf(fh, "#elif defined(__APPLE__)\n"); 547 fprintf(fh, "# warning FIXME: Check out GC/dylib.\n"); 548 fprintf(fh, "#elif defined(__linux__)\n"); 549 fprintf(fh, "# warning FIXME: Check out GC/so on linux.\n"); 518 550 fprintf(fh, "#else\n"); 519 551 fprintf(fh, "#error DLL must be registered with the garbage collector!\n"); … … 562 594 //printInterface(pif); 563 595 chrTemp=g_strconcat(pif->chrFileStem, ".ih", NULL); 564 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL HANDLE)596 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULL) 565 597 { 566 598 emitIHFileHeader(pLocalPI, pif); -
trunk/idl-compiler/parser_c/classversion_parser.c
r271 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 #include <stdlib.h> -
trunk/idl-compiler/parser_c/filestem_parser.c
r307 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 #include <stdlib.h> -
trunk/idl-compiler/parser_c/hash_parser.c
r308 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 #include <stdlib.h> … … 45 48 Current token is a '#'. 46 49 47 H:= '#' INT STRING INT // Line info from the preprocessor 50 H:= '#line' INT STRING INT // Line info from the preprocessor 51 H:= '#' INT STRING INT // Line info from the preprocessor (gcc short hand) 48 52 */ 49 53 void parseHash(void) 50 54 { 55 if (g_scanner_peek_next_token(gScanner) == G_TOKEN_IDENTIFIER 56 && !strcmp(gScanner->next_value.v_identifier, "line")) 57 getNextToken(); /* skip the line part. */ 51 58 52 59 if(matchNext(G_TOKEN_INT)) -
trunk/idl-compiler/parser_c/instancevar_parser.c
r271 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 #include <stdlib.h> -
trunk/idl-compiler/parser_c/interface_parser.c
r309 r326 37 37 a specialized parser function in another source file is called from here. 38 38 */ 39 #include <os2.h> 39 #ifdef __OS2__ 40 # include <os2.h> 41 #endif /* __OS2__ */ 42 40 43 #include <stdlib.h> 41 44 #include <string.h> … … 292 295 { 293 296 PSYMBOL pCurSymbol; 297 GTokenValue value; 294 298 295 299 /* Parent interface */ … … 305 309 exit(1); 306 310 } 307 GTokenValuevalue=gScanner->value;311 value=gScanner->value; 308 312 /* Make sure it's the correct symbol */ 309 313 pCurSymbol=value.v_symbol; -
trunk/idl-compiler/parser_c/lineinfo_parser.c
r306 r326 39 39 */ 40 40 41 #include <os2.h> 41 #ifdef __OS2__ 42 # include <os2.h> 43 #endif /* __OS2__ */ 44 42 45 #include <stdio.h> 43 46 #include <stdlib.h> -
trunk/idl-compiler/parser_c/metaclass_parser.c
r320 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 #include <stdlib.h> -
trunk/idl-compiler/parser_c/method_parser.c
r271 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdlib.h> 36 39 -
trunk/idl-compiler/parser_c/override_parser.c
r309 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 #include <stdlib.h> -
trunk/idl-compiler/parser_c/typespec_parser.c
r269 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #include <os2.h> 34 #ifdef __OS2__ 35 # include <os2.h> 36 #endif /* __OS2__ */ 37 35 38 #include <stdio.h> 36 39 -
trunk/nom/class_c/nomclassmanager.c
r313 r326 44 44 #endif 45 45 46 #define INCL_DOS 47 #include <os2.h> 46 #ifdef __OS2__ 47 # define INCL_DOS 48 # include <os2.h> 49 #endif /* __OS2__ */ 50 48 51 #include <string.h> 49 #include <gtk/gtk.h> 52 #ifdef NOM_WITH_GTK 53 # include <gtk/gtk.h> 54 #endif 50 55 51 56 … … 85 90 CORBA_Environment *ev) 86 91 { 87 CORBA_Object nomRetval=NULL HANDLE;92 CORBA_Object nomRetval=NULL; 88 93 nomMethodTab * mtab; 89 94 NOMClassMgrData *nomThis = NOMClassMgrGetData(nomSelf); … … 91 96 /* This is only for NOMClass objects */ 92 97 if(strchr(className, ':')) 93 return NULL HANDLE;98 return NULL; 94 99 95 100 mtab=g_datalist_get_data(&_gdataClassList, className); … … 164 169 /* This is only for NOMClassPriv objects */ 165 170 if(strchr(className, ':')) 166 return NULL HANDLE;171 return NULL; 167 172 168 173 mtab=g_datalist_get_data(&_gdataClassList, className); … … 170 175 return mtab->nomClsInfo; 171 176 else 172 return NULL HANDLE;177 return NULL; 173 178 } 174 179 … … 214 219 NOMClassMgrData* nomThis=NOMClassMgrGetData(nomSelf); 215 220 216 if(NULL HANDLE==nomObject)221 if(NULL==nomObject) 217 222 return FALSE; 218 223 219 return (g_tree_lookup(_pClassListTree, nomObject->mtab)!= NULL HANDLE);224 return (g_tree_lookup(_pClassListTree, nomObject->mtab)!= NULL); 220 225 } 221 226 … … 234 239 235 240 /* This returns a meta class */ 236 if((oClass=_nomFindClassFromName( nomSelf, oldClass, 0, 0, NULL HANDLE))==NULLHANDLE)241 if((oClass=_nomFindClassFromName( nomSelf, oldClass, 0, 0, NULL))==NULL) 237 242 return FALSE; 238 243 239 if((rClass=_nomFindClassFromName( nomSelf, replacementClass, 0, 0, NULL HANDLE))==NULLHANDLE)244 if((rClass=_nomFindClassFromName( nomSelf, replacementClass, 0, 0, NULL))==NULL) 240 245 return FALSE; 241 246 242 247 /* Check if the class is a direct child */ 243 ncp=(NOMClassPriv*)_nomGetObjectCreateInfo(rClass, NULL HANDLE);248 ncp=(NOMClassPriv*)_nomGetObjectCreateInfo(rClass, NULL); 244 249 245 250 if(strcmp(ncp->parentMtabStruct.next->mtab->nomClassName, oldClass)) … … 269 274 return NULL; 270 275 271 if((thePath=NOMPathNew())==NULL HANDLE)276 if((thePath=NOMPathNew())==NULL) 272 277 return NULL; 273 278 -
trunk/nom/class_c/nomcls.c
r294 r326 40 40 #endif 41 41 42 #define INCL_DOS 43 #include <os2.h> 42 #ifdef __OS2__ 43 # define INCL_DOS 44 # include <os2.h> 45 #endif /* __OS2__ */ 46 44 47 #include <string.h> 45 48 #include <stdlib.h> 46 #include <gtk/gtk.h> 49 #ifdef NOM_WITH_GTK 50 # include <gtk/gtk.h> 51 #endif 47 52 48 53 … … 64 69 if(nomIsObj(nObj)){ 65 70 //nomPrintf("Finalizing 0x%x: %s \n", nObj, nObj->mtab->nomClassName); 66 _nomUnInit(nObj, NULL HANDLE);71 _nomUnInit(nObj, NULL); 67 72 } 68 73 //else … … 80 85 81 86 if(!_ncpObject) 82 return NULL HANDLE;87 return NULL; 83 88 84 89 ncp=(NOMClassPriv*)_ncpObject; … … 86 91 /* Allocate memory big enough to hold an object. This means the size is that of the 87 92 mtab pointer and all instance variables. */ 88 if((nObj=_nomAllocate(nomSelf, ncp->mtab->ulInstanceSize, NULL HANDLE))==NULLHANDLE)89 return NULL HANDLE;93 if((nObj=_nomAllocate(nomSelf, ncp->mtab->ulInstanceSize, NULL))==NULL) 94 return NULL; 90 95 91 96 /* _nomInit() is called in _nomRenew() */ 92 return _nomRenew(nomSelf, (CORBA_Object)nObj, NULL HANDLE); /* This will also init the object */97 return _nomRenew(nomSelf, (CORBA_Object)nObj, NULL); /* This will also init the object */ 93 98 } 94 99 … … 135 140 tempEnv.fFlags=NOMENV_FLG_DONT_CHECK_OBJECT; 136 141 #endif 137 _nomRenewNoInit(nomSelf, nomObj, NULL HANDLE);142 _nomRenewNoInit(nomSelf, nomObj, NULL); 138 143 139 144 /* And now give the object the possibility to initialize... */ 140 145 /* Make sure the object is not checked. */ 141 146 //_nomInit((NOMObject*)nomObj, &tempEnv); 142 _nomInit((NOMObject*)nomObj, NULL HANDLE);147 _nomInit((NOMObject*)nomObj, NULL); 143 148 144 149 return nomObj; … … 165 170 166 171 /* The private struct characterizing the objects this meta class can create. */ 167 ncp=_nomGetObjectCreateInfo(nomSelf, NULL HANDLE);172 ncp=_nomGetObjectCreateInfo(nomSelf, NULL); 168 173 169 174 if(!ncp) … … 231 236 232 237 //The following was used before changing nomGetname() 233 //if(!_nomFindClassFromName(NOMClassMgrObject, _nomGetName(nomSelf, NULL HANDLE),234 // 0, 0, NULL HANDLE))238 //if(!_nomFindClassFromName(NOMClassMgrObject, _nomGetName(nomSelf, NULL), 239 // 0, 0, NULL)) 235 240 if(!_nomFindClassFromName(NOMClassMgrObject, _nomGetClassName(nomSelf, &tempEnv), 236 241 0, 0, &tempEnv)) … … 246 251 //ncPriv->ulIsMetaClass=1; /* Mark that we are a metaclass */ 247 252 ncPriv->ulClassFlags|=NOM_FLG_IS_METACLASS; /* Mark that we are a metaclass */ 248 _nomRegisterClass(NOMClassMgrObject, nomSelf->mtab, NULL HANDLE);253 _nomRegisterClass(NOMClassMgrObject, nomSelf->mtab, NULL); 249 254 /* Register all the methods this class introduces */ 250 255 ulNumIntroducedMethods=ncPriv->sci->ulNumStaticMethods; … … 253 258 if(*ncPriv->sci->nomSMethods[a].chrMethodDescriptor) 254 259 _nomRegisterMethod(NOMClassMgrObject, nomSelf->mtab, 255 *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL HANDLE);260 *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL); 256 261 } 257 262 /* Metaclass is registered. Register the object class this 258 263 metaclass may create. */ 259 ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULL HANDLE);//nomSelf->mtab->nomClsInfo;264 ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULL);//nomSelf->mtab->nomClsInfo; 260 265 if(ncPriv){ 266 #ifndef _MSC_VER 261 267 #warning !!!!! NOMClass does not have this pointer, this is a bug !!!!! 268 #endif 262 269 //ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */ 263 270 ncPriv->ulClassFlags&=~NOM_FLG_IS_METACLASS; /* Mark that we are not a metaclass (should be 0 already) */ 264 _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULL HANDLE);271 _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULL); 265 272 266 273 /* Register all the methods this class introduces */ … … 270 277 if(*ncPriv->sci->nomSMethods[a].chrMethodDescriptor) 271 278 _nomRegisterMethod(NOMClassMgrObject, ncPriv->mtab, 272 *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL HANDLE);279 *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL); 273 280 }/* for(a) */ 274 281 }/* ncPriv */ … … 281 288 nomPrintf("%s: Metaclass already registered, registering normal object class now.\n", __FUNCTION__); 282 289 283 ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULL HANDLE);//nomSelf->mtab->nomClsInfo;290 ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULL);//nomSelf->mtab->nomClsInfo; 284 291 // ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */ 285 292 ncPriv->ulClassFlags&=~NOM_FLG_IS_METACLASS; /* Mark that we are not a metaclass (should be 0 already) */ … … 292 299 if(*ncPriv->sci->nomSMethods[a].chrMethodDescriptor) 293 300 _nomRegisterMethod(NOMClassMgrObject, ncPriv->mtab, 294 *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL HANDLE);301 *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL); 295 302 } 296 303 //nomPrintf("%s %s \n", nomSelf->mtab->nomClassName, ncPriv->mtab->nomClassName); 297 _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULL HANDLE);304 _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULL); 298 305 } 299 306 } … … 316 323 /* Don't check object pointer. We are just created but not yet registered as a class. */ 317 324 // NOMClass_nomInit_parent(nomSelf, &tempEnv); 318 NOMClass_nomInit_parent(nomSelf, NULL HANDLE);319 } 320 321 322 323 325 NOMClass_nomInit_parent(nomSelf, NULL); 326 } 327 328 329 330 -
trunk/nom/class_c/nomobj.c
r255 r326 41 41 #endif 42 42 43 #define INCL_DOS 44 #include <os2.h> 43 #ifdef __OS2__ 44 # define INCL_DOS 45 # include <os2.h> 46 #endif /* __OS2__ */ 47 45 48 #include <string.h> 46 #include <gtk/gtk.h> 49 /* #include <gtk/gtk.h> - why? */ 47 50 48 51 #include "nom.h" … … 110 113 111 114 /* Give object the chance to free resources */ 112 _nomUnInit(nomSelf, NULL HANDLE);115 _nomUnInit(nomSelf, NULL); 113 116 114 117 /* And now delete the object */ … … 155 158 It is possible that we are called by a subclass. So get the class object and let the 156 159 class object create the correct class. */ 157 nomCls=NOMObject_nomGetClass(nomSelf, NULL HANDLE);158 return NOMClass_nomNew(nomCls, NULL HANDLE);160 nomCls=NOMObject_nomGetClass(nomSelf, NULL); 161 return NOMClass_nomNew(nomCls, NULL); 159 162 } 160 163 … … 203 206 } 204 207 205 if(nomClass==_nomGetClass(nomSelf, NULL HANDLE))208 if(nomClass==_nomGetClass(nomSelf, NULL)) 206 209 return TRUE; 207 210 -
trunk/nom/idl/nombase.idl
r268 r326 63 63 #define NOMCLASSNAME( a ) native P ## a 64 64 #endif 65 #ifndef _MSC_VER /* doesn't work here yet. */ 65 66 /* For doing parameter checks */ 66 67 #define NOMPARMCHECK(a ,...) const string _conc(a, _conc(__PARMCHECK__, _conc(__LINE__,__INCLUDE_LEVEL__))) = #__VA_ARGS__ 68 #endif 67 69 68 70 -
trunk/nom/include/nom.h
r281 r326 43 43 #define NOMEXTERN extern "C" 44 44 #else 45 45 #define NOMEXTERN extern 46 46 #endif 47 47 #endif … … 65 65 #define NOMDLINK 66 66 67 /** @def NOMDLLEXPORT 68 * Used for exporting a symbol. 69 * See __declspec(dllexport) in the Visual C++ reference for details. */ 70 /** @def NOMDLLIMPORT 71 * Used for importing a symbol from a DLL/so. 72 * See __declspec(dllimport) in the Visual C++ reference for details. */ 73 #if defined(_WIN32) || (defined(__OS2__) && defined(__GNUC__) && defined(__declspec)) 74 # define NOMDLLEXPORT __declspec(dllexport) 75 # define NOMDLLIMPORT __declspec(dllimport) 76 #elif defined(__GNUC__) 77 # if __GNUC__ >= 4 78 # define NOMDLLEXPORT __attribute__((visibility("default"))) 79 # else 80 # define NOMDLLEXPORT 81 # endif 82 # define NOMDLLIMPORT 83 #else 84 # define NOMDLLEXPORT 85 # define NOMDLLIMPORT 86 #endif 87 67 88 typedef void* NOMLINK nomMethodProc(void*); 68 89 69 90 #ifndef NULL 70 #define NULL ((void *) 0) 91 # ifdef __cplusplus 92 # define NULL 0 93 # else 94 # define NULL ((void *) 0) 95 # endif 71 96 #endif 72 97 -
trunk/nom/include/nomapi.h
r294 r326 91 91 typedef struct nomStaticMethodDescStruct { 92 92 nomMToken *nomMAddressInClassData; /* Method token in class data struct */ 93 nomID nomMethodId; /* This is a 'gchar**' pointing to something like 93 nomID nomMethodId; /* This is a 'gchar**' pointing to something like 94 94 "wpQueryContainerHandle" */ 95 95 char** chrMethodDescriptor; /* This points to something like: 96 96 "WPFolderWindow:wpQueryContainerHandle" */ 97 nomMethodProc *nomMethod; /* Address of the function implementing this 97 nomMethodProc *nomMethod; /* Address of the function implementing this 98 98 method. */ 99 99 nomParmInfo *pParamInfo; /* Information about the parameter types */ … … 140 140 typedef struct 141 141 { 142 ULONGthunk[4];142 gulong thunk[4]; 143 143 }nomMethodThunk; 144 144 … … 150 150 data and methods. Note that the name may be slightly misleading. This structure is not 151 151 limited to objects/classes which are related to NOMClass. It's a structure used by every NOM 152 class (be it a normal class or a meta class). 152 class (be it a normal class or a meta class). 153 153 */ 154 typedef struct 154 typedef struct 155 155 { 156 156 nomMethodTab *mtab; /* This is the mtab for this class it points to thisMtab at the … … 164 164 nomStaticClassInfo *sci; /* Class description */ 165 165 /* FIXME: the following list may be obsolete maybe when we just use the parentMtabStruc?? */ 166 nomMethodTabList mtabList; /* The (private) internal list of mtabs we maintain 166 nomMethodTabList mtabList; /* The (private) internal list of mtabs we maintain 167 167 struct nomMethodTabList { 168 168 nomMethodTab *mtab; /mtab for this class … … 189 189 gulong fFlags; 190 190 gpointer pReserved1; 191 gpointer pReserved2; 191 gpointer pReserved2; 192 192 }nomEnvironment; 193 193 -
trunk/nom/include/nomgc.h
r284 r326 39 39 { 40 40 GSList* dllList; 41 #ifdef __OS2__ 41 42 qsPtrRec_t * pMainAnchor; 43 #endif 42 44 }REGDLL,*HREGDLL; 43 45 44 46 /* Garbage collector */ 47 #ifdef __OS2__ 45 48 void _System nomInitGarbageCollection(void* pMemPtr); //The parameter will go away 49 #else 50 void nomInitGarbageCollection(void* pMemPtr); //The parameter will go away 51 #endif 46 52 NOMEXTERN HREGDLL NOMLINK nomBeginRegisterDLLWithGC(void); 47 53 NOMEXTERN void NOMLINK nomEndRegisterDLLWithGC(const HREGDLL hRegisterDLL ); 48 NOMEXTERN BOOLNOMLINK nomRegisterDLLByName(const HREGDLL hRegisterDLL, const char* chrDLLName);54 NOMEXTERN gboolean NOMLINK nomRegisterDLLByName(const HREGDLL hRegisterDLL, const char* chrDLLName); 49 55 NOMEXTERN void NOMLINK nomRegisterDataAreaForGC(char* pStart, char* pEnd); 50 56 #if 0 51 NOMEXTERN BOOLNOMLINK nomRegisterDLLByHandle(const HREGDLL hRegisterDLL, const gpointer pDLLHandle);57 NOMEXTERN gboolean NOMLINK nomRegisterDLLByHandle(const HREGDLL hRegisterDLL, const gpointer pDLLHandle); 52 58 #endif 53 59 54 NOMEXTERN BOOLNOMLINK nomQueryUsingNameIsDLLRegistered(const gchar *chrName);60 NOMEXTERN gboolean NOMLINK nomQueryUsingNameIsDLLRegistered(const gchar *chrName); 55 61 56 62 #endif /* NOMGC_H_INCLUDED */ -
trunk/nom/include/nomtk.h
r255 r326 46 46 /* That's the base structure of all the SOM stuff */ 47 47 typedef struct _nomEnv { 48 ULONG cbSize; /* Size of this struct */ 49 PVOID pMemPool; /* Shared memory heap for sub alloc */ 48 gulong cbSize; /* Size of this struct */ 49 void *pMemPool; /* Shared memory heap for sub alloc */ 50 #ifdef __OS2__ 50 51 HMTX hmtx_obsolete; /* Mutex sem to protect this structure -Will go away! */ 51 ULONG ulNumRegIds; /* Number of registered somIDs */ 52 #else 53 /* PORTME */ 54 #endif 55 gulong ulNumRegIds; /* Number of registered somIDs */ 52 56 NOMClassPriv *ncpNOMObject; /* This is for NOMObject*/ 53 57 nomClasses livingMetaClasses; /* List of created meta classes. */ … … 65 69 NOMEXTERN PNOM_ENV NOMLINK nomTkInit(void); 66 70 67 NOMEXTERN nomToken NOMLINK NOMMalloc(const ULONGsize);71 NOMEXTERN nomToken NOMLINK NOMMalloc(const gulong size); 68 72 NOMEXTERN boolean NOMLINK NOMFree(const nomToken memPtr); 69 NOMEXTERN nomToken NOMLINK NOMCalloc(const ULONG num, const ULONGsize);73 NOMEXTERN nomToken NOMLINK NOMCalloc(const gulong num, const gulong size); 70 74 //NOMEXTERN gboolean NOMLINK nomIsObj(NOMObject * nomObj); 71 75 NOMEXTERN gboolean NOMLINK nomIsObj(gpointer nomObj); … … 80 84 81 85 /* Functions used by nomBuildClass() */ 82 ULONGpriv_requestSomEnvMutex(PNOM_ENV pEnv);83 ULONGpriv_releaseSomEnvMutex(PNOM_ENV pEnv);84 BOOLpriv_addPrivClassToGlobalClassList(PNOM_ENV pEnv, NOMClassPriv * nClass);86 gulong priv_requestSomEnvMutex(PNOM_ENV pEnv); 87 gulong priv_releaseSomEnvMutex(PNOM_ENV pEnv); 88 gboolean priv_addPrivClassToGlobalClassList(PNOM_ENV pEnv, NOMClassPriv * nClass); 85 89 NOMClassPriv* priv_findPrivClassInGlobalClassListFromName(PNOM_ENV pEnv, char* nClass); 86 90 … … 114 118 #endif 115 119 116 void _dumpClassDataStruct(nomClassDataStructure* cds, ULONGulNumMethods);120 void _dumpClassDataStruct(nomClassDataStructure* cds, gulong ulNumMethods); 117 121 void _dumpSci(nomStaticClassInfo* sci); 118 122 void _dumpMtab(nomMethodTab* mtab); -
trunk/nom/src/nombuildclass.c
r255 r326 36 36 */ 37 37 38 #define INCL_DOS 39 #define INCL_DOSERRORS 40 41 #include <os2.h> 38 #ifdef __OS2__ 39 # define INCL_DOS 40 # define INCL_DOSERRORS 41 # include <os2.h> 42 #endif /* __OS2__ */ 43 42 44 #include <stdarg.h> 43 45 #include <stdio.h> 44 46 #include <string.h> 45 #include <alloca.h> 47 #include <stdlib.h> 48 #if !defined(_MSC_VER) 49 # include <alloca.h> 50 #endif 46 51 #include <glib.h> 47 52 #define SOM_NO_OBJECTS /* Otherwise som.h includes the IBM SOM classes */ … … 69 74 #endif 70 75 71 #ifdef DEBUG_NOMBUILDCLASS 72 #define DBG_BUILD_LINE(a) 73 #define DBG_NOMBUILDCLASS(a, b,...) if(a) nomPrintf("%d: " b , __LINE__, __VA_ARGS__); 76 #ifdef _MSC_VER 77 void _inline DBG_NOMBUILDCLASS(gboolean a, const char fmt, ...) 78 { 79 /* sorry nothing here. */ 80 } 74 81 #else 75 #define DBG_NOMBUILDCLASS(a, b,...) 76 #endif 82 # ifdef DEBUG_NOMBUILDCLASS 83 # define DBG_BUILD_LINE(a) 84 # define DBG_NOMBUILDCLASS(a, b,...) if(a) nomPrintf("%d: " b , __LINE__, __VA_ARGS__); 85 # else 86 # define DBG_NOMBUILDCLASS(a, b,...) 87 # endif 88 #endif 77 89 78 90 #define DBGBUILDNOMCLASS_ENTER BUILDNOMCLASS_ENTER … … 95 107 */ 96 108 97 static ULONGthunk[]={0x0424448b, 0x00000405, 0x0000c300};109 static gulong thunk[]={0x0424448b, 0x00000405, 0x0000c300}; 98 110 99 111 /* … … 102 114 JMP DWORD PTR [EDX+0ACh] : JMP to address pointing to by EDX+0ACh 103 115 */ 104 static ULONGmThunkCode[]={0x04244c8b, 0xff00518b, 0x0000aca2 , 0x16000000};116 static gulong mThunkCode[]={0x04244c8b, 0xff00518b, 0x0000aca2 , 0x16000000}; 105 117 106 118 … … 116 128 */ 117 129 118 static BOOLpriv_nomIsA(NOMObject *nomSelf, NOMClass* aClassObj)130 static gboolean priv_nomIsA(NOMObject *nomSelf, NOMClass* aClassObj) 119 131 { 120 132 nomParentMtabStructPtr pParentMtab=&((NOMClassPriv * )nomSelf)->parentMtabStruct; … … 195 207 __FUNCTION__, __LINE__, gstr->str); 196 208 idx++; /* This is the position for the class pointer */ 197 ncPriv=_nomGetClassInfoPtrFromName(NOMClassMgrObject, sci->chrParentClassNames[a], NULL HANDLE);209 ncPriv=_nomGetClassInfoPtrFromName(NOMClassMgrObject, sci->chrParentClassNames[a], NULL); 198 210 /* now find the index */ 199 211 ulNumMethods=nomGetNumIntroducedMethods(ncPriv); … … 245 257 } 246 258 else{ 247 ncPriv=_nomGetClassInfoPtrFromName(NOMClassMgrObject, sci->chrParentClassNames[a], NULL HANDLE);259 ncPriv=_nomGetClassInfoPtrFromName(NOMClassMgrObject, sci->chrParentClassNames[a], NULL); 248 260 //nomPrintf(" %s did not introduce the method. Adding %d to index\n", 249 261 // sci->chrParentClassNames[a], nomGetNumIntroducedMethods(ncPriv)+1); … … 275 287 for(b=0;b<sci->ulNumStaticOverrides;b++) {/* For every overriden method do */ 276 288 nomMethodProc** entries; 277 ULONGindex;289 gulong index; 278 290 279 291 entries=&nClass->mtab->entries[0]; /* Adress of array where we enter our resoved method */ … … 333 345 boolean addMethodAndDataToThisPrivClassStruct(NOMClassPriv* nClass, NOMClassPriv* ncpParent, nomStaticClassInfo *sci) 334 346 { 335 BYTE* mem;347 guint8 * mem; 336 348 int a; 337 349 … … 389 401 /* Now finally put the thunking in so the procedures are resolved correctly. */ 390 402 for(a=0;a<sci->ulNumStaticMethods;a++) { 391 ULONGulOffset;403 gulong ulOffset; 392 404 393 405 memcpy(&nClass->mThunk[a], mThunkCode, sizeof(mThunkCode)); /* Copy thunking code */ 394 406 395 ulOffset=( ULONG)((char*)(mem+sizeof(NOMClass*))-(char*)nClass->mtab); /* Skip class object pointer */407 ulOffset=(gulong)((char*)(mem+sizeof(NOMClass*))-(char*)nClass->mtab); /* Skip class object pointer */ 396 408 nClass->mThunk[a].thunk[2]=((ulOffset+a*sizeof(nomMethodProc*))<<8)+0xa2; 397 409 /* Put thunking code address into CClassStruct */ … … 431 443 { 432 444 ncpParent=_nomGetClassInfoPtrFromName(NOMClassMgrObject, chrClassName, 433 NULL HANDLE);445 NULL); 434 446 } 435 447 … … 495 507 NOMClass* nomClass) 496 508 { 497 ULONGulParentDataSize=0;498 ULONGmtabSize;499 ULONGulMemSize=0;509 gulong ulParentDataSize=0; 510 gulong mtabSize; 511 gulong ulMemSize=0; 500 512 NOMClassPriv *nClass, *ncpParent; 501 513 … … 503 515 504 516 if(!nomClass||!sci) 505 return NULL HANDLE;517 return NULL; 506 518 507 519 /* The addresse of static methods in sci are already resolved. See nomBuildClass() */ … … 512 524 }/* nomIdAllParents */ 513 525 else 514 ncpParent = NULL HANDLE;526 ncpParent = NULL; 515 527 516 528 if(!ncpParent) { … … 518 530 /* FIXME: 519 531 Maybe we should panic here. */ 520 return NULL HANDLE; /* Only NOMObject has no parent, so we have a problem here. */532 return NULL; /* Only NOMObject has no parent, so we have a problem here. */ 521 533 } 522 534 … … 540 552 541 553 /* Alloc private class struct using NOMCalloc. */ 542 if((nClass=(NOMClassPriv*)NOMCalloc(1, ulMemSize))==NULL HANDLE)543 return NULL HANDLE;554 if((nClass=(NOMClassPriv*)NOMCalloc(1, ulMemSize))==NULL) 555 return NULL; 544 556 #if 0 545 557 //Moved to addMethodAndDataToThisPrivClassStruct() … … 549 561 if(!nClass->mThunk) { 550 562 NOMFree(nClass); 551 return NULL HANDLE;563 return NULL; 552 564 } 553 565 } … … 561 573 if(!addMethodAndDataToThisPrivClassStruct( nClass, ncpParent, sci)){ 562 574 NOMFree(nClass); 563 return NULL HANDLE;575 return NULL; 564 576 }; 565 577 … … 580 592 nClass->mtab->nomClassObject=nomClass; /* Class object (metaclass). We build a normal class here. */ 581 593 nClass->mtab->nomClsInfo=(nomClassInfo*)nClass; 594 #ifndef _MSC_VER 582 595 #warning !!!!! Change this when nomId is a GQuark !!!!! 596 #endif 583 597 nClass->mtab->nomClassName=*sci->nomClassId; 584 598 nClass->mtab->ulInstanceSize=sci->ulInstanceDataSize+ulParentDataSize; /* Size of instance data of this class and all … … 589 603 DBG_NOMBUILDCLASS(TRUE, "New NOMClassPriv*: %x\n", nClass); 590 604 591 _nomSetObjectCreateInfo(nomClass, nClass, NULL HANDLE);605 _nomSetObjectCreateInfo(nomClass, nClass, NULL); 592 606 593 607 /* Mark the class as using nomUnInit() if any parent did that. We just have to … … 610 624 611 625 if(NULL==NOMClassMgrObject) 612 return NULL HANDLE;626 return NULL; 613 627 614 628 /* Search for meta class. */ 629 #ifndef _MSC_VER 615 630 #warning !!!!! Change this when nomID is a GQuark !!!!! 616 nomClassMeta=_nomFindClassFromName(NOMClassMgrObject, *sci->nomExplicitMetaId, majorVersion, minorVersion, NULLHANDLE); 631 #endif 632 nomClassMeta=_nomFindClassFromName(NOMClassMgrObject, *sci->nomExplicitMetaId, majorVersion, minorVersion, NULL); 617 633 618 634 DBG_NOMBUILDCLASS(TRUE, "%x %s %s\n", nomClassMeta, *sci->nomClassId, *sci->nomExplicitMetaId); 619 635 620 636 if(!nomClassMeta) 621 return NULL HANDLE;637 return NULL; 622 638 623 639 /* Create a new class object. We create a copy here because we may change the mtab entries … … 625 641 sizes, methods etc. I wonder how IBM SOM manages to use the same metaclass 626 642 for different classes without (apparently) copying it for different uses... */ 627 if((nomClass=(NOMClass*)NOMCalloc(1, _nomGetSize(nomClassMeta, NULL HANDLE)))==NULLHANDLE)628 return NULL HANDLE;643 if((nomClass=(NOMClass*)NOMCalloc(1, _nomGetSize(nomClassMeta, NULL)))==NULL) 644 return NULL; 629 645 630 646 /* Maybe we should just copy the whole struct here? */ 631 647 nomClass->mtab=nomClassMeta->mtab; 648 #ifndef _MSC_VER 632 649 #warning !!!!! No call of _nomSetInstanceSize !!!!! 633 650 #warning !!!!! No call of _nomSetObjectsSCI !!!!! 651 #endif 634 652 #if 0 635 653 /* Set object data */ … … 678 696 { 679 697 NOMObject *nObject; 680 nObject=_nomFindClassFromName(NOMClassMgrObject, sci->chrParentClassNames[a], 0, 0, NULL HANDLE);698 nObject=_nomFindClassFromName(NOMClassMgrObject, sci->chrParentClassNames[a], 0, 0, NULL); 681 699 682 700 DBG_NOMBUILDCLASS( TRUE , " Parent %d: %s, class object: %x\n" , … … 710 728 711 729 #ifdef DEBUG_NOMBUILDCLASS 730 # ifndef _MSC_VER 712 731 #warning !!!!! Change this when nomId is a GQuark !!!!! 732 # endif 713 733 nomPrintf("\n%d: Entering %s to build %s\n", __LINE__, __FUNCTION__, *sci->nomClassId); 714 734 #endif … … 722 742 723 743 if(!nomClassDefault) 724 return NULL HANDLE;744 return NULL; 725 745 726 746 /* Found NOMClass object */ 727 747 728 //nomPrintf("_nomGetSize(): %d\n", _nomGetSize(nomClassParent, NULL HANDLE));748 //nomPrintf("_nomGetSize(): %d\n", _nomGetSize(nomClassParent, NULL)); 729 749 730 750 /* Create an object */ 731 if((nomClass=(NOMClass*)NOMCalloc(1, _nomGetSize(nomClassDefault, NULL HANDLE)))==NULLHANDLE)732 return NULL HANDLE;751 if((nomClass=(NOMClass*)NOMCalloc(1, _nomGetSize(nomClassDefault, NULL)))==NULL) 752 return NULL; 733 753 734 754 nomClass->mtab=nomClassDefault->mtab; 735 755 756 #ifndef _MSC_VER 736 757 #warning !!!!! _nomSetInstanceSize() not called here !!!!! 737 758 #warning !!!!! _nomSetObjectsSCI() not called here !!!!! 759 #endif 738 760 #if 0 739 761 /* Set object data */ … … 783 805 784 806 /* Allocate a class object for NOMObject for creating NOMObject instances. */ 785 if((nomObjClass=(NOMClass*)NOMCalloc(1, ulSize))==NULL HANDLE) {807 if((nomObjClass=(NOMClass*)NOMCalloc(1, ulSize))==NULL) { 786 808 /* We panic here for the simple reason that without a working NOMObject the whole object system 787 809 will not work. */ 788 810 g_error("No memory for building the class object _NOMObject for NOMObject."); 789 return NULL HANDLE;811 return NULL; 790 812 } 791 813 792 814 nomObjClass->mtab=nomClass->mtab; /* Now it's an object */ 793 815 794 _nomSetObjectCreateInfo(nomObjClass, pGlobalNomEnv->ncpNOMObject, NULL HANDLE); /* This NOMClassPriv holds all info to build816 _nomSetObjectCreateInfo(nomObjClass, pGlobalNomEnv->ncpNOMObject, NULL); /* This NOMClassPriv holds all info to build 795 817 instances of NOMObject (not that anybody 796 818 should do that but... */ 819 #ifndef _MSC_VER 797 820 #warning !!!!!!!!!!!!! _somSetObjectsSCI() not called!!!!!!!!!!!!!!!! 798 821 #warning !!!!!!!!!!!!! _somSetClassData() not called!!!!!!!!!!!!!!!! 822 #endif 799 823 #if 0 800 824 _somSetObjectsSCI(nomObjClass, ncp->sci); … … 828 852 NOMClassPriv *nClass; 829 853 NOMClassPriv *ncpParent; 830 ULONGulParentDataSize=0;831 ULONGmtabSize;832 ULONGulMemSize=0;854 gulong ulParentDataSize=0; 855 gulong mtabSize; 856 gulong ulMemSize=0; 833 857 int a; 834 858 … … 856 880 857 881 if(!strcmp(*sci->nomClassId, "NOMObject")){ 858 if(pGlobalNomEnv->ncpNOMObject!=NULL HANDLE){882 if(pGlobalNomEnv->ncpNOMObject!=NULL){ 859 883 DBG_NOMBUILDCLASS(TRUE, "Class %s already built. returning 0x%x\n", 860 884 *sci->nomClassId, sci->nomCds->nomClassObject); 861 885 /* FIXME: this seems to be broken!! */ 862 return NULL HANDLE; /* NOMObject already built */886 return NULL; /* NOMObject already built */ 863 887 } 864 888 } … … 871 895 if(sci->ulNumStaticMethods!=0 && !sci->nomSMethods){ 872 896 nomPrintf(" !!! %s line %d: sci->nomSMethods is NULL for %s !!!\n", __FUNCTION__, __LINE__, *sci->nomClassId); 873 return NULL HANDLE;897 return NULL; 874 898 } 875 899 /* Fill static classdata with the info from nomStaticMethodDesc array. This means … … 903 927 priv_buildNOMObjectClassInfo(ulReserved, sci, /* yes */ 904 928 ulMajorVersion, ulMinorVersion); 905 return NULL HANDLE; /* We can't return a NOMClass for NOMObject because NOMClass isn't built yet. */929 return NULL; /* We can't return a NOMClass for NOMObject because NOMClass isn't built yet. */ 906 930 } 907 931 … … 914 938 if(sci->nomIdAllParents) { 915 939 #ifdef DEBUG_NOMBUILDCLASS 940 # ifndef _MSC_VER 916 941 #warning !!!!! Change this when nomId is a GQuark !!!!! 942 # endif 917 943 nomPrintf("%d: About to search parent %s...\n", __LINE__, **(sci->nomIdAllParents)); 918 944 #endif … … 927 953 #endif 928 954 if(!ncpParent) 929 return NULL HANDLE; /* Every class except NOMObject must have a parent!! */955 return NULL; /* Every class except NOMObject must have a parent!! */ 930 956 }/* nomIdAllParents */ 931 957 else 932 return NULL HANDLE; /* Every class except NOMObject must have a parent!! */958 return NULL; /* Every class except NOMObject must have a parent!! */ 933 959 934 960 if(!ncpParent) 935 return NULL HANDLE; /* Every class except NOMObject must have a parent!! */961 return NULL; /* Every class except NOMObject must have a parent!! */ 936 962 937 963 #ifdef DEBUG_NOMBUILDCLASS … … 1029 1055 1030 1056 /* Alloc class struct using NOMCalloc. */ 1031 if((nClass=(NOMClassPriv*)NOMCalloc(1, ulMemSize))==NULL HANDLE)1032 return NULL HANDLE;1057 if((nClass=(NOMClassPriv*)NOMCalloc(1, ulMemSize))==NULL) 1058 return NULL; 1033 1059 1034 1060 #if 0 … … 1039 1065 if(!nClass->mThunk) { 1040 1066 NOMFree(nClass); 1041 return NULL HANDLE;1067 return NULL; 1042 1068 } 1043 1069 } … … 1046 1072 nClass->ulClassSize=sci->ulInstanceDataSize+ulParentDataSize; 1047 1073 1048 if((nomClass=(NOMClass*)NOMCalloc(1, sci->ulInstanceDataSize+ulParentDataSize))==NULL HANDLE) {1074 if((nomClass=(NOMClass*)NOMCalloc(1, sci->ulInstanceDataSize+ulParentDataSize))==NULL) { 1049 1075 //NOMFree(nClass->mThunk); 1050 1076 NOMFree(nClass); 1051 return NULL HANDLE;1077 return NULL; 1052 1078 } 1053 1079 … … 1058 1084 NOMFree(nClass); 1059 1085 NOMFree(nomClass); 1060 return NULL HANDLE;1086 return NULL; 1061 1087 }; 1062 1088 … … 1088 1114 1089 1115 /* Set this class size into instance var */ 1116 #ifndef _MSC_VER 1090 1117 #warning !!!!! No call of _nomSetInstanceSize() here !!!!! 1118 #endif 1091 1119 // _nomSetInstanceSize(nomClass, sci->ulInstanceDataSize+ulParentDataSize); 1092 1120 … … 1149 1177 sID=SOMMalloc(sizeof(void*)); 1150 1178 if(!sID) 1151 return NULL HANDLE;1179 return NULL; 1152 1180 1153 1181 *sID=(char*)sid; … … 1156 1184 1157 1185 /* No somId registered yet, so create one */ 1158 if((sid=(somIdItem*)SOMCalloc(1, sizeof(somIdItem)))==NULL HANDLE)1159 return NULL HANDLE;1186 if((sid=(somIdItem*)SOMCalloc(1, sizeof(somIdItem)))==NULL) 1187 return NULL; 1160 1188 1161 1189 sid->idString=SOMMalloc(strlen(aString)+1); … … 1163 1191 { 1164 1192 SOMFree(sid); 1165 return NULL HANDLE;1193 return NULL; 1166 1194 } 1167 1195 … … 1172 1200 SOMFree(sid->idString); 1173 1201 SOMFree(sid); 1174 return NULL HANDLE;1202 return NULL; 1175 1203 } 1176 1204 1177 1205 sID=SOMMalloc(sizeof(void*)); 1178 1206 if(!sID) 1179 return NULL HANDLE;1207 return NULL; 1180 1208 1181 1209 *sID=(char*)sid; … … 1193 1221 char* chrPtr; 1194 1222 SOMClassPriv *scp; 1195 ULONGulLen;1223 gulong ulLen; 1196 1224 char *chrMem; 1197 1225 1198 1226 if(!sid) 1199 return NULL HANDLE;1200 1201 if((chrPtr=strchr(**sid, ':'))==NULL HANDLE)1202 return NULL HANDLE;1227 return NULL; 1228 1229 if((chrPtr=strchr(**sid, ':'))==NULL) 1230 return NULL; 1203 1231 1204 1232 /* Create local copy */ 1205 1233 ulLen=strlen(**sid); 1206 1234 if(ulLen>5000) /* prevent stack overflow in case of error */ 1207 return NULL HANDLE;1235 return NULL; 1208 1236 1209 1237 chrMem=alloca(ulLen); 1210 1238 strcpy(chrMem, **sid); 1211 1239 1212 if((chrPtr=strchr(chrMem, ':'))==NULL HANDLE)1213 return NULL HANDLE; /* How should that happen, but anyway... */1240 if((chrPtr=strchr(chrMem, ':'))==NULL) 1241 return NULL; /* How should that happen, but anyway... */ 1214 1242 1215 1243 *chrPtr=0; /* Now we have separated the class name */ … … 1222 1250 #endif 1223 1251 if(!scp) 1224 return NULL HANDLE;1252 return NULL; 1225 1253 #ifdef DEBUG_SOMBUILDCLASS 1226 1254 somPrintf("%d: %s: found %x (SOMClassPriv) ->%x (SOMClass)\n", __LINE__, __FUNCTION__, scp, scp->mtab->classObject); … … 1240 1268 char* chrPtr; 1241 1269 SOMClassPriv *scp; 1242 ULONGulLen;1270 gulong ulLen; 1243 1271 char *chrMem; 1244 1272 1245 1273 if(!sid) 1246 return NULL HANDLE;1247 1248 if((chrPtr=strchr(**sid, ':'))==NULL HANDLE)1249 return NULL HANDLE;1274 return NULL; 1275 1276 if((chrPtr=strchr(**sid, ':'))==NULL) 1277 return NULL; 1250 1278 1251 1279 /* Create local copy */ 1252 1280 ulLen=strlen(**sid); 1253 1281 if(ulLen>5000) /* prevent stack overflow in case of error */ 1254 return NULL HANDLE;1282 return NULL; 1255 1283 1256 1284 chrMem=alloca(ulLen); 1257 1285 strcpy(chrMem, **sid); 1258 1286 1259 if((chrPtr=strchr(chrMem, ':'))==NULL HANDLE)1260 return NULL HANDLE; /* How should that happen, but anyway... */1287 if((chrPtr=strchr(chrMem, ':'))==NULL) 1288 return NULL; /* How should that happen, but anyway... */ 1261 1289 1262 1290 *chrPtr=0; /* Now we have separated the class name */ … … 1267 1295 somPrintf("%d: %s: found %x (SOMClassPriv)\n", __LINE__, __FUNCTION__, scp); 1268 1296 if(!scp) 1269 return NULL HANDLE;1297 return NULL; 1270 1298 #ifdef DEBUG_SOMBUILDCLASS 1271 1299 somPrintf("%d: %s: found %x (SOMClassPriv) ->%x\n", __LINE__, __FUNCTION__, scp, scp->mtab->classObject); … … 1284 1312 FIXME: semaphores ???? 1285 1313 */ 1286 static ULONGpriv_getIndexOfMethodToBeOverriden(somId *methodId )1314 static gulong priv_getIndexOfMethodToBeOverriden(somId *methodId ) 1287 1315 { 1288 1316 return 0; … … 1297 1325 struct somMethodTabListStruct; 1298 1326 struct somParentMtabStruct; Struct to place parent mtab pointer 1299 ULONGthunk[3]; Assembler thunking code1327 gulong thunk[3]; Assembler thunking code 1300 1328 somMethodTabStruct mtabStruct; See beloe 1301 1329 ClassDataStruct class1; … … 1367 1395 long minorVersion) 1368 1396 { 1369 BYTE* mem;1397 guint8 * mem; 1370 1398 SOMClassPriv *sClass; /* This struct holds our private data. A pointer will be in mtab->classInfo */ 1371 1399 SOMClass *somClass; /* A real SOMClass pointer */ 1372 1400 int a; 1373 ULONGmtabSize;1374 ULONGulMemSize=0;1375 ULONGulParentDataSize=0;1401 gulong mtabSize; 1402 gulong ulMemSize=0; 1403 gulong ulParentDataSize=0; 1376 1404 1377 1405 #ifdef DEBUG_BUILDSOMOBJECT … … 1382 1410 1383 1411 /* Note: SOMObject has no parents */ 1384 return NULL HANDLE;1412 return NULL; 1385 1413 1386 1414 /* ulMemsize will be the size of our private class structure SOMClassPriv */ … … 1397 1425 1398 1426 /* Alloc private class struct using SOMCalloc. */ 1399 if((sClass=(SOMClassPriv*)SOMCalloc(1, ulMemSize))==NULL HANDLE)1400 return NULL HANDLE;1427 if((sClass=(SOMClassPriv*)SOMCalloc(1, ulMemSize))==NULL) 1428 return NULL; 1401 1429 1402 1430 /* Get mem for method thunking code. This assembler code is needed so the indirect … … 1407 1435 if(!sClass->mThunk) { 1408 1436 SOMFree(sClass); 1409 return NULL HANDLE;1437 return NULL; 1410 1438 } 1411 1439 … … 1425 1453 /* And now the real SOMClass struct which will be seen by the user. A SOMClass has a mTab pointer 1426 1454 at the beginning and the instance data following. */ 1427 if((somClass=(SOMClass*)SOMCalloc(1, sci->instanceDataSize+sizeof(somMethodTab*)))==NULL HANDLE) {1455 if((somClass=(SOMClass*)SOMCalloc(1, sci->instanceDataSize+sizeof(somMethodTab*)))==NULL) { 1428 1456 SOMFree(sClass->mThunk); 1429 1457 SOMFree(sClass); 1430 return NULL HANDLE;1458 return NULL; 1431 1459 } 1432 1460 somClass->mtab=sClass->mtab; … … 1461 1489 /* Now finally put the thunking in so the procedures are resolved correctly. */ 1462 1490 for(a=0;a<sci->numStaticMethods;a++) { 1463 ULONGulOffset;1491 gulong ulOffset; 1464 1492 1465 1493 memcpy(&sClass->mThunk[a], mThunkCode, sizeof(mThunkCode)); /* Copy method thunking code template */ 1466 ulOffset=( ULONG)((char*)(mem+sizeof(SOMClass*))-(char*)somClass->mtab); /* Skip priv class data pointer */1494 ulOffset=(gulong)((char*)(mem+sizeof(SOMClass*))-(char*)somClass->mtab); /* Skip priv class data pointer */ 1467 1495 sClass->mThunk[a].thunk[2]=((ulOffset+a*sizeof(somMethodProc*))<<8)+0xa2; /* Calculate offset for assembler code */ 1468 1496 #ifdef DEBUG_BUILDSOMOBJECT -
trunk/nom/src/nombuildnomcls.c
r255 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOS 36 #define INCL_DOSERRORS 37 38 #include <os2.h> 35 #ifdef __OS2__ 36 # define INCL_DOS 37 # define INCL_DOSERRORS 38 # include <os2.h> 39 #endif /* __OS2__ */ 40 39 41 #include <stdio.h> 40 42 … … 63 65 #define BUILDNOMCLASS_ENTER 64 66 #define BUILDNOMCLASS_LEAVE 67 # ifdef _MSC_VER 68 void _inline DBG_BUILDNOMCLASS(gboolean a, const char *msg, ...) 69 { 70 /* sorry, nothing here. */ 71 } 72 # else 65 73 #define DBG_BUILDNOMCLASS(a, b,...) 74 # endif 66 75 #endif 67 76 … … 71 80 72 81 extern PNOM_ENV pGlobalNomEnv; 73 extern ULONGthunk[];74 extern ULONGmThunkCode[];82 extern gulong thunk[]; 83 extern gulong mThunkCode[]; 75 84 76 85 /********************************************************/ … … 119 128 120 129 /* Alloc private class struct using SOMCalloc. */ 121 if((nClass=(NOMClassPriv*)NOMCalloc(1, gulMemSize))==NULL HANDLE)122 return NULL HANDLE;130 if((nClass=(NOMClassPriv*)NOMCalloc(1, gulMemSize))==NULL) 131 return NULL; 123 132 124 133 /* Get mem for method thunking code. This assembler code is needed so the indirect … … 132 141 if(!nClass->mThunk) { 133 142 NOMFree(nClass); 134 return NULL HANDLE;143 return NULL; 135 144 } 136 145 } … … 150 159 if(!addMethodAndDataToThisPrivClassStruct( nClass, ncpParent, sci)){ 151 160 NOMFree(nClass); 152 return NULL HANDLE;161 return NULL; 153 162 }; 154 163 … … 158 167 nClass->mtab->mtabSize=mtabSize; 159 168 nClass->mtab->nomClsInfo=(nomClassInfo*)nClass; /* Hold a pointer to the private data that is this NOMClassPriv */ 169 #ifndef _MSC_VER 160 170 #warning !!!!! Change this when nomId is a GQuark !!!!! 171 #endif 161 172 nClass->mtab->nomClassName=*sci->nomClassId; 162 173 nClass->mtab->ulInstanceSize=sci->ulInstanceDataSize+gulParentDataSize; /* Size of instance data of this class and all … … 205 216 else{ 206 217 g_error("No NOMObject while trying to build NOMClass."); /* This will result in a termination of the app! */ 207 return NULL HANDLE; /* NOMClass *must* have an object as parent!218 return NULL; /* NOMClass *must* have an object as parent! 208 219 We won't reach this point */ 209 220 } … … 223 234 224 235 /* Build the NOMClassPriv for NOMClass */ 225 if((nClass=buildNOMClassPrivStruct(sci, ncpParent))==NULL HANDLE)226 return NULL HANDLE;236 if((nClass=buildNOMClassPrivStruct(sci, ncpParent))==NULL) 237 return NULL; 227 238 228 239 ulParentDataSize=ncpParent->mtab->ulInstanceSize; /* Parent instance size. This is the mtab pointer + instance vars */ … … 231 242 /* And now the NOMClass struct. A NOMClass has a mTab pointer at the beginning and the instance data 232 243 following (including the parent instance data).*/ 233 if((nomClass=(NOMClass*)NOMCalloc(1, sci->ulInstanceDataSize+ulParentDataSize))==NULL HANDLE) {244 if((nomClass=(NOMClass*)NOMCalloc(1, sci->ulInstanceDataSize+ulParentDataSize))==NULL) { 234 245 NOMFree(nClass->mThunk); 235 246 NOMFree(nClass); 236 return NULL HANDLE;247 return NULL; 237 248 } 238 249 … … 274 285 pGlobalNomEnv->defaultMetaClass=nomClass; 275 286 287 #ifndef _MSC_VER 276 288 #warning !!!!! _nomSetInstanceSize() not called !!!!! 289 #endif 277 290 #if 0 278 291 /* Set this class size into instance var */ … … 281 294 282 295 /* Run initialization code if any */ 283 _nomInit(nomClass, NULL HANDLE);296 _nomInit(nomClass, NULL); 284 297 return nomClass; 285 298 } -
trunk/nom/src/nombuildnomobj.c
r255 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOS 36 #define INCL_DOSERRORS 37 38 #include <os2.h> 35 #ifdef __OS2__ 36 # define INCL_DOS 37 # define INCL_DOSERRORS 38 # include <os2.h> 39 #endif /* __OS2__ */ 40 39 41 #include <stdio.h> 40 42 #include <string.h> … … 67 69 */ 68 70 69 static ULONGthunk[]={0x0424448b, 0x00000405, 0x0000c300};71 static gulong thunk[]={0x0424448b, 0x00000405, 0x0000c300}; 70 72 71 73 /* … … 74 76 JMP DWORD PTR [EDX+0ACh] : JMP to address pointing to by EDX+0ACh 75 77 */ 76 static ULONGmThunkCode[]={0x04244c8b, 0xff00518b, 0x0000aca2 , 0x16000000};78 static gulong mThunkCode[]={0x04244c8b, 0xff00518b, 0x0000aca2 , 0x16000000}; 77 79 78 80 /********************************************************/ … … 100 102 gulong mtabSize; 101 103 gulong ulMemSize=0; 102 BYTE* mem;104 guint8 * mem; 103 105 int a; 104 106 … … 116 118 117 119 /* Alloc private class struct using NOMCalloc. */ 118 if((nClass=(NOMClassPriv*)NOMCalloc(1, ulMemSize))==NULL HANDLE)119 return NULL HANDLE;120 if((nClass=(NOMClassPriv*)NOMCalloc(1, ulMemSize))==NULL) 121 return NULL; 120 122 121 123 … … 138 140 nClass->mtab->mtabSize=mtabSize; /* This mtab is the same as the one used in the public NOMClass */ 139 141 nClass->mtab->nomClsInfo=(nomClassInfo*)nClass; /* Hold a pointer to the private data that is this NOMClassPriv */ 142 #ifndef _MSC_VER 140 143 #warning !!!!! Change this when nomId is a GQuark !!!!! 144 #endif 141 145 nClass->mtab->nomClassName=*sci->nomClassId; 142 146 nClass->mtab->ulInstanceSize=sci->ulInstanceDataSize+sizeof(nomMethodTabPtr); /* sizeof(methodTabStruct*) + size of instance data of this class … … 151 155 if(!nClass->mThunk) { 152 156 NOMFree(nClass); 153 return NULL HANDLE;157 return NULL; 154 158 } 155 159 } … … 172 176 /* Now finally put the thunking in so the procedures are resolved correctly. */ 173 177 for(a=0;a<sci->ulNumStaticMethods;a++) { 174 ULONGulOffset;178 gulong ulOffset; 175 179 176 180 memcpy(&nClass->mThunk[a], mThunkCode, sizeof(mThunkCode)); /* Copy method thunking code template */ 177 ulOffset=( ULONG)((char*)(mem+sizeof(NOMClass*))-(char*)nClass->mtab); /* Skip priv class data pointer */181 ulOffset=(gulong)((char*)(mem+sizeof(NOMClass*))-(char*)nClass->mtab); /* Skip priv class data pointer */ 178 182 nClass->mThunk[a].thunk[2]=((ulOffset+a*sizeof(nomMethodProc*))<<8)+0xa2; /* Calculate offset for assembler code */ 179 183 #ifdef DEBUG_BUILDNOMOBJECT … … 202 206 { 203 207 NOMClassPriv *nClassPriv; /* This struct holds our private data. A pointer will be in mtab->nomClsInfo */ 204 ULONGulParentDataSize=0;208 gulong ulParentDataSize=0; 205 209 206 210 #ifdef DEBUG_BUILDNOMOBJECT … … 210 214 211 215 /* Note: NOMObject has no parents */ 212 if((nClassPriv=buildNOMClassPrivStructForNOMObject(sci))==NULL HANDLE)213 return NULL HANDLE;216 if((nClassPriv=buildNOMClassPrivStructForNOMObject(sci))==NULL) 217 return NULL; 214 218 215 219 #ifdef DEBUG_BUILDNOMOBJECT … … 221 225 sci->ccds->parentMtab->mtab=nClassPriv->mtab; /* This class mtab */ 222 226 sci->ccds->parentMtab->next=NULL; /* We dont have parents because we are NOMObject */ 223 sci->ccds->parentMtab->nomClassObject=NULL HANDLE; /* NOMClass* Class object. We don't have one yet */227 sci->ccds->parentMtab->nomClassObject=NULL; /* NOMClass* Class object. We don't have one yet */ 224 228 sci->ccds->parentMtab->ulInstanceSize=nClassPriv->mtab->ulInstanceSize; 225 229 /* C Class data structure */ … … 267 271 268 272 /* Run initialization code if any */ 269 _nomInit((NOMObject*)nClassPriv, NULL HANDLE);270 return NULL HANDLE;273 _nomInit((NOMObject*)nClassPriv, NULL); 274 return NULL; 271 275 } 272 276 -
trunk/nom/src/nomdebug.c
r281 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOS 36 #define INCL_DOSFILEMGR 37 #define INCL_DOSERRORS 38 #define INCL_WIN 39 #define INCL_WINWORKPLACE 40 #define INCL_OS2MM 41 #define INCL_MMIOOS2 42 #define INCL_MCIOS2 43 #define INCL_GPI 44 #define INCL_PM 45 46 #include <os2.h> 35 #ifdef __OS2__ 36 # define INCL_DOS 37 # define INCL_DOSFILEMGR 38 # define INCL_DOSERRORS 39 # define INCL_WIN 40 # define INCL_WINWORKPLACE 41 # define INCL_OS2MM 42 # define INCL_MMIOOS2 43 # define INCL_MCIOS2 44 # define INCL_GPI 45 # define INCL_PM 46 # include <os2.h> 47 #endif /* __OS2__ */ 48 47 49 #include <stdarg.h> 48 50 #include <stdio.h> … … 65 67 g_error("The object used to call the method %s is not a valid NOM object. ", chrMethodName); 66 68 else 67 g_error("The object for which the method %s should be called is not valid for this method.\nThe object must be some instance of class %s (or of a subclass) but is a %s.", chrMethodName, NOMClass_nomGetCreatedClassName(nomClass, NULL HANDLE),68 NOMObject_nomGetClassName(nomObject, NULL HANDLE));69 g_error("The object for which the method %s should be called is not valid for this method.\nThe object must be some instance of class %s (or of a subclass) but is a %s.", chrMethodName, NOMClass_nomGetCreatedClassName(nomClass, NULL), 70 NOMObject_nomGetClassName(nomObject, NULL)); 69 71 } 70 72 } … … 114 116 115 117 // g_message("In %s with %s %px nomClass: %px (%s)", __FUNCTION__, chrMethodName, nomSelf, nomClass, nomClass->mtab->nomClassName); 116 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf, nomClass, NULL HANDLE))118 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf, nomClass, NULL)) 117 119 { 118 120 nomPrintObjectPointerErrorMsg(nomSelf, nomClass, chrMethodName); … … 154 156 nomPrintf("----- %s ----- NOMClassMgrObject: %lx\n", __FUNCTION__, NOMClassMgrObject); 155 157 156 pgdata=_nomGetClassList(NOMClassMgrObject, NULL HANDLE);158 pgdata=_nomGetClassList(NOMClassMgrObject, NULL); 157 159 if(pgdata){ 158 160 nomPrintf("%s: classlist: %lx\n", __FUNCTION__, pgdata); … … 176 178 nomPrintf("explicitMetaId (meta class): %s\n", *sci->nomExplicitMetaId); 177 179 else 178 nomPrintf("explicitMetaId (meta class): NULL HANDLE\n");180 nomPrintf("explicitMetaId (meta class): NULL\n"); 179 181 // somPrintf("*parents: 0x%x\n", sci->parents); 180 182 nomPrintf("somClassDataStructure cds: 0x%x\n",sci->nomCds); … … 190 192 191 193 192 void _dumpClassDataStruct(nomClassDataStructure* cds, ULONGulNumMethods)194 void _dumpClassDataStruct(nomClassDataStructure* cds, gulong ulNumMethods) 193 195 { 194 196 int a; … … 215 217 nomPrintf(" instanceSize (this and all parents): %d 0x%x\n", mtab->ulInstanceSize, mtab->ulInstanceSize); 216 218 nomPrintf(" mtabSize: %d 0x%x\n", mtab->mtabSize, mtab->mtabSize); 217 nomPrintf(" somMethodProcs: (%ld)\n", (mtab->mtabSize-( LONG)sizeof(nomMethodTab))/4);219 nomPrintf(" somMethodProcs: (%ld)\n", (mtab->mtabSize-(glong)sizeof(nomMethodTab))/4); 218 220 // entries=sObj->mtab->entries[0]; 219 221 for(a=0; a<=(mtab->mtabSize-sizeof(nomMethodTab))/4; a++) … … 234 236 nomPrintf("*classInfo: 0x%x\n", *sObj->mtab->nomClsInfo); 235 237 236 so=( ULONG*)sObj->mtab->classInfo;238 so=(gulong*)sObj->mtab->classInfo; 237 239 #endif 238 240 nomPrintf("className: %s\n", sObj->mtab->nomClassName); … … 249 251 250 252 #if 0 251 void _dumpStaticMTab(somStaticMethod_t* smt, ULONGulMethod)253 void _dumpStaticMTab(somStaticMethod_t* smt, gulong ulMethod) 252 254 { 253 255 somStaticMethod_t* tmpSmt=&smt[ulMethod]; … … 262 264 } 263 265 264 void _dumpOverrideMTab(somOverrideMethod_t* omt, ULONGulMethod)266 void _dumpOverrideMTab(somOverrideMethod_t* omt, gulong ulMethod) 265 267 { 266 268 somOverrideMethod_t* tmpOmt=&omt[ulMethod]; … … 300 302 tempPtr=(void*)tempPtr->next->mtab; 301 303 else 302 tempPtr=NULL HANDLE;304 tempPtr=NULL; 303 305 } 304 306 … … 400 402 somPrintf(" instanceSize (this and all parents): %d 0x%x\n", sObj->mtab->instanceSize, sObj->mtab->instanceSize); 401 403 somPrintf(" mtabSize: %d 0x%x\n", sObj->mtab->mtabSize, sObj->mtab->mtabSize); 402 somPrintf(" somMethodProcs: (%ld)\n", (sObj->mtab->mtabSize-( LONG)sizeof(somMethodTab))/4);404 somPrintf(" somMethodProcs: (%ld)\n", (sObj->mtab->mtabSize-(glong)sizeof(somMethodTab))/4); 403 405 // entries=sObj->mtab->entries[0]; 404 406 for(a=0; a<=(sObj->mtab->mtabSize-sizeof(somMethodTab))/4; a++) -
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; -
trunk/nom/src/nomid.c
r190 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOS 36 #define INCL_DOSERRORS 37 38 #include <os2.h> 35 #ifdef __OS2__ 36 # define INCL_DOS 37 # define INCL_DOSERRORS 38 # include <os2.h> 39 #endif /* __OS2__ */ 39 40 40 41 #include "nom.h" -
trunk/nom/src/nommemory.c
r193 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOS 36 #define INCL_DOSERRORS 37 #define INCL_DOSMEMMGR 35 #ifdef __OS2__ 36 # define INCL_DOS 37 # define INCL_DOSERRORS 38 # define INCL_DOSMEMMGR 39 # include <os2.h> 40 #endif /* __OS2__ */ 38 41 39 #include <os2.h>40 42 41 43 #include <string.h> 42 44 #include <stdlib.h> 43 45 44 #include <gtk/gtk.h> 46 /* #include <gtk/gtk.h> - why? */ 45 47 #include <nom.h> 46 48 #include <nomtk.h> … … 49 51 extern gboolean bUseGC; /* Set during initialization */ 50 52 51 NOMEXTERN nomToken NOMLINK NOMMalloc( ULONGsize)53 NOMEXTERN nomToken NOMLINK NOMMalloc(const gulong size) 52 54 { 53 55 gchar* memPtr; 54 56 55 if((memPtr=g_malloc(size))==NULL HANDLE)56 return NULL HANDLE;57 if((memPtr=g_malloc(size))==NULL) 58 return NULL; 57 59 58 60 return (nomToken) memPtr; … … 61 63 PULONG memPtr; 62 64 63 if((memPtr=g_malloc(size+sizeof(gpointer)))==NULL HANDLE)64 return NULL HANDLE;65 if((memPtr=g_malloc(size+sizeof(gpointer)))==NULL) 66 return NULL; 65 67 66 68 *memPtr=size; … … 70 72 } 71 73 72 nomToken NOMLINK NOMCalloc(const ULONG num, const ULONGsize)74 nomToken NOMLINK NOMCalloc(const gulong num, const gulong size) 73 75 { 74 76 gchar* memPtr; 75 77 76 if((memPtr=g_malloc(size*num ))==NULL HANDLE)77 return NULL HANDLE; /* We won't end here because GLib just terminates the process :-/78 if((memPtr=g_malloc(size*num ))==NULL) 79 return NULL; /* We won't end here because GLib just terminates the process :-/ 78 80 A really sick idea imho. */ 79 81 if(!bUseGC) … … 85 87 PULONG memPtr; 86 88 87 if((memPtr=g_malloc(size*num + sizeof( ULONG)))==NULLHANDLE)88 return NULL HANDLE; /* We won't end here because GLib just terminates the process :-/89 if((memPtr=g_malloc(size*num + sizeof(gulong)))==NULL) 90 return NULL; /* We won't end here because GLib just terminates the process :-/ 89 91 A really sick idea imho. */ 90 92 if(!bUseGC) 91 memset(memPtr, 0, size*num + sizeof( ULONG)); /* GC always returns zeroed memory */93 memset(memPtr, 0, size*num + sizeof(gulong)); /* GC always returns zeroed memory */ 92 94 93 95 *memPtr=size; … … 103 105 { 104 106 #if 0 105 ULONG* pul=(PULONG)memPtr;107 gulong* pul=(PULONG)memPtr; 106 108 107 109 pul--; -
trunk/nom/src/nomtkinit.c
r284 r326 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOS 36 #define INCL_DOSERRORS 37 #define INCL_DOSMEMMGR 38 #include <os2.h> 35 #ifdef __OS2__ 36 # define INCL_DOS 37 # define INCL_DOSERRORS 38 # define INCL_DOSMEMMGR 39 # include <os2.h> 40 #endif /* __OS2__ */ 39 41 40 42 #include <stdarg.h> … … 59 61 PNOM_ENV pGlobalNomEnv; 60 62 /* Global class manager object */ 61 NOMClassMgr* NOMClassMgrObject=NULL HANDLE; /* Referenced from different files */63 NOMClassMgr* NOMClassMgrObject=NULL; /* Referenced from different files */ 62 64 63 65 gboolean fInitialized=FALSE; … … 80 82 { 81 83 if(NOMClassMgrObject) 82 return NOMClassMgr_nomIsObject(NOMClassMgrObject, (PNOMObject)nomObj, NULL HANDLE);84 return NOMClassMgr_nomIsObject(NOMClassMgrObject, (PNOMObject)nomObj, NULL); 83 85 84 86 if(!nomObj) … … 104 106 NOMEXTERN PNOM_ENV NOMLINK nomTkInit(void) 105 107 { 106 PVOIDmemPtr;108 void *memPtr; 107 109 108 110 if(pGlobalNomEnv) … … 170 172 171 173 /* Now register the classes we already have */ 172 _nomClassReady(pGlobalNomEnv->defaultMetaClass, NULL HANDLE); //NOMClass173 _nomClassReady( _NOMClassMgr, NULL HANDLE); //NOMClassMgr174 _nomClassReady(pGlobalNomEnv->defaultMetaClass, NULL); //NOMClass 175 _nomClassReady( _NOMClassMgr, NULL); //NOMClassMgr 174 176 ncPriv=(NOMClassPriv*)pGlobalNomEnv->nomObjectMetaClass->mtab->nomClsInfo; 175 177 176 178 /* Do not register the NOMObject metaclass here. It's already registered because it's 177 179 NOMClass in fact. */ 178 _nomClassReady(_NOMObject, NULL HANDLE); //NOMObject180 _nomClassReady(_NOMObject, NULL); //NOMObject 179 181 180 182 … … 186 188 187 189 nomPrintf("\nCalling _nomTestFunc_NOMTest2() 1\n", nomTst2Obj); 188 _nomTestFunc_NOMTest2(nomTst2Obj, NULL HANDLE);190 _nomTestFunc_NOMTest2(nomTst2Obj, NULL); 189 191 nomPrintf("\nCalling _nomTestFuncString_NOMTest2() 1\n", nomTst2Obj); 190 nomPrintf("--> %s\n",_nomTestFuncString_NOMTest2(nomTst2Obj, NULL HANDLE));192 nomPrintf("--> %s\n",_nomTestFuncString_NOMTest2(nomTst2Obj, NULL)); 191 193 nomPrintf("\nCalling _nomTestFunc_NOMTest2() 2\n", nomTst2Obj); 192 _nomTestFunc_NOMTest2(nomTst2Obj, NULL HANDLE);194 _nomTestFunc_NOMTest2(nomTst2Obj, NULL); 193 195 194 196 nomPrintf("\nCalling _nomTestFunc() with NOMTest2 object: %x\n", nomTst2Obj); 195 _nomTestFunc(nomTst2Obj, NULL HANDLE);197 _nomTestFunc(nomTst2Obj, NULL); 196 198 nomPrintf("\nCalling _nomTestFuncString() with NOMTest2: %x\n", nomTst2Obj); 197 nomPrintf("--> %s\n",_nomTestFuncString(nomTst2Obj, NULL HANDLE));199 nomPrintf("--> %s\n",_nomTestFuncString(nomTst2Obj, NULL)); 198 200 nomPrintf("\n"); 199 _nomTestFunc(nomTst2Obj, NULL HANDLE);200 _nomTestFunc_NOMTest2(nomTst2Obj, NULL HANDLE);201 _nomTestFunc(nomTst2Obj, NULL); 202 _nomTestFunc_NOMTest2(nomTst2Obj, NULL); 201 203 #endif 202 204 /* This must be done last! */ -
trunk/tests/c/test-nom.c
r323 r326 32 32 * 33 33 * ***** END LICENSE BLOCK ***** */ 34 #define INCL_DOSPROCESS 35 #define INCL_DOS 36 #define INCL_DOSPROFILE 37 #define INCL_DOSERRORS 38 39 #include <os2.h> 34 #ifdef __OS2__ 35 # define INCL_DOSPROCESS 36 # define INCL_DOS 37 # define INCL_DOSPROFILE 38 # define INCL_DOSERRORS 39 # include <os2.h> 40 #endif /* __OS2__ */ 41 40 42 #include <stdio.h> 41 43 #include <stdlib.h> 42 44 #include <string.h> 43 45 44 #include <io.h> 46 #ifdef HAVE_IO_H 47 # include <io.h> 48 #endif 49 #ifdef HAVE_UNISTD_H 50 # include <unistd.h> 51 #endif 45 52 #include <fcntl.h> 46 #include <sys \stat.h>53 #include <sys/stat.h> 47 54 48 55 #include <glib.h> … … 89 96 void tstAClassInstanceVarInitValues(AClass * aObject) 90 97 { 91 ULONGulRC;98 gulong ulRC; 92 99 93 100 g_message("================================================================"); … … 95 102 g_message("================================================================"); 96 103 97 ulRC=_tstQueryUlongVar1(aObject, NULL HANDLE);104 ulRC=_tstQueryUlongVar1(aObject, NULL); 98 105 g_message("Calling tstQueryUlongVar1():\t%ld\t\t%s", ulRC, (0!=ulRC ? "FAILED" : "OK")); 99 106 g_assert(0==ulRC); 100 107 101 ulRC=_tstQueryUlongVar2(aObject, NULL HANDLE);108 ulRC=_tstQueryUlongVar2(aObject, NULL); 102 109 g_message("Calling tstQueryUlongVar2():\t%ld\t\t%s\n", ulRC, (0!=ulRC ? "FAILED" : "OK")); 103 110 g_assert(0==ulRC); … … 107 114 void tstBClassInstanceVarInitValues(BClass * aObject) 108 115 { 109 ULONGulRC;116 gulong ulRC; 110 117 111 118 g_message("================================================================"); … … 113 120 g_message("================================================================"); 114 121 115 ulRC=_tstQueryBClassUlongVar1(aObject, NULL HANDLE);122 ulRC=_tstQueryBClassUlongVar1(aObject, NULL); 116 123 g_message("Calling tstQueryBClassUlongVar1():\t%ld\t\t%s", ulRC, (0!=ulRC ? "FAILED" : "OK")); 117 124 g_assert(0==ulRC); 118 125 119 ulRC=_tstQueryBClassUlongVar2(aObject, NULL HANDLE);126 ulRC=_tstQueryBClassUlongVar2(aObject, NULL); 120 127 g_message("Calling tstQueryBClassUlongVar2():\t%ld\t\t%s\n", ulRC, (0!=ulRC ? "FAILED" : "OK")); 121 128 g_assert(0==ulRC); … … 125 132 void tstSetAClassInstanceVar(AClass * aObject) 126 133 { 127 ULONGulRC;134 gulong ulRC; 128 135 129 136 g_message("========================================================"); … … 131 138 g_message("========================================================"); 132 139 /* Set 1. value */ 133 _tstSetUlongVar1(aObject, ULONG_TESTVALUE_1, NULL HANDLE);134 ulRC=_tstQueryUlongVar1(aObject, NULL HANDLE);135 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 136 g_assert(ULONG_TESTVALUE_1==ulRC); 137 138 ulRC=_tstQueryUlongVar2(aObject, NULL HANDLE);140 _tstSetUlongVar1(aObject, ULONG_TESTVALUE_1, NULL); 141 ulRC=_tstQueryUlongVar1(aObject, NULL); 142 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 143 g_assert(ULONG_TESTVALUE_1==ulRC); 144 145 ulRC=_tstQueryUlongVar2(aObject, NULL); 139 146 g_message("Calling tstQueryUlongVar2():\t0x%lx\t\t\t%s\n", ulRC, (0!=ulRC ? "FAILED" : "OK")); 140 147 g_assert(0==ulRC); 141 148 142 149 /* Set 2. value */ 143 _tstSetUlongVar2(aObject, ULONG_TESTVALUE_2, NULL HANDLE);144 ulRC=_tstQueryUlongVar1(aObject, NULL HANDLE);145 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 146 g_assert(ULONG_TESTVALUE_1==ulRC); 147 148 ulRC=_tstQueryUlongVar2(aObject, NULL HANDLE);150 _tstSetUlongVar2(aObject, ULONG_TESTVALUE_2, NULL); 151 ulRC=_tstQueryUlongVar1(aObject, NULL); 152 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 153 g_assert(ULONG_TESTVALUE_1==ulRC); 154 155 ulRC=_tstQueryUlongVar2(aObject, NULL); 149 156 g_message("Calling tstQueryUlongVar2():\t0x%lx\t\t%s\n\n", ulRC, (ULONG_TESTVALUE_2!=ulRC ? "FAILED" : "OK")); 150 157 g_assert(ULONG_TESTVALUE_2==ulRC); … … 153 160 void tstSetBClassInstanceVar(BClass * aObject) 154 161 { 155 ULONGulRC;162 gulong ulRC; 156 163 157 164 g_message("========================================================"); … … 159 166 g_message("========================================================"); 160 167 /* Set 1. value */ 161 _tstSetBClassUlongVar1(aObject, ULONG_TESTVALUE_BCLASS_1, NULL HANDLE);168 _tstSetBClassUlongVar1(aObject, ULONG_TESTVALUE_BCLASS_1, NULL); 162 169 163 170 /* AClass */ 164 ulRC=_tstQueryUlongVar1(aObject, NULL HANDLE);165 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 166 g_assert(ULONG_TESTVALUE_1==ulRC); 167 ulRC=_tstQueryUlongVar2(aObject, NULL HANDLE);171 ulRC=_tstQueryUlongVar1(aObject, NULL); 172 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 173 g_assert(ULONG_TESTVALUE_1==ulRC); 174 ulRC=_tstQueryUlongVar2(aObject, NULL); 168 175 g_message("Calling tstQueryUlongVar2():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_2!=ulRC ? "FAILED" : "OK")); 169 176 g_assert(ULONG_TESTVALUE_2==ulRC); 170 177 171 178 /* BClass*/ 172 ulRC=_tstQueryBClassUlongVar1(aObject, NULL HANDLE);179 ulRC=_tstQueryBClassUlongVar1(aObject, NULL); 173 180 g_message("Calling tstQueryBClassUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_BCLASS_1!=ulRC ? "FAILED" : "OK")); 174 181 g_assert(ULONG_TESTVALUE_BCLASS_1==ulRC); 175 182 176 ulRC=_tstQueryBClassUlongVar2(aObject, NULL HANDLE);183 ulRC=_tstQueryBClassUlongVar2(aObject, NULL); 177 184 g_message("Calling tstQueryBClassUlongVar2():\t0x%lx\t\t\t%s\n\n", ulRC, (0!=ulRC ? "FAILED" : "OK")); 178 185 g_assert(0==ulRC); … … 181 188 182 189 /* Set 2. value */ 183 _tstSetBClassUlongVar2(aObject, ULONG_TESTVALUE_BCLASS_2, NULL HANDLE);190 _tstSetBClassUlongVar2(aObject, ULONG_TESTVALUE_BCLASS_2, NULL); 184 191 185 192 /* AClass */ 186 ulRC=_tstQueryUlongVar1(aObject, NULL HANDLE);187 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 188 g_assert(ULONG_TESTVALUE_1==ulRC); 189 ulRC=_tstQueryUlongVar2(aObject, NULL HANDLE);193 ulRC=_tstQueryUlongVar1(aObject, NULL); 194 g_message("Calling tstQueryUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_1!=ulRC ? "FAILED" : "OK")); 195 g_assert(ULONG_TESTVALUE_1==ulRC); 196 ulRC=_tstQueryUlongVar2(aObject, NULL); 190 197 g_message("Calling tstQueryUlongVar2():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_2!=ulRC ? "FAILED" : "OK")); 191 198 g_assert(ULONG_TESTVALUE_2==ulRC); 192 199 193 200 /* BClass*/ 194 ulRC=_tstQueryBClassUlongVar1(aObject, NULL HANDLE);201 ulRC=_tstQueryBClassUlongVar1(aObject, NULL); 195 202 g_message("Calling tstQueryBClassUlongVar1():\t0x%lx\t\t%s", ulRC, (ULONG_TESTVALUE_BCLASS_1!=ulRC ? "FAILED" : "OK")); 196 203 g_assert(ULONG_TESTVALUE_BCLASS_1==ulRC); 197 204 198 ulRC=_tstQueryBClassUlongVar2(aObject, NULL HANDLE);205 ulRC=_tstQueryBClassUlongVar2(aObject, NULL); 199 206 g_message("Calling tstQueryBClassUlongVar2():\t0x%lx\t\t%s\n\n", ulRC, (ULONG_TESTVALUE_BCLASS_2!=ulRC ? "FAILED" : "OK")); 200 207 g_assert(ULONG_TESTVALUE_BCLASS_2==ulRC); … … 209 216 { 210 217 NOMClassMgr *NOMClassMgrObject; 211 HREGDLL hReg=NULL HANDLE;218 HREGDLL hReg=NULL; 212 219 AClass* aObject; 213 220 BClass* bObject; … … 226 233 /* Register DLLs with the garbage collector */ 227 234 hReg=nomBeginRegisterDLLWithGC(); 228 if(NULL HANDLE==hReg)235 if(NULL==hReg) 229 236 return 1; 230 237 -
trunk/tests/class_c/aclass.c
r315 r326 36 36 #endif 37 37 38 #define INCL_DOS 39 #include <os2.h> 38 #ifdef __OS2__ 39 # define INCL_DOS 40 # include <os2.h> 41 #endif /* __OS2__ */ 40 42 41 43 #include "glib.h" -
trunk/tests/class_c/bclass.c
r322 r326 12 12 #endif 13 13 14 #define INCL_DOS 15 #include <os2.h> 14 #ifdef __OS2__ 15 # define INCL_DOS 16 # include <os2.h> 17 #endif /* __OS2__ */ 18 16 19 #include <nom.h> 17 20 #include <nomtk.h>
Note:
See TracChangeset
for help on using the changeset viewer.