Changeset 64
- Timestamp:
- Apr 26, 2001, 10:21:31 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/except.h
r41 r64 118 118 ********************************************************************/ 119 119 120 VOID _Optlink excExplainException(FILE *file, 121 PSZ pszHandlerName, 122 PEXCEPTIONREPORTRECORD pReportRec, 123 PCONTEXTRECORD pContextRec); 124 120 125 VOID excRegisterHooks(PFNEXCOPENFILE pfnExcOpenFileNew, 121 126 PFNEXCHOOK pfnExcHookNew, -
trunk/include/helpers/gpih.h
r56 r64 79 79 #define RGBCOL_DARKGRAY 0x00808080 80 80 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); 83 83 typedef GPIHMANIPULATERGB *PGPIHMANIPULATERGB; 84 84 -
trunk/include/helpers/procstat.h
r57 r64 573 573 *@@ QS32EVENT: 574 574 * 575 *@@added V [umoeller]575 *@@added V0.9.10 (2001-04-08) [umoeller] 576 576 */ 577 577 -
trunk/include/helpers/ras.h
r7 r64 1 1 2 /* 2 3 *@@sourcefile ras.h: -
trunk/include/helpers/timer.h
r44 r64 1 1 2 /* 2 3 *@@sourcefile threads.h: -
trunk/include/helpers/xml.h
r39 r64 36 36 #define __SIMPLES_DEFINED 37 37 #endif 38 39 /* ****************************************************************** 40 * 41 * Error handling 42 * 43 ********************************************************************/ 38 44 39 45 typedef enum _DOMERROR … … 72 78 ERROR_DOM_NO_ELEMENT, 73 79 ERROR_DOM_DUPLICATE_DOCTYPE, 74 ERROR_DOM_DOCTYPE_ STRUCTURE,80 ERROR_DOM_DOCTYPE_ROOT_NAMES_MISMATCH, 75 81 // DOCTYPE is given and root element name does not match doctype name 76 82 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 78 89 } DOMERROR; 90 91 const char* xmlDescribeError(int code); 79 92 80 93 /* ****************************************************************** … … 185 198 + --------------+-------------+--------------+------------+-------------- 186 199 + | | | | 187 + ELEMENT | tag name | 0 8| ELEMENT | ATTRIBUTE200 + ELEMENT | tag name | 0 | ELEMENT | ATTRIBUTE 188 201 + | | | nodes | nodes 189 202 + | | | | … … 306 319 307 320 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); 308 357 309 358 /* ****************************************************************** … … 541 590 } CMNOTATIONDECLNODE, *PCMNOTATIONDECLNODE; 542 591 592 APIRET xmlCreateElementDecl(const char *pcszName, 593 PXMLCONTENT pModel, 594 PCMELEMENTDECLNODE *ppNew); 595 543 596 /* ****************************************************************** 544 597 * … … 561 614 562 615 PDOMDOCUMENTNODE pDocumentNode; 616 // document node (contains all the elements) 563 617 564 618 PDOMDOCTYPENODE pDocTypeNode; … … 593 647 #define DF_PARSECOMMENTS 0x0001 594 648 #define DF_PARSEDTD 0x0002 649 #define DF_FAIL_IF_NO_DTD 0x0004 595 650 596 651 APIRET xmlCreateDOM(ULONG flParserFlags, … … 604 659 APIRET xmlFreeDOM(PXMLDOM pDom); 605 660 661 /* ****************************************************************** 662 * 663 * DOM lookup 664 * 665 ********************************************************************/ 666 606 667 PCMELEMENTDECLNODE xmlFindElementDecl(PXMLDOM pDom, 607 668 const XSTRING *pstrElementName); 608 669 609 670 PCMATTRIBUTEDECLBASE xmlFindAttribDeclBase(PXMLDOM pDom, 610 671 const XSTRING *pstrElementName); 611 672 612 673 PCMATTRIBUTEDECL xmlFindAttribDecl(PXMLDOM pDom, … … 615 676 PCMATTRIBUTEDECLBASE *ppAttribDeclBase); 616 677 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 617 692 #endif 618 693 -
trunk/include/helpers/xprf.h
r14 r64 4 4 * header file for xprf.c. See remarks there. 5 5 * 6 * This file is new with V0.82.6 * This file was new with V0.9.5 (?). 7 7 * 8 8 * Note: Version numbering in this file relates to XWorkplace version -
trunk/include/helpers/xstring.h
r45 r64 116 116 ULONG ulFirstReplOfs, 117 117 ULONG cReplLen, 118 const XSTRING *pstrReplaceWith); 118 const char *pcszReplaceWith, 119 ULONG cReplaceWithLen); 119 120 typedef ULONG XWPENTRY XSTRRPL(PXSTRING pxstr, 120 121 ULONG ulFirstReplOfs, 121 122 ULONG cReplLen, 122 const XSTRING *pstrReplaceWith); 123 const char *pcszReplaceWith, 124 ULONG cReplaceWithLen); 123 125 typedef XSTRRPL *PXSTRRPL; 124 126 -
trunk/src/helpers/dosh.c
r63 r64 2186 2186 2187 2187 /* 2188 *@@ doshFindExecutable:2189 * this searches the PATH for the specified pcszCommand2190 * by calling DosSearchPath.2191 *2192 * papcszExtensions determines if additional searches are to be2193 * performed if DosSearchPath returns ERROR_FILE_NOT_FOUND.2194 * This must point to an array of strings specifying the extra2195 * extensions to search for.2196 *2197 * If both papcszExtensions and cExtensions are null, no2198 * extra searches are performed.2199 *2200 * If this returns NO_ERROR, pszExecutable receives2201 * 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 count2225 {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 then2236 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 else2258 arc = ERROR_NOT_ENOUGH_MEMORY;2259 }2260 2261 return (arc);2262 }2263 2264 /*2265 2188 *@@ doshExecVIO: 2266 2189 * executes cmd.exe with the /c parameter -
trunk/src/helpers/dosh2.c
r59 r64 2359 2359 free(paResources); 2360 2360 return (NO_ERROR); 2361 } 2362 2363 /* 2364 * FindFile: 2365 * helper for doshFindExecutable. 2366 * 2367 *added V0.9.11 (2001-04-25) [umoeller] 2368 */ 2369 2370 APIRET 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 2448 APIRET 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); 2361 2487 } 2362 2488
Note:
See TracChangeset
for help on using the changeset viewer.