Changeset 8006 for trunk/tools/database


Ignore:
Timestamp:
Feb 24, 2002, 3:58:29 AM (24 years ago)
Author:
bird
Message:

New kFile* classes; now in sync with os2tools.

Location:
trunk/tools/database
Files:
6 edited

Legend:

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

    r6678 r8006  
    1 /* $Id: APIImport.cpp,v 1.12 2001-09-07 10:31:42 bird Exp $ */
     1/* $Id: APIImport.cpp,v 1.13 2002-02-24 02:58:26 bird Exp $ */
    22/*
    33 *
     
    1212*   Header Files                                                               *
    1313*******************************************************************************/
    14 #include <os2.h>
    1514#include <stdio.h>
    1615#include <string.h>
    1716
    18 #include "APIImport.h"
     17#include "kTypes.h"
     18#include "kError.h"
    1919#include "kFile.h"
    20 #include "kInterfaces.h"
     20#include "kFileInterfaces.h"
    2121#include "kFileFormatBase.h"
    2222#include "kFilePE.h"
    2323#include "kFileDef.h"
     24
     25#include "APIImport.h"
    2426#include "db.h"
    2527
     
    5052{
    5153    int     argi;
    52     BOOL    fFatal = FALSE;
     54    KBOOL   fFatal = FALSE;
    5355    long    lRc = 0;
    5456    OPTIONS options = {0};
     
    270272            {
    271273                i = i;
    272                 kFileDef *pFile = new kFileDef(pInFile);
     274                kFileDef *pFile = new kFileDef(new kFile(pszFilename));
    273275                pExportFile = pFile;
    274276                pModuleFile = pFile;
     
    288290                if ((lDll = dbCheckInsertDll(pszModuleName, DLL_ODIN32_API)) >= 0)
    289291                {
    290                     BOOL    fClearUpdateOk = FALSE;
    291                     BOOL    fOk;
     292                    KBOOL   fClearUpdateOk = FALSE;
     293                    KBOOL   fOk;
    292294                    kExportEntry export;
    293295
  • trunk/tools/database/APIImport.h

    r3882 r8006  
    1 /* $Id: APIImport.h,v 1.3 2000-07-21 21:09:43 bird Exp $ */
     1/* $Id: APIImport.h,v 1.4 2002-02-24 02:58:27 bird Exp $ */
    22/*
    33 * APIImportPE - imports a DLL with functions into the Odin32 database. Header.
     
    2020typedef struct _options
    2121{
    22     BOOL    fIgnoreOrdinals;            /* Don't update ordinals. */
    23     BOOL    fErase;                     /* Erase functions which wasn't found. */
     22    KBOOL   fIgnoreOrdinals;            /* Don't update ordinals. */
     23    KBOOL   fErase;                     /* Erase functions which wasn't found. */
    2424} OPTIONS, *POPTIONS;
    2525
  • trunk/tools/database/StateUpd.cpp

    r6678 r8006  
    1 /* $Id: StateUpd.cpp,v 1.39 2001-09-07 10:31:43 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.40 2002-02-24 02:58:27 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    2020#include <stdlib.h>
    2121#include <assert.h>
    22 
     22#include <direct.h>
     23
     24#include "kTypes.h"
    2325#include "StateUpd.h"
    2426#include "db.h"
     
    5355static unsigned long analyseFnDcl(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    5456static unsigned long analyseFnDcl2(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    55 static char *SDSCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL);
    56 static char *CommonCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL);
    57 static BOOL isFunction(char **papszLines, int i, POPTIONS pOptions);
    58 static BOOL isDesignNote(char **papszLines, int i, POPTIONS pOptions);
     57static char *SDSCopyTextUntilNextTag(char *pszTarget, KBOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL);
     58static char *CommonCopyTextUntilNextTag(char *pszTarget, KBOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL);
     59static KBOOL isFunction(char **papszLines, int i, POPTIONS pOptions);
     60static KBOOL isDesignNote(char **papszLines, int i, POPTIONS pOptions);
    5961static long _System dbNotUpdatedCallBack(const char *pszValue, const char *pszFieldName, void *pvUser);
    6062static char *skipInsignificantChars(char **papszLines, int &i, char *psz);
     
    6971static void  copy(char *psz, char *pszFrom, int iFrom, char *pszTo, int iTo, char **papszLines);
    7072static void  copy(char *psz, int jFrom, int iFrom, int jTo, int iTo, char **papszLines);
    71 static void  copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML);
    72 static void  copyComment(char *psz, int jFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML);
     73static void  copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, KBOOL fStrip, KBOOL fHTML);
     74static void  copyComment(char *psz, int jFrom, int iFrom, char **papszLines, KBOOL fStrip, KBOOL fHTML);
    7375static char *stristr(const char *pszStr, const char *pszSubStr);
    7476static char *skipBackwards(const char *pszStopAt, const char *pszFrom, int &iLine, char **papszLines);
     
    8587{
    8688    int            argi;
    87     BOOL           fFatal = FALSE;
     89    KBOOL          fFatal = FALSE;
    8890    unsigned long  ulRc = 0;
    8991    char           szDLLName[64];
     
    9698    char          *pszPasswd   = "";
    9799    ULONG          ul1, ul2;
    98     ULONG          cUpdated, cAll, cNotAliased;
     100    unsigned long  cUpdated, cAll, cNotAliased;
    99101
    100102    DosError(0x3);
     
    468470    PSZ          pszDir;
    469471    PSZ          pszFile;
    470     BOOL         fFile;
     472    KBOOL        fFile;
    471473
    472474    /* -0.*/
     
    12001202
    12011203    /* 2a. */
    1202     /* operators are not supported (BOOL kTime::operator > (const kTime &time) const) */
     1204    /* operators are not supported (KBOOL kTime::operator > (const kTime &time) const) */
    12031205    if (pszFn > papszLines[iFn])
    12041206    {
     
    12781280    if (strnicmp(pszFn, "ODINFUNCTION", 12) == 0 || strnicmp(pszFn, "ODINPROCEDURE", 13) == 0)
    12791281    {
    1280         BOOL fProc = strnicmp(pszFn, "ODINPROCEDURE", 13) == 0;
     1282        KBOOL fProc = strnicmp(pszFn, "ODINPROCEDURE", 13) == 0;
    12811283        j = 0;
    12821284        if (cArgs < (fProc ? 1 : 2))
     
    18301832 * @remark    Addes some HTML tags.
    18311833 */
    1832 static char *SDSCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart)
     1834static char *SDSCopyTextUntilNextTag(char *pszTarget, KBOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart)
    18331835{
    18341836    char *pszRet = pszTarget;
     
    19571959 * @remark    Addes some HTML tags.
    19581960 */
    1959 static char *CommonCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart)
     1961static char *CommonCopyTextUntilNextTag(char *pszTarget, KBOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart)
    19601962{
    19611963    char *pszRet = pszTarget;
     
    20872089 * @param     pOptions     Pointer to options.
    20882090 */
    2089 static BOOL isFunction(char **papszLines, int i, POPTIONS pOptions)
     2091static KBOOL isFunction(char **papszLines, int i, POPTIONS pOptions)
    20902092{
    20912093    if (!pOptions->fOld)
     
    22442246 * @param     pOptions     Pointer to options.
    22452247 */
    2246 static BOOL isDesignNote(char **papszLines, int i, POPTIONS pOptions)
     2248static KBOOL isDesignNote(char **papszLines, int i, POPTIONS pOptions)
    22472249{
    22482250    char *psz = papszLines[i];
     
    23272329static char *skipInsignificantChars(char **papszLines, int &i, char *psz)
    23282330{
    2329     BOOL fComment = *psz == '/' && psz[1]  == '*';
     2331    KBOOL fComment = *psz == '/' && psz[1]  == '*';
    23302332
    23312333    while (fComment || *psz == ' ' || *psz == '\0' || (*psz == '/' && psz[1] == '/'))
     
    27392741 *
    27402742 */
    2741 static void copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML)
     2743static void copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, KBOOL fStrip, KBOOL fHTML)
    27422744{
    27432745    copyComment(psz, pszFrom - papszLines[iFrom], iFrom, papszLines, fStrip, fHTML);
     
    27602762 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    27612763 */
    2762 static void copyComment(char *psz, int jFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML)
     2764static void copyComment(char *psz, int jFrom, int iFrom, char **papszLines, KBOOL fStrip, KBOOL fHTML)
    27632765{
    27642766    char *  pszStartBuffer = psz;       /* Start of the target buffer. */
     
    29162918static char *skipBackwards(const char *pszStopAt, const char *pszFrom, int &iLine, char **papszLines)
    29172919{
    2918     BOOL        fComment = FALSE;
     2920    KBOOL       fComment = FALSE;
    29192921    int         i = iLine;
    29202922    const char *psz = pszFrom;
  • trunk/tools/database/StateUpd.h

    r6678 r8006  
    1 /* $Id: StateUpd.h,v 1.7 2001-09-07 10:33:10 bird Exp $ */
     1/* $Id: StateUpd.h,v 1.8 2002-02-24 02:58:28 bird Exp $ */
    22/*
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    1616typedef struct _options
    1717{
    18     BOOL        fIntegrityBefore;       /* ib  */
    19     BOOL        fIntegrityAfter;        /* ie  */
    20     BOOL        fIntegrityOnly;         /* io  */
    21     BOOL        fRecursive;             /* s   */
    22     BOOL        fOld;                   /* Old */
    23     BOOL        fOS2;                   /* Ignore OS2 prefixes */
    24     BOOL        fCOMCTL32;              /* Ignore COMCTL32 prefixes */
    25     BOOL        fVERSION;               /* Ignore VERSION prefixes */
     18    KBOOL       fIntegrityBefore;       /* ib  */
     19    KBOOL       fIntegrityAfter;        /* ie  */
     20    KBOOL       fIntegrityOnly;         /* io  */
     21    KBOOL       fRecursive;             /* s   */
     22    KBOOL       fOld;                   /* Old */
     23    KBOOL       fOS2;                   /* Ignore OS2 prefixes */
     24    KBOOL       fCOMCTL32;              /* Ignore COMCTL32 prefixes */
     25    KBOOL       fVERSION;               /* Ignore VERSION prefixes */
    2626    char *      pszDLLName;             /* Name of the dll being processed */
    2727    signed long lDllRefcode;            /* Database reference code of the dll */
  • trunk/tools/database/db.cpp

    r7911 r8006  
    1 /* $Id: db.cpp,v 1.28 2002-02-15 14:09:56 bird Exp $ *
     1/* $Id: db.cpp,v 1.29 2002-02-24 02:58:29 bird Exp $ *
    22 *
    33 * DB - contains all database routines.
     
    6464#include <mysql.h>
    6565
     66#include "kTypes.h"
    6667#include "db.h"
    6768
  • trunk/tools/database/db.h

    r6678 r8006  
    1 /* $Id: db.h,v 1.16 2001-09-07 10:31:44 bird Exp $ */
     1/* $Id: db.h,v 1.17 2002-02-24 02:58:29 bird Exp $ */
    22/*
    33 * DB - contains all database routines
     
    101101    char *           _System dbGetLastErrorDesc(void);
    102102
    103     BOOL             _System dbConnect(const char *pszHost,
     103    KBOOL            _System dbConnect(const char *pszHost,
    104104                                       const char *pszUser,
    105105                                       const char *pszPassword,
    106106                                       const char *pszDatabase);
    107     BOOL             _System dbDisconnect();
     107    KBOOL            _System dbDisconnect();
    108108    signed long      _System dbGetDll(const char *pszDllName);
    109109    signed long      _System dbCountFunctionInDll(signed long ulDll,
    110                                                   BOOL fNotAliases);
     110                                                  KBOOL fNotAliases);
    111111    signed long      _System dbCheckInsertDll(const char *pszDll, char fchType);
    112112    unsigned short   _System dbGet(const char *pszTable,
     
    114114                                   const char *pszMatch1,
    115115                                   const char *pszMatchValue1);
    116     BOOL             _System dbInsertUpdateFunction(signed long lDll,
     116    KBOOL            _System dbInsertUpdateFunction(signed long lDll,
    117117                                                    const char *pszFunction,
    118118                                                    const char *pszIntFunction,
    119119                                                    unsigned long ulOrdinal,
    120                                                     BOOL fIgnoreOrdinal,
     120                                                    KBOOL fIgnoreOrdinal,
    121121                                                    char fchType);
    122     BOOL             _System dbInsertUpdateFile(signed long lDll,
     122    KBOOL            _System dbInsertUpdateFile(signed long lDll,
    123123                                                const char *pszFilename,
    124124                                                const char *pszDescription,
     
    126126                                                signed long lLastAuthor,
    127127                                                const char *pszRevision);
    128     BOOL             _System dbFindFunction(const char *pszFunctionName,
     128    KBOOL            _System dbFindFunction(const char *pszFunctionName,
    129129                                            PFNFINDBUF pFnFindBuf,
    130130                                            signed long lDll);
     
    135135                                              signed long lDll,
    136136                                              char *pszError);
    137     BOOL             _System dbRemoveDesignNotes(signed long lFile);
    138     BOOL             _System dbAddDesignNote(signed long lDll,
     137    KBOOL            _System dbRemoveDesignNotes(signed long lFile);
     138    KBOOL            _System dbAddDesignNote(signed long lDll,
    139139                                             signed long lFile,
    140140                                             const char *pszTitle,
     
    144144                                             signed long lSeqNbrNote,
    145145                                             signed long lLine,
    146                                              BOOL        fSubSection,
     146                                             KBOOL       fSubSection,
    147147                                             signed long *plRefCode);
    148148    unsigned long    _System dbCreateHistory(char *pszError);
     
    152152    void *           _System dbExecuteQuery(const char *pszQuery);
    153153    signed long      _System dbQueryResultRows(void *pres);
    154     BOOL             _System dbFreeResult(void *pres);
    155     BOOL             _System dbFetch(void *pres,
     154    KBOOL            _System dbFreeResult(void *pres);
     155    KBOOL            _System dbFetch(void *pres,
    156156                                     DBCALLBACKFETCH dbFetchCallBack,
    157157                                     void *pvUser);
    158158    signed long      _System dbDateToDaysAfterChrist(const char *pszDate);
    159     BOOL             _System dbDaysAfterChristToDate(signed long ulDays,
     159    KBOOL            _System dbDaysAfterChristToDate(signed long ulDays,
    160160                                                    char *pszDate);
    161161    /* StateUpd stuff */
    162     BOOL             _System dbGetNotUpdatedFunction(signed long lDll,
     162    KBOOL            _System dbGetNotUpdatedFunction(signed long lDll,
    163163                                                     DBCALLBACKFETCH dbFetchCallBack);
    164164    signed long      _System dbGetNumberOfUpdatedFunction(signed long lDll);
    165165
    166166    /* APIImport stuff */
    167     BOOL             _System dbClearUpdateFlagFile(signed long lDll);
    168     BOOL             _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll);
    169     BOOL             _System dbDeleteNotUpdatedFiles(signed long lDll);
    170     BOOL             _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll);
     167    KBOOL            _System dbClearUpdateFlagFile(signed long lDll);
     168    KBOOL            _System dbClearUpdateFlagFunction(signed long lDll, KBOOL fAll);
     169    KBOOL            _System dbDeleteNotUpdatedFiles(signed long lDll);
     170    KBOOL            _System dbDeleteNotUpdatedFunctions(signed long lDll, KBOOL fAll);
    171171
    172172#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.