Changeset 6678 for trunk/tools/database


Ignore:
Timestamp:
Sep 7, 2001, 12:33:10 PM (24 years ago)
Author:
bird
Message:

reverse prev rev.

Location:
trunk/tools/database
Files:
10 edited

Legend:

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

    r6677 r6678  
    1 /* $Id: APIImport.cpp,v 1.11 2001-09-07 10:24:05 bird Exp $ */
     1/* $Id: APIImport.cpp,v 1.12 2001-09-07 10:31:42 bird Exp $ */
    22/*
    33 *
     
    9292                    break;
    9393
    94                 case '-':
    9594                case 'h':
    9695                case 'H':
     
    258257            char    achDataBuffer[0x200];
    259258            char   *pszModuleName = &achDataBuffer[0];
    260             signed long  lModule;
     259            signed long  lDll;
    261260
    262261            /* try create file objects */
     
    287286
    288287                /* find or insert module name */
    289                 if ((lModule = dbCheckInsertModule(pszModuleName, DLL_ODIN32_API)) >= 0)
     288                if ((lDll = dbCheckInsertDll(pszModuleName, DLL_ODIN32_API)) >= 0)
    290289                {
    291290                    BOOL    fClearUpdateOk = FALSE;
     
    295294                    /* Clear the update flag for all functions in this DLL. */
    296295                    if (pOptions->fErase)
    297                         fClearUpdateOk = dbClearUpdateFlagFunction(lModule, FALSE);
     296                        fClearUpdateOk = dbClearUpdateFlagFunction(lDll, FALSE);
    298297
    299298                    lRc = 0;
     
    335334                            else
    336335                            {   /* Update Database */
    337                                 fOk = dbInsertUpdateFunction(lModule,
     336                                fOk = dbInsertUpdateFunction(lDll,
    338337                                                             &szName[0],
    339338                                                             &szIntName[0],
     
    359358                    /* Clear the update flag for all functions in this DLL. */
    360359                    if (fClearUpdateOk && pOptions->fErase)
    361                         if (!dbDeleteNotUpdatedFunctions(lModule, FALSE))
     360                        if (!dbDeleteNotUpdatedFunctions(lDll, FALSE))
    362361                        {
    363362                            fprintf(phLog, "%s: error - dbDeleteNotUpdatedFunctions failed.\n\terror description: %s\n",
  • trunk/tools/database/Codes.sql

    r6677 r6678  
    1 -- $Id: Codes.sql,v 1.2 2001-09-07 10:24:05 bird Exp $
     1-- $Id: Codes.sql,v 1.3 2001-09-07 10:31:43 bird Exp $
    22--
    33-- Codes.
     
    2828    VALUES ('FTYP', 'I   ', 'Internal Odin32 API');
    2929INSERT INTO code
    30     VALUES ('FTYP', 'F   ', 'Some Function');
     30    VALUES ('FTYP', 'O   ', 'Other function');
    3131
    32 INSERT INTO code
    33     VALUES ('FTYP', 'M   ', 'Class public method');
    34 INSERT INTO code
    35     VALUES ('FTYP', 'O   ', 'Class operator');
    36 INSERT INTO code
    37     VALUES ('FTYP', 'C   ', 'Class constructor');
    38 INSERT INTO code
    39     VALUES ('FTYP', 'D   ', 'Class donstructor');
    4032
  • trunk/tools/database/CreateTables.sql

    r6677 r6678  
    1 -- $Id: CreateTables.sql,v 1.19 2001-09-07 10:24:06 bird Exp $
     1-- $Id: CreateTables.sql,v 1.20 2001-09-07 10:31:43 bird Exp $
    22--
    33-- Create all tables.
     
    5555--
    5656CREATE TABLE state (
    57     refcode     TINYINT NOT NULL PRIMARY KEY,
    58     color       CHAR(7) NOT NULL,
    59     weight      TINYINT NOT NULL,
    60     name        VARCHAR(32) NOT NULL,
     57    refcode TINYINT NOT NULL PRIMARY KEY,
     58    color   CHAR(7) NOT NULL,
     59    weight  TINYINT NOT NULL,
     60    name    VARCHAR(32) NOT NULL,
    6161    description TEXT NOT NULL,
    6262    UNIQUE u1(refcode),
     
    6767
    6868--
    69 -- This table holds the module names.
     69-- This table holds the dll names.
    7070--    Type has these known types:
    7171--       'A' for Odin32 API dll
     
    7474--       'T' for tools (executables and dlls)
    7575--
    76 CREATE TABLE module (
    77     refcode     SMALLINT      NOT NULL AUTO_INCREMENT PRIMARY KEY,
     76CREATE TABLE dll (
     77    refcode     TINYINT       NOT NULL AUTO_INCREMENT PRIMARY KEY,
    7878    name        VARCHAR(32)   NOT NULL,
    7979    type        CHAR          NOT NULL DEFAULT 'A',
     
    8585
    8686--
    87 -- This table holds fileinformation (per module).
     87-- This table holds fileinformation (per dll).
    8888--
    8989CREATE TABLE file (
    9090    refcode         INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
    91     module          SMALLINT NOT NULL,
     91    dll             TINYINT NOT NULL,
    9292    name            VARCHAR(128) NOT NULL,
    9393    lastdatetime    DATETIME NOT NULL,
     
    9797    description     TEXT,
    9898    UNIQUE u1(refcode),
    99     UNIQUE u2(module, name),
     99    UNIQUE u2(dll, name),
    100100    INDEX  i1(name)
    101101);
     
    112112CREATE TABLE designnote (
    113113    refcode     INTEGER NOT NULL AUTO_INCREMENT,
    114     module      SMALLINT NOT NULL,
     114    dll         TINYINT NOT NULL,
    115115    file        INTEGER NOT NULL,
    116116    line        INTEGER  NOT NULL DEFAULT -1,
     
    123123    UNIQUE      u1(refcode, seqnbrnote),
    124124    UNIQUE      u2(refcode, seqnbrnote, level),
    125     UNIQUE      u3(module, seqnbr, level, seqnbrnote, refcode),
     125    UNIQUE      u3(dll, seqnbr, level, seqnbrnote, refcode),
    126126    INDEX       i1(file, refcode)
    127127);
     
    129129
    130130--
    131 -- This table holds API information (per module / file).
     131-- This table holds API information (per dll / file).
    132132--
    133133-- Type has these known values:
    134134--       'A' for API
    135135--       'I' for Internal Odin32 API
    136 --       'F' for All other functions.
    137 ---
    138 --       'M' for Class method (?)
    139 --       'O' for Class operator (?)
    140 --       'C' for Class constructor (?)
    141 --       'D' for Class destructor (?)
    142136--
    143137CREATE TABLE function (
    144138    refcode  INTEGER  NOT NULL AUTO_INCREMENT PRIMARY KEY,
    145     module   SMALLINT NOT NULL,
     139    dll      TINYINT NOT NULL,
    146140    aliasfn  INTEGER  NOT NULL DEFAULT -1,
    147141    file     INTEGER  NOT NULL DEFAULT -1,
     
    162156    time        TEXT,
    163157    UNIQUE i1(refcode, aliasfn),
    164     UNIQUE i1a(module, aliasfn, refcode),
    165     UNIQUE i1b(aliasfn, name, module, refcode),
    166     UNIQUE i1c(aliasfn, intname, module, refcode),
    167     UNIQUE i2(name, module, refcode),
    168     UNIQUE i3(intname, module, refcode),
    169     INDEX  i4(module, file),
     158    UNIQUE i1a(dll, aliasfn, refcode),
     159    UNIQUE i1b(aliasfn, name, dll),
     160    UNIQUE i1c(aliasfn, intname, dll, refcode),
     161    UNIQUE i2(name, dll, refcode),
     162    UNIQUE i3(intname, dll, refcode),
     163    INDEX  i4(dll, file),
    170164    INDEX  i5(file, refcode),
    171165    INDEX  i6(state, file),
    172166    UNIQUE i7(state, refcode),
    173167    UNIQUE i8(refcode, state),
    174     UNIQUE i9(module, state, refcode),
    175     UNIQUE u1(refcode),
    176     UNIQUE u2(name, module, refcode),
     168    UNIQUE i9(dll, state, refcode),
     169    UNIQUE u1(refcode),
     170    UNIQUE u2(name, dll),
    177171    UNIQUE u3(type, refcode)
    178172);
     
    183177--
    184178CREATE TABLE parameter (
    185     function    INTEGER NOT NULL,
     179    function INTEGER NOT NULL,
    186180    sequencenbr TINYINT NOT NULL,
    187     name        VARCHAR(64) NOT NULL,
    188     type        VARCHAR(64) NOT NULL,
     181    name     VARCHAR(64) NOT NULL,
     182    type     VARCHAR(64) NOT NULL,
    189183    description TEXT,
    190184    INDEX  i1(function, name),
     
    197191--
    198192CREATE TABLE fnauthor (
    199     author      SMALLINT NOT NULL,
    200     function    INTEGER NOT NULL,
     193    author   SMALLINT NOT NULL,
     194    function INTEGER NOT NULL,
    201195    UNIQUE u1(author, function),
    202196    UNIQUE u2(function, author)
     
    208202--
    209203CREATE TABLE apigroup (
    210     refcode     SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    211     module      SMALLINT NOT NULL,
    212     name        VARCHAR(64) NOT NULL,
     204    refcode SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
     205    dll     TINYINT NOT NULL,
     206    name    VARCHAR(64) NOT NULL,
    213207    description VARCHAR(128),
    214208    UNIQUE u1(refcode),
     
    225219
    226220--
    227 -- Status history for modules.
    228 --
    229 CREATE TABLE historymodule (
    230     module      SMALLINT NOT NULL,
    231     state       SMALLINT NOT NULL,
    232     date        DATE     NOT NULL,
    233     count       SMALLINT NOT NULL,
    234     TYPE        CHAR     NOT NULL DEFAULT 'A',
    235     UNIQUE u1(module, state, date)
     221-- Status history for dlls.
     222--
     223CREATE TABLE historydll (
     224    dll TINYINT NOT NULL,
     225    state SMALLINT NOT NULL,
     226    date  DATE NOT NULL,
     227    count SMALLINT NOT NULL,
     228    UNIQUE u1(dll, state, date)
    236229);
    237230
     
    241234--
    242235CREATE TABLE historyapigroup (
    243     apigroup    SMALLINT NOT NULL,
    244     state       SMALLINT NOT NULL,
    245     date        DATE    NOT NULL,
    246     count       SMALLINT NOT NULL,
     236    apigroup SMALLINT NOT NULL,
     237    state SMALLINT NOT NULL,
     238    date  DATE NOT NULL,
     239    count SMALLINT NOT NULL,
    247240    UNIQUE u1(apigroup, state, date)
    248241);
     
    250243
    251244--
    252 -- Module API count history.
    253 --
    254 CREATE TABLE historymoduletotal (
    255     module      SMALLINT NOT NULL,
    256     date        DATE     NOT NULL,
    257     totalcount  SMALLINT NOT NULL,
    258     type        CHAR     NOT NULL DEFAULT 'A',
    259     UNIQUE u1(module, DATE)
     245-- Dll API count history.
     246--
     247CREATE TABLE historydlltotal (
     248    dll SMALLINT NOT NULL,
     249    date DATE NOT NULL,
     250    totalcount SMALLINT NOT NULL,
     251    UNIQUE u1(dll, DATE)
    260252);
    261253
     
    265257--
    266258CREATE TABLE historyapigrouptotal (
    267     apigroup    SMALLINT NOT NULL,
    268     date        DATE    NOT NULL,
    269     totalcount  SMALLINT NOT NULL,
     259    apigroup SMALLINT NOT NULL,
     260    date DATE NOT NULL,
     261    totalcount SMALLINT NOT NULL,
    270262    UNIQUE u1(apigroup, date)
    271263);
     
    322314
    323315--
    324 -- This table relates a tgroup with a module.
    325 --
    326 CREATE TABLE tgroupmodule (
     316-- This table relates a tgroup with a dll.
     317--
     318CREATE TABLE tgroupdll (
    327319    tgroup      SMALLINT NOT NULL,
    328     module      SMALLINT NOT NULL,
    329     UNIQUE u1(tgroup, module)
     320    dll         TINYINT NOT NULL,
     321    UNIQUE u1(tgroup, dll)
    330322);
    331323
  • trunk/tools/database/Makefile

    r6677 r6678  
    1 # $Id: Makefile,v 1.18 2001-09-07 10:24:06 bird Exp $
     1# $Id: Makefile,v 1.19 2001-09-07 10:31:43 bird Exp $
    22
    33#
     
    3535   mysqladmin DROP Odin32
    3636   mysql < CreateTables.sql
    37    mysql $@ < States.sql
    38    mysql $@ < Authors.sql
    39    mysql $@ < Codes.sql
     37   mysql < States.sql
     38   mysql < Authors.sql
    4039   -mysqladmin refresh
    4140
  • trunk/tools/database/StateUpd.cpp

    r6677 r6678  
    1 /* $Id: StateUpd.cpp,v 1.38 2001-09-07 10:24:06 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.39 2001-09-07 10:31:43 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    88
    99/*******************************************************************************
    10 *   Defined Constants And Macros                                               *
     10*   Header Files                                                               *
    1111*******************************************************************************/
    12 #define DEBUGLOG    1                   /* enables debug logging. */
    13 #ifdef DEBUGLOG
    14 #define logprintf(a) fprintf a
    15 #else
    16 #define logprintf(a) ((int)0)
    17 #endif
    18 
    1912#define INCL_DOSFILEMGR
    2013#define INCL_DOSERRORS
    2114#define INCL_DOSMISC
    2215#define INCL_DOSPROCESS
    23 
    24 
    25 /*******************************************************************************
    26 *   Header Files                                                               *
    27 *******************************************************************************/
    2816#include <os2.h>
    2917#include <malloc.h>
     
    3624#include "db.h"
    3725
     26
     27
    3828/*******************************************************************************
    3929*   Global Variables                                                           *
    4030*******************************************************************************/
    41 #ifdef DEBUGLOG
    4231static FILE  *phLog = NULL;
    43 #endif
    4432static FILE  *phSignal = NULL;
    4533
     
    5846static void closeLogs(void);
    5947static unsigned long processDir(const char *pszDirOrFile, POPTIONS pOptions);
    60 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions, BOOL fHeader);
    61 static unsigned long processFileHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
     48static unsigned long processFile(const char *pszFilename, POPTIONS pOptions);
     49static unsigned long processModuleHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    6250static unsigned long processDesignNote(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    63 static unsigned long processFunction(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
     51static unsigned long processAPI(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    6452static unsigned long analyseFnHdr(PFNDESC pFnDesc, char **papszLines, int i, const char *pszFilename, POPTIONS pOptions);
    6553static unsigned long analyseFnDcl(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    6654static unsigned long analyseFnDcl2(PFNDESC pFnDesc, char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions);
    67 static void  logFunction(PFNDESC pFnDesc);
    68 static char *ResolvSourceFile(char *pszFileObj, char **papszDirs);
    6955static char *SDSCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL);
    7056static char *CommonCopyTextUntilNextTag(char *pszTarget, BOOL fHTML, int iStart, int iEnd, char **papszLines, const char *pszStart = NULL);
    7157static BOOL  isFunction(char **papszLines, int i, POPTIONS pOptions);
    7258static BOOL  isDesignNote(char **papszLines, int i, POPTIONS pOptions);
    73 static BOOL  isClass(char **papszLines, int i, POPTIONS pOptions);
    7459static long _System dbNotUpdatedCallBack(const char *pszValue, const char *pszFieldName, void *pvUser);
    7560static char *skipInsignificantChars(char **papszLines, int &i, char *psz);
     
    8974static char *skipBackwards(const char *pszStopAt, const char *pszFrom, int &iLine, char **papszLines);
    9075static int   findStrLine(const char *psz, int iStart, int iEnd, char **papszLines);
    91 static void *textbufferCreate(const char *pszFilename);
    92 static char *textbufferGetNextLine(void *pvBuffer, void **ppv, char *pszLineBuffer, int cchLineBuffer);
    93 static char *textbufferNextLine(void *pvBuffer, register char *psz);
    94 static void  textbufferDestroy(void *pvBuffer);
    95 static signed long fsize(FILE *phFile);
    96 static char *fileNameNoExt(const char *pszFilename, char *pszBuffer);
    9776
    9877
     
    10887    BOOL           fFatal = FALSE;
    10988    unsigned long  ulRc = 0;
    110     char           szModName[64];
    111     char *         apszDirs[2] = {".", NULL};
    112     OPTIONS        options =
    113     {   FALSE,                          /* fIntegrityBefore  */
    114         FALSE,                          /* fIntegrityAfter;  */
    115         FALSE,                          /* fIntegrityOnly;   */
    116         FALSE,                          /* fRecursive;       */
    117         FALSE,                          /* fOld;             */
    118         FALSE,                          /* fOS2;             */
    119         FALSE,                          /* fCOMCTL32;        */
    120         FALSE,                          /* fVERSION;         */
    121         &szModName[0],                  /* pszModName;       */
    122         ' ',                            /* chModType;        */
    123         -1,                             /* lModRefcode;      */
    124         -1,                             /* lFileRefcode;     */
    125         &apszDirs[0]                    /* apszDirs;         */
    126     };
     89    char           szDLLName[64];
     90    OPTIONS        options = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, &szDLLName[0], -1};
    12791    unsigned long  ulRc2;
    12892    char          *pszErrorDesc = NULL;
     
    137101    /*DosSetPriority(PRTYS_PROCESSTREE, PRTYC_REGULAR, 1, 0);*/
    138102
    139     /* get module name from directory */
     103    /* get dll name from directory */
    140104    ul1 = ul2 = 0;
    141105    DosQueryCurrentDisk(&ul1, &ul2);
    142     ul2 = sizeof(szModName);
    143     DosQueryCurrentDir(ul1, &szModName[0], &ul2);
     106    ul2 = sizeof(szDLLName);
     107    DosQueryCurrentDir(ul1, &szDLLName[0], &ul2);
    144108    if (ul2 != 0)
    145109    {
    146         if (szModName[ul2-1] == '\\' || szModName[ul2-1] == '/')
    147             szModName[--ul2] = '\0';
     110        if (szDLLName[ul2-1] == '\\' || szDLLName[ul2-1] == '/')
     111            szDLLName[--ul2] = '\0';
    148112        ul1 = ul2;
    149         while (ul1 != 0 && szModName[ul1-1] != '\\' && szModName[ul1-1] != '/')
     113        while (ul1 != 0 && szDLLName[ul1-1] != '\\' && szDLLName[ul1-1] != '/')
    150114            ul1--;
    151115        if (ul1 != 0)
    152             options.pszModName = &szModName[ul1];
     116            options.pszDLLName = &szDLLName[ul1];
    153117    }
    154118    else
    155         szModName[0] = '\0';
     119        szDLLName[0] = '\0';
    156120
    157121
     
    163127    *           -io              Integrity check only.
    164128    *           -s               Scan subdirectories.
     129    *           -Old <[+]|->     Old API Style.
    165130    *           -OS2<[+]|->      Removes 'OS2'-prefix from function name.
    166131    *           -COMCTL32<[+]|-> Removes 'COMCTL32'-prefix from function name.
    167132    *           -VERSION<[+]|->  Removes 'VERSION'-prefix from function name.
    168     *           -Mod:<modname>   Name of the module being processed.
    169     *           -Type:<modtype>  Module type. default API or whatever is in DB.
     133    *           -Dll:<dllname>   Name of the dll being processed.
    170134    *           -d:<dbname>      Database name
    171135    *           -p:<passwd>      Password
     
    183147                case 'D':
    184148                    if (strnicmp(&argv[argi][1], "dll:", 4) == 0 )
    185                         options.pszModName = &argv[argi][5];
     149                        options.pszDLLName = &argv[argi][5];
    186150                    else
    187151                    {
     
    193157                    break;
    194158
    195                 case '-':
    196159                case 'h':
    197160                case 'H':
     
    229192                    }
    230193                    break;
    231 
    232                 case 'm':
    233                 case 'M':
    234                     if (strchr(&argv[argi][1], ':'))
    235                         options.pszModName = strchr(&argv[argi][1], ':') + 1;
    236                     else
    237                     {
    238                         fFatal = TRUE;
    239                         fprintf(stderr, "warning: option '-mod:' requires a module name.\n");
    240                     }
    241                     break;
    242 
    243194
    244195                case 'o':
     
    266217                case 'S':
    267218                    options.fRecursive = TRUE;
    268                     fprintf(stderr, "Warning: -s processes subdirs of source for one module\n");
     219                    fprintf(stderr, "Warning: -s processes subdirs of source for one DLL\n");
    269220                    break;
    270221
     
    277228                    break;
    278229
    279                 case 't':
    280                 case 'T':
    281                     if (strchr(&argv[argi][1], ':'))
    282                     {
    283                         char ch = *(strchr(&argv[argi][1], ':') + 1);
    284                         if (strchr("AIST", ch))
    285                             options.chModType = ch;
    286                         else
    287                         {
    288                             fFatal = TRUE;
    289                             fprintf(stderr, "warning: option '-type:' requires type char.\n");
    290                         }
    291                     }
    292                     else
    293                     {
    294                         fFatal = TRUE;
    295                         fprintf(stderr, "warning: option '-type:' requires type char.\n");
    296                     }
    297                     break;
    298 
    299230                default:
    300231                    fprintf(stderr, "incorrect parameter. (argi=%d, argv[argi]=%s)\n", argi, argv[argi]);
     
    303234            }
    304235        }
    305         else if (argv[argi][0] == '@')
    306         {   /*
    307              * Parameter file (debugger parameter length restrictions led to this):
    308              *    Create a textbuffer.
    309              *    Parse the file and create a new parameter vector.
    310              *    Set argv to the new parameter vector, argi to 0 and argc to
    311              *    the parameter count.
    312              *    Restrictions: Parameters enclosed in "" is not implemented.
    313              *                  No commandline parameters are processed after the @file
    314              */
    315             char *pszBuffer = (char*)textbufferCreate(&argv[argi][1]); /* !ASSUMS! that pvBuffer is the file string! */
    316             if (pszBuffer != NULL)
    317             {
    318                 char **apszArgs = NULL;
    319                 char *psz = pszBuffer;
    320                 int  i = 0;
    321 
    322                 while (*psz != '\0')
    323                 {
    324                     /* find end of parameter word */
    325                     char *pszEnd = psz + 1;
    326                     char  ch = *pszEnd;
    327                     while (ch != ' ' && ch != '\t' && ch != '\n' && ch != '\r' && ch != '\0')
    328                         ch = *++pszEnd;
    329 
    330                     /* allocate more arg array space? */
    331                     if ((i % 512) == 0)
    332                     {
    333                         apszArgs = (char**)realloc(apszArgs, sizeof(char*) * (514 + i));
    334                         if (apszArgs == NULL)
    335                         {
    336                             fprintf(stderr, "error: out of memory. (line=%d)\n", __LINE__);
    337                             return -8;
    338                         }
    339                     }
    340                     *pszEnd = '\0';
    341                     apszArgs[i++] = psz;
    342 
    343                     /* next */
    344                     psz = pszEnd + 1;
    345                     ch = *psz;
    346                     while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')
    347                         ch = *++psz;
    348                 }
    349 
    350                 argc = i;
    351                 argi = 0;
    352                 argv = apszArgs;
    353                 apszArgs[argc] = NULL;
    354                 continue;
    355             }
    356             else
    357             {
    358                 fprintf(stderr, "error: could not open parameter file\n");
    359                 return -1;
    360             }
    361             break;
    362         }
    363236        else
    364237            break; /* files has started */
     
    393266        }
    394267
    395 
    396268        if (!options.fIntegrityOnly)
    397269        {
    398             /* add/update module */
    399             if (options.chModType != ' ' && options.pszModName)
    400                 dbCheckInsertModule(options.pszModName, options.chModType);
    401 
    402             /* find module */
    403             options.lModRefcode = dbGetModule(options.pszModName);
    404             logprintf((phLog, "Module: refcode=%d, name=%s\n", options.lModRefcode, options.pszModName));
    405             if (options.lModRefcode >= 0)
     270            /* find dll */
     271            options.lDllRefcode = dbGetDll(options.pszDLLName);
     272            fprintf(phLog, "DLL: refcode=%d, name=%s\n", options.lDllRefcode, options.pszDLLName);
     273            if (options.lDllRefcode >= 0)
    406274            {
    407275                /* processing */
     
    409277                    ulRc = processDir(".", &options);
    410278                else
    411                     while (argi < argc)
     279                    while (argv[argi] != NULL)
    412280                    {
    413                         char *  pszDirOrFile = argv[argi];
    414                         int     cchDirOrFile = strlen(pszDirOrFile);
    415 
    416                         if (cchDirOrFile > 4 && !stricmp(pszDirOrFile + cchDirOrFile - 4, ".obj") ) /* check for .obj */
    417                         {
    418                             pszDirOrFile = ResolvSourceFile(pszDirOrFile, options.papszDirs);
    419                             if (!pszDirOrFile)
    420                             {
    421                                 /*
    422                                  * Ignore dllentry.
    423                                  */
    424                                 if (!stristr(argv[argi], "dllentry"))
    425                                 {
    426                                     fprintf(phSignal, "%s: Failed to resolve source file\n", argv[argi]);
    427                                     ulRc += 0x00010000;
    428                                 }
    429                                 argi++;
    430                                 break;
    431                             }
    432                         }
    433                         ulRc += processDir(pszDirOrFile, &options);
     281                        ulRc += processDir(argv[argi], &options);
    434282                        argi++;
    435283                    }
     
    461309            }
    462310            else
    463             {   /* failed to find module - concidered nearly fatal. */
    464                 fprintf(phSignal, "-,-: failed to find module (%s)!\n\t%s\n",
    465                         options.pszModName ? options.pszModName : "<NULL>",
     311            {   /* failed to find dll - concidered nearly fatal. */
     312                fprintf(phSignal, "-,-: failed to find dll (%s)!\n\t%s\n",
     313                        options.pszDLLName ? options.pszDLLName : "<NULL>",
    466314                        dbGetLastErrorDesc());
    467315                ulRc++;
     
    472320        if (!options.fIntegrityOnly)
    473321        {
    474             cUpdated    = dbGetNumberOfUpdatedFunction(options.lModRefcode);
    475             cAll        = dbCountFunctionInModule(options.lModRefcode, FALSE);
    476             cNotAliased = dbCountFunctionInModule(options.lModRefcode, TRUE);
     322            cUpdated    = dbGetNumberOfUpdatedFunction(options.lDllRefcode);
     323            cAll        = dbCountFunctionInDll(options.lDllRefcode, FALSE);
     324            cNotAliased = dbCountFunctionInDll(options.lDllRefcode, TRUE);
    477325            if (cNotAliased > cUpdated)
    478326            {
     
    481329                ulRc += 0x00010000;
    482330            }
    483             logprintf((phLog, "------------------------------------------------------\n"));
    484             logprintf((phLog, "-------- Functions which was not updated -------------\n"));
    485             dbGetNotUpdatedFunction(options.lModRefcode, dbNotUpdatedCallBack);
    486             logprintf((phLog, "------------------------------------------------------\n"));
    487             logprintf((phLog, "------------------------------------------------------\n\n"));
    488             logprintf((phLog,"Number of function in this module:          %4ld (%ld)\n", cAll, cNotAliased));
    489             logprintf((phLog,"Number of successfully processed functions: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated));
    490         }
    491         logprintf((phLog,    "Number of signals:                          %4ld\n", (long)(ulRc >> 16)));
     331            fprintf(phLog, "-------------------------------------------------\n");
     332            fprintf(phLog, "-------- Functions which was not updated --------\n");
     333            dbGetNotUpdatedFunction(options.lDllRefcode, dbNotUpdatedCallBack);
     334            fprintf(phLog, "-------------------------------------------------\n");
     335            fprintf(phLog, "-------------------------------------------------\n\n");
     336            fprintf(phLog,"Number of function in this DLL:        %4ld (%ld)\n", cAll, cNotAliased);
     337            fprintf(phLog,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);
     338        }
     339        fprintf(phLog,"Number of signals:                     %4ld\n", (long)(ulRc >> 16));
    492340
    493341        /* close the logs */
     
    500348        if (!options.fIntegrityOnly)
    501349        {
    502             fprintf(stdout,"Number of function in this module:          %4ld (%ld)\n", cAll, cNotAliased);
    503             fprintf(stdout,"Number of successfully processed functions: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);
    504         }
    505         fprintf(stdout,    "Number of signals:                          %4ld\n", (long)(ulRc >> 16));
     350            fprintf(stdout,"Number of function in this DLL:        %4ld (%ld)\n", cAll, cNotAliased);
     351            fprintf(stdout,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);
     352        }
     353        fprintf(stdout,"Number of signals:                     %4ld\n", (long)(ulRc >> 16));
    506354        if ((int)(ulRc >> 16) > 0)
    507355            fprintf(stderr, "Check signal file 'Signals.Log'.\n");
     
    528376           "    -io           Integrity check only.         default: disabled\n"
    529377           "    -s            Scan subdirectories.          default: disabled\n"
     378           "    -Old          Use old API style.            default: disabled\n"
    530379           "    -OS2          Ignore 'OS2'-prefix on APIs.  default: disabled\n"
    531            "    -Mod:<modname> Name of the module.          default: currentdirname\n"
    532            "    -Type:<type>  Module type. AIST.            default: read database\n"
     380           "    -Dll:<dllname> Name of the dll.             default: currentdirname\n"
    533381           "    -h:<hostname> Database server hostname.     default: localhost\n"
    534382           "    -u:<username> Username on the server.       default: root\n"
     
    554402static void openLogs(void)
    555403{
    556     #ifdef DEBUGLOG
    557404    if (phLog == NULL)
    558405    {
     
    564411        }
    565412    }
    566     #endif
    567413
    568414    if (phSignal == NULL)
     
    583429static void closeLogs(void)
    584430{
    585     #ifdef DEBUGLOG
    586431    if (phLog != stderr && phLog != NULL)
    587432        fclose(phLog);
    588     #endif
    589433    if (phSignal != stdout && phSignal != NULL)
    590434    {
     
    629473    rc = DosQueryPathInfo(pszDirOrFile, FIL_STANDARD, &fs , sizeof(fs));
    630474    fFile = rc == NO_ERROR && (fs.attrFile & FILE_DIRECTORY) != FILE_DIRECTORY;
    631     if (!fFile)
    632         fFile = strpbrk(pszDirOrFile, "*?") != NULL;
    633475
    634476    /* 0. */
     
    668510        char *psz = strrchr(&ffb.achName[0], '.');
    669511        if (psz != NULL && (!stricmp(psz, ".cpp") || !stricmp(psz, ".c")))
    670             ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions, FALSE);
    671         else if (psz != NULL && (!stricmp(psz, ".h") || !stricmp(psz, ".hpp")))
    672             ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions, TRUE);
     512            ulRc += processFile(strcat(strcat(strcpy(&szFileSpec[0], pszDir), "\\"), &ffb.achName[0]), pOptions);
    673513
    674514        /* next */
     
    711551/**
    712552 * Processes a file.
    713  * @returns high word = number of signals
    714  *          low  word = number of APIs processed. (1 or 0).
    715  * @param   pszFilename Filename
    716  * @param   pOptions    Pointer to options.
    717  * @param   fHeader     Flags if we're processing a header file or not.
     553 * @returns   high word = number of signals
     554 *            low  word = number of APIs processed. (1 or 0).
     555 * @param     pszFilename  Filename
     556 * @param     pOptions  Pointer to options.
    718557 * @sketch     1. read file into memory.
    719558 *             2. create line array.
    720559 *            (3. simple preprocessing - TODO)
    721  *             4. process file header.
     560 *             4. process module header.
    722561 *             5. scan thru the line array, looking for APIs and designnotes.
    723562 *                5b. when API is found, process it.
    724563 *                5c. when designnote found, process it.
    725564 */
    726 static unsigned long processFile(const char *pszFilename, POPTIONS pOptions, BOOL fHeader)
     565static unsigned long processFile(const char *pszFilename, POPTIONS pOptions)
    727566{
    728567    unsigned long  cSignals = 0;
     
    730569    char          *pszFile;
    731570
    732     logprintf((phLog, "Processing '%s':\n", pszFilename));
    733 
    734     /*
    735      * (1) Read file into memory
    736      */
     571    fprintf(phLog, "Processing '%s':\n", pszFilename);
     572    /* 1.*/
    737573    pszFile = readFileIntoMemory(pszFilename);
    738574    if (pszFile != NULL)
     
    740576        char **papszLines;
    741577
    742         /*
    743          * (2) Create line array.
    744          */
     578        /* 2.*/
    745579        papszLines = createLineArray(pszFile);
    746580        if (papszLines != NULL)
     
    749583            int i = 0;
    750584
    751             /*
    752              * 3. Simple preprocessing - TODO
    753              */
    754 
    755 
    756             /*
    757              * (4) Process the file header.
    758              */
    759             ulRc = processFileHeader(papszLines, i, i, pszFilename, pOptions);
     585            /* 3. - TODO */
     586
     587            /* 4. */
     588            ulRc = processModuleHeader(papszLines, i, i, pszFilename, pOptions);
    760589            cSignals += ulRc >> 16;
    761590            if (ulRc & 0x0000ffff)
    762591            {
    763                 /*
    764                  * (4b) Remove Design notes.
     592                /* 4b.
     593                 * Remove Design notes.
    765594                 */
     595                pOptions->lSeqFile = 0;
    766596                if (!dbRemoveDesignNotes(pOptions->lFileRefcode))
    767597                {
     
    772602
    773603
    774                 /*
    775                  * (5) The scan loop.
    776                  */
     604                /* 5.*/
    777605                while (papszLines[i] != NULL)
    778606                {
    779                     /*
    780                      * (5b) Function.
    781                      */
    782607                    if (isFunction(papszLines, i, pOptions))
    783608                    {
    784                         ulRc = processFunction(papszLines, i, i, pszFilename, pOptions);
     609                        ulRc = processAPI(papszLines, i, i, pszFilename, pOptions);
    785610                        cAPIs += 0x0000ffff & ulRc;
    786611                        cSignals += ulRc >> 16;
    787612                    }
    788                     /*
    789                      * (5c) Design note.
    790                      */
    791                     else if (isDesignNote(papszLines, i, pOptions))
     613                    else
    792614                    {
    793                         ulRc = processDesignNote(papszLines, i, i, pszFilename, pOptions);
    794                         cSignals += ulRc >> 16;
    795                     }
    796                     /*
    797                      * (5d) Class detection (experimental)
    798                      */
    799                     #ifdef DEBUGLOG
    800                     else if (isClass(papszLines, i, pOptions))
    801                     {
    802                         logprintf((phLog, "Found class at line %d. %s\n", i, papszLines[i]));
     615                        if (isDesignNote(papszLines, i, pOptions))
     616                        {
     617                            ulRc = processDesignNote(papszLines, i, i, pszFilename, pOptions);
     618                            cSignals += ulRc >> 16;
     619                        }
    803620                        i++;
    804621                    }
    805                     #endif
    806                     /*
    807                      * Nothing.
    808                      */
    809                     else
    810                         i++;
    811                 } /* while - scan loop */
    812             }
    813 
    814             /*
    815              * Cleanup.
    816              */
     622                }
     623            }
     624
    817625            free(papszLines);
    818626        }
     
    829637        cSignals++;
    830638    }
    831     logprintf((phLog, "Processing of '%s' is completed.\n\n", pszFilename));
    832 
    833     fHeader = fHeader;
     639    fprintf(phLog, "Processing of '%s' is completed.\n\n", pszFilename);
     640
    834641
    835642    return (unsigned long)((cSignals << 16) | cAPIs);
     
    838645
    839646/**
    840  * Processes an file header and other file information.
     647 * Processes an module header and other file information.
    841648 * @returns     high word = number of signals.
    842649 *              low  word = Success indicator (TRUE / FALSE).
     
    848655 * @sketch      Extract module information if any....
    849656 */
    850 static unsigned long processFileHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)
    851 {
    852     char            szDescription[10240];       /* File description buffer. */
    853     char            szId[128];                  /* CVS Id keyword buffer. */
    854     char *          psz, *psz2;
     657static unsigned long processModuleHeader(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)
     658{
     659    char    szDescription[10240];       /* File description buffer. */
     660    char    szId[128];                  /* CVS Id keyword buffer. */
     661    char *  psz, *psz2;
    855662    const char *    pszDBFilename;
    856663    char *          pszLastDateTime = NULL;
     
    976783         * Insert or update the database.
    977784         */
    978         if (dbInsertUpdateFile((unsigned short)pOptions->lModRefcode, pszDBFilename,
     785        if (dbInsertUpdateFile((unsigned short)pOptions->lDllRefcode, pszDBFilename,
    979786                               &szDescription[0], pszLastDateTime, lLastAuthor, pszRevision))
    980787        {
     
    982789             * Get file refcode.
    983790             */
    984             pOptions->lFileRefcode = dbFindFile(pOptions->lModRefcode, pszDBFilename);
     791            pOptions->lFileRefcode = dbFindFile(pOptions->lDllRefcode, pszDBFilename);
    985792            if (pOptions->lFileRefcode < 0)
    986793            {
     
    1126933             * Add the note.
    1127934             */
    1128             if (!dbAddDesignNote(pOptions->lModRefcode, pOptions->lFileRefcode,
     935            if (!dbAddDesignNote(pOptions->lDllRefcode, pOptions->lFileRefcode,
    1129936                                 pszTitle, psz,
    1130937                                 lLevel, lSeqNbr, lSeqNbrNote++, i + 1, lLevel > 0, &lRefCode))
     
    1163970
    1164971/**
    1165  * Processes an function.
     972 * Processes an API function.
    1166973 * @returns   high word = number of signals
    1167974 *            low  word = number of APIs processed. (1 or 0).
     
    1172979 * @param     pOptions  Pointer to options.
    1173980 */
    1174 static unsigned long processFunction(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)
     981static unsigned long processAPI(char **papszLines, int i, int &iRet, const char *pszFilename, POPTIONS pOptions)
    1175982{
    1176983    unsigned long ulRc;
     
    1192999     */
    11931000
    1194     /*
    1195      * (1) Analyse function declaration.
    1196      */
     1001    /* 1.*/
    11971002    ulRc = analyseFnDcl(&FnDesc, papszLines, i, iRet, pszFilename, pOptions);
    11981003    if (0x0000ffff & ulRc) /* if low word is 0 the fatal */
    11991004    {
    1200         unsigned long   ulRcTmp;
    1201         char  *         pszErrorDesc = (char*)malloc(20480);
    1202 
    1203         /*
    1204          * (2) Analyse function header.
    1205          */
     1005        unsigned long ulRcTmp;
     1006        //char szErrorDesc[2113]; /* due to some limitation in the latest EMX release size is 2112 and not 4096 as initially implemented. */
     1007        char  *pszErrorDesc = (char*)malloc(20480);
     1008
     1009        /* 2.*/
    12061010        ulRcTmp = analyseFnHdr(&FnDesc, papszLines, i, pszFilename, pOptions);
    12071011        if (ulRcTmp == ~0UL) /* check for fatal error */
    1208         {
    1209             free(pszErrorDesc);
    12101012            return (0xffff0000UL & ulRc) + 0x00010000UL;
    1211         }
    12121013        ulRc += 0xffff0000UL & ulRcTmp;
    12131014
    1214         /*
    1215          * (3) Log data (for debug purpose).
    1216          */
    1217         logFunction(&FnDesc);
    1218 
    1219         /*
    1220          * (4) Update database.
    1221          */
    1222         ulRcTmp = dbUpdateFunction(&FnDesc, pOptions->lModRefcode, pszErrorDesc);
     1015        /* 3.*/
     1016        fprintf(phLog, "Name:      '%s'  (refcodes=", FnDesc.pszName);
     1017        for (j = 0; j < FnDesc.cRefCodes; j++)
     1018            fprintf(phLog, j > 0 ? ", %ld" : "%ld", FnDesc.alRefCode[j]);
     1019        fprintf(phLog, ")\n");
     1020        fprintf(phLog, "  Returns: '%s'\n", FnDesc.pszReturnType != NULL ? FnDesc.pszReturnType : "<missing>");
     1021        fprintf(phLog, "  cParams: %2d\n", FnDesc.cParams);
     1022        for (j = 0; j < FnDesc.cParams; j++)
     1023            fprintf(phLog, "  Param %2d: type '%s' %*s name '%s' description: %s\n", j, FnDesc.apszParamType[j],
     1024                    max((int)(15 - strlen(FnDesc.apszParamType[j])), 0), "", FnDesc.apszParamName[j],
     1025                    FnDesc.apszParamDesc[j] != NULL ?  FnDesc.apszParamDesc[j] : "(null)");
     1026        fprintf(phLog, "  Status:   %ld - '%s'\n", FnDesc.lStatus, FnDesc.pszStatus != NULL ? FnDesc.pszStatus : "<missing>");
     1027        fprintf(phLog, "  cAuthors: %2d\n", FnDesc.cAuthors);
     1028        for (j = 0; j < FnDesc.cAuthors; j++)
     1029            fprintf(phLog, "  Author %d: '%s'  (refcode=%ld)\n", j, FnDesc.apszAuthor[j], FnDesc.alAuthorRefCode[j]);
     1030
     1031        fprintf(phLog, "  Description: %s\n", FnDesc.pszDescription != NULL ? FnDesc.pszDescription : "(null)");
     1032        fprintf(phLog, "  Remark:      %s\n", FnDesc.pszRemark != NULL ? FnDesc.pszRemark : "(null)");
     1033        fprintf(phLog, "  Return Desc: %s\n", FnDesc.pszReturnDesc != NULL ? FnDesc.pszReturnDesc : "(null)");
     1034        fprintf(phLog, "  Sketch:      %s\n", FnDesc.pszSketch != NULL ? FnDesc.pszSketch : "(null)");
     1035        fprintf(phLog, "  Equiv:       %s\n", FnDesc.pszEquiv != NULL ? FnDesc.pszEquiv : "(null)");
     1036        fprintf(phLog, "  Time:        %s\n", FnDesc.pszTime != NULL ? FnDesc.pszTime : "(null)");
     1037        fprintf(phLog, "------------\n");
     1038
     1039        /* 4.*/
     1040        ulRcTmp = dbUpdateFunction(&FnDesc, pOptions->lDllRefcode, pszErrorDesc);
    12231041        if (ulRcTmp != 0)
    12241042        {
     
    12461064                                  const char *pszFilename, POPTIONS pOptions)
    12471065{
     1066    static long     lPrevFnDll = -1L; /* fix for duplicate dlls */
    12481067    unsigned long   ulRc;
    12491068    FNFINDBUF       FnFindBuf;
     
    12511070
    12521071    /* brief algorithm:
    1253      * 1. Read function declaration using analyseFnDcl2.
    1254      * 2. Apply name rules.
    1255      * 3. Do a database lookup on the name.
    1256      *  3b. If more that one match, write a signal. (TODO: a simple fix is done, but there are holes.)
    1257      * 4. if not found then add the function as other (type=O). Only do this if we know which module we're in.
    1258      *  4b. do 3.
     1072     * 1. read function declaration using analyseFnDcl2.
     1073     * 2. apply name rules.
     1074     * 3. do a database lookup on the name.
     1075     *  3b. if more that one match, write a signal. (TODO: a simple fix is done, but there are holes.)
    12591076     */
    12601077
    1261     /*
    1262      * (1) Read function declaration using analyseFnDcl2.
    1263      */
     1078    /* 1. */
    12641079    ulRc = analyseFnDcl2(pFnDesc, papszLines, i, iRet, pszFilename, pOptions);
    12651080    if (ulRc != 1)
    12661081        return ulRc;
    12671082
    1268     /*
    1269      * (2) Apply name rules (if api only?).
    1270      */
     1083    /* 2. */
    12711084    if (pOptions->fOS2 && strncmp(pFnDesc->pszName, "OS2", 3) == 0)
    12721085        pFnDesc->pszName += 3;
     
    12781091        pFnDesc->pszName += 3;
    12791092
    1280     /*
    1281      * (3) Do a database lookup on the name.
    1282      */
    1283     if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lModRefcode))
     1093    /* 3. */
     1094    if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lDllRefcode))
    12841095    {
    12851096        fprintf(phSignal, "%s, %s: error occured while reading from database, %s\n",
     
    12911102    if (FnFindBuf.cFns != 0)
    12921103    {
    1293         if (pOptions->lModRefcode < 0)
     1104        if (pOptions->lDllRefcode < 0)
    12941105        {
    12951106            if (FnFindBuf.cFns > 1)
    12961107            {
    1297                 fprintf(phSignal, "%s: unknown module and more than two occurences of this function!\n", pszFilename);
     1108                fprintf(phSignal, "%s: unknown dll and more than two occurences of this function!\n", pszFilename);
    12981109                return 0x00010000;
    12991110            }
    1300             pOptions->lModRefcode = FnFindBuf.alModRefCode[0];
    1301             logprintf((phLog, "ModRef = %d\n", pOptions->lModRefcode));
     1111            pOptions->lDllRefcode = FnFindBuf.alDllRefCode[0];
     1112            fprintf(phLog, "DllRef = %d\n", pOptions->lDllRefcode);
    13021113        }
    13031114
     
    13061117
    13071118        if (pFnDesc->cRefCodes == 0)
    1308             logprintf((phLog, "%s was not an API in this module(%d)!\n", pFnDesc->pszName, pOptions->lModRefcode));
     1119            fprintf(phLog, "%s was not an API in this dll(%d)!\n", pFnDesc->pszName, pOptions->lDllRefcode);
    13091120    }
    13101121    else
    1311         logprintf((phLog, "%s was not an API\n", pFnDesc->pszName));
    1312 
    1313     /*
    1314      * (4) If not found then add the function as other (type=O).
    1315      *     Only do this if we know which module we're in.
    1316      */
    1317     if (FnFindBuf.cFns == 0 || pFnDesc->cRefCodes == 0 && pOptions->lModRefcode >= 0)
    1318     {
    1319         if (!dbInsertUpdateFunction(pOptions->lModRefcode,
    1320                                     pFnDesc->pszName, pFnDesc->pszName,
    1321                                     -1, TRUE, FUNCTION_OTHER))
    1322         {
    1323             fprintf(phSignal, "%s, %s: error occured inserting new function, %s\n",
    1324                     pszFilename, pFnDesc->pszName, dbGetLastErrorDesc());
    1325             return 0x00010000;
    1326         }
    1327 
    1328         if (!dbFindFunction(pFnDesc->pszName, &FnFindBuf, pOptions->lModRefcode))
    1329         {
    1330             fprintf(phSignal, "%s, %s: error occured while reading from database, %s\n",
    1331                     pszFilename, pFnDesc->pszName, dbGetLastErrorDesc());
    1332             return 0x00010000;
    1333         }
    1334 
    1335         for (lFn = 0; lFn < FnFindBuf.cFns; lFn++)
    1336             pFnDesc->alRefCode[pFnDesc->cRefCodes++] = FnFindBuf.alRefCode[lFn];
    1337 
    1338         if (pFnDesc->cRefCodes == 0)
    1339         {
    1340             fprintf(phSignal, "%s, %s: Function was not found even though it was just added.\n",
    1341                     pszFilename, pFnDesc->pszName);
    1342             return 0x00010000;
    1343         }
    1344     }
     1122        fprintf(phLog, "%s was not an API\n", pFnDesc->pszName);
    13451123
    13461124    ulRc = pFnDesc->cRefCodes;
     
    13651143{
    13661144    /** @sketch
    1367      * 1. Find the '('
    1368      * 2. Find the word ahead of the '(', this is the function name.
    1369      * 2a. Class test.
    1370      * 3. Find the closing ')'
    1371      * 4. Copy the parameters, which is between the two '()'
    1372      * 5. Format the parameters
    1373      * 6. Return type, function name and arguments.
    1374      *    Check for the ODINFUNCTION macro.
     1145     * 1. find the '('
     1146     * 2. find the word ahead of the '(', this is the function name.
     1147     * 2a. class test.
     1148     * 3. find the closing ')'
     1149     * 4. copy the parameters, which is between the two '()'
     1150     * 5. format the parameters
    13751151     */
    13761152
     
    13951171    }
    13961172
    1397     /*
    1398      * (2) find the word ahead of the '(', this is the function name.
    1399      */
     1173    /* 2. */
    14001174    iFn = iP1;
    14011175    if (papszLines[iFn] != pszP1)
     
    14251199    pszFn = findStartOfWord(pszFn, papszLines[iFn]);
    14261200
    1427     /*
    1428      * (2a) class test.
    1429      */
     1201    /* 2a. */
    14301202    /* operators are not supported (BOOL kTime::operator > (const kTime &time) const) */
    14311203    if (pszFn > papszLines[iFn])
     
    14531225        pszClass = pszClassEnd = NULL;
    14541226
    1455     /*
    1456      * (3) find the closing ')'
    1457      */
     1227    /* 3. */
    14581228    c = 1;
    14591229    iP2 = iP1;
     
    14731243    iRet = iP2 + 1; //assumes: only one function on a single line!
    14741244
    1475     /*
    1476      * (4) Copy the parameters, which is between the two '()'
    1477      */
     1245    /* 4. */
    14781246    psz = pFnDesc->szFnDclBuffer;
    14791247    copy(pFnDesc->szFnDclBuffer, pszP1, iP1, pszP2, iP2, papszLines);
    14801248    pszEnd = psz + strlen(psz) + 1;
    14811249
    1482     /*
    1483      * (5) Format the parameters.
    1484      */
     1250    /* 5.*/
    14851251    cArgs = 0;
    14861252    if (stricmp(psz, "(void)") != 0 && strcmp(psz, "()") != 0 && strcmp(psz, "( )"))
     
    15091275    }
    15101276
    1511     /*
    1512      * (6) Return type, function name and arguments.
    1513      *     Check for the ODINFUNCTION macro.
    1514      */
     1277    /* 6. */
    15151278    if (strnicmp(pszFn, "ODINFUNCTION", 12) == 0 || strnicmp(pszFn, "ODINPROCEDURE", 13) == 0)
    15161279    {
     
    15621325            /* FIXME LATER! Some constructors calling baseclass constructors "breaks" this rule. Win32MDIChildWindow in /src/user32/win32wmdichild.cpp for example. */
    15631326            fprintf(phSignal,"Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd));
    1564             logprintf((phLog,   "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd)));
     1327            fprintf(phLog,   "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd));
    15651328            if (strlen(pszEnd) > 512)
    15661329                fprintf(stderr,  "Fatal error? return statement is too larget. len=%d\n", strlen(pszEnd));
    1567             #ifdef DEBUGLOG
    15681330            fflush(phLog);
    1569             #endif
    15701331            fflush(phSignal);
    15711332            fflush(stderr);
     
    15781339        /* !BugFix! some function occur more than once, usually as inline functions */
    15791340        if (pFnDesc->pszReturnType != NULL
    1580             && (pFnDesc->fchType == FUNCTION_ODIN32_API || pFnDesc->fchType == FUNCTION_INTERNAL_ODIN32_API)
    1581             && stristr(pFnDesc->pszReturnType, "inline ") != NULL)
    1582         {
    1583             logprintf((phLog, "Not an API. Inlined functions can't be exported!\n"));
     1341            && strstr(pFnDesc->pszReturnType, "inline ") != NULL)
     1342        {
     1343            fprintf(phLog, "Not an API. Inlined functions can't be exported!\n");
    15841344            return 0;
    15851345        }
     
    15931353            )
    15941354        {   /* cdecl function is prefixed with an '_' */
    1595             strcpy(pszEnd, "_"); /* BUGBUG */
     1355            strcpy(pszEnd, "_");
    15961356        }
    15971357        if (pszClass != NULL)
     
    16051365        *pszEnd = '\0';
    16061366
    1607         /* class name and type */
    1608         if (pszClass != NULL)
    1609         {
    1610             pFnDesc->pszClass = pszEnd;
    1611             strncat(pszEnd,pszClass, pszClassEnd - pszClass + 1);
    1612             if (!pFnDesc->pszReturnType || !*pFnDesc->pszReturnType)
    1613                 pFnDesc->fchType =  *pszFn != '~' ? FUNCTION_CONSTRUCTOR : FUNCTION_DESTRUCTOR;
    1614             else
    1615                 pFnDesc->fchType = FUNCTION_METHOD; /* BUGBUG operator. */
    1616             pszEnd = strlen(pszEnd) + pszEnd + 1;
    1617             *pszEnd = '\0';
    1618         }
    16191367
    16201368        /* arguments */
     
    16591407                    else
    16601408                    {   /* arg yet another special case! 'fn(int argc, char *argv[])' */
    1661                         char *pszP2 = NULL;
     1409                        char *pszP2;
    16621410                        cch = strlen(apszArgs[j]);
    16631411                        psz = &apszArgs[j][cch-2];
     
    16891437                                memset(psz, ' ', pszP2 - psz);
    16901438                            else
    1691                                 logprintf((phLog, "assert: line %d\n", __LINE__));
     1439                                fprintf(phLog, "assert: line %d\n", __LINE__);
    16921440                        }
    16931441                        pFnDesc->apszParamType[j] = trim(apszArgs[j]);
     
    18361584        /* 2c.*/
    18371585        if (iName <= iEnd && strstr(papszLines[iName], pFnDesc->pszName) == NULL)
    1838             logprintf((phLog, "Warning: a matching function name is not found in the name Field\n"));
     1586            fprintf(phLog, "Warning: a matching function name is not found in the name Field\n");
    18391587    }
    18401588
     
    20671815}
    20681816
    2069 
    2070 /**
    2071  * Writes debug log data on a function.
    2072  * @param   pFnDesc     Pointer to function description block.
    2073  */
    2074 void logFunction(PFNDESC pFnDesc)
    2075 {
    2076     #ifdef DEBUGLOG
    2077     int j;
    2078 
    2079     fprintf(phLog, "Name:      '%s'  (refcodes=", pFnDesc->pszName);
    2080     for (j = 0; j < pFnDesc->cRefCodes; j++)
    2081         fprintf(phLog, j > 0 ? ", %ld" : "%ld", pFnDesc->alRefCode[j]);
    2082     fprintf(phLog, ")\n");
    2083     fprintf(phLog, "  Returns: '%s'\n", pFnDesc->pszReturnType != NULL ? pFnDesc->pszReturnType : "<missing>");
    2084     fprintf(phLog, "  cParams: %2d\n", pFnDesc->cParams);
    2085     for (j = 0; j < pFnDesc->cParams; j++)
    2086         fprintf(phLog, "  Param %2d: type '%s' %*s name '%s' description: %s\n", j, pFnDesc->apszParamType[j],
    2087                 max((int)(15 - strlen(pFnDesc->apszParamType[j])), 0), "", pFnDesc->apszParamName[j],
    2088                 pFnDesc->apszParamDesc[j] != NULL ?  pFnDesc->apszParamDesc[j] : "(null)");
    2089     fprintf(phLog, "  Status:   %ld - '%s'\n", pFnDesc->lStatus, pFnDesc->pszStatus != NULL ? pFnDesc->pszStatus : "<missing>");
    2090     fprintf(phLog, "  cAuthors: %2d\n", pFnDesc->cAuthors);
    2091     for (j = 0; j < pFnDesc->cAuthors; j++)
    2092         fprintf(phLog, "  Author %d: '%s'  (refcode=%ld)\n", j, pFnDesc->apszAuthor[j], pFnDesc->alAuthorRefCode[j]);
    2093 
    2094     fprintf(phLog, "  Description: %s\n", pFnDesc->pszDescription != NULL ? pFnDesc->pszDescription : "(null)");
    2095     fprintf(phLog, "  Remark:      %s\n", pFnDesc->pszRemark != NULL ? pFnDesc->pszRemark : "(null)");
    2096     fprintf(phLog, "  Return Desc: %s\n", pFnDesc->pszReturnDesc != NULL ? pFnDesc->pszReturnDesc : "(null)");
    2097     fprintf(phLog, "  Sketch:      %s\n", pFnDesc->pszSketch != NULL ? pFnDesc->pszSketch : "(null)");
    2098     fprintf(phLog, "  Equiv:       %s\n", pFnDesc->pszEquiv != NULL ? pFnDesc->pszEquiv : "(null)");
    2099     fprintf(phLog, "  Time:        %s\n", pFnDesc->pszTime != NULL ? pFnDesc->pszTime : "(null)");
    2100     fprintf(phLog, "------------\n");
    2101     #else
    2102     pFnDesc = pFnDesc;
    2103     #endif
    2104 }
    2105 
    2106 
    2107 /**
    2108  * Resolves the source filename of an .obj file.
    2109  * @returns Pointer to static filename buffer.
    2110  * @param   pszFileObj  Name of object file.
    2111  * @param   papszDirs   Array of directories to search. NULL terminated.
    2112  * @remark  The string returned is in _static_ memory.
    2113  */
    2114 char *ResolvSourceFile(char *pszFileObj, char **papszDirs)
    2115 {
    2116     static char     szFile[CCHMAXPATH];
    2117     static char *   aszSuffixes[] = { ".cpp", ".c", ".orc", NULL };
    2118     char *  aszDirs[] = { ".;", NULL };
    2119     char *  pszDir;
    2120     int     i;
    2121     char    szFileTmp[CCHMAXPATH];
    2122 
    2123     /*
    2124      * Extract file name.
    2125      */
    2126     fileNameNoExt(pszFileObj, szFileTmp);
    2127 
    2128 
    2129     /*
    2130      * Loop dirs.
    2131      */
    2132     for (i = 0; papszDirs[i]; i++)
    2133     {
    2134         int j;
    2135 
    2136         for (j = 0; aszSuffixes[j]; j++)
    2137         {
    2138             APIRET       rc;
    2139             FILESTATUS3  fs;
    2140 
    2141             strcat(strcat(strcat(strcpy(szFile, papszDirs[i]), "\\"), szFileTmp), aszSuffixes[j]);
    2142             rc = DosQueryPathInfo(szFile, FIL_STANDARD, &fs , sizeof(fs));
    2143             if (rc == NO_ERROR && (fs.attrFile & FILE_DIRECTORY) != FILE_DIRECTORY)
    2144             {
    2145                 logprintf((phLog, "ResolveSourceFile(%s,..) -> %s\n", pszFileObj, szFile));
    2146                 return szFile;
    2147             }
    2148         }
    2149     }
    2150 
    2151     logprintf((phLog, "ResolveSourceFile(%s,..) -> NULL\n", pszFileObj));
    2152     return NULL;
    2153 }
    21541817
    21551818
     
    24982161                                if (pszB != NULL && *pszB == '{')
    24992162                                {
    2500                                     logprintf((phLog, "Function found: %.*s\n", cchFnName, pszFnName));
     2163                                    fprintf(phLog, "Function found: %.*s\n", cchFnName, pszFnName);
    25012164                                    return TRUE;
    25022165                                }
     
    25612224                        if (pszB != NULL && *pszB == '{')
    25622225                        {
    2563                             logprintf((phLog, "Possible API: %.*s\n", cchFnName, pszOS2));
     2226                            fprintf(phLog, "Possible API: %.*s\n", cchFnName, pszOS2);
    25642227                            return TRUE;
    25652228                        }
     
    26032266
    26042267
    2605 /**
    2606  * Checks if there is a class declaration starting at the current line.
    2607  * @returns   TRUE if design note found, else FALSE.
    2608  * @param     papszLines   Array of lines in the file.
    2609  * @param     i            Index into papszLines.
    2610  * @param     pOptions     Pointer to options.
    2611  */
    2612 BOOL isClass(char **papszLines, int i, POPTIONS pOptions)
    2613 {
    2614     char *psz = papszLines[i];
    2615 
    2616     if (psz == NULL)
    2617         return FALSE;
    2618 
    2619     // look for class
    2620     while (*psz == ' ')
    2621         psz++;
    2622 
    2623     pOptions = pOptions;
    2624     return !strncmp(psz, "class", 5)
    2625            && (psz[5] == '\t' || psz[5] == ' ' || psz[5] == '\n' || psz[5] == '\r' || psz[5] == '\0');
    2626 }
    2627 
    26282268
    26292269
     
    26382278    {
    26392279        case 0:
    2640             logprintf((phLog, "%s", pszValue));
     2280            fprintf(phLog, "%s", pszValue);
    26412281            break;
    26422282        case 1:
    2643             logprintf((phLog, "(%s)", pszValue));
     2283            fprintf(phLog, "(%s)", pszValue);
    26442284            break;
    26452285        case 2: /* updated */
    2646             logprintf((phLog, " %s=%s", pszFieldName, pszValue));
     2286            fprintf(phLog, " %s=%s", pszFieldName, pszValue);
    26472287            break;
    26482288        case 3: /* aliasfn */
    2649             logprintf((phLog, " %s=%s", pszFieldName, pszValue));
     2289            fprintf(phLog, " %s=%s", pszFieldName, pszValue);
    26502290            break;
    26512291        case 4:
    26522292            if (pszValue != NULL)
    2653                 logprintf((phLog, " --> %s.", pszValue));
     2293                fprintf(phLog, " --> %s.", pszValue);
    26542294            break;
    26552295        case 5:
    26562296            if (pszValue != NULL)
    2657                 logprintf((phLog, "%s", pszValue));
     2297                fprintf(phLog, "%s", pszValue);
    26582298            break;
    26592299        case 6:
    26602300            if (pszValue != NULL)
    2661                 logprintf((phLog, "(%s)", pszValue));
     2301                fprintf(phLog, "(%s)", pszValue);
    26622302            break;
    26632303
    26642304        default:
    26652305            i = 0;
    2666             logprintf((phLog, "\n"));
     2306            fprintf(phLog, "\n");
    26672307    }
    26682308
     
    26702310    {
    26712311        i = 0;
    2672         logprintf((phLog, "\n"));
     2312        fprintf(phLog, "\n");
    26732313    }
    26742314
     
    28012441        psz++;
    28022442    }
    2803     logprintf((phLog, "%d lines\n", cLines));
     2443    fprintf(phLog, "%d lines\n", cLines);
    28042444
    28052445    papszLines = (char**)calloc(cLines + 1, sizeof(char *));
     
    33542994
    33552995
    3356 /**
    3357  * Creates a memory buffer for a text file.
    3358  * @returns   Pointer to file memoryblock. NULL on error.
    3359  * @param     pszFilename  Pointer to filename string.
    3360  * @remark    This function is the one using most of the execution
    3361  *            time (DosRead + DosOpen) - about 70% of the execution time!
    3362  */
    3363 void *textbufferCreate(const char *pszFilename)
    3364 {
    3365     void *pvFile = NULL;
    3366     FILE *phFile;
    3367 
    3368     phFile = fopen(pszFilename, "rb");
    3369     if (phFile != NULL)
    3370     {
    3371         signed long cbFile = fsize(phFile);
    3372         if (cbFile >= 0)
    3373         {
    3374             pvFile = malloc(cbFile + 1);
    3375             if (pvFile != NULL)
    3376             {
    3377                 memset(pvFile, 0, cbFile + 1);
    3378                 if (cbFile > 0 && fread(pvFile, 1, cbFile, phFile) == 0)
    3379                 {   /* failed! */
    3380                     free(pvFile);
    3381                     pvFile = NULL;
    3382                 }
    3383             }
    3384             else
    3385                 fprintf(stderr, "warning/error: failed to open file %s\n", pszFilename);
    3386         }
    3387         fclose(phFile);
    3388     }
    3389     return pvFile;
    3390 }
    3391 
    3392 
    3393 /**
    3394  * Destroys a text textbuffer.
    3395  * @param     pvBuffer   Buffer handle.
    3396  */
    3397 void textbufferDestroy(void *pvBuffer)
    3398 {
    3399     free(pvBuffer);
    3400 }
    3401 
    3402 
    3403 /**
    3404  * Gets the next line from an textbuffer.
    3405  * @returns   Pointer to the next line.
    3406  * @param     pvBuffer  Buffer handle.
    3407  * @param     psz       Pointer to current line.
    3408  *                      NULL is passed in to get the first line.
    3409  */
    3410 char *textbufferNextLine(void *pvBuffer, register char *psz)
    3411 {
    3412     register char ch;
    3413 
    3414     /* if first line psz is NULL. */
    3415     if (psz == NULL)
    3416         return (char*)pvBuffer;
    3417 
    3418     /* skip till end of file or end of line. */
    3419     ch = *psz;
    3420     while (ch != '\0' && ch != '\n' && ch != '\r')
    3421         ch = *++psz;
    3422 
    3423     /* skip line end */
    3424     if (ch == '\r')
    3425         ch = *++psz;
    3426     if (ch == '\n')
    3427         psz++;
    3428 
    3429     return psz;
    3430 }
    3431 
    3432 
    3433 /**
    3434  * Gets the next line from an textbuffer.
    3435  * (fgets for textbuffer)
    3436  * @returns   Pointer to pszOutBuffer. NULL when end of file.
    3437  * @param     pvBuffer  Buffer handle.
    3438  * @param     ppv       Pointer to a buffer index pointer. (holds the current buffer index)
    3439  *                      Pointer to a null pointer is passed in to get the first line.
    3440  * @param     pszLineBuffer  Output line buffer. (!= NULL)
    3441  * @param     cchLineBuffer  Size of the output line buffer. (> 0)
    3442  * @remark    '\n' and '\r' are removed!
    3443  */
    3444 char *textbufferGetNextLine(void *pvBuffer, void **ppv, char *pszLineBuffer, int cchLineBuffer)
    3445 {
    3446     char *          pszLine = pszLineBuffer;
    3447     char *          psz = *(char**)(void*)ppv;
    3448     register char   ch;
    3449 
    3450     /* first line? */
    3451     if (psz == NULL)
    3452         psz = (char*)pvBuffer;
    3453 
    3454     /* Copy to end of the line or end of the linebuffer. */
    3455     ch = *psz;
    3456     cchLineBuffer--; /* reserve space for '\0' */
    3457     while (cchLineBuffer > 0 && ch != '\0' && ch != '\n' && ch != '\r')
    3458     {
    3459         *pszLine++ = ch;
    3460         ch = *++psz;
    3461     }
    3462     *pszLine = '\0';
    3463 
    3464     /* skip line end */
    3465     if (ch == '\r')
    3466         ch = *++psz;
    3467     if (ch == '\n')
    3468         psz++;
    3469 
    3470     /* check if position has changed - if unchanged it's the end of file! */
    3471     if (*ppv == (void*)psz)
    3472         pszLineBuffer = NULL;
    3473 
    3474     /* store current position */
    3475     *ppv = (void*)psz;
    3476 
    3477     return pszLineBuffer;
    3478 }
    3479 
    3480 
    3481 /**
    3482  * Find the size of a file.
    3483  * @returns   Size of file. -1 on error.
    3484  * @param     phFile  File handle.
    3485  */
    3486 signed long fsize(FILE *phFile)
    3487 {
    3488     int ipos;
    3489     signed long cb;
    3490 
    3491     if ((ipos = ftell(phFile)) < 0
    3492         ||
    3493         fseek(phFile, 0, SEEK_END) != 0
    3494         ||
    3495         (cb = ftell(phFile)) < 0
    3496         ||
    3497         fseek(phFile, ipos, SEEK_SET) != 0
    3498         )
    3499         cb = -1;
    3500     return cb;
    3501 }
    3502 
    3503 
    3504 /**
    3505  * Copies the name part with out extention into pszBuffer and returns
    3506  * a pointer to the buffer.
    3507  * If no name is found "" is returned.
    3508  * @returns   Pointer to pszBuffer with path.
    3509  * @param     pszFilename  Pointer to readonly filename.
    3510  * @param     pszBuffer    Pointer to output Buffer.
    3511  * @status    completely implemented.
    3512  * @author    knut st. osmundsen
    3513  */
    3514 char *fileNameNoExt(const char *pszFilename, char *pszBuffer)
    3515 {
    3516     char *psz = strrchr(pszFilename, '\\');
    3517     if (psz == NULL)
    3518         psz = strrchr(pszFilename, '/');
    3519 
    3520     strcpy(pszBuffer, psz == NULL ? pszFilename : psz + 1);
    3521 
    3522     psz = strrchr(pszBuffer, '.');
    3523     if (psz > pszBuffer) /* an extetion on it's own (.depend) is a filename not an extetion! */
    3524         *psz = '\0';
    3525 
    3526     return pszBuffer;
    3527 }
    3528 
     2996
     2997
  • trunk/tools/database/StateUpd.h

    r6677 r6678  
    1 /* $Id: StateUpd.h,v 1.6 2001-09-07 10:24:06 bird Exp $ */
     1/* $Id: StateUpd.h,v 1.7 2001-09-07 10:33:10 bird Exp $ */
    22/*
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    1919    BOOL        fIntegrityAfter;        /* ie  */
    2020    BOOL        fIntegrityOnly;         /* io  */
    21     BOOL        fRecursive;             /* s  */
     21    BOOL        fRecursive;             /* s   */
    2222    BOOL        fOld;                   /* Old */
    23     BOOL        fOS2;                   /* Ignore OS2 prefixes. */
    24     BOOL        fCOMCTL32;              /* Ignore COMCTL32 prefixes. */
    25     BOOL        fVERSION;               /* Ignore VERSION prefixes. */
    26     char *      pszModName;             /* Name of the module being processed. */
    27     char        chModType;              /* Type of module being processed. */
    28     signed long lModRefcode;            /* Database reference code of the module. */
     23    BOOL        fOS2;                   /* Ignore OS2 prefixes */
     24    BOOL        fCOMCTL32;              /* Ignore COMCTL32 prefixes */
     25    BOOL        fVERSION;               /* Ignore VERSION prefixes */
     26    char *      pszDLLName;             /* Name of the dll being processed */
     27    signed long lDllRefcode;            /* Database reference code of the dll */
    2928    signed long lFileRefcode;           /* File reference code. */
    30     char **     papszDirs;              /* Pointer to NULL terminated array of directories*/
    31                                         /* to be searched when .obj files are specified. */
     29    signed long lSeqFile;               /* Design note file sequence number. */
    3230} OPTIONS, *POPTIONS;
    3331
  • trunk/tools/database/db.cpp

    r6677 r6678  
    1 /* $Id: db.cpp,v 1.26 2001-09-07 10:24:07 bird Exp $ *
     1/* $Id: db.cpp,v 1.27 2001-09-07 10:31:44 bird Exp $ *
    22 *
    33 * DB - contains all database routines.
     
    154154
    155155/**
    156  * Gets the refid for the give mod name.
    157  * @returns Module refid. -1 on error.
    158  * @param   pszModName      Module name.
    159  */
    160 signed long _System dbGetModule(const char *pszModName)
     156 * Gets the refid for the give dll name.
     157 * @returns   Dll refid. -1 on error.
     158 * @param     pszDllName  Dll name.
     159 */
     160signed long _System dbGetDll(const char *pszDllName)
    161161{
    162162    int         rc;
     
    164164    MYSQL_RES * pres;
    165165
    166     sprintf(&szQuery[0], "SELECT refcode FROM module WHERE name = '%s'\n", pszModName);
     166    sprintf(&szQuery[0], "SELECT refcode FROM dll WHERE name = '%s'\n", pszDllName);
    167167    rc   = mysql_query(pmysql, &szQuery[0]);
    168168    pres = mysql_store_result(pmysql);
     
    178178
    179179/**
    180  * Count the function in a given module.
    181  * @returns Number of functions. -1 on error.
    182  * @param   lModule         Module refcode.
    183  * @param   fNotAliases     TRUE: don't count aliased functions.
    184  */
    185 signed long     _System dbCountFunctionInModule(signed long lModule, BOOL fNotAliases)
     180 * Count the function in a given dll.
     181 * @returns  Number of functions. -1 on error.
     182 * @param    lDll         Dll refcode.
     183 * @param    fNotAliases  TRUE: don't count aliased functions.
     184 */
     185signed long     _System dbCountFunctionInDll(signed long lDll, BOOL fNotAliases)
    186186{
    187187    signed long rc;
     
    189189    MYSQL_RES * pres;
    190190
    191     if (lModule >= 0)
    192     {
    193         sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE module = %ld\n", lModule);
     191    if (lDll >= 0)
     192    {
     193        sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE dll = %ld\n", lDll);
    194194        if (fNotAliases)
    195195            strcat(&szQuery[0], " AND aliasfn < 0");
     
    211211
    212212/**
    213  * Checks if module exists. If not exists the module is inserted.
    214  * @returns Module refcode. -1 on errors.
    215  * @param   pszModule   Module name.
    216  * @param   fchType     Module type.
    217  * @remark  This search must be case insensitive.
    218  *          (In the mysql-world everything is case insensitive!)
    219  */
    220 signed long _System dbCheckInsertModule(const char *pszModule, char fchType)
     213 * Checks if dll exists. If not exists the dll is inserted.
     214 * @returns   Dll refcode. -1 on errors.
     215 * @param     pszDll  Dll name.
     216 * @remark    This search must be case insensitive.
     217 *            (In the mysql-world everything is case insensitive!)
     218 */
     219signed long _System dbCheckInsertDll(const char *pszDll, char fchType)
    221220{
    222221    int         rc;
     
    225224
    226225    /* try find match */
    227     sprintf(&szQuery[0], "SELECT refcode, name FROM module WHERE name = '%s'\n", pszModule);
     226    sprintf(&szQuery[0], "SELECT refcode, name FROM dll WHERE name = '%s'\n", pszDll);
    228227    rc   = mysql_query(pmysql, &szQuery[0]);
    229228    pres = mysql_store_result(pmysql);
    230229
    231     /* not found? - insert module */
     230    /* not found? - insert dll */
    232231    if (rc < 0 || pres == NULL || mysql_num_rows(pres) == 0)
    233232    {
    234233        mysql_free_result(pres);
    235234
    236         sprintf(&szQuery[0], "INSERT INTO module(name, type) VALUES('%s', '%c')\n", pszModule, fchType);
     235        sprintf(&szQuery[0], "INSERT INTO dll(name, type) VALUES('%s', '%c')\n", pszDll, fchType);
    237236        rc = mysql_query(pmysql, &szQuery[0]);
    238237        if (rc < 0)
     
    240239
    241240        /* select row to get refcode */
    242         sprintf(&szQuery[0], "SELECT refcode, name FROM module WHERE name = '%s'\n", pszModule);
     241        sprintf(&szQuery[0], "SELECT refcode, name FROM dll WHERE name = '%s'\n", pszDll);
    243242        rc   = mysql_query(pmysql, &szQuery[0]);
    244243        pres = mysql_store_result(pmysql);
     
    291290 * The update flags is always updated.
    292291 * @returns     Success indicator. TRUE / FALSE.
    293  * @param       lModule             Module refcode.
     292 * @param       lDll                Dll refcode.
    294293 * @param       pszFunction         Function name.
    295294 * @param       pszIntFunction      Internal function name. (required!)
     
    298297 * @param       fchType             Function type flag. One of the FUNCTION_* defines.
    299298 */
    300 BOOL _System dbInsertUpdateFunction(signed long lModule,
     299BOOL _System dbInsertUpdateFunction(signed long lDll,
    301300                                    const char *pszFunction, const char *pszIntFunction,
    302301                                    unsigned long ulOrdinal, BOOL fIgnoreOrdinal, char fchType)
     
    313312
    314313    /* try find function */
    315     sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE module = %d AND name = '%s'", lModule, pszFunction);
     314    sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE dll = %d AND name = '%s'", lDll, pszFunction);
    316315    rc = mysql_query(pmysql, pszQuery);
    317316    pres = mysql_store_result(pmysql);
     
    323322        if (mysql_num_rows(pres) > 1)
    324323        {
    325             fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same module. "
    326                     "lModule = %d, pszFunction = %s\n", __FUNCTION__, lModule, pszFunction);
     324            fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same dll. "
     325                    "lDll = %d, pszFunction = %s\n", __FUNCTION__, lDll, pszFunction);
    327326            return FALSE;
    328327        }
     
    348347         * Insert it.
    349348         */
    350         sprintf(&szQuery[0], "INSERT INTO function(module, name, intname, ordinal, updated, type) VALUES(%d, '%s', '%s', %ld, 1, '%c')",
    351                 lModule, pszFunction, pszIntFunction, ulOrdinal, fchType);
     349        sprintf(&szQuery[0], "INSERT INTO function(dll, name, intname, ordinal, updated, type) VALUES(%d, '%s', '%s', %ld, 1, '%c')",
     350                lDll, pszFunction, pszIntFunction, ulOrdinal, fchType);
    352351        rc = mysql_query(pmysql, &szQuery[0]);
    353352    }
     
    361360 * Inserts or updates (existing) file information.
    362361 * @returns     Success indicator (TRUE / FALSE).
    363  * @param       lModule         Module reference code.
     362 * @param       lDll           Dll reference code.
    364363 * @param       pszFilename     Filename.
    365364 * @param       pszDescription  Pointer to file description.
     
    370369 * @remark
    371370 */
    372 BOOL            _System dbInsertUpdateFile(signed long lModule,
     371BOOL            _System dbInsertUpdateFile(signed long lDll,
    373372                                           const char *pszFilename,
    374373                                           const char *pszDescription,
     
    383382
    384383    /* parameter assertions */
    385     assert(lModule != 0);
     384    assert(lDll != 0);
    386385    assert(pszFilename != NULL);
    387386    assert(*pszFilename != '\0');
    388387
    389388    /* try find file */
    390     sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE module = %d AND name = '%s'", lModule, pszFilename);
     389    sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE dll = %d AND name = '%s'", lDll, pszFilename);
    391390    rc = mysql_query(pmysql, &szQuery[0]);
    392391    pres = mysql_store_result(pmysql);
     
    396395        if (mysql_num_rows(pres) > 1)
    397396        {
    398             fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same module. "
    399                     "lModule = %d, pszFilename = %s\n", __FUNCTION__, lModule, pszFilename);
     397            fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same dll. "
     398                    "lDll = %d, pszFilename = %s\n", __FUNCTION__, lDll, pszFilename);
    400399            return FALSE;
    401400        }
     
    451450    else
    452451    {   /* insert */
    453         sprintf(&szQuery[0], "INSERT INTO file(module, name, lastauthor, description, lastdatetime, revision) VALUES(%d, '%s', %ld, ",
    454                 lModule, pszFilename, lLastAuthor);
     452        sprintf(&szQuery[0], "INSERT INTO file(dll, name, lastauthor, description, lastdatetime, revision) VALUES(%d, '%s', %ld, ",
     453                lDll, pszFilename, lLastAuthor);
    455454        if (pszDescription != NULL && *pszDescription != '\0')
    456455            sqlstrcat(&szQuery[0], NULL, pszDescription);
     
    525524 * @param     pszFunctionName   Pointer to a function name string. (input)
    526525 * @param     pFnFindBuf        Pointer to a find buffer. (output)
    527  * @param     lModule           Module refcode (optional). If given the search is limited to
    528  *                              the given module and aliasing functions is updated (slow!).
    529  * @sketch    1) Get functions for this module(if given).
     526 * @param     lDll              Dll refcode (optional). If given the search is limited to
     527 *                              the given dll and aliasing functions is updated (slow!).
     528 * @sketch    1) Get functions for this dll(if given).
    530529 *            2) Get functions which aliases the functions found in (1).
    531530 *            3) Get new aliases by intname
     
    534533 *            6) Update all functions from (3) and (4) to alias the first function from 1.
    535534 */
    536 BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf, signed long lModule)
     535BOOL _System dbFindFunction(const char *pszFunctionName, PFNFINDBUF pFnFindBuf, signed long lDll)
    537536{
    538537    MYSQL_RES   *pres;
     
    542541
    543542    /*
    544      * 1) Get functions for this module(if given).
     543     * 1) Get functions for this dll(if given).
    545544     */
    546     if (lModule < 0)
    547         sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file, name, type FROM function WHERE intname = '%s'",
     545    if (lDll < 0)
     546        sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function WHERE intname = '%s'",
    548547                pszFunctionName);
    549548    else
    550         sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file, name, type FROM function "
    551                 "WHERE intname = '%s' AND module = %ld",
    552                 pszFunctionName, lModule);
     549        sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function "
     550                "WHERE intname = '%s' AND dll = %ld",
     551                pszFunctionName, lDll);
    553552
    554553    rc = mysql_query1(pmysql, &szQuery[0]);
     
    559558        {
    560559            char szFnName[NBR_FUNCTIONS][80];
    561             BOOL fAPI = FALSE;
    562560
    563561            pFnFindBuf->cFns = 0;
     
    565563            {
    566564                pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]);
    567                 pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]);
     565                pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]);
    568566                pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]);
    569567                pFnFindBuf->alFileRefCode[pFnFindBuf->cFns] = atol(row[3]);
    570568                strcpy(szFnName[pFnFindBuf->cFns], row[4]);
    571                 pFnFindBuf->achType[pFnFindBuf->cFns] = *row[5];
    572                 if (pFnFindBuf->achType[pFnFindBuf->cFns] == FUNCTION_ODIN32_API ||
    573                     pFnFindBuf->achType[pFnFindBuf->cFns] == FUNCTION_INTERNAL_ODIN32_API)
    574                     fAPI = TRUE;
    575569
    576570                /* next */
     
    579573            mysql_free_result(pres);
    580574
    581             /* alias check and fix for apis. */
    582             if (fAPI && lModule >= 0 && pFnFindBuf->cFns != 0)
     575            /* alias check and fix */
     576            if (lDll >= 0 && pFnFindBuf->cFns != 0)
    583577            {
    584                 int cFnsThisModule, cFnsAliasesAndThisModule, i, f;
     578                int cFnsThisDll, cFnsAliasesAndThisDll, i, f;
    585579
    586580                /*
    587581                 * 2) Get functions which aliases the functions found in (1).
    588582                 */
    589                 cFnsThisModule = (int)pFnFindBuf->cFns;
    590                 strcpy(&szQuery[0], "SELECT refcode, module, aliasfn, file, name FROM function WHERE aliasfn IN (");
    591                 for (i = 0; i < cFnsThisModule; i++)
     583                cFnsThisDll = (int)pFnFindBuf->cFns;
     584                strcpy(&szQuery[0], "SELECT refcode, dll, aliasfn, file, name FROM function WHERE aliasfn IN (");
     585                for (i = 0; i < cFnsThisDll; i++)
    592586                {
    593587                    if (i > 0)  strcat(&szQuery[0], " OR ");
     
    605599                        {
    606600                            pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]);
    607                             pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]);
     601                            pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]);
    608602                            pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]);
    609603                            pFnFindBuf->alFileRefCode[pFnFindBuf->cFns] = atol(row[3]);
     
    618612                         * 3) Get new aliases by intname
    619613                         */
    620                         cFnsAliasesAndThisModule = (int)pFnFindBuf->cFns;
    621                         sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file FROM function "
    622                                              "WHERE aliasfn = (-1) AND module <> %ld AND (intname = '%s'",
    623                                 lModule, pszFunctionName);
    624                         for (i = 0; i < cFnsAliasesAndThisModule; i++)
     614                        cFnsAliasesAndThisDll = (int)pFnFindBuf->cFns;
     615                        sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file FROM function "
     616                                             "WHERE aliasfn = (-1) AND dll <> %ld AND (intname = '%s'",
     617                                lDll, pszFunctionName);
     618                        for (i = 0; i < cFnsAliasesAndThisDll; i++)
    625619                            sprintf(&szQuery[strlen(&szQuery[0])], " OR intname = '%s'", szFnName[i]);
    626620                        strcat(&szQuery[0], ")");
     
    635629                                {
    636630                                    pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]);
    637                                     pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]);
     631                                    pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]);
    638632                                    if (row[2] != NULL)
    639633                                        pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]);
     
    651645                                 * 4) Get new aliases by name
    652646                                 */
    653                                 sprintf(&szQuery[0], "SELECT refcode, module, aliasfn, file FROM function "
    654                                                      "WHERE aliasfn = (-1) AND module <> %ld AND (name = '%s'",
    655                                         lModule, pszFunctionName);
    656                                 for (i = 0; i < cFnsAliasesAndThisModule; i++)
     647                                sprintf(&szQuery[0], "SELECT refcode, dll, aliasfn, file FROM function "
     648                                                     "WHERE aliasfn = (-1) AND dll <> %ld AND (name = '%s'",
     649                                        lDll, pszFunctionName);
     650                                for (i = 0; i < cFnsAliasesAndThisDll; i++)
    657651                                    sprintf(&szQuery[strlen(&szQuery[0])], " OR name = '%s'", szFnName[i]);
    658652                                strcat(&szQuery[0], ")");
     
    667661                                        {
    668662                                            pFnFindBuf->alRefCode[pFnFindBuf->cFns] = atol(row[0]);
    669                                             pFnFindBuf->alModRefCode[pFnFindBuf->cFns] = atol(row[1]);
     663                                            pFnFindBuf->alDllRefCode[pFnFindBuf->cFns] = atol(row[1]);
    670664                                            if (row[2] != NULL)
    671665                                                pFnFindBuf->alAliasFn[pFnFindBuf->cFns] = atol(row[2]);
     
    684678                                        sprintf(&szQuery[0], "UPDATE function SET aliasfn = (-2) "
    685679                                                             "WHERE refcode IN (",
    686                                                 lModule, pszFunctionName);
    687                                         for (f = 0, i = 0; i < cFnsThisModule; i++)
     680                                                lDll, pszFunctionName);
     681                                        for (f = 0, i = 0; i < cFnsThisDll; i++)
    688682                                            if (pFnFindBuf->alAliasFn[i] != ALIAS_DONTMIND)
    689683                                                sprintf(&szQuery[strlen(&szQuery[0])],
     
    694688                                        else
    695689                                            rc = 0;
    696                                         if (rc >= 0 && cFnsAliasesAndThisModule < pFnFindBuf->cFns)
     690                                        if (rc >= 0 && cFnsAliasesAndThisDll < pFnFindBuf->cFns)
    697691                                        {
    698692                                            /*
     
    702696                                                                 "WHERE aliasfn = (-1) AND refcode IN (",
    703697                                                    pFnFindBuf->alRefCode[0], pFnFindBuf->alFileRefCode[0]);
    704                                             for (i = cFnsAliasesAndThisModule; i < pFnFindBuf->cFns; i++)
     698                                            for (i = cFnsAliasesAndThisDll; i < pFnFindBuf->cFns; i++)
    705699                                            {
    706700                                                sprintf(&szQuery[strlen(&szQuery[0])],
    707                                                         i > cFnsAliasesAndThisModule ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);
     701                                                        i > cFnsAliasesAndThisDll ? ", %ld" : "%ld", pFnFindBuf->alRefCode[i]);
    708702                                            }
    709703                                            strcat(&szQuery[0], ")");
     
    728722/**
    729723 * Finds the refcode for a file (if it exists).
    730  * @returns File 'refcode'.
    731  *          -1 on error or not found.
    732  * @param   lModule         Refcode of the module which this file belongs to.
    733  * @param   pszFilename     The filename to search for.
    734  */
    735 signed long     _System dbFindFile(signed long lModule, const char *pszFilename)
     724 * @returns     File 'refcode'.
     725 *              -1 on error or not found.
     726 * @param       lDll            Refcode of the dll which this file belongs to.
     727 * @param       pszFilename     The filename to search for.
     728 */
     729signed long     _System dbFindFile(signed long lDll, const char *pszFilename)
    736730{
    737731    char        szQuery[256];
     
    739733    signed long lRefCode = -1;
    740734
    741     assert(lModule >= 0);
     735    assert(lDll >= 0);
    742736    assert(pszFilename != NULL);
    743737    assert(*pszFilename != '\0');
    744738
    745     sprintf(&szQuery[0], "SELECT refcode FROM file WHERE module = %ld AND name = '%s'",
    746             lModule, pszFilename);
     739    sprintf(&szQuery[0], "SELECT refcode FROM file WHERE dll = %ld AND name = '%s'",
     740            lDll, pszFilename);
    747741    if (mysql_query(pmysql, &szQuery[0]) >= 0)
    748742    {
     
    884878 * @returns   number of errors.
    885879 * @param     pFnDesc   Function description struct.
    886  * @param     lModule   Module which we are working at.
     880 * @param     lDll      Dll which we are working at.
    887881 * @param     pszError  Buffer for error messages
    888882 * @result    on error(s) pszError will hold information about the error(s).
    889883 */
    890 unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, signed long lModule, char *pszError)
     884unsigned long _System dbUpdateFunction(PFNDESC pFnDesc, signed long lDll, char *pszError)
    891885{
    892886    MYSQL_RES *     pres;
     
    11461140    } /* for */
    11471141
    1148     lModule = lModule;
     1142    lDll = lDll;
    11491143    free(pszQuery2);
    11501144    return ulRc;
     
    11541148/**
    11551149 * Removes all the existing design notes in the specified file.
    1156  * @returns Success indicator.
    1157  * @param   lFile       File refcode of the file to remove all design notes for.
    1158  * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1150 * @returns     Success indicator.
     1151 * @param       lFile       File refcode of the file to remove all design notes for.
     1152 * @sketch
     1153 * @status
     1154 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     1155 * @remark
    11591156 */
    11601157BOOL            _System dbRemoveDesignNotes(signed long lFile)
     
    11711168 * Adds a design note.
    11721169 * @returns     Success indicator.
    1173  * @param       lModule         Module refcode.
     1170 * @param       lDll            Dll refcode.
    11741171 * @param       lFile           File refcode.
    11751172 * @param       pszTitle        Design note title.
    11761173 * @param       pszText         Design note text.
    11771174 * @param       lLevel          Level of the note section. 0 is the design note it self.
    1178  * @param       lSeqNbr         Sequence number (in module). If 0 the use next available number.
     1175 * @param       lSeqNbr         Sequence number (in dll). If 0 the use next available number.
    11791176 * @param       lSeqNbrNote     Sequence number in note.
    11801177 * @param       lLine           Line number (1 - based!).
     
    11841181 * @param       plRefCode       Pointer to reference id of the design note. see fSubSection for more info.
    11851182 */
    1186 BOOL            _System dbAddDesignNote(signed long lModule,
     1183BOOL            _System dbAddDesignNote(signed long lDll,
    11871184                                        signed long lFile,
    11881185                                        const char *pszTitle,
     
    12001197
    12011198
    1202     assert(lModule >= 0 && lFile >= 0);
     1199    assert(lDll >= 0 && lFile >= 0);
    12031200    assert(lSeqNbrNote >= 0);
    12041201
     
    12081205    if (lSeqNbr == 0 && !fSubSection)
    12091206    {
    1210         sprintf(&szQuery[0], "SELECT MAX(seqnbr) + 1 FROM designnote WHERE module = %ld AND level = 0", lModule);
     1207        sprintf(&szQuery[0], "SELECT MAX(seqnbr) + 1 FROM designnote WHERE dll = %ld AND level = 0", lDll);
    12111208        if (mysql_query(pmysql, &szQuery[0]) >= 0)
    12121209        {
     
    12321229     */
    12331230    if (!fSubSection)
    1234         sprintf(&szQuery[0], "INSERT INTO designnote(module, file, level, seqnbrnote, seqnbr, line, name, note) "
     1231        sprintf(&szQuery[0], "INSERT INTO designnote(dll, file, level, seqnbrnote, seqnbr, line, name, note) "
    12351232                             "VALUES (%ld, %ld, %ld, %ld, %ld, %ld, ",
    1236                 lModule, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);
     1233                lDll, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);
    12371234    else
    1238         sprintf(&szQuery[0], "INSERT INTO designnote(refcode, module, file, level, seqnbrnote, seqnbr, line, name, note) "
     1235        sprintf(&szQuery[0], "INSERT INTO designnote(refcode, dll, file, level, seqnbrnote, seqnbr, line, name, note) "
    12391236                             "VALUES (%ld, %ld, %ld, %ld, %ld, %ld, %ld, ",
    1240                 *plRefCode, lModule, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);
     1237                *plRefCode, lDll, lFile, lLevel, lSeqNbrNote, lSeqNbr, lLine);
    12411238
    12421239    if (pszTitle != NULL && *pszTitle != '\0')
     
    12891286
    12901287            /* delete - all rows on this date in the history tables */
    1291             sprintf(pszQuery, "DELETE FROM historymodule WHERE date = '%s'", &szCurDt[0]);
     1288            sprintf(pszQuery, "DELETE FROM historydll WHERE date = '%s'", &szCurDt[0]);
    12921289            rc = mysql_query(pmysql, pszQuery);
    12931290            CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery));
     
    12971294            CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery));
    12981295
    1299             sprintf(pszQuery, "DELETE FROM historymoduletotal WHERE date = '%s'", &szCurDt[0]);
     1296            sprintf(pszQuery, "DELETE FROM historydlltotal WHERE date = '%s'", &szCurDt[0]);
    13001297            rc = mysql_query(pmysql, pszQuery);
    13011298            CheckLogContinue((pszError, "error removing old history rows: %s - (sql=%s) ", dbGetLastErrorDesc(), pszQuery));
     
    13051302
    13061303            /* insert new stats */
    1307             sprintf(pszQuery, "INSERT INTO historymodule(module, state, date, count, type) "
    1308                     "SELECT module, state, '%s', count(*), type FROM function GROUP BY module, state, type",
     1304            sprintf(pszQuery, "INSERT INTO historydll(dll, state, date, count) "
     1305                    "SELECT dll, state, '%s', count(*) FROM function GROUP BY dll, state",
    13091306                    &szCurDt[0]);
    13101307            rc = mysql_query(pmysql, pszQuery);
     
    13191316
    13201317            /* inserting new totals */
    1321             sprintf(pszQuery, "INSERT INTO historymoduletotal(module, date, totalcount, type) "
    1322                     "SELECT module, '%s', count(*), type FROM function GROUP BY module, type",
     1318            sprintf(pszQuery, "INSERT INTO historydlltotal(dll, date, totalcount) "
     1319                    "SELECT dll, '%s', count(*) FROM function GROUP BY dll",
    13231320                    &szCurDt[0]);
    13241321            rc = mysql_query(pmysql, pszQuery);
     
    13261323
    13271324            sprintf(pszQuery, "INSERT INTO historyapigrouptotal(apigroup, date, totalcount) "
    1328                     "SELECT apigroup, '%s', count(*) FROM function WHERE apigroup IS NOT NULL AND type = 'A' "
     1325                    "SELECT apigroup, '%s', count(*) FROM function WHERE apigroup IS NOT NULL "
    13291326                    "GROUP BY apigroup",
    13301327                    &szCurDt[0]);
     
    13721369
    13731370    /* foreign keys in function table */
    1374     strcpy(pszQuery, "SELECT refcode, module, state, apigroup, file FROM function");
     1371    strcpy(pszQuery, "SELECT refcode, dll, state, apigroup, file FROM function");
    13751372    rc = mysql_query(pmysql, pszQuery);
    13761373    if (rc >= 0)
     
    13811378            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    13821379            {
    1383                 /* check module */
    1384                 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]);
     1380                /* check dll */
     1381                sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]);
    13851382                rc = mysql_query(pmysql, pszQuery);
    1386                 CheckFKError("function/module", "Foreign key 'module' not found in the module table");
     1383                CheckFKError("function/dll", "Foreign key 'dll' not found in the dll table");
    13871384
    13881385                /* check state */
     
    14141411
    14151412    /* foreign keys in file */
    1416     strcpy(pszQuery, "SELECT refcode, module FROM file");
     1413    strcpy(pszQuery, "SELECT refcode, dll FROM file");
    14171414    rc = mysql_query(pmysql, pszQuery);
    14181415    if (rc >= 0)
     
    14231420            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    14241421            {
    1425                 /* check module */
    1426                 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]);
     1422                /* check dll */
     1423                sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]);
    14271424                rc = mysql_query(pmysql, pszQuery);
    1428                 CheckFKError("apigroup/module", "Foreign key 'module' not found in the module table");
     1425                CheckFKError("apigroup/dll", "Foreign key 'dll' not found in the dll table");
    14291426            }
    14301427            mysql_free_result(pres1);
     
    14351432
    14361433    /* foreign keys in apigroup */
    1437     strcpy(pszQuery, "SELECT refcode, module FROM apigroup");
     1434    strcpy(pszQuery, "SELECT refcode, dll FROM apigroup");
    14381435    rc = mysql_query(pmysql, pszQuery);
    14391436    if (rc >= 0)
     
    14441441            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    14451442            {
    1446                 /* check module */
    1447                 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]);
     1443                /* check dll */
     1444                sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]);
    14481445                rc = mysql_query(pmysql, pszQuery);
    1449                 CheckFKError("file/module", "Foreign key 'module' not found in the module table");
     1446                CheckFKError("file/dll", "Foreign key 'dll' not found in the dll table");
    14501447            }
    14511448            mysql_free_result(pres1);
     
    14811478        ulRc += logDbError(pszError, pszQuery);
    14821479
    1483     /* foreign keys in historymodule table */
    1484     strcpy(pszQuery, "SELECT date, module, state FROM historymodule");
     1480    /* foreign keys in historydll table */
     1481    strcpy(pszQuery, "SELECT date, dll, state FROM historydll");
    14851482    rc = mysql_query(pmysql, pszQuery);
    14861483    if (rc >= 0)
     
    14911488            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    14921489            {
    1493                 /* check module */
    1494                 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]);
     1490                /* check dll */
     1491                sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]);
    14951492                rc = mysql_query(pmysql, pszQuery);
    1496                 CheckFKError("historymodule/module", "Foreign key 'module' not found in the module table");
     1493                CheckFKError("historydll/dll", "Foreign key 'dll' not found in the dll table");
    14971494
    14981495                /* check state */
    14991496                sprintf(pszQuery, "SELECT refcode FROM state WHERE refcode = %s", row1[2]);
    15001497                rc = mysql_query(pmysql, pszQuery);
    1501                 CheckFKError("historymodule/state", "Foreign key 'state' not found in the state table");
     1498                CheckFKError("historydll/state", "Foreign key 'state' not found in the state table");
    15021499            }
    15031500            mysql_free_result(pres1);
     
    15171514            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    15181515            {
    1519                 /* check module */
     1516                /* check dll */
    15201517                sprintf(pszQuery, "SELECT refcode FROM apigroup WHERE refcode = %s", row1[1]);
    15211518                rc = mysql_query(pmysql, pszQuery);
     
    15331530        ulRc += logDbError(pszError, pszQuery);
    15341531
    1535     /* foreign keys in historymoduletotal table */
    1536     strcpy(pszQuery, "SELECT date, module FROM historymoduletotal");
     1532    /* foreign keys in historydlltotal table */
     1533    strcpy(pszQuery, "SELECT date, dll FROM historydlltotal");
    15371534    rc = mysql_query(pmysql, pszQuery);
    15381535    if (rc >= 0)
     
    15431540            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    15441541            {
    1545                 /* check module */
    1546                 sprintf(pszQuery, "SELECT refcode FROM module WHERE refcode = %s", row1[1]);
     1542                /* check dll */
     1543                sprintf(pszQuery, "SELECT refcode FROM dll WHERE refcode = %s", row1[1]);
    15471544                rc = mysql_query(pmysql, pszQuery);
    1548                 CheckFKError("historymoduletotal/module", "Foreign key 'module' not found in the module table");
     1545                CheckFKError("historydlltotal/dll", "Foreign key 'dll' not found in the dll table");
    15491546            }
    15501547            mysql_free_result(pres1);
     
    15641561            while ((row1 = mysql_fetch_row(pres1)) != NULL)
    15651562            {
    1566                 /* check module */
     1563                /* check dll */
    15671564                sprintf(pszQuery, "SELECT refcode FROM apigroup WHERE refcode = %s", row1[1]);
    15681565                rc = mysql_query(pmysql, pszQuery);
     
    18581855
    18591856/**
    1860  * Display all functions for, the given module, that is not updated.
     1857 * Display all functions for, the given dll, that is not updated.
    18611858 * @returns   TRUE / FALSE.
    1862  * @param     lModule      Module reference number.
     1859 * @param     lDll         Dll reference number.
    18631860 * @param     dbFetchCall  Callback function which will be called once for each
    18641861 *                         field for all the functions not updated.
    18651862 *                         pvUser is NULL, pszValue field value, pszFieldName the field name.
    18661863 */
    1867 BOOL _System dbGetNotUpdatedFunction(signed long lModule, DBCALLBACKFETCH dbFetchCallBack)
     1864BOOL _System dbGetNotUpdatedFunction(signed long lDll, DBCALLBACKFETCH dbFetchCallBack)
    18681865{
    18691866    BOOL        fRet = FALSE;
     
    18741871    sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last "
    18751872                         "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode "
    1876                          "     LEFT JOIN module d ON f2.module = d.refcode "
    1877                          "WHERE f1.module = %ld AND f1.updated = 0",
    1878             lModule);
     1873                         "     LEFT JOIN dll d ON f2.dll = d.refcode "
     1874                         "WHERE f1.dll = %ld AND f1.updated = 0",
     1875            lDll);
    18791876    pres = dbExecuteQuery(szQuery);
    18801877    if (pres != NULL)
     
    18921889    sprintf(&szQuery[0], "SELECT f1.name, f1.intname, f1.updated, f1.aliasfn, d.name, f2.name, f2.intname AS last "
    18931890                         "FROM function f1 LEFT OUTER JOIN function f2 ON f1.aliasfn = f2.refcode "
    1894                          "     LEFT JOIN module d ON f2.module = d.refcode "
    1895                          "WHERE f1.module = %ld AND f1.updated > 1",
    1896             lModule);
     1891                         "     LEFT JOIN dll d ON f2.dll = d.refcode "
     1892                         "WHERE f1.dll = %ld AND f1.updated > 1",
     1893            lDll);
    18971894    pres = dbExecuteQuery(szQuery);
    18981895    if (pres != NULL)
     
    19151912
    19161913/**
    1917  * Counts the function for the given MODULE which has been updated.
    1918  * @returns -1 on error, number of updated function on success.
    1919  * @param   lModule     Module reference number.
    1920  */
    1921 signed long _System dbGetNumberOfUpdatedFunction(signed long lModule)
     1914 * Counts the function for the given DLL which has been updated.
     1915 * @returns   -1 on error, number of updated function on success.
     1916 * @param     lDll         Dll reference number.
     1917 */
     1918signed long _System dbGetNumberOfUpdatedFunction(signed long lDll)
    19221919{
    19231920    int         rc;
     
    19251922    MYSQL_RES * pres;
    19261923
    1927     sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE module = (%ld) AND updated > 0\n", lModule);
     1924    sprintf(&szQuery[0], "SELECT count(*) FROM function WHERE dll = (%ld) AND updated > 0\n", lDll);
    19281925    rc   = mysql_query(pmysql, &szQuery[0]);
    19291926    pres = mysql_store_result(pmysql);
     
    19391936
    19401937/**
    1941  * Clear the update flags for all file in a module/module.
    1942  * @returns Success indicator. (TRUE / FALSE)
    1943  * @param   lModule     Module refcode.
    1944  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    1945  * @remark  Intended for use by APIImport.
    1946  */
    1947 BOOL             _System dbClearUpdateFlagFile(signed long lModule)
     1938 * Clear the update flags for all file in a dll/module.
     1939 * @returns     Success indicator. (TRUE / FALSE)
     1940 * @param       lDll    Dll refcode.
     1941 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     1942 * @remark      Intended for use by APIImport.
     1943 */
     1944BOOL             _System dbClearUpdateFlagFile(signed long lDll)
    19481945{
    19491946    int         rc;
     
    19511948
    19521949    sprintf(&szQuery[0],
    1953             "UPDATE file SET updated = 0 WHERE module = (%ld)",
    1954             lModule);
     1950            "UPDATE file SET updated = 0 WHERE dll = (%ld)",
     1951            lDll);
    19551952    rc = mysql_query(pmysql, &szQuery[0]);
    19561953    return rc == 0;
     
    19601957/**
    19611958 * Clear update flag
    1962  * @returns Success indicator.
    1963  * @param   lModule Module refcode.
    1964  * @param   fAll    All module. If false only APIs and Internal APIs are cleared
    1965  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    1966  * @remark  Intended for use by APIImport.
    1967  */
    1968 BOOL             _System dbClearUpdateFlagFunction(signed long lModule, BOOL fAll)
     1959 * @returns     Success indicator.
     1960 * @param       lDll    Dll refcode.
     1961 * @param       fAll    All dll. If false only APIs and Internal APIs are cleared
     1962 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     1963 * @remark      Intended for use by APIImport.
     1964 */
     1965BOOL             _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll)
    19691966{
    19701967    int         rc;
     
    19721969
    19731970    sprintf(&szQuery[0],
    1974             "UPDATE function SET updated = 0 WHERE module = (%ld)",
    1975             lModule);
     1971            "UPDATE function SET updated = 0 WHERE dll = (%ld)",
     1972            lDll);
    19761973    if (!fAll)
    19771974        strcat(&szQuery[0], " AND type IN ('A', 'I')");
     
    19831980
    19841981/**
    1985  * Deletes all the files in a module/module which was not found/updated.
     1982 * Deletes all the files in a dll/module which was not found/updated.
    19861983 * @returns     Success indicator.
    1987  * @param       lModule    Module refcode.
     1984 * @param       lDll    Dll refcode.
    19881985 * @sketch      Select all files which is to be deleted.
    19891986 *                  Set all references to each file in function to -1.
     
    19921989 * @remark      Use with GRATE CARE!
    19931990 */
    1994 BOOL             _System dbDeleteNotUpdatedFiles(signed long lModule)
     1991BOOL             _System dbDeleteNotUpdatedFiles(signed long lDll)
    19951992{
    19961993    MYSQL_RES * pres;
     
    20001997
    20011998    sprintf(&szQuery[0],
    2002             "SELECT refcode FROM file WHERE module = (%ld) AND updated = 0",
    2003             lModule);
     1999            "SELECT refcode FROM file WHERE dll = (%ld) AND updated = 0",
     2000            lDll);
    20042001    rc = mysql_query(pmysql, &szQuery[0]);
    20052002    pres = mysql_store_result(pmysql);
     
    20182015
    20192016    sprintf(&szQuery[0],
    2020             "DELETE FROM file WHERE module = %ld AND updated = 0",
    2021             lModule);
     2017            "DELETE FROM file WHERE dll = %ld AND updated = 0",
     2018            lDll);
    20222019    rc = mysql_query(pmysql, &szQuery[0]);
    20232020    if (rc) fRc = FALSE;
     
    20332030 *
    20342031 * @returns     Success indicator. (TRUE / FALSE)
    2035  * @param       lModule     The refcode of the module owning the functions.
    2036  * @param       fAll        All function. If FALSE then only APIs and Internal APIs.
    2037  * @sketch      Select all functions which wan't updated (ie. updated = 0 and module = lModule).
     2032 * @param       lDll    The refcode of the dll owning the functions.
     2033 * @param       fAll    All function. If FALSE then only APIs and Internal APIs.
     2034 * @sketch      Select all functions which wan't updated (ie. updated = 0 and dll = lDll).
    20382035 *              If anyone Then
    20392036 *                  Delete the referenced to the functions in:
     
    20442041 * @remark      Use with GREATE CARE!
    20452042 */
    2046 BOOL             _System dbDeleteNotUpdatedFunctions(signed long lModule, BOOL fAll)
     2043BOOL             _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll)
    20472044{
    20482045    MYSQL_RES * pres;
     
    20522049
    20532050    sprintf(&szQuery[0],
    2054             "SELECT refcode FROM function WHERE module = %ld AND updated = 0",
    2055             lModule);
     2051            "SELECT refcode FROM function WHERE dll = %ld AND updated = 0",
     2052            lDll);
    20562053    if (!fAll)
    20572054        strcat(&szQuery[0], " AND type IN ('A', 'I')");
     
    20842081        {
    20852082            sprintf(&szQuery[0],
    2086                     "DELETE FROM function WHERE module = %ld AND updated = 0",
    2087                     lModule);
     2083                    "DELETE FROM function WHERE dll = %ld AND updated = 0",
     2084                    lDll);
    20882085            if (!fAll)
    20892086                strcat(&szQuery[0], " AND type IN ('A', 'I')");
  • trunk/tools/database/db.h

    r6677 r6678  
    1 /* $Id: db.h,v 1.15 2001-09-07 10:24:07 bird Exp $ */
     1/* $Id: db.h,v 1.16 2001-09-07 10:31:44 bird Exp $ */
    22/*
    33 * DB - contains all database routines
     
    2929#define FUNCTION_ODIN32_API             'A' /* for Odin32 APIs (ie. LoadLibrary) */
    3030#define FUNCTION_INTERNAL_ODIN32_API    'I' /* for Internal/Additional Odin32 APIs (ie. RegisterLxExe) */
    31 #define FUNCTION_OTHER                  'F' /* for all other functions (ie. OSLibInitWSeBFileIO) */
    32 #define FUNCTION_METHOD                 'M'
    33 #define FUNCTION_OPERATOR               'O'
    34 #define FUNCTION_CONSTRUCTOR            'C'
    35 #define FUNCTION_DESTRUCTOR             'D'
     31#define FUNCTION_OTHER                  'O' /* for all other functions (ie. OSLibInitWSeBFileIO) */
    3632
    3733/* type flags of dll */
     
    5349        /* function name and type */
    5450        char *      pszName;
    55         char *      pszClass;
    56         char        fchType;            /* function type. */
    5751        char *      pszReturnType;
    5852        long        cRefCodes;
     
    9589        unsigned long   cFns;
    9690        signed long     alRefCode[NBR_FUNCTIONS];
    97         signed long     alModRefCode[NBR_FUNCTIONS];
     91        signed long     alDllRefCode[NBR_FUNCTIONS];
    9892        signed long     alAliasFn[NBR_FUNCTIONS];     /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to function. */
    9993        signed long     alFileRefCode[NBR_FUNCTIONS]; /* -1 is SQL-NULL, -2 is "do not mind", >= 0 ref to file. */
    100         char            achType[NBR_FUNCTIONS];
    10194    } FNFINDBUF, *PFNFINDBUF;
    10295
     
    113106                                       const char *pszDatabase);
    114107    BOOL             _System dbDisconnect();
    115     signed long      _System dbGetModule(const char *pszModName);
    116     signed long      _System dbCountFunctionInModule(signed long lModule,
    117                                                      BOOL fNotAliases);
    118     //signed long      _System dbCheckInsertDll(const char *pszDll, char fchType);
    119     signed long      _System dbCheckInsertModule(const char *pszModule, char fchType);
     108    signed long      _System dbGetDll(const char *pszDllName);
     109    signed long      _System dbCountFunctionInDll(signed long ulDll,
     110                                                  BOOL fNotAliases);
     111    signed long      _System dbCheckInsertDll(const char *pszDll, char fchType);
    120112    unsigned short   _System dbGet(const char *pszTable,
    121113                                   const char *pszGetColumn,
    122114                                   const char *pszMatch1,
    123115                                   const char *pszMatchValue1);
    124     BOOL             _System dbInsertUpdateFunction(signed long lModule,
     116    BOOL             _System dbInsertUpdateFunction(signed long lDll,
    125117                                                    const char *pszFunction,
    126118                                                    const char *pszIntFunction,
     
    128120                                                    BOOL fIgnoreOrdinal,
    129121                                                    char fchType);
    130     BOOL             _System dbInsertUpdateFile(signed long lModule,
     122    BOOL             _System dbInsertUpdateFile(signed long lDll,
    131123                                                const char *pszFilename,
    132124                                                const char *pszDescription,
     
    136128    BOOL             _System dbFindFunction(const char *pszFunctionName,
    137129                                            PFNFINDBUF pFnFindBuf,
    138                                             signed long lModule);
    139     signed long      _System dbFindFile(signed long lModule, const char *pszFilename);
     130                                            signed long lDll);
     131    signed long      _System dbFindFile(signed long lDll, const char *pszFilename);
    140132    signed long      _System dbFindAuthor(const char *pszAuthor, const char *pszEmail);
    141133    signed long      _System dbGetFunctionState(signed long lRefCode);
    142134    unsigned long    _System dbUpdateFunction(PFNDESC pFnDesc,
    143                                               signed long lModule,
     135                                              signed long lDll,
    144136                                              char *pszError);
    145137    BOOL             _System dbRemoveDesignNotes(signed long lFile);
    146     BOOL             _System dbAddDesignNote(signed long lModule,
     138    BOOL             _System dbAddDesignNote(signed long lDll,
    147139                                             signed long lFile,
    148140                                             const char *pszTitle,
     
    168160                                                    char *pszDate);
    169161    /* StateUpd stuff */
    170     BOOL             _System dbGetNotUpdatedFunction(signed long lModule,
     162    BOOL             _System dbGetNotUpdatedFunction(signed long lDll,
    171163                                                     DBCALLBACKFETCH dbFetchCallBack);
    172     signed long      _System dbGetNumberOfUpdatedFunction(signed long lModule);
     164    signed long      _System dbGetNumberOfUpdatedFunction(signed long lDll);
    173165
    174166    /* APIImport stuff */
    175     BOOL             _System dbClearUpdateFlagFile(signed long lModule);
    176     BOOL             _System dbClearUpdateFlagFunction(signed long lModule, BOOL fAll);
    177     BOOL             _System dbDeleteNotUpdatedFiles(signed long lModule);
    178     BOOL             _System dbDeleteNotUpdatedFunctions(signed long lModule, BOOL fAll);
     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);
    179171
    180172#ifdef __cplusplus
  • trunk/tools/database/www/Odin32DB.phtml

    r6677 r6678  
    3131 * What are we up to? We'll parse the input parameter (if any) to find out.
    3232 */
    33 if (isset($modrefcode))
    34 {   /* Modules by refcode */
    35     $sCategory      = "module";
    36     $sCategoryName  = "Module";
    37     if ($modrefcode != "")
    38         $iRefcode = (int)$modrefcode;
     33if (isset($dllrefcode))
     34{   /* DLLs by refcode */
     35    $sCategory      = "dll";
     36    $sCategoryName  = "Dll";
     37    if ($dllrefcode != "")
     38        $iRefcode = (int)$dllrefcode;
    3939    $fFunctions = (isset($fFunctions)   && $fFunctions  != '0');
    4040    $fFiles     = (isset($fFiles)       && $fFiles      != '0');
     
    7878    if ($authorrefcode != "")
    7979        $iRefcode = (int)$authorrefcode;
    80     $fModules   = (isset($fModules)     && $fModules    != '0');
     80    $fDlls      = (isset($fDlls)        && $fDlls  != '0');
    8181    $fFunctions = (isset($fFunctions)   && $fFunctions  != '0');
    8282    $fFiles     = (isset($fFiles)       && $fFiles      != '0');
    8383    $fAPIGroups = (isset($fAPIGroups)   && $fAPIGroups  != '0');
    8484    $fSortByState=(isset($fSortByState) && $fSortByState!= '0');
    85     if (!(isset($authormod) && $authormod != "" && @(int)$authormod >= 0))
    86         $authormod = -1;
     85    if (!(isset($authordll) && $authordll != "" && @(int)$authordll >= 0))
     86        $authordll = -1;
    8787}
    8888else if (isset($designnoterefcode))
     
    9595else if (isset($dlls))
    9696{   /* All dlls */
    97     $sCategory      = "modules";
     97    $sCategory      = "dlls";
    9898    $sCategoryName  = "All Dlls";
    99     $sModType = 'A';
     99    $sDllType = 'A';
    100100}
    101101else if (isset($internal))
    102 {   /* All Internal Modules */
    103     $sCategory      = "modules";
     102{   /* All Internal Dlls */
     103    $sCategory      = "dlls";
    104104    $sCategoryName  = "Internal Dlls";
    105     $sModType = 'I';
     105    $sDllType = 'I';
    106106}
    107107else if (isset($support))
    108 {   /* All Suppors Stuff */
    109     $sCategory      = "modules";
     108{   /* All dlls */
     109    $sCategory      = "dlls";
    110110    $sCategoryName  = "Support Stuff";
    111     $sModType = 'S';
     111    $sDllType = 'S';
    112112}
    113113else if (isset($tools))
    114114{   /* Tools */
    115     $sCategory      = "modules";
     115    $sCategory      = "dlls";
    116116    $sCategoryName  = "Tools";
    117     $sModType = 'T';
     117    $sDllType = 'T';
    118118}
    119119else if (isset($apigroups))
     
    179179    switch ($sCategory)
    180180    {
    181         case "module":
    182         {
    183             Odin32DBModuleInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState);
     181        case "dll":
     182        {
     183            Odin32DBDllInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState);
    184184            break;
    185185        }
     
    205205        case "author":
    206206        {
    207             Odin32DBAuthorInfo($db, $iRefcode, $fModules, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authormod);
     207            Odin32DBAuthorInfo($db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $authordll);
    208208            break;
    209209        }
     
    249249        }
    250250
    251         case "modules":
     251        case "dlls":
    252252        {
    253253            /*
    254              * List all modules.
     254             * List all dlls.
    255255             */
    256256            Odin32DBNavigationTop("","");
     
    269269                   "    COUNT(f.refcode)    AS functions\n".
    270270                   "FROM\n".
    271                    "    module d\n".
     271                   "    dll d\n".
    272272                   "    LEFT OUTER JOIN function f\n".
    273                    "    ON f.module = d.refcode\n".
     273                   "    ON f.dll = d.refcode\n".
    274274                   "WHERE\n".
    275                    "    d.type = '".$sModuleType."'\n".
     275                   "    d.type = '".$sDllType."'\n".
    276276                   "GROUP BY d.refcode\n".
    277277                   "ORDER BY d.name\n";
     
    283283                {
    284284                    echo "\n<font size=-1><ul><b>";
    285                     while ($aModule = mysql_fetch_array($result))
     285                    while ($aDll = mysql_fetch_array($result))
    286286                    {
    287                         echo "<li><a href=\"Odin32DB.phtml?modrefcode=".$aModule["refcode"].
    288                              "\">".$aModule["name"]."</a> (".$aModule["functions"].")\n";
     287                        echo "<li><a href=\"Odin32DB.phtml?dllrefcode=".$aDll["refcode"].
     288                             "\">".$aDll["name"]."</a> (".$aDll["functions"].")\n";
    289289                    }
    290290                    echo "</b></ul></font>\n";
     
    324324            {
    325325                if (mysql_num_rows($result) <= 0)
    326                     echo "<i>No Authors!</i>\n";
     326                    echo "<i>No dlls!</i>\n";
    327327                else
    328328                {
     
    371371            {
    372372                if (mysql_num_rows($result) <= 0)
    373                     echo "<i>No Apigroups!</i>\n";
     373                    echo "<i>No dlls!</i>\n";
    374374                else
    375375                {
     
    409409                   "    dn.seqnbr           AS seqnbr,\n".
    410410                   "    dn.level            AS level,\n".
    411                    "    m.name              AS modname,\n".
     411                   "    d.name              AS dllname,\n".
    412412                   "    f.name              AS filename\n".
    413413                   "FROM\n".
    414414                   "    designnote dn,\n".
    415                    "    module m,\n".
     415                   "    dll d,\n".
    416416                   "    file f\n".
    417                    "WHERE   dn.module = d.refcode\n".
     417                   "WHERE   dn.dll = d.refcode\n".
    418418                   "    AND dn.file = f.refcode\n".
    419419                   "    AND dn.level <= 1\n".
    420                    "ORDER BY m.name, dn.seqnbr, dn.seqnbrnote\n";
     420                   "ORDER BY d.name, dn.seqnbr, dn.seqnbrnote\n";
    421421            if ($result = mysql_query($sql, $db))
    422422            {
  • trunk/tools/database/www/Odin32DBHelpers.php3

    r6677 r6678  
    113113
    114114/**
    115  * Compute completion percentage for a module.
     115 * Compute completion percentage for a dll.
    116116 * @returns     Completion percentage. Range 0-100.
    117117 *              On error -1 or -2 is returned.
    118  * @param       $iModule    Module reference code.
    119  * @param       $db         Database connection variable.
    120  * @sketch      Get total number of function in the module.
    121  *              Get number of completed functions in the module.
     118 * @param       $iDll  Dll reference code.
     119 * @param       $db     Database connection variable.
     120 * @sketch      Get total number of function in the dll.
     121 *              Get number of completed functions in the dll.
    122122 *              return complete*100 / total
    123123 * @status      Completely implemented
     
    125125 * @remark
    126126 */
    127 function Odin32DBComputeCompletion($iModule, $db)
    128 {
    129     /*
    130      * Count the total number of functions in the module.
     127function Odin32DBComputeCompletion($iDll, $db)
     128{
     129    /*
     130     * Count the total number of functions in the DLL.
    131131     */
    132132    $sql = sprintf("SELECT  SUM(s.weight)/COUNT(f.state)
     
    136136                        WHERE
    137137                            f.state = s.refcode
    138                             AND module = %d",
    139                         $iModule);
     138                            AND dll = %d",
     139                        $iDll);
    140140    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1)
    141141    {
     
    165165
    166166/**
    167  * Draws a completion bar for a module (or all modules.).
    168  * @param       $iModule    Module reference code.
     167 * Draws a completion bar for a dll (or all dlls).
     168 * @param       $iDll       Dll reference code.
    169169 *                          If < 0 then for the entire project.
    170  * @param       $iModName   Module name.
     170 * @param       $iDllName   Dll name.
    171171 * @param       $db         Database connection variable.
    172172 * @sketch      Call Odin32DBCompletionBar2 with an appropriate condition.
     
    174174 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    175175 */
    176 function Odin32DBCompletionBarModule($iModule, $sModName, $db)
    177 {
    178     if ($iModule < 0)
    179         return Odin32DBcompletionBar2("", $sModName, $db);
    180     return Odin32DBcompletionBar2("module = ".$iModule." AND f.type IN ('A', 'I')", $sModName, $db);
     176function Odin32DBCompletionBarDll($iDll, $sDllName, $db)
     177{
     178    if ($iDll < 0)
     179        return Odin32DBcompletionBar2("", $sDllName, $db);
     180    return Odin32DBcompletionBar2("dll = ".$iDll, $sDllName, $db);
    181181}
    182182
     
    221221{
    222222    /*
    223      * Count the total number of functions for the author.
     223     * Count the total number of functions in the DLL.
    224224     */
    225225    $sql = "SELECT COUNT(*) FROM fnauthor fa JOIN function f\n".
    226            "WHERE fa.function = f.refcode AND fa.author = ".$iAuthor." AND f.type IN ('A', 'I')";
     226           "WHERE fa.function = f.refcode AND fa.author = ".$iAuthor;
    227227    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1)
    228228    {
     
    260260           "    fa.author = ".$iAuthor." AND\n".
    261261           "    fa.function = f.refcode AND\n".
    262            "    f.state = s.refcode AND\n".
    263            "    f.type IN ('A', 'I')\n".
     262           "    f.state = s.refcode\n".
    264263           "GROUP BY s.refcode\n".
    265264           "ORDER BY state\n";
     
    296295/**
    297296 * Draws a completion bar.
    298  * @param       $sCondition Where conditions.
    299  * @param       $sName      Name...
    300  * @param       $db         Database connection variable.
    301  * @sketch      Get total number of function in the selection.
     297 * @param       $iDll   Dll reference code.
     298 *                      If < 0 then for the entire project.
     299 * @param       $db     Database connection variable.
     300 * @sketch      Get total number of function in the dll.
    302301 *              Get the number of function per status. (+state color)
    303302 *              Draw bar.
     
    308307{
    309308    /*
    310      * Count the total number of functions in selection.
     309     * Count the total number of functions in the DLL.
    311310     */
    312311    $sql = "SELECT COUNT(*) FROM function f";
     
    392391{
    393392    /*
    394      * Select the states.
    395      */
    396     $sql = "SELECT name,
    397                    color
    398             FROM   state
    399             ORDER BY refcode";
     393     * Count the total number of functions in the DLL.
     394     */
     395    $sql = "SELECT
     396                    name,
     397                    color
     398                FROM
     399                    state
     400                ORDER BY refcode";
    400401    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) < 1)
    401402    {
     
    667668/**
    668669 * Writes the a function listing base sqlstatement with these columns (ordered):
    669  *      0. Module refcode
    670  *      1. Module name
     670 *      0. dll refcode
     671 *      1. dll name
    671672 *      2. number of functions
    672673 *
     
    676677 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    677678 */
    678 function Odin32DBWriteModules($sql, $db)
     679function Odin32DBWriteDlls($sql, $db)
    679680{
    680681    if ($result2 = mysql_query($sql, $db))
     
    684685            echo "\n<table width=100% border=0 cellpadding=0>\n".
    685686                 "<tr>\n".
    686                  "  <td width=75%><font size=-1><b>Modules</b></font></td>\n".
     687                 "  <td width=75%><font size=-1><b>Dlls</b></font></td>\n".
    687688                 "  <td align=right><font size=-1><b>Functions</b></font></td>\n".
    688689                 "</tr>\n";
    689690            while ($aFunction = mysql_fetch_array($result2))
    690691                printf("<tr>".
    691                        "<td><font size=-1><a href=\"Odin32DB.phtml?modrefcode=%s\">%s</a></font></td>".
     692                       "<td><font size=-1><a href=\"Odin32DB.phtml?dllrefcode=%s\">%s</a></font></td>".
    692693                       "<td align=right><font size=-1>%s</font></td>".
    693694                       "</tr>\n",
     
    761762/**
    762763 * Writes the a function listing base sqlstatement with these columns (ordered):
    763  *      0. module refcode
    764  *      1. module name
     764 *      0. dll refcode
     765 *      1. dll name
    765766 *      2. function refcode
    766767 *      3. function name
     
    774775 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    775776 */
    776 function Odin32DBWriteFunctionsWithModules($sql, $db, $sURLArgs)
     777function Odin32DBWriteFunctionsWithDlls($sql, $db, $sURLArgs)
    777778{
    778779    if ($result2 = mysql_query($sql, $db))
     
    782783            echo "\n<table width=100% border=0 cellpadding=0>\n".
    783784                 "<tr>\n".
    784                  "  <td width=30%><font size=-1><b>Module Name</b></font></td>\n".
     785                 "  <td width=30%><font size=-1><b>Dll Name</b></font></td>\n".
    785786                 "  <td width=45%><font size=-1><b>Function Name</b></font></td>\n".
    786787                 "  <td><font size=-1><b>State</b></font></td>\n".
     
    788789            while ($aFunction = mysql_fetch_row($result2))
    789790                printf("<tr>".
    790                        "<td><font size=-1><a href=\"Odin32DB.phtml?modrefcode=%s\">%s</a></font></td>".
     791                       "<td><font size=-1><a href=\"Odin32DB.phtml?dllrefcode=%s\">%s</a></font></td>".
    791792                       "<td><font size=-1><a href=\"Odin32DB.phtml?functionrefcode=%s\">%s</a></font></td>".
    792793                       "<td><font size=-1 color=%s>%s</font></td>".
     
    808809
    809810            echo "<p>Click <a href=\"Odin32DB.phtml#functions?".$sURLArgs."\">here</a> to view functions sorted ".
    810                  ($fSortByState  ? "alphabetical by module" : "by state"). ".<br>";
     811                 ($fSortByState  ? "alphabetical by dll" : "by state"). ".<br>";
    811812        }
    812813        else
     
    952953
    953954    echo "<a href=\"Odin32DB.phtml\">Root</a>\n".
    954          " - <a href=\"Odin32DB.phtml?modules=1\">Moduless</a>\n".
     955         " - <a href=\"Odin32DB.phtml?dlls=1\">Dlls</a>\n".
    955956         " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n".
    956957         " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n";
     
    985986    echo
    986987         "<a href=\"Odin32DB.phtml\">Root</a>\n".
    987          " - <a href=\"Odin32DB.phtml?moduless=1\">Modules</a>\n".
     988         " - <a href=\"Odin32DB.phtml?dlls=1\">Dlls</a>\n".
    988989         " - <a href=\"Odin32DB.phtml?authors=1\">Authors</a>\n".
    989990         " - <a href=\"Odin32DB.phtml?apigroups=1\">API Groups</a>\n";
     
    10281029                   "    a.name          AS aliasname,\n".
    10291030                   "    a.refcode       AS aliasrefcode,\n".
    1030                    "    ad.name         AS aliasnmodname,\n".
    1031                    "    ad.refcode      AS aliasmodrefcode,\n".
    1032                    "    d.name          AS modname,\n".
    1033                    "    d.refcode       AS modrefcode,\n".
     1031                   "    ad.name         AS aliasdllname,\n".
     1032                   "    ad.refcode      AS aliasdllrefcode,\n".
     1033                   "    d.name          AS dllname,\n".
     1034                   "    d.refcode       AS dllrefcode,\n".
    10341035                   "    i.name          AS filename,\n".
    10351036                   "    i.refcode       AS filerefcode,\n".
     
    10391040                   "    function f\n".
    10401041                   "    LEFT OUTER JOIN function a ON f.aliasfn  = a.refcode\n".
    1041                    "    LEFT OUTER JOIN module ad  ON a.module   = ad.refcode\n".
     1042                   "    LEFT OUTER JOIN dll ad     ON a.dll      = ad.refcode\n".
    10421043                   "    LEFT OUTER JOIN apigroup g ON f.apigroup = g.refcode\n".
    1043                    "    LEFT       JOIN module d   ON f.module   = d.refcode\n".
     1044                   "    LEFT       JOIN dll d      ON f.dll      = d.refcode\n".
    10441045                   "    LEFT       JOIN state s    ON f.state    = s.refcode\n".
    10451046                   "    LEFT OUTER JOIN file i     ON f.file     = i.refcode\n".
     
    10631064        Odin32DBInfoRow1("Type", $array, "type", "", "","invalid","");
    10641065        Odin32DBInfoRow1("State", $array, "state", "", "","invalid","");
    1065         Odin32DBInfoRow1("Module", $array, "modname", "modrefcode", "modrefcode","","");
     1066        Odin32DBInfoRow1("Dll", $array, "dllname", "dllrefcode", "dllrefcode","","");
    10661067        Odin32DBInfoRow1("Ordinal", $array, "ordinal","","","not available","");
    10671068        if (isset($array["apigroupname"]))
    10681069            Odin32DBInfoRow1("API Group", $array, "apigroupname", "apigrouprefcode", "apigrouprefcode","","");
    10691070        Odin32DBInfoRow1("File", $array, "filename", "filerefcode", "filerefcode", "not available",
    1070                          " (<a href=\"cvs.phtml#".$array["line"]."?sFile=./src/".$array["modname"]."/".$array["filename"].",v&sRevision=\">cvs</a>)");
     1071                         " (<a href=\"cvs.phtml#".$array["line"]."?sFile=./src/".$array["dllname"]."/".$array["filename"].",v&sRevision=\">cvs</a>)");
    10711072        if ($array["line"] > 0)
    10721073            Odin32DBInfoRow1("Line", $array, "line", "", "","","");
     
    10741075            Odin32DBInfoRow1("Line", $array, "unavailable", "", "","not available","");
    10751076        if (isset($array["aliasrefcode"]))
    1076             Odin32DBInfoRow2("Forwards", $array, "aliasmodname", "aliasmodrefcode", "modrefcode","",".",
     1077            Odin32DBInfoRow2("Forwards", $array, "aliasdllname", "aliasdllrefcode", "dllrefcode","",".",
    10771078                                                 "aliasname", "aliasrefcode", "functionrefcode");
    10781079        else
    10791080        {
    10801081            $sql = sprintf("SELECT\n".
    1081                            "    m.name      AS modname,\n".
    1082                            "    m.refcode   AS modrefcode,\n".
     1082                           "    d.name      AS dllname,\n".
     1083                           "    d.refcode   AS dllrefcode,\n".
    10831084                           "    f.name      AS fnname,\n".
    10841085                           "    f.refcode   AS fnrefcode\n".
    10851086                           "FROM\n".
    10861087                           "    function f,\n".
    1087                            "    module m\n".
     1088                           "    dll d\n".
    10881089                           "WHERE\n".
    10891090                           "    f.aliasfn = %d AND\n".
    1090                            "    f.module = m.refcode\n".
    1091                            "ORDER BY m.name, f.name\n",
     1091                           "    f.dll = d.refcode\n".
     1092                           "ORDER BY d.name, f.name\n",
    10921093                           $iRefcode);
    10931094            if (($result2 = mysql_query($sql, $db)))
     
    11011102                        if ($f) $sValue = $sValue."<br>";
    11021103                        else    $f = 1;
    1103                         $sValue = $sValue."<a href=\"Odin32DB.phtml?modrefcode=".
    1104                                           $aAlias["modrefcode"]."\">".$aAlias["modname"]."</a>.".
     1104                        $sValue = $sValue."<a href=\"Odin32DB.phtml?dllrefcode=".
     1105                                          $aAlias["dllrefcode"]."\">".$aAlias["dllname"]."</a>.".
    11051106                                          "<a href=\"Odin32DB.phtml?functionrefcode=".
    11061107                                          $aAlias["fnrefcode"]."\">".$aAlias["fnname"]."</a>";
     
    12441245
    12451246/**
    1246  * Writes standard module info.
     1247 * Writes standard dll info.
    12471248 *
    12481249 * @returns     void
    12491250 * @param       $db             Database handle.
    1250  * @param       $iRefcode       Module reference code.
     1251 * @param       $iRefcode       Dll reference code.
    12511252 * @param       $fFunctions     Flags which tells wether to list all functions or not.
    12521253 * @param       $fFiles         Flags which tells wether to list all files or not.
     
    12591260 * @remark
    12601261 */
    1261 function Odin32DBModuleInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState)
    1262 {
    1263     $sURLArgs = "modrefcode=".$iRefcode.
     1262function Odin32DBDllInfo($db, $iRefcode, $fFunctions, $fFiles, $fAPIGroups, $fAuthors, $fSortByState)
     1263{
     1264    $sURLArgs = "dllrefcode=".$iRefcode.
    12641265                ($fFunctions   ? "&fFunctions=1"   : "").
    12651266                ($fFiles       ? "&fFiles=1"       : "").
     
    12711272     * Navigation - TOP
    12721273     */
    1273     $sExpand    = "modrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";
     1274    $sExpand    = "dllrefcode=".$iRefcode."&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1";
    12741275    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
    1275     $sCollapse  = "modrefcode=".$iRefcode;
     1276    $sCollapse  = "dllrefcode=".$iRefcode;
    12761277    Odin32DBNavigationTop($sExpand, $sCollapse);
    12771278
     
    12801281     */
    12811282    $sql = sprintf("SELECT\n".
    1282                    "    m.name          AS name,\n".
    1283                    "    m.description   AS description,\n".
     1283                   "    d.name          AS name,\n".
     1284                   "    d.description   AS description,\n".
    12841285                   "    c.description   AS type\n".
    12851286                   "FROM\n".
    1286                    "    module d,\n".
     1287                   "    dll d,\n".
    12871288                   "    code c\n".
    12881289                   "WHERE\n".
    12891290                   "    c.codegroup = 'DTYP' AND\n".
    1290                    "    m.type = c.code AND\n".
    1291                    "    m.refcode = %d",
     1291                   "    d.type = c.code AND\n".
     1292                   "    d.refcode = %d",
    12921293                    $iRefcode);
    12931294    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
     
    13061307                       "    function\n".
    13071308                       "WHERE\n".
    1308                        "    module = %d",
     1309                       "    dll = %d",
    13091310                       $iRefcode);
    13101311        $cFunctions = 0;
     
    13201321                       "    file\n".
    13211322                       "WHERE\n".
    1322                        "    module = %d",
     1323                       "    dll = %d",
    13231324                       $iRefcode);
    13241325        $cFiles = 0;
     
    13341335                       "    apigroup\n".
    13351336                       "WHERE\n".
    1336                        "    module = %d",
     1337                       "    dll = %d",
    13371338                       $iRefcode);
    13381339        $cAPIGroups = 0;
     
    13501351         */
    13511352        Odin32DBNaslov("Completion", "completion");
    1352         Odin32DBCompletionBarModule($iRefcode, "", $db);
     1353        Odin32DBCompletionBarDll($iRefcode, "", $db);
    13531354
    13541355        /*
     
    13611362                       "    function\n".
    13621363                       "WHERE\n".
    1363                        "    module = %d\n".
     1364                       "    dll = %d\n".
    13641365                       "GROUP BY state\n".
    13651366                       "ORDER BY state",
     
    13821383                           "    LEFT JOIN state s ON f.state = s.refcode\n".
    13831384                           "WHERE\n".
    1384                            "    f.module = %d\n",
     1385                           "    f.dll = %d\n",
    13851386                           $iRefcode);
    13861387            if ($fSortByState)
     
    14091410                           "    LEFT OUTER JOIN function fn ON fn.file = f.refcode\n".
    14101411                           "WHERE\n".
    1411                            "    f.module = %d\n".
     1412                           "    f.dll = %d\n".
    14121413                           "GROUP BY f.refcode\n".
    14131414                           "ORDER BY f.name\n",
     
    14361437                               "    JOIN function f\n".
    14371438                               "WHERE\n".
    1438                                "    g.module = %d AND\n".
    1439                                "    f.module = %d AND\n".
     1439                               "    g.dll = %d AND\n".
     1440                               "    f.dll = %d AND\n".
    14401441                               "    f.apigroup = g.refcode\n".
    14411442                               "GROUP BY f.apigroup\n".
     
    14661467                           "    JOIN author a\n".
    14671468                           "WHERE\n".
    1468                            "    f.module    = %d AND\n".
     1469                           "    f.dll       = %d AND\n".
    14691470                           "    fa.function = f.refcode AND\n".
    14701471                           "    fa.author   = a.refcode\n".
     
    15341535                   "    f.revision      AS revision,\n".
    15351536                   "    f.description   AS description,\n".
    1536                    "    f.module        AS modrefcode,\n".
    1537                    "    m.name          AS modname\n".
     1537                   "    f.dll           AS dllrefcode,\n".
     1538                   "    d.name          AS dllname\n".
    15381539                   "FROM\n".
    15391540                   "    file f,\n".
    1540                    "    module m,\n".
     1541                   "    dll d,\n".
    15411542                   "    author a\n".
    15421543                   "WHERE\n".
    15431544                   "    f.refcode   = %d AND\n".
    1544                    "    f.module    = m.refcode AND\n".
     1545                   "    f.dll       = d.refcode AND\n".
    15451546                   "    f.lastauthor= a.refcode",
    15461547                    $iRefcode);
     
    15531554        echo "\n<table width=100% border=3 cellpadding=0>\n";
    15541555        Odin32DBInfoRow1("Name", $array, "name","","","",
    1555                          " (<a href=\"cvs.phtml?sFile=./src/".$array["modname"]."/".$array["name"].",v&sRevision=\">cvs</a>)");
     1556                         " (<a href=\"cvs.phtml?sFile=./src/".$array["dllname"]."/".$array["name"].",v&sRevision=\">cvs</a>)");
    15561557        Odin32DBInfoRow1("Revision", $array, "revision","","","","");
    15571558        Odin32DBInfoRow1("Changed", $array, "lastdatetime","","","","");
    15581559        Odin32DBInfoRow1("Last Author", $array, "lastauthorname","lastauthorrefcode","authorrefcode","","");
    1559         Odin32DBInfoRow1("Module", $array, "modname","modrefcode","modrefcode","","");
     1560        Odin32DBInfoRow1("Dll", $array, "dllname","dllrefcode","dllrefcode","","");
    15601561        $sql = sprintf("SELECT\n".
    15611562                       "    COUNT(*) as functions\n".
     
    17211722 * @param       $db             Database handle.
    17221723 * @param       $iRefcode       Author reference code.
    1723  * @param       $fModules       Flags which tells wether to list all modules or not.
     1724 * @param       $fDlls          Flags which tells wether to list all dlls or not.
    17241725 * @param       $fFunctions     Flags which tells wether to list all functions or not.
    17251726 * @param       $fFiles         Flags which tells wether to list all files or not.
     
    17271728 * @param       $fSortByState   Flags which tells wether to sort functions by
    17281729 *                              state and function name or just by function name.
    1729  * @param       $iModRefcode    Module refcode. All modules if < 0.
     1730 * @param       $iDllRefcode    Dll refcode. All Dll if < 0.
    17301731 *                              (not implemented yet)
    17311732 * @sketch
     
    17331734 * @remark
    17341735 */
    1735 function Odin32DBAuthorInfo($db, $iRefcode, $fModules, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iModRefcode)
     1736function Odin32DBAuthorInfo($db, $iRefcode, $fDlls, $fFunctions, $fFiles, $fAPIGroups, $fSortByState, $iDllRefcode)
    17361737{
    17371738    $sURLArgs = "authorrefcode=".$iRefcode.
    1738                 ($fModules     ? "&fModules=1"        : "").
     1739                ($fDlls        ? "&fDlls=1"        : "").
    17391740                ($fFunctions   ? "&fFunctions=1"   : "").
    17401741                ($fFiles       ? "&fFiles=1"       : "").
     
    17451746     * Navigation - TOP
    17461747     */
    1747     $sExpand    = "authorrefcode=".$iRefcode."&fModules=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&mod=".$iModRefcode;
     1748    $sExpand    = "authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;
    17481749    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
    17491750    $sCollapse  = "authorrefcode=".$iRefcode;
     
    17951796            }
    17961797        $sql = sprintf("SELECT\n".
    1797                        "    COUNT(f.module) as functions
     1798                       "    COUNT(f.dll) as functions
    17981799                       \n".
    17991800                       "FROM\n".
     
    18031804                       "    fa.author = %d AND".
    18041805                       "    f.refcode = fa.function\n".
    1805                        "GROUP BY f.module",
     1806                       "GROUP BY f.dll",
    18061807                       $iRefcode);
    1807         $cModules = 0;
    1808         if (($result2 = mysql_query($sql, $db)) && ($cModules = mysql_num_rows($result2)) > 0)
    1809             Odin32DBInfoRow1NoArray("# Moduless", $cModules, "","","","");
     1808        $cDlls = 0;
     1809        if (($result2 = mysql_query($sql, $db)) && ($cDlls = mysql_num_rows($result2)) > 0)
     1810            Odin32DBInfoRow1NoArray("# Dlls", $cDlls, "","","","");
    18101811        $sql = sprintf("SELECT\n".
    1811                        "    COUNT(f.module) as functions
     1812                       "    COUNT(f.dll) as functions
    18121813                       \n".
    18131814                       "FROM\n".
     
    18241825            Odin32DBInfoRow1NoArray("# Files", $cFiles, "","","","");
    18251826        $sql = sprintf("SELECT\n".
    1826                        "    COUNT(f.module) as functions
     1827                       "    COUNT(f.dll) as functions
    18271828                       \n".
    18281829                       "FROM\n".
     
    18661867
    18671868        /*
    1868          * Modules
    1869          */
    1870         Odin32DBNaslov("Modules", "Modules");
    1871         if ($fModules)
     1869         * Dlls
     1870         */
     1871        Odin32DBNaslov("Dlls", "dlls");
     1872        if ($fDlls)
    18721873        {
    18731874            $sql = sprintf("SELECT\n".
    1874                            "    m.refcode,\n".
    1875                            "    m.name,\n".
     1875                           "    d.refcode,\n".
     1876                           "    d.name,\n".
    18761877                           "    COUNT(f.refcode)\n".
    18771878                           "FROM\n".
    18781879                           "    fnauthor fa,\n".
    1879                            "    module m,\n".
     1880                           "    dll d,\n".
    18801881                           "    function f\n".
    18811882                           "WHERE\n".
    18821883                           "    fa.author = %d AND\n".
    18831884                           "    fa.function = f.refcode AND\n".
    1884                            "    f.module = m.refcode\n".
    1885                            "GROUP BY m.refcode\n".
    1886                            "ORDER BY m.name\n",
     1885                           "    f.dll = d.refcode\n".
     1886                           "GROUP BY d.refcode\n".
     1887                           "ORDER BY d.name\n",
    18871888                            $iRefcode);
    1888             Odin32DBWriteModules($sql, $db, $sURLArgs);
     1889            Odin32DBWriteDlls($sql, $db, $sURLArgs);
    18891890        }
    18901891        else
    1891             echo "Click <a href=\"Odin32DB.phtml#modules?".$sURLArgs."&fModules=1".
     1892            echo "Click <a href=\"Odin32DB.phtml#dlls?".$sURLArgs."&fDlls=1".
    18921893                 "\">here</a> to see all files.\n";
    18931894
     
    19021903                           "    f.refcode,\n".
    19031904                           "    f.name,\n".
    1904                            "    m.refcode,\n".
    1905                            "    m.name,\n".
     1905                           "    d.refcode,\n".
     1906                           "    d.name,\n".
    19061907                           "    s.color,\n".
    19071908                           "    s.name\n".
     
    19091910                           "    fnauthor fa\n".
    19101911                           "    JOIN function f\n".
    1911                            "    JOIN module m\n".
     1912                           "    JOIN dll d\n".
    19121913                           "    LEFT JOIN state s ON f.state = s.refcode\n".
    19131914                           "WHERE\n".
    19141915                           "    fa.author = %d AND\n".
    19151916                           "    fa.function = f.refcode AND \n".
    1916                            "    f.module = m.refcode\n",
     1917                           "    f.dll = d.refcode\n",
    19171918                           $iRefcode);
    19181919            if ($fSortByState)
     
    19201921            else
    19211922                $sql = $sql."ORDER BY d.name, f.name";
    1922             Odin32DBWriteFunctionsWithModules($sql, $db, $sURLArgs);
     1923            Odin32DBWriteFunctionsWithDlls($sql, $db, $sURLArgs);
    19231924        }
    19241925        else
     
    20372038                   "    g.refcode       AS refcode,\n".
    20382039                   "    g.description   AS description,\n".
    2039                    "    m.name          AS modname,\n".
    2040                    "    m.refcode       AS modrefcode\n".
     2040                   "    d.name          AS dllname,\n".
     2041                   "    d.refcode       AS dllrefcode\n".
    20412042                   "FROM\n".
    20422043                   "    apigroup g\n".
    2043                    "    JOIN module m\n".
     2044                   "    JOIN dll d\n".
    20442045                   "WHERE\n".
    20452046                   "    g.refcode = %d AND".
    2046                    "    g.module = m.refcode\n",
     2047                   "    g.dll = d.refcode\n",
    20472048                   $iRefcode);
    20482049    if (($result = mysql_query($sql, $db)) && mysql_num_rows($result) > 0 && ($array = mysql_fetch_array($result)))
     
    20542055        echo "\n<table width=100% border=3 cellpadding=0>\n";
    20552056        Odin32DBInfoRow1("Name", $array, "name","","","","");
    2056         Odin32DBInfoRow1("Module", $array, "modname","modrefcode","modrefcode","bad configuration","");
     2057        Odin32DBInfoRow1("Dll", $array, "dllname","dllrefcode","dllrefcode","bad configuration","");
    20572058        if (isset($array["description"]))
    20582059            Odin32DBInfoRow1("Description", $array, "description","","","","");
     
    20842085
    20852086        $sql = sprintf("SELECT\n".
    2086                        "    COUNT(f.module) as functions\n".
     2087                       "    COUNT(f.dll) as functions\n".
    20872088                       "FROM\n".
    20882089                       "    fnauthor fa,\n".
     
    22302231     * Navigation - TOP
    22312232     */
    2232     $sExpand    = "authorrefcode=".$iRefcode."&fModules=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&module=".$iModRefcode;
     2233    $sExpand    = "authorrefcode=".$iRefcode."&fDlls=1&fFiles=1&fFunctions=1&fAPIGroups=1&fAuthors=1&dll=".$iDllRefcode;
    22332234    if ($fSortByState)  $sExpand = $sExpand."&fSortByState=".$fSortByState;
    22342235    $sCollapse  = "authorrefcode=".$iRefcode;
     
    22422243                   "    dn.note          AS note,\n".
    22432244                   "    dn.refcode       AS refcode,\n".
    2244                    "    dn.module        AS modrefcode,\n".
     2245                   "    dn.dll           AS dllrefcode,\n".
    22452246                   "    dn.file          AS filerefcode,\n".
    22462247                   "    dn.seqnbrnote    AS seqnbnote,\n".
     
    22482249                   "    dn.seqnbr        AS seqnbr,\n".
    22492250                   "    dn.line          AS line,\n".
    2250                    "    m.name           AS modname,\n".
     2251                   "    d.name           AS dll,\n".
    22512252                   "    f.name           AS file\n".
    22522253                   "FROM\n".
    22532254                   "    designnote dn,\n".
    2254                    "    module m,\n".
     2255                   "    dll d,\n".
    22552256                   "    file f\n".
    22562257                   "WHERE   dn.refcode = %d\n".
    2257                    "    AND dn.module = m.refcode\n".
     2258                   "    AND dn.dll = d.refcode\n".
    22582259                   "    AND dn.file = f.refcode\n".
    22592260                   "ORDER BY dn.seqnbrnote\n",
     
    22672268        echo "\n<table width=100% border=3 cellpadding=0>\n";
    22682269        Odin32DBInfoRow1("Title", $array, "name","","","","");
    2269         Odin32DBInfoRow1("Module", $array, "modname","","","","");
     2270        Odin32DBInfoRow1("Module", $array, "dll","","","","");
    22702271        Odin32DBInfoRow1("File", $array, "file","","","","");
    22712272        Odin32DBInfoRow1("Line", $array, "line","","","","");
Note: See TracChangeset for help on using the changeset viewer.