Changeset 5531 for trunk/tools/database


Ignore:
Timestamp:
Apr 17, 2001, 2:26:28 AM (24 years ago)
Author:
bird
Message:

Second iteration of the kFile* classes and interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/APIImport.cpp

    r5053 r5531  
    1 /* $Id: APIImport.cpp,v 1.8 2001-02-02 08:45:42 bird Exp $ */
     1/* $Id: APIImport.cpp,v 1.9 2001-04-17 00:24:46 bird Exp $ */
    22/*
    33 *
     
    1818#include "APIImport.h"
    1919#include "kFile.h"
     20#include "kInterfaces.h"
    2021#include "kFileFormatBase.h"
    2122#include "kFilePE.h"
     
    242243static long processFile(const char *pszFilename, const POPTIONS pOptions, long &cFunctions)
    243244{
    244     kFileFormatBase  *pFile;
    245245    long              lRc = 1;
    246246
     
    252252        try
    253253        {
     254            kFileFormatBase *   pFileBase = NULL;
     255            kExportI *          pExportFile;
     256            kModuleI *          pModuleFile;
    254257            char    achDataBuffer[0x200];
    255258            char   *pszModuleName = &achDataBuffer[0];
     
    259262            try
    260263            {
    261                 pFile = new kFilePE(&InFile);
     264                kFilePE *pFile = new kFilePE(&InFile);
     265                pExportFile = pFile;
     266                pModuleFile = pFile;
     267                pFileBase = pFile;
    262268            }
    263269            catch (int i)
    264270            {
    265271                i = i;
    266                 pFile = new kFileDef(&InFile);
    267             }
    268 
    269             if (pFile->queryModuleName(pszModuleName))
     272                kFileDef *pFile = new kFileDef(&InFile);
     273                pExportFile = pFile;
     274                pModuleFile = pFile;
     275                pFileBase = pFile;
     276            }
     277
     278            if (pModuleFile->moduleGetName(pszModuleName))
    270279            {
    271280                int cch = strlen(pszModuleName);
     
    281290                    BOOL    fClearUpdateOk = FALSE;
    282291                    BOOL    fOk;
    283                     EXPORTENTRY export;
     292                    kExportEntry export;
    284293
    285294                    /* Clear the update flag for all functions in this DLL. */
     
    288297
    289298                    lRc = 0;
    290                     fOk = pFile->findFirstExport(&export);
     299                    fOk = pExportFile->exportFindFirst(&export);
    291300                    while (fOk)
    292301                    {
    293302                        /* check if name or not */
    294                         if (!pFile->isDef() || export.ulOrdinal < ORD_START_INTERNAL_FUNCTIONS)
     303                        if (!pFileBase->isDef() || export.ulOrdinal < ORD_START_INTERNAL_FUNCTIONS)
    295304                        {
    296305                            char szIntName[256];
     
    344353
    345354                        /* next */
    346                         fOk = pFile->findNextExport(&export);
     355                        fOk = pExportFile->exportFindNext(&export);
    347356                    }
    348357
     
    362371                fprintf(phLog, "%s: error - could not get module name.\n", pszFilename);
    363372
    364             delete(pFile);
     373            delete(pFileBase);
    365374        }
    366375        catch (int err)
Note: See TracChangeset for help on using the changeset viewer.