Changeset 3882 for trunk/tools/database


Ignore:
Timestamp:
Jul 21, 2000, 11:09:45 PM (25 years ago)
Author:
bird
Message:

Corrections and handling of the updated field in function and file.

Location:
trunk/tools/database
Files:
5 edited

Legend:

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

    r2789 r3882  
    1 /* $Id: APIImport.cpp,v 1.5 2000-02-15 13:31:05 bird Exp $ */
     1/* $Id: APIImport.cpp,v 1.6 2000-07-21 21:09:42 bird Exp $ */
    22/*
    33 *
     
    6666    *           -u:<user>     Userid
    6767    *           -h:<host>     Hostname/IP-address
     68    *           -e[+|-]       Erase functions which wasn't found.
    6869    **************************************************************************/
    6970    if (argc == 1)
     
    8283                    else
    8384                        fprintf(stderr, "warning: option '-d:' requires database name.\n");
     85                    break;
     86
     87                case 'e': /* erase */
     88                case 'E':
     89                    options.fErase = argv[argi][2] != '-';
    8490                    break;
    8591
     
    177183           "    -p:<password> Password.                     default: <empty>\n"
    178184           "    -d:<database> Database to use.              default: Odin32\n"
     185           "    -e[+|-]       Erase functions which wasn't found.\n"
     186           "                                                default: -e-\n"
    179187           "    dll/defnames  List of DLL/Defs to process.\n"
    180188           "\n"
     
    188196           "\t2) function name\n"
    189197           "\t3) function ordinal (If not option 'o-' is specified.)\n"
    190            "This utililty is not destructive but additive. That is, it would not remove any\n"
    191            "rows in the database, only add or update them. On existing functions the\n"
    192            "ordinal value will be updated when 'o+' is specified.\n"
    193198           "\n"
    194            "Copyright (c) 1999 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)",
     199           "Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)",
    195200           MAJOR_VER, MINOR_VER
    196201           );
     
    248253            char    achDataBuffer[0x200];
    249254            char   *pszModuleName = &achDataBuffer[0];
    250             signed short  sDll;
     255            signed long  lDll;
    251256
    252257            /* try create file objects */
     
    271276
    272277                /* find or insert module name */
    273                 if ((sDll = dbCheckInsertDll(pszModuleName)) >= 0)
     278                if ((lDll = dbCheckInsertDll(pszModuleName, DLL_ODIN32_API)) >= 0)
    274279                {
    275                     BOOL   fOk;
     280                    BOOL    fClearUpdateOk = FALSE;
     281                    BOOL    fOk;
    276282                    EXPORTENTRY export;
     283
     284                    /* Clear the update flag for all functions in this DLL. */
     285                    if (pOptions->fErase)
     286                        fClearUpdateOk = dbClearUpdateFlagFunction(lDll, FALSE);
    277287
    278288                    lRc = 0;
     
    313323                            }
    314324                            else
    315                             {
    316                                 fOk = dbInsertUpdateFunction(sDll,
     325                            {   /* Update Database */
     326                                fOk = dbInsertUpdateFunction(lDll,
    317327                                                             &szName[0],
    318328                                                             &szIntName[0],
    319329                                                             export.ulOrdinal,
    320                                                              pOptions->fIgnoreOrdinals && export.ulOrdinal != 0xffffffffUL);
     330                                                             pOptions->fIgnoreOrdinals && export.ulOrdinal != 0xffffffffUL,
     331                                                             FUNCTION_ODIN32_API
     332                                                             );
    321333                                if (fOk)
    322334                                    cFunctions++;
     335                                else
     336                                {
     337                                    fprintf(phLog, "%s: error - dbInsertUpdateFunction failed.\n\terror description: %s \n",
     338                                            pszFilename, dbGetLastErrorDesc());
     339                                    lRc++;
     340                                }
    323341                            }
    324                         }
    325 
    326                         if (!fOk)
    327                         {
    328                             fprintf(phLog, "%s: error - dbInsertUpdateFunction failed.\n\terror description: %s \n",
    329                                     pszFilename, dbGetLastErrorDesc());
    330                             lRc = 1;
    331342                        }
    332343
     
    335346                    }
    336347
     348                    /* Clear the update flag for all functions in this DLL. */
     349                    if (fClearUpdateOk && pOptions->fErase)
     350                        if (!dbDeleteNotUpdatedFunctions(lDll, FALSE))
     351                        {
     352                            fprintf(phLog, "%s: error - dbDeleteNotUpdatedFunctions failed.\n\terror description: %s\n",
     353                                    pszFilename, dbGetLastErrorDesc());
     354                            lRc += 1;
     355                        }
    337356                }
    338357                else
  • trunk/tools/database/APIImport.h

    r2759 r3882  
    1 /* $Id: APIImport.h,v 1.2 2000-02-11 18:35:53 bird Exp $ */
     1/* $Id: APIImport.h,v 1.3 2000-07-21 21:09:43 bird Exp $ */
    22/*
    33 * APIImportPE - imports a DLL with functions into the Odin32 database. Header.
     
    2020typedef struct _options
    2121{
    22     BOOL fIgnoreOrdinals;
     22    BOOL    fIgnoreOrdinals;            /* Don't update ordinals. */
     23    BOOL    fErase;                     /* Erase functions which wasn't found. */
    2324} OPTIONS, *POPTIONS;
    2425
  • trunk/tools/database/StateUpd.cpp

    r3848 r3882  
    1 /* $Id: StateUpd.cpp,v 1.25 2000-07-18 17:56:50 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.26 2000-07-21 21:09:43 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    310310            {   /* failed to find dll - concidered nearly fatal. */
    311311                fprintf(phSignal, "-,-: failed to find dll (%s)!\n\t%s\n",
    312                         options.pszDLLName ? options.pszDLLName : "<NULL>");
     312                        options.pszDLLName ? options.pszDLLName : "<NULL>",
     313                        dbGetLastErrorDesc());
    313314                ulRc++;
    314315            }
     
    323324            if (cNotAliased > cUpdated)
    324325            {
    325                 fprintf(phSignal, "%d functions where not found (found=%d, total=%d).\n", 
     326                fprintf(phSignal, "%d functions where not found (found=%d, total=%d).\n",
    326327                        cNotAliased- cUpdated, cUpdated, cNotAliased);
    327328                ulRc += 0x00010000;
     
    697698            szId[psz2 - psz] = '\0';
    698699            iRet = i;
    699    
     700
    700701            /* parse it! */
    701702            psz = strstr(szId+4, ",v ");
  • trunk/tools/database/db.cpp

    r3848 r3882  
    1 /* $Id: db.cpp,v 1.15 2000-07-18 17:56:50 bird Exp $ *
     1/* $Id: db.cpp,v 1.16 2000-07-21 21:09:44 bird Exp $ *
    22 *
    33 * DB - contains all database routines.
     
    158158 * @param     pszDllName  Dll name.
    159159 */
    160 signed short _System dbGetDll(const char *pszDllName)
     160signed long _System dbGetDll(const char *pszDllName)
    161161{
    162162    int         rc;
     
    173173        rc = -1;
    174174    mysql_free_result(pres);
    175     return (short)rc;
     175    return (signed long)rc;
    176176}
    177177
     
    180180 * Count the function in a given dll.
    181181 * @returns  Number of functions. -1 on error.
    182  * @param    usDll        Dll refcode.
     182 * @param    lDll         Dll refcode.
    183183 * @param    fNotAliases  TRUE: don't count aliased functions.
    184184 */
    185 signed long     _System dbCountFunctionInDll(signed long ulDll, BOOL fNotAliases)
     185signed long     _System dbCountFunctionInDll(signed long lDll, BOOL fNotAliases)
    186186{
    187187    signed long rc;
     
    189189    MYSQL_RES * pres;
    190190
    191     if (ulDll >= 0)
    192     {
    193         sprintf(&szQuery[0], "SELECT count(refcode) FROM function WHERE dll = %ld\n", ulDll);
     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");
     
    217217 *            (In the mysql-world everything is case insensitive!)
    218218 */
    219 signed short _System dbCheckInsertDll(const char *pszDll)
     219signed long _System dbCheckInsertDll(const char *pszDll, char fchType)
    220220{
    221221    int         rc;
     
    233233        mysql_free_result(pres);
    234234
    235         sprintf(&szQuery[0], "INSERT INTO dll(name) VALUES('%s')\n", pszDll);
     235        sprintf(&szQuery[0], "INSERT INTO dll(name, type) VALUES('%s', '%c')\n", pszDll, fchType);
    236236        rc = mysql_query(pmysql, &szQuery[0]);
     237        if (rc < 0)
     238            return -1;
    237239
    238240        /* select row to get refcode */
     
    248250    mysql_free_result(pres);
    249251
    250     return (short)rc;
     252    return (long)rc;
    251253}
    252254
     
    280282    mysql_free_result(pres);
    281283
    282     return (short)rc;
     284    return (unsigned short)rc;
    283285}
    284286
     
    286288/**
    287289 * Updates or inserts a function name into the database.
    288  * @returns   Success indicator. TRUE / FALSE.
    289  * @param     usDll           Dll refcode.
    290  * @param     pszFunction     Function name.
    291  * @param     pszIntFunction  Internal function name. (required!)
    292  * @param     ulOrdinal       Ordinal value.
    293  * @param     fIgnoreOrdinal  Do not update ordinal value.
    294  */
    295 BOOL _System dbInsertUpdateFunction(unsigned short usDll,
     290 * The update flags is always updated.
     291 * @returns     Success indicator. TRUE / FALSE.
     292 * @param       lDll                Dll refcode.
     293 * @param       pszFunction         Function name.
     294 * @param       pszIntFunction      Internal function name. (required!)
     295 * @param       ulOrdinal           Ordinal value.
     296 * @param       fIgnoreOrdinal      Do not update ordinal value.
     297 * @param       fchType             Function type flag. One of the FUNCTION_* defines.
     298 */
     299BOOL _System dbInsertUpdateFunction(signed long lDll,
    296300                                    const char *pszFunction, const char *pszIntFunction,
    297                                     unsigned long ulOrdinal, BOOL fIgnoreOrdinal)
    298 {
    299     int  rc;
    300     long lFunction = -1;
    301     char szQuery[512];
     301                                    unsigned long ulOrdinal, BOOL fIgnoreOrdinal, char fchType)
     302{
     303    int     rc;
     304    long    lFunction = -1;
     305    char    szQuery[512];
     306    char *  pszQuery = &szQuery[0];
    302307    MYSQL_RES *pres;
    303308
     
    307312
    308313    /* try find function */
    309     sprintf(&szQuery[0], "SELECT refcode, intname FROM function WHERE dll = %d AND name = '%s'", usDll, pszFunction);
    310     rc = mysql_query(pmysql, &szQuery[0]);
     314    sprintf(pszQuery, "SELECT refcode, intname FROM function WHERE dll = %d AND name = '%s'", lDll, pszFunction);
     315    rc = mysql_query(pmysql, pszQuery);
    311316    pres = mysql_store_result(pmysql);
    312317    if (rc >= 0 && pres != NULL && mysql_num_rows(pres) != 0)
    313     {   /* update function (function is found) */
     318    {   /*
     319         * Found the function. So now we'll update it.
     320         */
    314321        MYSQL_ROW parow;
    315322        if (mysql_num_rows(pres) > 1)
    316323        {
    317324            fprintf(stderr, "internal database integrity error(%s): More function by the same name for the same dll. "
    318                     "usDll = %d, pszFunction = %s\n", __FUNCTION__, usDll, pszFunction);
     325                    "lDll = %d, pszFunction = %s\n", __FUNCTION__, lDll, pszFunction);
    319326            return FALSE;
    320327        }
    321328
    322329        parow = mysql_fetch_row(pres);
    323         if (parow != NULL)
    324             lFunction = getvalue(0, parow);
     330        lFunction = getvalue(0, parow);
    325331        mysql_free_result(pres);
    326332
     333        strcpy(pszQuery, "UPDATE function SET updated = updated + 1");
     334        pszQuery += strlen(pszQuery);
    327335        if (strcmp(parow[1], pszIntFunction) != 0)
    328         {
    329             sprintf(&szQuery[0], "UPDATE function SET intname = '%s' WHERE refcode = %ld",
    330                     pszIntFunction, lFunction);
    331             rc = mysql_query(pmysql, &szQuery[0]);
    332         }
    333 
    334         if (rc >= 0 && !fIgnoreOrdinal)
    335         {
    336             sprintf(&szQuery[0], "UPDATE function SET ordinal = %ld WHERE refcode = %ld",
    337                     ulOrdinal, lFunction);
    338             rc = mysql_query(pmysql, &szQuery[0]);
    339         }
    340 
     336            pszQuery += sprintf(pszQuery, ", intname = '%s'", pszIntFunction);
     337
     338        if (!fIgnoreOrdinal)
     339            pszQuery += sprintf(pszQuery, ", ordinal = %ld", ulOrdinal);
     340
     341        sprintf(pszQuery, ", type = '%c' WHERE refcode = %ld", fchType, lFunction);
     342        rc = mysql_query(pmysql, &szQuery[0]);
    341343    }
    342344    else
    343     {   /* insert */
    344         sprintf(&szQuery[0], "INSERT INTO function(dll, name, intname, ordinal) VALUES(%d, '%s', '%s', %ld)",
    345                 usDll, pszFunction, pszIntFunction, ulOrdinal);
     345    {   /*
     346         * The function was not found. (or maybe an error occured?)
     347         * Insert it.
     348         */
     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);
    346351        rc = mysql_query(pmysql, &szQuery[0]);
    347352    }
     
    355360 * Inserts or updates (existing) file information.
    356361 * @returns     Success indicator (TRUE / FALSE).
    357  * @param       usDll           Dll reference code.
     362 * @param       lDll           Dll reference code.
    358363 * @param       pszFilename     Filename.
    359364 * @param       pszDescription  Pointer to file description.
     
    364369 * @remark
    365370 */
    366 BOOL            _System dbInsertUpdateFile(unsigned short usDll,
     371BOOL            _System dbInsertUpdateFile(signed long lDll,
    367372                                           const char *pszFilename,
    368373                                           const char *pszDescription,
     
    377382
    378383    /* parameter assertions */
    379     assert(usDll != 0);
     384    assert(lDll != 0);
    380385    assert(pszFilename != NULL);
    381386    assert(*pszFilename != '\0');
    382387
    383388    /* try find file */
    384     sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE dll = %d AND name = '%s'", usDll, pszFilename);
     389    sprintf(&szQuery[0], "SELECT refcode, name FROM file WHERE dll = %d AND name = '%s'", lDll, pszFilename);
    385390    rc = mysql_query(pmysql, &szQuery[0]);
    386391    pres = mysql_store_result(pmysql);
     
    391396        {
    392397            fprintf(stderr, "internal database integrity error(%s): More files by the same name in the same dll. "
    393                     "usDll = %d, pszFilename = %s\n", __FUNCTION__, usDll, pszFilename);
     398                    "lDll = %d, pszFilename = %s\n", __FUNCTION__, lDll, pszFilename);
    394399            return FALSE;
    395400        }
     
    446451    {   /* insert */
    447452        sprintf(&szQuery[0], "INSERT INTO file(dll, name, description, lastauthor, lastdatetime, revision) VALUES(%d, '%s', %ld, ",
    448                 usDll, pszFilename, lLastAuthor);
     453                lDll, pszFilename, lLastAuthor);
    449454        if (pszDescription != NULL && *pszDescription != '\0')
    450455            sqlstrcat(&szQuery[0], NULL, pszDescription);
     
    986991        }
    987992
    988         /* Equiv */
     993        /* Time */
    989994        if (pFnDesc->pszTime != NULL)
    990995        {
     
    19171922
    19181923
     1924
     1925/**
     1926 * Clear the update flags for all file in a dll/module.
     1927 * @returns     Success indicator. (TRUE / FALSE)
     1928 * @param       lDll    Dll refcode.
     1929 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     1930 * @remark      Intended for use by APIImport.
     1931 */
     1932BOOL             _System dbClearUpdateFlagFile(signed long lDll)
     1933{
     1934    int         rc;
     1935    char        szQuery[128];
     1936
     1937    sprintf(&szQuery[0],
     1938            "UPDATE file SET updated = 0 WHERE dll = (%ld)",
     1939            lDll);
     1940    rc = mysql_query(pmysql, &szQuery[0]);
     1941    return rc == 0;
     1942}
     1943
     1944
     1945/**
     1946 * Clear update flag
     1947 * @returns     Success indicator.
     1948 * @param       lDll    Dll refcode.
     1949 * @param       fAll    All dll. If false only APIs and Internal APIs are cleared
     1950 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     1951 * @remark      Intended for use by APIImport.
     1952 */
     1953BOOL             _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll)
     1954{
     1955    int         rc;
     1956    char        szQuery[128];
     1957
     1958    sprintf(&szQuery[0],
     1959            "UPDATE function SET updated = 0 WHERE dll = (%ld)",
     1960            lDll);
     1961    if (!fAll)
     1962        strcat(&szQuery[0], " AND type IN ('A', 'I')");
     1963    rc = mysql_query(pmysql, &szQuery[0]);
     1964    return rc == 0;
     1965}
     1966
     1967
     1968
     1969/**
     1970 * Deletes all the files in a dll/module which was not found/updated.
     1971 * @returns     Success indicator.
     1972 * @param       lDll    Dll refcode.
     1973 * @sketch      Select all files which is to be deleted.
     1974 *                  Set all references to each file in function to -1.
     1975 *              Delete all files which is to be deleted.
     1976 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     1977 * @remark      Use with GRATE CARE!
     1978 */
     1979BOOL             _System dbDeleteNotUpdatedFiles(signed long lDll)
     1980{
     1981    MYSQL_RES * pres;
     1982    int         rc;
     1983    BOOL        fRc = TRUE;
     1984    char        szQuery[128];
     1985
     1986    sprintf(&szQuery[0],
     1987            "SELECT refcode FROM file WHERE dll = (%ld) AND updated = 0",
     1988            lDll);
     1989    rc = mysql_query(pmysql, &szQuery[0]);
     1990    pres = mysql_store_result(pmysql);
     1991    if (pres != NULL && mysql_num_rows(pres))
     1992    {
     1993        MYSQL_ROW  row;
     1994        while ((row = mysql_fetch_row(pres)) != NULL)
     1995        {
     1996            sprintf(&szQuery[0],
     1997                    "UPDATE function SET file = -1 WHERE file = %s",
     1998                    row[0]);
     1999            rc = mysql_query(pmysql, &szQuery[0]);
     2000            if (rc) fRc = FALSE;
     2001        }
     2002    }
     2003
     2004    sprintf(&szQuery[0],
     2005            "DELETE FROM file WHERE dll = %ld AND updated = 0",
     2006            lDll);
     2007    rc = mysql_query(pmysql, &szQuery[0]);
     2008    if (rc) fRc = FALSE;
     2009
     2010    return fRc;
     2011}
     2012
     2013
     2014/**
     2015 * Deletes all the functions which haven't been updated.
     2016 * All rows in other tables which references the functions are
     2017 * also delete.
     2018 *
     2019 * @returns     Success indicator. (TRUE / FALSE)
     2020 * @param       lDll    The refcode of the dll owning the functions.
     2021 * @param       fAll    All function. If FALSE then only APIs and Internal APIs.
     2022 * @sketch      Select all functions which has updated = 0 and dll = lDll.
     2023 *                  Delete the referenced to the functions in:
     2024 *                      parameters
     2025 *                      fnauthor
     2026 *              Delete all function which has updated = 0 and dll = lDll
     2027 *
     2028 * @remark      Use with GREATE CARE!
     2029 */
     2030BOOL             _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll)
     2031{
     2032    MYSQL_RES * pres;
     2033    int         rc;
     2034    BOOL        fRc = TRUE;
     2035    char        szQuery[128];
     2036
     2037    sprintf(&szQuery[0],
     2038            "SELECT refcode FROM function WHERE dll = %ld AND updated = 0",
     2039            lDll);
     2040    if (!fAll)
     2041        strcat(&szQuery[0], " AND type IN ('A', 'I')");
     2042    rc = mysql_query(pmysql, &szQuery[0]);
     2043    pres = mysql_store_result(pmysql);
     2044    if (pres != NULL && mysql_num_rows(pres))
     2045    {
     2046        MYSQL_ROW  row;
     2047        while ((row = mysql_fetch_row(pres)) != NULL)
     2048        {
     2049            /* delete parameters */
     2050            sprintf(&szQuery[0], "DELETE FROM parameter WHERE function %s", row[0]);
     2051            rc = mysql_query(pmysql, &szQuery[0]);
     2052            if (rc) fRc = FALSE;
     2053
     2054            /* author relations */
     2055            sprintf(&szQuery[0], "DELETE FROM fnauthor WHERE function %s", row[0]);
     2056            rc = mysql_query(pmysql, &szQuery[0]);
     2057            if (rc) fRc = FALSE;
     2058        }
     2059    }
     2060
     2061    sprintf(&szQuery[0],
     2062            "DELETE FROM function WHERE dll = %ld AND updated = 0",
     2063            lDll);
     2064    if (!fAll)
     2065        strcat(&szQuery[0], " AND type IN ('A', 'I')");
     2066    rc = mysql_query(pmysql, &szQuery[0]);
     2067    if (rc) fRc = FALSE;
     2068
     2069    return fRc;
     2070}
     2071
     2072
     2073
    19192074/**
    19202075 * Appends a set of strings to a query. The main string (pszStr) is enclosed in "'"s.
     
    19292084static char *sqlstrcat(char *pszQuery, const char *pszBefore, const char *pszStr, const char *pszAfter)
    19302085{
    1931     char *          pszLineStart = pszQuery;   
     2086    char *          pszLineStart = pszQuery;
    19322087    register char   ch;
    19332088
     
    19822137                *pszQuery++ = 'n';
    19832138                break;
    1984            
     2139
    19852140            case '\t':
    19862141                *pszQuery++ = '\\';
  • trunk/tools/database/db.h

    r3841 r3882  
    1 /* $Id: db.h,v 1.10 2000-07-18 07:35:00 bird Exp $ */
     1/* $Id: db.h,v 1.11 2000-07-21 21:09:45 bird Exp $ */
    22/*
    33 * DB - contains all database routines
     
    1919*   Defined Constants                                                          *
    2020*******************************************************************************/
    21 #define NBR_PARAMETERS      30
    22 #define NBR_FUNCTIONS       20
    23 #define NBR_AUTHORS         20
    24 #define ALIAS_NULL          -1
    25 #define ALIAS_DONTMIND      -2
     21#define NBR_PARAMETERS                  30
     22#define NBR_FUNCTIONS                   20
     23#define NBR_AUTHORS                     20
     24
     25#define ALIAS_NULL                      -1
     26#define ALIAS_DONTMIND                  -2
     27
     28/* type flags of function */
     29#define FUNCTION_ODIN32_API             'A' /* for Odin32 APIs (ie. LoadLibrary) */
     30#define FUNCTION_INTERNAL_ODIN32_API    'I' /* for Internal/Additional Odin32 APIs (ie. RegisterLxExe) */
     31#define FUNCTION_OTHER                  'O' /* for all other functions (ie. OSLibInitWSeBFileIO) */
     32
     33/* type flags of dll */
     34#define DLL_ODIN32_API                  'A' /* for Odin32 API dll (ie. kernel32) */
     35#define DLL_INTERNAL                    'I' /* for Internal Odin32 (API) dll (ie. odincrt) */
     36#define DLL_SUPPORT                     'S' /* for support stuff (ie. pe.exe and win32k.sys). */
     37#define DLL_TOOLS                       'T' /* for tools (executables and dlls) */
    2638
    2739
     
    8193*   Exported Functions                                                         *
    8294*******************************************************************************/
    83     char *          _System dbGetLastErrorDesc(void);
     95    char *           _System dbGetLastErrorDesc(void);
    8496
    85     BOOL            _System dbConnect(const char *pszHost,
    86                                       const char *pszUser,
    87                                       const char *pszPassword,
    88                                       const char *pszDatabase);
    89     BOOL            _System dbDisconnect();
    90     signed short    _System dbGetDll(const char *pszDllName);
    91     signed long     _System dbCountFunctionInDll(signed long ulDll,
    92                                                  BOOL fNotAliases);
    93     signed short    _System dbCheckInsertDll(const char *pszDll);
    94     unsigned short  _System dbGet(const char *pszTable,
    95                                   const char *pszGetColumn,
    96                                   const char *pszMatch1,
    97                                   const char *pszMatchValue1);
    98     BOOL            _System dbInsertUpdateFunction(unsigned short usDll,
    99                                                    const char *pszFunction,
    100                                                    const char *pszIntFunction,
    101                                                    unsigned long ulOrdinal,
    102                                                    BOOL fIgnoreOrdinal);
    103     BOOL            _System dbInsertUpdateFile(unsigned short usDll,
    104                                                const char *pszFilename,
    105                                                const char *pszDescription,
    106                                                const char *pszLastDateTime,
    107                                                signed long lLastAuthor,
    108                                                const char *pszRevision);
    109     BOOL            _System dbFindFunction(const char *pszFunctionName,
    110                                            PFNFINDBUF pFnFindBuf,
    111                                            signed long lDll);
    112     signed long     _System dbFindFile(signed long lDll, const char *pszFilename);
    113     signed long     _System dbFindAuthor(const char *pszAuthor, const char *pszEmail);
    114     signed long     _System dbGetFunctionState(signed long lRefCode);
    115     unsigned long   _System dbUpdateFunction(PFNDESC pFnDesc,
    116                                              signed long lDll,
    117                                              char *pszError);
    118     BOOL            _System dbRemoveDesignNotes(signed long lFile);
    119     BOOL            _System dbAddDesignNote(signed long lDll,
    120                                             signed long lFile,
    121                                             const char *pszTitle,
    122                                             const char *pszText,
    123                                             signed long lSeqNbr,
    124                                             signed long lSeqNbrFile);
    125     unsigned long   _System dbCreateHistory(char *pszError);
    126     unsigned long   _System dbCheckIntegrity(char *pszError);
     97    BOOL             _System dbConnect(const char *pszHost,
     98                                       const char *pszUser,
     99                                       const char *pszPassword,
     100                                       const char *pszDatabase);
     101    BOOL             _System dbDisconnect();
     102    signed long      _System dbGetDll(const char *pszDllName);
     103    signed long      _System dbCountFunctionInDll(signed long ulDll,
     104                                                  BOOL fNotAliases);
     105    signed long      _System dbCheckInsertDll(const char *pszDll, char fchType);
     106    unsigned short   _System dbGet(const char *pszTable,
     107                                   const char *pszGetColumn,
     108                                   const char *pszMatch1,
     109                                   const char *pszMatchValue1);
     110    BOOL             _System dbInsertUpdateFunction(signed long lDll,
     111                                                    const char *pszFunction,
     112                                                    const char *pszIntFunction,
     113                                                    unsigned long ulOrdinal,
     114                                                    BOOL fIgnoreOrdinal,
     115                                                    char fchType);
     116    BOOL             _System dbInsertUpdateFile(signed long lDll,
     117                                                const char *pszFilename,
     118                                                const char *pszDescription,
     119                                                const char *pszLastDateTime,
     120                                                signed long lLastAuthor,
     121                                                const char *pszRevision);
     122    BOOL             _System dbFindFunction(const char *pszFunctionName,
     123                                            PFNFINDBUF pFnFindBuf,
     124                                            signed long lDll);
     125    signed long      _System dbFindFile(signed long lDll, const char *pszFilename);
     126    signed long      _System dbFindAuthor(const char *pszAuthor, const char *pszEmail);
     127    signed long      _System dbGetFunctionState(signed long lRefCode);
     128    unsigned long    _System dbUpdateFunction(PFNDESC pFnDesc,
     129                                              signed long lDll,
     130                                              char *pszError);
     131    BOOL             _System dbRemoveDesignNotes(signed long lFile);
     132    BOOL             _System dbAddDesignNote(signed long lDll,
     133                                             signed long lFile,
     134                                             const char *pszTitle,
     135                                             const char *pszText,
     136                                             signed long lSeqNbr,
     137                                             signed long lSeqNbrFile);
     138    unsigned long    _System dbCreateHistory(char *pszError);
     139    unsigned long    _System dbCheckIntegrity(char *pszError);
    127140
    128141    /* kHtml stuff */
    129     void *          _System dbExecuteQuery(const char *pszQuery);
    130     signed long     _System dbQueryResultRows(void *pres);
    131     BOOL            _System dbFreeResult(void *pres);
    132     BOOL            _System dbFetch(void *pres,
    133                                     DBCALLBACKFETCH dbFetchCallBack,
    134                                     void *pvUser);
    135     signed long     _System dbDateToDaysAfterChrist(const char *pszDate);
    136     BOOL            _System dbDaysAfterChristToDate(signed long ulDays,
     142    void *           _System dbExecuteQuery(const char *pszQuery);
     143    signed long      _System dbQueryResultRows(void *pres);
     144    BOOL             _System dbFreeResult(void *pres);
     145    BOOL             _System dbFetch(void *pres,
     146                                     DBCALLBACKFETCH dbFetchCallBack,
     147                                     void *pvUser);
     148    signed long      _System dbDateToDaysAfterChrist(const char *pszDate);
     149    BOOL             _System dbDaysAfterChristToDate(signed long ulDays,
    137150                                                    char *pszDate);
    138151    /* StateUpd stuff */
    139     BOOL            _System dbGetNotUpdatedFunction(signed long lDll,
    140                                                     DBCALLBACKFETCH dbFetchCallBack);
    141     signed long     _System dbGetNumberOfUpdatedFunction(signed long lDll);
     152    BOOL             _System dbGetNotUpdatedFunction(signed long lDll,
     153                                                     DBCALLBACKFETCH dbFetchCallBack);
     154    signed long      _System dbGetNumberOfUpdatedFunction(signed long lDll);
     155
     156    /* APIImport stuff */
     157    BOOL             _System dbClearUpdateFlagFile(signed long lDll);
     158    BOOL             _System dbClearUpdateFlagFunction(signed long lDll, BOOL fAll);
     159    BOOL             _System dbDeleteNotUpdatedFiles(signed long lDll);
     160    BOOL             _System dbDeleteNotUpdatedFunctions(signed long lDll, BOOL fAll);
    142161
    143162#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.