Changeset 3882 for trunk/tools/database/APIImport.cpp
- Timestamp:
- Jul 21, 2000, 11:09:45 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/APIImport.cpp
r2789 r3882 1 /* $Id: APIImport.cpp,v 1. 5 2000-02-15 13:31:05bird Exp $ */1 /* $Id: APIImport.cpp,v 1.6 2000-07-21 21:09:42 bird Exp $ */ 2 2 /* 3 3 * … … 66 66 * -u:<user> Userid 67 67 * -h:<host> Hostname/IP-address 68 * -e[+|-] Erase functions which wasn't found. 68 69 **************************************************************************/ 69 70 if (argc == 1) … … 82 83 else 83 84 fprintf(stderr, "warning: option '-d:' requires database name.\n"); 85 break; 86 87 case 'e': /* erase */ 88 case 'E': 89 options.fErase = argv[argi][2] != '-'; 84 90 break; 85 91 … … 177 183 " -p:<password> Password. default: <empty>\n" 178 184 " -d:<database> Database to use. default: Odin32\n" 185 " -e[+|-] Erase functions which wasn't found.\n" 186 " default: -e-\n" 179 187 " dll/defnames List of DLL/Defs to process.\n" 180 188 "\n" … … 188 196 "\t2) function name\n" 189 197 "\t3) function ordinal (If not option 'o-' is specified.)\n" 190 "This utililty is not destructive but additive. That is, it would not remove any\n"191 "rows in the database, only add or update them. On existing functions the\n"192 "ordinal value will be updated when 'o+' is specified.\n"193 198 "\n" 194 "Copyright (c) 1999 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)",199 "Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)", 195 200 MAJOR_VER, MINOR_VER 196 201 ); … … 248 253 char achDataBuffer[0x200]; 249 254 char *pszModuleName = &achDataBuffer[0]; 250 signed short sDll;255 signed long lDll; 251 256 252 257 /* try create file objects */ … … 271 276 272 277 /* find or insert module name */ 273 if (( sDll = dbCheckInsertDll(pszModuleName)) >= 0)278 if ((lDll = dbCheckInsertDll(pszModuleName, DLL_ODIN32_API)) >= 0) 274 279 { 275 BOOL fOk; 280 BOOL fClearUpdateOk = FALSE; 281 BOOL fOk; 276 282 EXPORTENTRY export; 283 284 /* Clear the update flag for all functions in this DLL. */ 285 if (pOptions->fErase) 286 fClearUpdateOk = dbClearUpdateFlagFunction(lDll, FALSE); 277 287 278 288 lRc = 0; … … 313 323 } 314 324 else 315 { 316 fOk = dbInsertUpdateFunction( sDll,325 { /* Update Database */ 326 fOk = dbInsertUpdateFunction(lDll, 317 327 &szName[0], 318 328 &szIntName[0], 319 329 export.ulOrdinal, 320 pOptions->fIgnoreOrdinals && export.ulOrdinal != 0xffffffffUL); 330 pOptions->fIgnoreOrdinals && export.ulOrdinal != 0xffffffffUL, 331 FUNCTION_ODIN32_API 332 ); 321 333 if (fOk) 322 334 cFunctions++; 335 else 336 { 337 fprintf(phLog, "%s: error - dbInsertUpdateFunction failed.\n\terror description: %s \n", 338 pszFilename, dbGetLastErrorDesc()); 339 lRc++; 340 } 323 341 } 324 }325 326 if (!fOk)327 {328 fprintf(phLog, "%s: error - dbInsertUpdateFunction failed.\n\terror description: %s \n",329 pszFilename, dbGetLastErrorDesc());330 lRc = 1;331 342 } 332 343 … … 335 346 } 336 347 348 /* Clear the update flag for all functions in this DLL. */ 349 if (fClearUpdateOk && pOptions->fErase) 350 if (!dbDeleteNotUpdatedFunctions(lDll, FALSE)) 351 { 352 fprintf(phLog, "%s: error - dbDeleteNotUpdatedFunctions failed.\n\terror description: %s\n", 353 pszFilename, dbGetLastErrorDesc()); 354 lRc += 1; 355 } 337 356 } 338 357 else
Note:
See TracChangeset
for help on using the changeset viewer.