Changeset 15
- Timestamp:
- Dec 11, 2000, 8:54:20 AM (25 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/cnrh.h
r14 r15 347 347 * 348 348 * <B>Target emphasis:</B> 349 * 349 350 * For Name, Text, and Details view, per default target emphasis 350 351 * during d'n'd is only displayed _around_ the record core. 352 * This allows users to drop records onto each other. 351 353 * If you add CA_ORDEREDTARGETEMPH, target emphasis is only 352 * displayed _be low_ the record core. If you add CA_MIXEDTARGETEMPH,353 * both emphasis types are possible.354 * displayed _between_ records (to reorder records). 355 * If you add CA_MIXEDTARGETEMPH, both emphasis types are possible. 354 356 * 355 357 * Additional flags for _all_ views: -
trunk/include/helpers/dosh.h
r14 r15 46 46 47 47 BOOL doshIsWarp4(VOID); 48 49 APIRET doshQueryAvailPhysMem(PULONG pulMem,50 ULONG ulLogicalSwapDrive);51 48 52 49 PSZ doshQuerySysErrorMsg(APIRET arc); -
trunk/include/helpers/undoc.h
r14 r15 73 73 74 74 /* 75 * WPS object styles 76 * V0.9.7 (2000-12-10) [umoeller] 77 */ 78 79 #ifndef OBJSTYLE_LOCKEDINPLACE 80 #define OBJSTYLE_LOCKEDINPLACE 0x00020000 81 #endif 82 83 /* 75 84 * Some more OS/2 default menu items: 76 85 * -
trunk/include/helpers/xstring.h
r14 r15 55 55 56 56 void XWPENTRY xstrInitSet(PXSTRING pxstr, PSZ pszNew); 57 typedef void XWPENTRY XSTRINITSET(PXSTRING pxstr, PSZ pszNew); 58 typedef XSTRINITSET *PXSTRINITSET; 57 59 58 60 void XWPENTRY xstrInitCopy(PXSTRING pxstr, const char *pcszSource); 61 typedef void XWPENTRY XSTRINITCOPY(PXSTRING pxstr, const char *pcszSource); 62 typedef XSTRINITCOPY *PXSTRINITCOPY; 59 63 60 64 void XWPENTRY xstrClear(PXSTRING pxstr); … … 63 67 64 68 PXSTRING XWPENTRY xstrCreate(ULONG ulPreAllocate); 69 typedef PXSTRING XWPENTRY XSTRCREATE(ULONG ulPreAllocate); 70 typedef XSTRCREATE *PXSTRCREATE; 65 71 66 72 VOID XWPENTRY xstrFree(PXSTRING pxstr); 73 typedef VOID XWPENTRY XSTRFREE(PXSTRING pxstr); 74 typedef XSTRFREE *PXSTRFREE; 67 75 68 76 ULONG XWPENTRY xstrset(PXSTRING pxstr, PSZ pszNew); 77 typedef ULONG XWPENTRY XSTRSET(PXSTRING pxstr, PSZ pszNew); 78 typedef XSTRSET *PXSTRSET; 69 79 70 80 ULONG XWPENTRY xstrcpy(PXSTRING pxstr, const char *pcszSource); 81 typedef ULONG XWPENTRY XSTRCPY(PXSTRING pxstr, const char *pcszSource); 82 typedef XSTRCPY *PXSTRCPY; 71 83 72 84 ULONG XWPENTRY xstrcat(PXSTRING pxstr, const char *pcszSource); 73 85 typedef ULONG XWPENTRY XSTRCAT(PXSTRING pxstr, const char *pcszSource); 74 86 typedef XSTRCAT *PXSTRCAT; 87 88 ULONG XWPENTRY xstrcatc(PXSTRING pxstr, CHAR c); 89 typedef ULONG XWPENTRY XSTRCATC(PXSTRING pxstr, CHAR c); 90 typedef XSTRCATC *PXSTRCATC; 75 91 76 92 /* … … 90 106 const char *pcszBeginChars, 91 107 const char *pcszEndChars); 108 typedef PSZ XWPENTRY XSTRFINDWORD(const XSTRING *pxstr, 109 ULONG ulOfs, 110 const XSTRING *pstrFind, 111 size_t *pShiftTable, 112 PBOOL pfRepeatFind, 113 const char *pcszBeginChars, 114 const char *pcszEndChars); 115 typedef XSTRFINDWORD *PXSTRFINDWORD; 92 116 93 117 ULONG XWPENTRY xstrrpl(PXSTRING pxstr, … … 97 121 size_t *pShiftTable, 98 122 PBOOL pfRepeatFind); 123 typedef ULONG XWPENTRY XSTRRPL(PXSTRING pxstr, 124 PULONG pulOfs, 125 const XSTRING *pstrSearch, 126 const XSTRING *pstrReplace, 127 size_t *pShiftTable, 128 PBOOL pfRepeatFind); 129 typedef XSTRRPL *PXSTRRPL; 99 130 100 131 ULONG XWPENTRY xstrcrpl(PXSTRING pxstr, … … 102 133 const char *pcszSearch, 103 134 const char *pcszReplace); 135 typedef ULONG XWPENTRY XSTRCRPL(PXSTRING pxstr, 136 PULONG pulOfs, 137 const char *pcszSearch, 138 const char *pcszReplace); 139 typedef XSTRCRPL *PXSTRCRPL; 104 140 #endif 105 141 -
trunk/include/setup.h
r7 r15 8 8 #ifndef SETUP_HEADER_INCLUDED 9 9 #define SETUP_HEADER_INCLUDED 10 11 // XWPEXPORT defines the standard linkage for the 12 // XWorkplace helpers. 13 #ifdef __EMX__ 14 #define XWPENTRY 15 #elif defined (__IBMCPP__) || defined (__IBMC__) 16 #define XWPENTRY _Optlink 17 #endif 10 18 11 19 /************************************************************* -
trunk/src/helpers/animate.c
r14 r15 41 41 #define INCL_DOSDEVICES 42 42 #define INCL_DOSDEVIOCTL 43 #define INCL_DOSMISC 43 44 #define INCL_DOSERRORS 44 45 … … 58 59 #include "helpers\animate.h" 59 60 60 #include "helpers\datetime.h"61 61 #include "helpers\winh.h" 62 62 #include "helpers\gpih.h" … … 85 85 * Returns the count of animation steps that were drawn. 86 86 * This is dependent on the speed of the system. 87 * 88 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime 87 89 */ 88 90 … … 122 124 // 2) since large bitmaps take more time to calculate, 123 125 // the animation won't appear to slow down then 124 ulInitialTime = dtGetULongTime(); 126 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 127 &ulInitialTime, 128 sizeof(ulInitialTime)); 125 129 ul = 1; 126 130 ulSteps = 1000; … … 137 141 DBM_STRETCH); 138 142 139 ulNowTime = dtGetULongTime(); 143 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 144 &ulNowTime, 145 sizeof(ulNowTime)); 140 146 141 147 // recalculate ul: rule of three based on the … … 175 181 * been acquired using WinGetScreenPS, 176 182 * ulSteps should be around 40-50. 183 * 184 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime 177 185 */ 178 186 … … 195 203 ulPhase = 1; 196 204 197 do { 198 ULONG ulFromTime = dtGetULongTime(); 205 do 206 { 207 ULONG ulFromTime, ulTime2; 208 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 209 &ulFromTime, 210 sizeof(ulFromTime)); 199 211 200 212 if (ulPhase == 1) … … 225 237 rclNow.yTop = (rclScreen.yTop) - rclNow.yBottom; 226 238 227 if (rclNow.yBottom > (rclNow.yTop - LAST_WIDTH) ) { 239 if (rclNow.yBottom > (rclNow.yTop - LAST_WIDTH) ) 240 { 228 241 rclNow.yBottom = (rclScreen.yTop / 2) - LAST_WIDTH; 229 242 rclNow.yTop = (rclScreen.yTop / 2) + LAST_WIDTH; … … 262 275 263 276 // done with "shrinking"? 264 if ( rclNow.xRight < ((rclScreen.xRight / 2) + LAST_WIDTH) ) {277 if ( rclNow.xRight < ((rclScreen.xRight / 2) + LAST_WIDTH) ) 265 278 ulPhase = 2; // exit 266 267 268 } else if (ulPhase == 2){279 } 280 else if (ulPhase == 2) 281 { 269 282 // Phase 2: draw a horizontal white line about 270 283 // where the last rclNow was. This is only … … 290 303 ul = 0; 291 304 292 } else if (ulPhase == 3) { 305 } 306 else if (ulPhase == 3) 307 { 293 308 // Phase 3: make the white line shorter with 294 309 // every iteration by drawing black rectangles … … 324 339 325 340 ul++; 326 if (ul > LAST_STEPS) {341 if (ul > LAST_STEPS) 327 342 ulPhase = 99; 328 }329 343 } 330 344 331 345 ul++; 332 346 333 while (dtGetULongTime() < ulFromTime + WAIT_TIME) { 334 // PSZ p = NULL; // keep compiler happy 335 } 347 DosSleep(WAIT_TIME); 348 349 /* do 350 { 351 DosSleep(0); 352 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 353 &ulTime2, 354 sizeof(ulTime2)); 355 } while (ulTime2 < ulFromTime + WAIT_TIME); */ 336 356 } while (ulPhase != 99); 337 357 -
trunk/src/helpers/cnrh.c
r14 r15 1644 1644 * 1645 1645 * -- the container sends CN_INITDRAG ("real" d'n'd desired by user); 1646 * 1646 1647 * -- the container sends us CN_PICKUP (Alt+MB2 pressed); 1648 * 1647 1649 * -- the user has selected "Pickup" from a record core's 1648 1650 * context menu (ID_XSMI_FILETYPES_PICKUP command). … … 1674 1676 * -- ulItemID will be set to the preccDrag so that the target 1675 1677 * window can access the dragged record. 1678 * 1676 1679 * -- hstrSourceName == hstrTargetName gets the RECORDCORE.pszIcon. 1677 1680 * 1678 1681 * The drag icon will be a default system file icon. 1682 * 1683 * Preconditions: 1684 * 1685 * -- pszIcon must be set in the RECORDCORE. This is used for 1686 * the item source name. This must not be NULL. 1679 1687 */ 1680 1688 -
trunk/src/helpers/datetime.c
r14 r15 41 41 // as unsigned char 42 42 43 #define INCL_DOSMISC 43 44 #include <os2.h> 44 45 … … 73 74 * time in milliseconds. 74 75 * 75 * Even though this does handle date information (i.e.76 * will still return an increasing number when the77 * clock switches from 23:59:59:9999 to 0:00:00:0000),78 * this will not work forver after the first call.79 * Here's the calculation:80 *81 + 1000 ms per second82 + * 60 secs per minute83 + * 60 minutes per hour84 + * 24 hours per day85 + = 86'400'000 after 23:59:59:999986 *87 76 * A ULONG can hold a max value of 4'294'967'295. 88 77 * So this overflows after 49.71... days. 89 78 * 90 *@@ changed V0.9.7 (2000-12-05) [umoeller]: now handling date also79 *@@V0.9.7 (2000-12-08) [umoeller]: replaced, now using DosQuerySysInfo(QSV_MS_COUNT) 91 80 */ 92 81 93 82 ULONG dtGetULongTime(VOID) 94 83 { 95 DATETIME dt; 96 ULONG ulTime, 97 ulDateScalarPassed = 1; 98 DosGetDateTime(&dt); 99 ulTime = (10*(dt.hundredths + 100*(dt.seconds + 60*(dt.minutes + 60*(dt.hours))))); 84 ULONG ulTimeNow; 85 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 86 &ulTimeNow, 87 sizeof(ulTimeNow)); 88 return (ulTimeNow); 89 90 /* DATETIME dt; 91 ULONG ulHours, 92 ulDaysPassed = 0; 100 93 101 94 if (G_ulDateScalarFirstCalled == 0) … … 112 105 dt.month, 113 106 dt.day); 114 // calculate days passed since first call; 115 // this should be 1 if the date hasn't changed 116 ulDateScalarPassed = (G_ulDateScalarFirstCalled - ulDateScalarNow) + 1; 107 ulDaysPassed = (ulDateScalarNow - G_ulDateScalarFirstCalled); 108 _Pmpf((__FUNCTION__ ": days passed = %d", ulDaysPassed)); 117 109 } 118 110 119 return (ulTime * ulDateScalarPassed); 111 DosGetDateTime(&dt); 112 ulHours = dt.hours; // this is UCHAR in DATETIME 113 // get the hours; for every day passed, add 24 hours... 114 ulHours += (24 * ulDaysPassed); 115 // 0 if we're still on the first date 116 117 return (10*(dt.hundredths + 100*(dt.seconds + 60*(dt.minutes + 60*(ulHours))))); */ 120 118 } 121 119 -
trunk/src/helpers/dosh.c
r14 r15 178 178 179 179 return (s_brc); 180 }181 182 /*183 *@@ doshQueryAvailPhysMem:184 * returns the amount of physical memory which185 * is presently available (before the swapper186 * would have to be expanded).187 *188 * This number is calculated by getting the189 * total available memory (QSV_TOTRESMEM)190 * and subtracting the free space on the191 * drive with the swap file from it.192 *193 * As a result, you also need to specify194 * the logical drive on which the swapper195 * resides (3 = C, 4 = D, and so on).196 *197 *@@added V0.9.7 (2000-12-01) [umoeller]198 */199 200 APIRET doshQueryAvailPhysMem(PULONG pulMem,201 ULONG ulLogicalSwapDrive)202 {203 APIRET arc = DosQuerySysInfo(QSV_TOTAVAILMEM,204 QSV_TOTAVAILMEM,205 pulMem,206 sizeof(*pulMem));207 if (arc == NO_ERROR)208 {209 double dFree = 0;210 arc = doshQueryDiskFree(ulLogicalSwapDrive,211 &dFree);212 *pulMem -= (ULONG)dFree;213 }214 215 return (arc);216 180 } 217 181 … … 895 859 * 896 860 *@@added V0.9.6 (2000-10-16) [umoeller] 861 *@@changed V0.9.7 (2000-12-10) [umoeller]: fixed "F:filename.ext" case 897 862 */ 898 863 899 864 PSZ doshGetExtension(const char *pcszFilename) 900 865 { 901 PSZ p szExtension = 0;866 PSZ pReturn = NULL; 902 867 903 868 if (pcszFilename) 904 869 { 905 870 // find filename 906 PSZ p2 = strrchr(pcszFilename + 2, '\\'), 907 // works on "C:\blah" or "\\unc\blah" 908 p3 = NULL; 909 910 if (!p2) 911 // no backslash found: then this is not qualified... 912 // use start of filename 913 p2 = (PSZ)pcszFilename; 871 const char *p2 = strrchr(pcszFilename + 2, '\\'), 872 // works on "C:\blah" or "\\unc\blah" 873 *pStartOfName = NULL, 874 *pExtension = NULL; 875 876 if (p2) 877 pStartOfName = p2 + 1; 878 else 879 { 880 // no backslash found: 881 // maybe only a drive letter was specified: 882 if (*(pcszFilename + 1) == ':') 883 // yes: 884 pStartOfName = pcszFilename + 2; 885 else 886 // then this is not qualified at all... 887 // use start of filename 888 pStartOfName = (PSZ)pcszFilename; 889 } 914 890 915 891 // find last dot in filename 916 p 3 = strrchr(p2 + 1, '.');917 if (p 3)918 p szExtension = p3+ 1;919 } 920 921 return (p szExtension);892 pExtension = strrchr(pStartOfName, '.'); 893 if (pExtension) 894 pReturn = (PSZ)pExtension + 1; 895 } 896 897 return (pReturn); 922 898 } 923 899 -
trunk/src/helpers/except.c
r14 r15 516 516 { 517 517 case XCPT_ACCESS_VIOLATION: 518 {519 518 fprintf(file, "\nXCPT_ACCESS_VIOLATION: "); 520 519 if (pReportRec->ExceptionInfo[0] & XCPT_READ_ACCESS) … … 538 537 " confusion with administering memory or error conditions \n" 539 538 " were not properly checked for.\n"); 540 break; 541 } 539 break; 542 540 543 541 case XCPT_INTEGER_DIVIDE_BY_ZERO: 544 {545 542 fprintf(file, "\nXCPT_INTEGER_DIVIDE_BY_ZERO.\n"); 546 543 fprintf(file, 547 544 "Explanation: An attempt was made to divide an integer value by zero,\n" 548 545 " which is not defined.\n"); 549 break; 550 } 546 break; 551 547 552 548 case XCPT_ILLEGAL_INSTRUCTION: 553 {554 549 fprintf(file, "\nXCPT_ILLEGAL_INSTRUCTION.\n"); 555 550 fprintf(file, 556 551 "Explanation: An attempt was made to execute an instruction that\n" 557 552 " is not defined on this machine's architecture.\n"); 558 break; 559 } 553 break; 560 554 561 555 case XCPT_PRIVILEGED_INSTRUCTION: 562 {563 556 fprintf(file, "\nXCPT_PRIVILEGED_INSTRUCTION.\n"); 564 557 fprintf(file, … … 566 559 " is not permitted in the current machine mode or that\n" 567 560 " XFolder had no permission to execute.\n"); 568 break; 569 } 561 break; 570 562 571 563 case XCPT_INTEGER_OVERFLOW: … … 575 567 " significant bit. This is a sign of an attempt to store\n" 576 568 " a value which does not fit into an integer variable.\n"); 569 break; 577 570 578 571 default: 579 572 fprintf(file, "\nUnknown OS/2 exception number %d.\n", pReportRec->ExceptionNum); 580 573 fprintf(file, "Look this up in the OS/2 header files.\n"); 574 break; 581 575 } 582 576 -
trunk/src/helpers/helpers_post.in
r14 r15 45 45 $(OUTPUTDIR)\animate.obj: $(@B).c $(HLPINC)\$(@B).h \ 46 46 $(PROJECTINC)\setup.h \ 47 $(HLPINC)\ datetime.h $(HLPINC)\winh.h $(HLPINC)\gpih.h \47 $(HLPINC)\winh.h $(HLPINC)\gpih.h \ 48 48 49 49 $(OUTPUTDIR)\cnrh.obj: $(@B).c $(HLPINC)\$(@B).h \ -
trunk/src/helpers/timer.c
r14 r15 71 71 #define INCL_DOSPROCESS 72 72 #define INCL_DOSSEMAPHORES 73 #define INCL_DOSMISC 73 74 #define INCL_DOSERRORS 74 75 #include <os2.h> … … 190 191 * is stopped thru tmrStopTimer, which then 191 192 * sets the thread's fExit flag to TRUE. 193 * 194 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime 192 195 */ 193 196 … … 244 247 { 245 248 PXTIMER pTimer = (PXTIMER)pTimerNode->pItemData; 246 ULONG ulTimeNow = dtGetULongTime(); 249 ULONG ulTimeNow; 250 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 251 &ulTimeNow, sizeof(ulTimeNow)); 247 252 248 253 if (pTimer->ulNextFire < ulTimeNow) … … 357 362 * 358 363 * -- The caller must call LockTimers() first. 359 *360 *@@added V0.9.7 (2000-12-04) [umoeller]361 364 */ 362 365 … … 385 388 * 386 389 * The timer is _not_ stopped automatically 387 * when the wi dgetis destroyed.388 * 389 *@@ added V0.9.7 (2000-12-04) [umoeller]390 * when the window is destroyed. 391 * 392 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime 390 393 */ 391 394 … … 432 435 { 433 436 // exists already: reset only 434 pTimer->ulNextFire = dtGetULongTime() + ulTimeout; 437 ULONG ulTimeNow; 438 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 439 &ulTimeNow, sizeof(ulTimeNow)); 440 pTimer->ulNextFire = ulTimeNow + ulTimeout; 435 441 usrc = pTimer->usTimerID; 436 442 } … … 441 447 if (pTimer) 442 448 { 449 ULONG ulTimeNow; 450 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, 451 &ulTimeNow, sizeof(ulTimeNow)); 443 452 pTimer->usTimerID = usTimerID; 444 453 pTimer->hwndTarget = hwnd; 445 454 pTimer->ulTimeout = ulTimeout; 446 pTimer->ulNextFire = dtGetULongTime()+ ulTimeout;455 pTimer->ulNextFire = ulTimeNow + ulTimeout; 447 456 448 457 lstAppendItem(&G_llTimers, … … 476 485 * 477 486 * Returns TRUE if the timer was stopped. 478 *479 *@@added V0.9.7 (2000-12-04) [umoeller]480 487 */ 481 488 … … 523 530 * that you should call during WM_DESTROY of 524 531 * a window that has started timers. 525 *526 *@@added V0.9.7 (2000-12-04) [umoeller]527 532 */ 528 533 -
trunk/src/helpers/winh.c
r14 r15 2480 2480 * object. 2481 2481 * 2482 * Even though this isn't clearly said in PMREF, 2483 * PROGDETAILS.swpInitial is important: 2484 * 2485 * -- To start a session minimized, set SWP_MINIMIZE. 2486 * 2487 * -- To start a VIO session without auto-close, set 2488 * the half-documented SWP_NOAUTOCLOSE flag (0x8000) 2489 * This flag is now in the newer toolkit headers. 2490 * 2482 2491 * Since this calls WinStartApp in turn, this 2483 2492 * requires a message queue on the calling thread. 2484 2493 * 2485 2494 *@@added V0.9.6 (2000-10-16) [umoeller] 2495 *@@changed V0.9.7 (2000-12-10) [umoeller]: PROGDETAILS.swpInitial no longer zeroed... this broke VIOs 2486 2496 */ 2487 2497 … … 2500 2510 ProgDetails.Length = sizeof(PROGDETAILS); 2501 2511 ProgDetails.progt.fbVisible = SHE_VISIBLE; 2502 ProgDetails.pszEnvironment = 0; // "WORKPLACE\0\0"; 2503 memset(&ProgDetails.swpInitial, 0, sizeof(SWP)); 2512 ProgDetails.pszEnvironment = 0; 2513 2514 // memset(&ProgDetails.swpInitial, 0, sizeof(SWP)); 2515 // this wasn't a good idea... WPProgram stores stuff 2516 // in here, such as the "minimize on startup" -> SWP_MINIMIZE 2504 2517 2505 2518 // duplicate parameters... … … 2513 2526 2514 2527 // program type fixups 2515 switch (ProgDetails.progt.progc) 2528 switch (ProgDetails.progt.progc) // that's a ULONG 2516 2529 { 2517 2530 case ((ULONG)-1): // we get that sometimes... … … 2524 2537 switch (ProgDetails.progt.progc) 2525 2538 { 2526 case PROG_31_ENH :2527 case PROG_31_ENHSEAMLESSCOMMON: 2528 case PROG_31_ENH SEAMLESSVDM:2539 case PROG_31_ENHSEAMLESSVDM: // 17 2540 case PROG_31_ENHSEAMLESSCOMMON: // 18 2541 case PROG_31_ENH: // 19 2529 2542 fIsWindowsApp = TRUE; 2530 2543 fIsWindowsEnhApp = TRUE; 2531 2544 break; 2532 2545 2533 case PROG_WINDOW_AUTO: 2534 #ifdef PROG_30_STD 2535 case PROG_30_STD: 2546 #ifndef PROG_30_STD 2547 #define PROG_30_STD (PROGCATEGORY)11 2536 2548 #endif 2537 case PROG_31_STD: 2538 case PROG_WINDOW_REAL: 2539 #ifdef PROG_30_STDSEAMLESSVDM 2540 case PROG_30_STDSEAMLESSVDM: 2549 2550 #ifndef PROG_30_STDSEAMLESSVDM 2551 #define PROG_30_STDSEAMLESSVDM (PROGCATEGORY)13 2541 2552 #endif 2542 case PROG_31_STDSEAMLESSVDM: 2543 case PROG_30_STDSEAMLESSCOMMON: 2544 case PROG_31_STDSEAMLESSCOMMON: 2553 2554 case PROG_WINDOW_REAL: // 10 2555 case PROG_30_STD: // 11 2556 case PROG_WINDOW_AUTO: // 12 2557 case PROG_30_STDSEAMLESSVDM: // 13 2558 case PROG_30_STDSEAMLESSCOMMON: // 14 2559 case PROG_31_STDSEAMLESSVDM: // 15 2560 case PROG_31_STDSEAMLESSCOMMON: // 16 2561 case PROG_31_STD: // 20 2545 2562 fIsWindowsApp = TRUE; 2546 2563 break; … … 2705 2722 // do not use SAF_STARTCHILDAPP, or the 2706 2723 // app will be terminated automatically 2724 // when the WPS terminates! 2707 2725 2708 2726 // _Pmpf((__FUNCTION__ ": got happ 0x%lX", happ)); -
trunk/src/helpers/xstring.c
r14 r15 186 186 * this can be used instead of xstrInit if you 187 187 * want to initialize an XSTRING with a copy 188 * of an existing string. 188 * of an existing string. This is a shortcut 189 * for xstrInit() and then xstrcpy(). 189 190 * 190 191 * As opposed to xstrInitSet, this does create … … 382 383 * 383 384 * Returns the length of the new string (excluding the null 384 * terminator), or null upon errors. 385 * terminator) if the string was changed, or 0 if nothing 386 * happened. 387 * 388 * Note: To append a single character, xstrcatc is faster 389 * than xstrcat. 385 390 * 386 391 * Example: … … 391 396 + xstrcat(&str, "blup"); 392 397 * 393 * After this, psz points to a new string containing398 * After this, str.psz points to a new string containing 394 399 * "blahblup". 395 400 * … … 399 404 *@@changed V0.9.3 (2000-05-11) [umoeller]: returned 0 if pszString was initially empty; fixed 400 405 *@@changed V0.9.6 (2000-11-01) [umoeller]: rewritten 406 *@@changed V0.9.7 (2000-12-10) [umoeller]: return value was wrong 401 407 */ 402 408 … … 452 458 // in all cases, set new length 453 459 pxstr->ulLength += ulSourceLength; 454 ulrc = ulSourceLength;460 ulrc = pxstr->ulLength; // V0.9.7 (2000-12-10) [umoeller] 455 461 456 462 } // end if (ulSourceLength) … … 458 464 // do nothing 459 465 } 466 467 return (ulrc); 468 } 469 470 /* 471 *@@ xstrcatc: 472 * this is similar to xstrcat, except that this is 473 * for a single character. This is a bit faster than 474 * xstrcat. 475 * 476 * If "c" is \0, nothing happens. 477 * 478 * If pxstr is empty, this behaves just like xstrcpy. 479 * 480 * Returns the length of the new string (excluding the null 481 * terminator) if the string was changed, or 0 if nothing 482 * happened. 483 * 484 * Example: 485 * 486 + XSTRING str; 487 + xstrInit(&str, 0); 488 + xstrcpy(&str, "blu"); 489 + xstrcatc(&str, 'p'); 490 * 491 * After this, str.psz points to a new string containing 492 * "blup". 493 * 494 *@@added V0.9.7 (2000-12-10) [umoeller] 495 */ 496 497 ULONG xstrcatc(PXSTRING pxstr, // in/out: string 498 CHAR c) // in: character to append, can be \0 499 { 500 ULONG ulrc = 0; 501 502 if ((pxstr) && (c)) 503 { 504 // ULONG ulSourceLength = 1; 505 // 1) memory management 506 ULONG cbNeeded = pxstr->ulLength // existing length, without null terminator 507 + 1 // new character 508 + 1; // null terminator 509 if (cbNeeded > pxstr->cbAllocated) 510 { 511 // we need more memory than we have previously 512 // allocated: 513 if (pxstr->cbAllocated) 514 // appendee already had memory: 515 // reallocate 516 pxstr->psz = (PSZ)realloc(pxstr->psz, 517 cbNeeded); 518 else 519 // appendee has no memory: 520 pxstr->psz = (PSZ)malloc(cbNeeded); 521 522 pxstr->cbAllocated = cbNeeded; 523 // ulLength is unchanged yet 524 } 525 // else: we have enough memory, both if appendee 526 // is empty or not empty 527 528 // now we have: 529 // -- if appendee (pxstr) had enough memory, no problem 530 // -- if appendee (pxstr) needed more memory 531 // -- and was not empty: pxstr->psz now points to a 532 // reallocated copy of the old string 533 // -- and was empty: pxstr->psz now points to a 534 // new (unitialized) buffer 535 536 // 2) append character: 537 pxstr->psz[pxstr->ulLength] = c; 538 pxstr->psz[pxstr->ulLength + 1] = '\0'; 539 540 // in all cases, set new length 541 pxstr->ulLength++; 542 ulrc = pxstr->ulLength; 543 544 } // end if ((pxstr) && (c)) 460 545 461 546 return (ulrc);
Note:
See TracChangeset
for help on using the changeset viewer.