Changeset 8002 for trunk/tools/impdef/ImpDef.cpp
- Timestamp:
- Feb 24, 2002, 3:44:40 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/impdef/ImpDef.cpp
r5531 r8002 1 /* $Id: ImpDef.cpp,v 1. 7 2001-04-17 00:26:28bird Exp $ */1 /* $Id: ImpDef.cpp,v 1.8 2002-02-24 02:44:40 bird Exp $ */ 2 2 /* 3 3 * ImpDef - Create export file which use internal names and ordinals. … … 10 10 * Header Files * 11 11 *******************************************************************************/ 12 #include <os2.h>12 //#include <os2.h> 13 13 #include <stdio.h> 14 14 #include <string.h> 15 15 #include <stdlib.h> 16 #include "ImpDef.h" 16 17 #include "kTypes.h" 18 #include "kError.h" 17 19 #include "kFile.h" 18 #include "k InterFaces.h"20 #include "kFileInterfaces.h" 19 21 #include "kFileFormatBase.h" 20 22 #include "kFileDef.h" 23 24 #include "ImpDef.h" 21 25 22 26 … … 38 42 { 39 43 int argi; 40 BOOLfFatal = FALSE;44 KBOOL fFatal = FALSE; 41 45 long lRc = 0; 42 46 char *pszInput = NULL; … … 186 190 try 187 191 { 188 kFile Input(pszInput);192 kFile * pInput = new kFile(pszInput); 189 193 try 190 194 { 191 kFileDef DefFile(&Input);195 kFileDef * pDefFile = new kFileDef(pInput); 192 196 try 193 197 { 198 kFile * pOutput = new kFile(pszOutput, FALSE); 194 199 kExportEntry export; 195 kFile Output(pszOutput, FALSE);196 200 197 201 /* generate LIBRARY line */ 198 Output.printf(202 pOutput->printf( 199 203 ";Internal export definition file - autogenerated by ImpDef.\n" 200 204 "%s\n", 201 DefFile.queryType());205 pDefFile->queryType()); 202 206 203 207 /* Description line */ 204 if ( DefFile.queryDescription())205 Output.printf("DESCRIPTION '%s'\n", DefFile.queryDescription());208 if (pDefFile->queryDescription()) 209 pOutput->printf("DESCRIPTION '%s'\n", pDefFile->queryDescription()); 206 210 207 211 /* Exports */ 208 if ( DefFile.exportFindFirst(&export))212 if (pDefFile->exportFindFirst(&export)) 209 213 { 210 Output.printf("EXPORTS\n");214 pOutput->printf("EXPORTS\n"); 211 215 do 212 216 { … … 235 239 pszName = generateExportName(&export, &szName[0], pOptions); 236 240 237 Output.printf(" %-*s @%ld\n", 40, pszName, export.ulOrdinal); 238 } while (DefFile.exportFindNext(&export)); 239 Output.setSize(); 241 pOutput->printf(" %-*s @%ld\n", 40, pszName, export.ulOrdinal); 242 } while (pDefFile->exportFindNext(&export)); 243 pOutput->setSize(); 244 delete pOutput; 240 245 } 241 246 } 242 catch ( int errorcode)243 { 244 kFile::StdErr.printf("error creating output file, '%s', errorcode 0x%x\n", pszOutput, err orcode);247 catch (kError err) 248 { 249 kFile::StdErr.printf("error creating output file, '%s', errorcode 0x%x\n", pszOutput, err.getErrno()); 245 250 lRc = -4; 246 251 } 247 } 248 catch (int errorcode) 249 { 250 kFile::StdErr.printf("%s is not a valid def file, errorcode 0x%x\n", pszInput, errorcode); 252 delete pDefFile; 253 } 254 catch (kError err) 255 { 256 kFile::StdErr.printf("%s is not a valid def file, errorcode 0x%x\n", pszInput, err.getErrno()); 251 257 lRc = -3; 252 258 } 253 } 254 catch (int errorcode) 255 { 256 kFile::StdErr.printf( "error openining inputfile, '%s', errorcode 0x%x\n", pszInput, errorcode); 259 //delete pInput; - not needed done by ~kFileFormatBase! 260 } 261 catch (kError err) 262 { 263 kFile::StdErr.printf( "error openining inputfile, '%s', errorcode 0x%x\n", pszInput, err.getErrno()); 257 264 lRc = -2; 258 265 }
Note:
See TracChangeset
for help on using the changeset viewer.