Changeset 64


Ignore:
Timestamp:
Apr 26, 2001, 10:21:31 PM (24 years ago)
Author:
umoeller
Message:

Sources as for V0.9.11.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/except.h

    r41 r64  
    118118     ********************************************************************/
    119119
     120    VOID _Optlink excExplainException(FILE *file,
     121                                      PSZ pszHandlerName,
     122                                      PEXCEPTIONREPORTRECORD pReportRec,
     123                                      PCONTEXTRECORD pContextRec);
     124
    120125    VOID excRegisterHooks(PFNEXCOPENFILE pfnExcOpenFileNew,
    121126                          PFNEXCHOOK pfnExcHookNew,
  • trunk/include/helpers/gpih.h

    r56 r64  
    7979    #define RGBCOL_DARKGRAY         0x00808080
    8080
    81     VOID XWPENTRY gpihManipulateRGB(PLONG plColor, BYTE bMultiplier, BYTE bDivisor);
    82     typedef VOID XWPENTRY GPIHMANIPULATERGB(PLONG plColor, BYTE bMultiplier, BYTE bDivisor);
     81    VOID XWPENTRY gpihManipulateRGB(PLONG plColor, double dFactor);
     82    typedef VOID XWPENTRY GPIHMANIPULATERGB(PLONG plColor, double dFactor);
    8383    typedef GPIHMANIPULATERGB *PGPIHMANIPULATERGB;
    8484
  • trunk/include/helpers/procstat.h

    r57 r64  
    573573     *@@ QS32EVENT:
    574574     *
    575      *@@added V [umoeller]
     575     *@@added V0.9.10 (2001-04-08) [umoeller]
    576576     */
    577577
  • trunk/include/helpers/ras.h

    r7 r64  
     1
    12/*
    23 *@@sourcefile ras.h:
  • trunk/include/helpers/timer.h

    r44 r64  
     1
    12/*
    23 *@@sourcefile threads.h:
  • trunk/include/helpers/xml.h

    r39 r64  
    3636        #define __SIMPLES_DEFINED
    3737    #endif
     38
     39    /* ******************************************************************
     40     *
     41     *   Error handling
     42     *
     43     ********************************************************************/
    3844
    3945    typedef enum _DOMERROR
     
    7278        ERROR_DOM_NO_ELEMENT,
    7379        ERROR_DOM_DUPLICATE_DOCTYPE,
    74         ERROR_DOM_DOCTYPE_STRUCTURE,
     80        ERROR_DOM_DOCTYPE_ROOT_NAMES_MISMATCH,
    7581                // DOCTYPE is given and root element name does not match doctype name
    7682        ERROR_DOM_INTEGRITY,
    77         ERROR_DOM_DUPLICATE_ATTRIBUTE
     83        ERROR_DOM_DUPLICATE_ATTRIBUTE,
     84
     85        // @@@todo these
     86        ERROR_DOM_VALIDATE_INVALID_ELEMENT,
     87        ERROR_DOM_ELEMENT_DECL_OUTSIDE_DOCTYPE,
     88        ERROR_DOM_ATTLIST_DECL_OUTSIDE_DOCTYPE
    7889    } DOMERROR;
     90
     91    const char* xmlDescribeError(int code);
    7992
    8093    /* ******************************************************************
     
    185198     +      --------------+-------------+--------------+------------+--------------
    186199     +                    |             |              |            |
    187      +      ELEMENT       | tag name    | 0          8  | ELEMENT    | ATTRIBUTE
     200     +      ELEMENT       | tag name    | 0            | ELEMENT    | ATTRIBUTE
    188201     +                    |             |              | nodes      | nodes
    189202     +                    |             |              |            |
     
    306319
    307320    VOID xmlDeleteNode(PNODEBASE pNode);
     321
     322    /* ******************************************************************
     323     *
     324     *   Specific DOM node constructors
     325     *
     326     ********************************************************************/
     327
     328    APIRET xmlCreateElementNode(PDOMNODE pParent,
     329                                const char *pcszElement,
     330                                PDOMNODE *ppNew);
     331
     332    APIRET xmlCreateAttributeNode(PDOMNODE pElement,
     333                                  const char *pcszName,
     334                                  const char *pcszValue,
     335                                  PDOMNODE *ppNew);
     336
     337    APIRET xmlCreateTextNode(PDOMNODE pParent,
     338                             const char *pcszText,
     339                             ULONG ulLength,
     340                             PDOMNODE *ppNew);
     341
     342    APIRET xmlCreateCommentNode(PDOMNODE pParent,
     343                                const char *pcszText,
     344                                PDOMNODE *ppNew);
     345
     346    APIRET xmlCreatePINode(PDOMNODE pParent,
     347                           const char *pcszTarget,
     348                           const char *pcszData,
     349                           PDOMNODE *ppNew);
     350
     351    APIRET xmlCreateDocumentTypeNode(PDOMDOCUMENTNODE pDocumentNode,
     352                                     const char *pcszDoctypeName,
     353                                     const char *pcszSysid,
     354                                     const char *pcszPubid,
     355                                     int fHasInternalSubset,
     356                                     PDOMDOCTYPENODE *ppNew);
    308357
    309358    /* ******************************************************************
     
    541590    } CMNOTATIONDECLNODE, *PCMNOTATIONDECLNODE;
    542591
     592    APIRET xmlCreateElementDecl(const char *pcszName,
     593                                PXMLCONTENT pModel,
     594                                PCMELEMENTDECLNODE *ppNew);
     595
    543596    /* ******************************************************************
    544597     *
     
    561614
    562615        PDOMDOCUMENTNODE pDocumentNode;
     616                        // document node (contains all the elements)
    563617
    564618        PDOMDOCTYPENODE pDocTypeNode;
     
    593647    #define DF_PARSECOMMENTS        0x0001
    594648    #define DF_PARSEDTD             0x0002
     649    #define DF_FAIL_IF_NO_DTD       0x0004
    595650
    596651    APIRET xmlCreateDOM(ULONG flParserFlags,
     
    604659    APIRET xmlFreeDOM(PXMLDOM pDom);
    605660
     661    /* ******************************************************************
     662     *
     663     *   DOM lookup
     664     *
     665     ********************************************************************/
     666
    606667    PCMELEMENTDECLNODE xmlFindElementDecl(PXMLDOM pDom,
    607668                                          const XSTRING *pstrElementName);
    608669
    609670    PCMATTRIBUTEDECLBASE xmlFindAttribDeclBase(PXMLDOM pDom,
    610                                                  const XSTRING *pstrElementName);
     671                                               const XSTRING *pstrElementName);
    611672
    612673    PCMATTRIBUTEDECL xmlFindAttribDecl(PXMLDOM pDom,
     
    615676                                       PCMATTRIBUTEDECLBASE *ppAttribDeclBase);
    616677
     678    PDOMNODE xmlGetRootElement(PXMLDOM pDom);
     679
     680    PDOMNODE xmlGetFirstChild(PDOMNODE pDomNode);
     681
     682    PDOMNODE xmlGetLastChild(PDOMNODE pDomNode);
     683
     684    PDOMNODE xmlGetFirstText(PDOMNODE pElement);
     685
     686    PLINKLIST xmlGetElementsByTagName(PDOMNODE pParent,
     687                                      const char *pcszName);
     688
     689    const XSTRING* xmlGetAttribute(PDOMNODE pElement,
     690                                   const char *pcszAttribName);
     691
    617692#endif
    618693
  • trunk/include/helpers/xprf.h

    r14 r64  
    44 *      header file for xprf.c. See remarks there.
    55 *
    6  *      This file is new with V0.82.
     6 *      This file was new with V0.9.5 (?).
    77 *
    88 *      Note: Version numbering in this file relates to XWorkplace version
  • trunk/include/helpers/xstring.h

    r45 r64  
    116116                           ULONG ulFirstReplOfs,
    117117                           ULONG cReplLen,
    118                            const XSTRING *pstrReplaceWith);
     118                           const char *pcszReplaceWith,
     119                           ULONG cReplaceWithLen);
    119120    typedef ULONG XWPENTRY XSTRRPL(PXSTRING pxstr,
    120121                                   ULONG ulFirstReplOfs,
    121122                                   ULONG cReplLen,
    122                                    const XSTRING *pstrReplaceWith);
     123                                   const char *pcszReplaceWith,
     124                                   ULONG cReplaceWithLen);
    123125    typedef XSTRRPL *PXSTRRPL;
    124126
  • trunk/src/helpers/dosh.c

    r63 r64  
    21862186
    21872187/*
    2188  *@@ doshFindExecutable:
    2189  *      this searches the PATH for the specified pcszCommand
    2190  *      by calling DosSearchPath.
    2191  *
    2192  *      papcszExtensions determines if additional searches are to be
    2193  *      performed if DosSearchPath returns ERROR_FILE_NOT_FOUND.
    2194  *      This must point to an array of strings specifying the extra
    2195  *      extensions to search for.
    2196  *
    2197  *      If both papcszExtensions and cExtensions are null, no
    2198  *      extra searches are performed.
    2199  *
    2200  *      If this returns NO_ERROR, pszExecutable receives
    2201  *      the full path of the executable found by DosSearchPath.
    2202  *      Otherwise ERROR_FILE_NOT_FOUND is returned.
    2203  *
    2204  *      Example:
    2205  *
    2206  +      const char *aExtensions[] = {  "EXE",
    2207  +                                     "COM",
    2208  +                                     "CMD"
    2209  +                                  };
    2210  +      CHAR szExecutable[CCHMAXPATH];
    2211  +      APIRET arc = doshFindExecutable("lvm",
    2212  +                                      szExecutable,
    2213  +                                      sizeof(szExecutable),
    2214  +                                      aExtensions,
    2215  +                                      3);
    2216  *
    2217  *@@added V0.9.9 (2001-03-07) [umoeller]
    2218  */
    2219 
    2220 APIRET doshFindExecutable(const char *pcszCommand,      // in: command (e.g. "lvm")
    2221                           PSZ pszExecutable,            // out: full path (e.g. "F:\os2\lvm.exe")
    2222                           ULONG cbExecutable,           // in: sizeof (*pszExecutable)
    2223                           const char **papcszExtensions, // in: array of extensions (without dots)
    2224                           ULONG cExtensions)            // in: array item count
    2225 {
    2226     APIRET arc = DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY,
    2227                                "PATH",
    2228                                (PSZ)pcszCommand,
    2229                                pszExecutable,
    2230                                cbExecutable);
    2231     if (    (arc == ERROR_FILE_NOT_FOUND)           // not found?
    2232          && (cExtensions)                    // any extra searches wanted?
    2233        )
    2234     {
    2235         // try additional things then
    2236         PSZ psz2 = (PSZ)malloc(strlen(pcszCommand) + 20);
    2237         if (psz2)
    2238         {
    2239             ULONG   ul;
    2240             for (ul = 0;
    2241                  ul < cExtensions;
    2242                  ul++)
    2243             {
    2244                 const char *pcszExtThis = papcszExtensions[ul];
    2245                 sprintf(psz2, "%s.%s", pcszCommand, pcszExtThis);
    2246                 arc = DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY,
    2247                                     "PATH",
    2248                                     psz2,
    2249                                     pszExecutable,
    2250                                     cbExecutable);
    2251                 if (arc != ERROR_FILE_NOT_FOUND)
    2252                     break;
    2253             }
    2254 
    2255             free(psz2);
    2256         }
    2257         else
    2258             arc = ERROR_NOT_ENOUGH_MEMORY;
    2259     }
    2260 
    2261     return (arc);
    2262 }
    2263 
    2264 /*
    22652188 *@@ doshExecVIO:
    22662189 *      executes cmd.exe with the /c parameter
  • trunk/src/helpers/dosh2.c

    r59 r64  
    23592359    free(paResources);
    23602360    return (NO_ERROR);
     2361}
     2362
     2363/*
     2364 * FindFile:
     2365 *      helper for doshFindExecutable.
     2366 *
     2367 *added V0.9.11 (2001-04-25) [umoeller]
     2368 */
     2369
     2370APIRET FindFile(const char *pcszCommand,      // in: command (e.g. "lvm")
     2371                PSZ pszExecutable,            // out: full path (e.g. "F:\os2\lvm.exe")
     2372                ULONG cbExecutable)           // in: sizeof (*pszExecutable)
     2373{
     2374    APIRET arc = NO_ERROR;
     2375    FILESTATUS3 fs3;
     2376
     2377    if (    (strchr(pcszCommand, '\\'))
     2378         || (strchr(pcszCommand, ':'))
     2379       )
     2380    {
     2381        // looks like this is qualified:
     2382        arc = DosQueryPathInfo((PSZ)pcszCommand,
     2383                               FIL_STANDARD,
     2384                               &fs3,
     2385                               sizeof(fs3));
     2386        if (!arc)
     2387            if (!(fs3.attrFile & FILE_DIRECTORY))
     2388                strhncpy0(pszExecutable,
     2389                          pcszCommand,
     2390                          cbExecutable);
     2391            else
     2392                // directory:
     2393                arc = ERROR_INVALID_EXE_SIGNATURE;
     2394    }
     2395    else
     2396        // non-qualified:
     2397        arc = DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY,
     2398                            "PATH",
     2399                            (PSZ)pcszCommand,
     2400                            pszExecutable,
     2401                            cbExecutable);
     2402
     2403    return (arc);
     2404}
     2405
     2406/*
     2407 *@@ doshFindExecutable:
     2408 *      this attempts to find an executable by doing the
     2409 *      following:
     2410 *
     2411 *      1)  If pcszCommand appears to be qualified (i.e. contains
     2412 *          a backslash), this checks for whether the file exists.
     2413 *
     2414 *      2)  If pcszCommand contains no backslash, this calls
     2415 *          DosSearchPath in order to find the full path of the
     2416 *          executable.
     2417 *
     2418 *      papcszExtensions determines if additional searches are to be
     2419 *      performed if the file doesn't exist (case 1) or DosSearchPath
     2420 *      returned ERROR_FILE_NOT_FOUND (case 2).
     2421 *      This must point to an array of strings specifying the extra
     2422 *      extensions to search for.
     2423 *
     2424 *      If both papcszExtensions and cExtensions are null, no
     2425 *      extra searches are performed.
     2426 *
     2427 *      If this returns NO_ERROR, pszExecutable receives
     2428 *      the full path of the executable found by DosSearchPath.
     2429 *      Otherwise ERROR_FILE_NOT_FOUND is returned.
     2430 *
     2431 *      Example:
     2432 *
     2433 +      const char *aExtensions[] = {  "EXE",
     2434 +                                     "COM",
     2435 +                                     "CMD"
     2436 +                                  };
     2437 +      CHAR szExecutable[CCHMAXPATH];
     2438 +      APIRET arc = doshFindExecutable("lvm",
     2439 +                                      szExecutable,
     2440 +                                      sizeof(szExecutable),
     2441 +                                      aExtensions,
     2442 +                                      3);
     2443 *
     2444 *@@added V0.9.9 (2001-03-07) [umoeller]
     2445 *@@changed V0.9.11 (2001-04-25) [umoeller]: this never worked for qualified pcszCommand's, fixed
     2446 */
     2447
     2448APIRET doshFindExecutable(const char *pcszCommand,      // in: command (e.g. "lvm")
     2449                          PSZ pszExecutable,            // out: full path (e.g. "F:\os2\lvm.exe")
     2450                          ULONG cbExecutable,           // in: sizeof (*pszExecutable)
     2451                          const char **papcszExtensions, // in: array of extensions (without dots)
     2452                          ULONG cExtensions)            // in: array item count
     2453{
     2454    APIRET arc = FindFile(pcszCommand,
     2455                          pszExecutable,
     2456                          cbExecutable);
     2457
     2458    if (    (arc == ERROR_FILE_NOT_FOUND)           // not found?
     2459         && (cExtensions)                    // any extra searches wanted?
     2460       )
     2461    {
     2462        // try additional things then
     2463        PSZ psz2 = (PSZ)malloc(strlen(pcszCommand) + 20);
     2464        if (psz2)
     2465        {
     2466            ULONG   ul;
     2467            for (ul = 0;
     2468                 ul < cExtensions;
     2469                 ul++)
     2470            {
     2471                const char *pcszExtThis = papcszExtensions[ul];
     2472                sprintf(psz2, "%s.%s", pcszCommand, pcszExtThis);
     2473                arc = FindFile(psz2,
     2474                               pszExecutable,
     2475                               cbExecutable);
     2476                if (arc != ERROR_FILE_NOT_FOUND)
     2477                    break;
     2478            }
     2479
     2480            free(psz2);
     2481        }
     2482        else
     2483            arc = ERROR_NOT_ENOUGH_MEMORY;
     2484    }
     2485
     2486    return (arc);
    23612487}
    23622488
Note: See TracChangeset for help on using the changeset viewer.