Changeset 45
- Timestamp:
- Mar 10, 2001, 12:58:28 AM (24 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/winh.h
r43 r45 172 172 SHORT sId); 173 173 174 BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget, 175 HWND hmenuSource, 176 USHORT usID, 177 SHORT sTargetPosition); 178 typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget, 179 HWND hmenuSource, 180 USHORT usID, 181 SHORT sTargetPosition); 182 typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM; 183 184 HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget, 185 SHORT sTargetPosition, 186 const char *pcszTitle, 187 SHORT sID, 188 HWND hmenuSource); 189 typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget, 190 SHORT sTargetPosition, 191 const char *pcszTitle, 192 SHORT sID, 193 HWND hmenuSource); 194 typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU; 195 174 196 PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu, 175 197 USHORT usItemID); -
trunk/include/helpers/xstring.h
r41 r45 48 48 ULONG cbAllocated; // memory allocated in *psz 49 49 // (>= ulLength + 1) 50 ULONG ulDelta; // allocation delta (0 = none) 51 // V0.9.9 (2001-03-07) [umoeller] 50 52 } XSTRING, *PXSTRING; 51 53 -
trunk/src/helpers/dosh.c
r43 r45 1922 1922 { 1923 1923 // try additional things then 1924 PSZ psz2 = malloc(strlen(pcszCommand) + 20);1924 PSZ psz2 = (PSZ)malloc(strlen(pcszCommand) + 20); 1925 1925 if (psz2) 1926 1926 { -
trunk/src/helpers/winh.c
r43 r45 272 272 273 273 /* 274 *@@ winhCopyMenuItem: 275 * copies a menu item from hmenuSource to hmenuTarget. 276 * 277 * This creates a full duplicate. If usID specifies 278 * a submenu, the entire submenu is copied as well 279 * (this will then recurse). 280 * 281 * NOTE: Copying submenus will work only if each item 282 * in the submenu has a unique menu ID. This is due 283 * to the dumb implementation of menus in PM where 284 * it is impossible to query menu items without 285 * knowing their ID. 286 * 287 *@@added V0.9.9 (2001-03-09) [umoeller] 288 */ 289 290 BOOL winhCopyMenuItem(HWND hmenuTarget, 291 HWND hmenuSource, 292 USHORT usID, 293 SHORT sTargetPosition) // in: position to insert at or MIT_END 294 { 295 BOOL brc = FALSE; 296 MENUITEM mi = {0}; 297 if (WinSendMsg(hmenuSource, 298 MM_QUERYITEM, 299 MPFROM2SHORT(usID, 300 FALSE), 301 (MPARAM)&mi)) 302 { 303 // found in source: 304 // is it a separator? 305 if (mi.afStyle & MIS_SEPARATOR) 306 winhInsertMenuSeparator(hmenuTarget, 307 sTargetPosition, 308 usID); 309 else 310 { 311 // no separator: 312 // get item text 313 PSZ pszSource = winhQueryMenuItemText(hmenuSource, 314 usID); 315 if (pszSource) 316 { 317 if ( (mi.afStyle & MIS_SUBMENU) 318 && (mi.hwndSubMenu) 319 ) 320 { 321 // this is the top of a submenu: 322 HWND hwndSubMenu = winhInsertSubmenu(hmenuTarget, 323 sTargetPosition, 324 mi.id, 325 pszSource, 326 mi.afStyle, 327 0, 328 NULL, 329 0, 330 0); 331 if (hwndSubMenu) 332 { 333 // now copy all the items in the submenu 334 SHORT cMenuItems = (SHORT)WinSendMsg(mi.hwndSubMenu, 335 MM_QUERYITEMCOUNT, 336 0, 0); 337 // loop through all entries in the original submenu 338 ULONG i; 339 for (i = 0; 340 i < cMenuItems; 341 i++) 342 { 343 CHAR szItemText[100]; 344 SHORT id = (SHORT)WinSendMsg(mi.hwndSubMenu, 345 MM_ITEMIDFROMPOSITION, 346 MPFROMSHORT(i), 347 0); 348 // recurse 349 winhCopyMenuItem(hwndSubMenu, 350 mi.hwndSubMenu, 351 id, 352 MIT_END); 353 } 354 355 // now check... was the original submenu 356 // "conditional cascade"? 357 if (WinQueryWindowULong(mi.hwndSubMenu, 358 QWL_STYLE) 359 & MS_CONDITIONALCASCADE) 360 // yes: 361 { 362 // get the original default item 363 SHORT sDefID = (SHORT)WinSendMsg(mi.hwndSubMenu, 364 MM_QUERYDEFAULTITEMID, 365 0, 0); 366 // set "conditional cascade style" on target too 367 WinSetWindowBits(hwndSubMenu, 368 QWL_STYLE, 369 MS_CONDITIONALCASCADE, 370 MS_CONDITIONALCASCADE); 371 // and set default item id 372 WinSendMsg(hwndSubMenu, 373 MM_SETDEFAULTITEMID, 374 (MPARAM)sDefID, 375 0); 376 } 377 } // end if (hwndSubmenu) 378 } // end if ( (mi.afStyle & MIS_SUBMENU) 379 else 380 { 381 // no submenu: 382 // just copy that item 383 SHORT s; 384 mi.iPosition = sTargetPosition; 385 s = (SHORT)WinSendMsg(hmenuTarget, 386 MM_INSERTITEM, 387 MPFROMP(&mi), 388 MPFROMP(pszSource)); 389 if (s != MIT_MEMERROR && s != MIT_ERROR) 390 brc = TRUE; 391 } 392 393 free(pszSource); 394 } // end if (pszSource) 395 } // end else if (mi.afStyle & MIS_SEPARATOR) 396 } // end if (WinSendMsg(hmenuSource, MM_QUERYITEM,... 397 398 return (brc); 399 } 400 401 /* 402 *@@ winhMergeIntoSubMenu: 403 * creates a new submenu in hmenuTarget with the 404 * specified title at the specified position 405 * and copies the entire contents of hmenuSource 406 * into that. 407 * 408 * Returns the window handle of the new submenu 409 * or NULLHANDLE on errors. 410 * 411 * NOTE: Copying submenus will work only if each item 412 * in the submenu has a unique menu ID. This is due 413 * to the dumb implementation of menus in PM where 414 * it is impossible to query menu items without 415 * knowing their ID. 416 * 417 *@@added V0.9.9 (2001-03-09) [umoeller] 418 */ 419 420 HWND winhMergeIntoSubMenu(HWND hmenuTarget, // in: menu where to create submenu 421 SHORT sTargetPosition, // in: position to insert at or MIT_END 422 const char *pcszTitle, // in: title of new submenu 423 SHORT sID, // in: ID of new submenu 424 HWND hmenuSource) // in: menu to merge 425 { 426 HWND hwndNewSubmenu = WinCreateMenu(hmenuTarget, NULL); 427 if (hwndNewSubmenu) 428 { 429 MENUITEM mi = {0}; 430 SHORT src = 0; 431 SHORT s = 0; 432 mi.iPosition = MIT_END; 433 mi.afStyle = MIS_TEXT | MIS_SUBMENU; 434 mi.id = 2000; 435 mi.hwndSubMenu = hwndNewSubmenu; 436 437 WinSetWindowUShort(hwndNewSubmenu, QWS_ID, sID); 438 439 // insert new submenu into hmenuTarget 440 src = SHORT1FROMMR(WinSendMsg(hmenuTarget, 441 MM_INSERTITEM, 442 (MPARAM)&mi, 443 (MPARAM)pcszTitle)); 444 if ( (src != MIT_MEMERROR) 445 && (src != MIT_ERROR) 446 ) 447 { 448 int i; 449 SHORT cMenuItems = (SHORT)WinSendMsg(hmenuSource, 450 MM_QUERYITEMCOUNT, 451 0, 0); 452 453 // loop through all entries in the original menu 454 for (i = 0; i < cMenuItems; i++) 455 { 456 SHORT id = (SHORT)WinSendMsg(hmenuSource, 457 MM_ITEMIDFROMPOSITION, 458 MPFROMSHORT(i), 459 0); 460 winhCopyMenuItem(hwndNewSubmenu, 461 hmenuSource, 462 id, 463 MIT_END); 464 } 465 } 466 else 467 { 468 // error: 469 WinDestroyWindow(hwndNewSubmenu); 470 hwndNewSubmenu = NULLHANDLE; 471 } 472 } 473 474 return (hwndNewSubmenu); 475 } 476 477 /* 274 478 *@@ winhQueryMenuItemText: 275 479 * this returns a menu item text as a PSZ -
trunk/src/helpers/xstring.c
r43 r45 125 125 * 126 126 * If (ulPreAllocate != 0), memory is pre-allocated 127 * for the string, but the string will be empty. 127 * for the string, but the string will be empty 128 * (its first byte is set to '\0'). In addition, 129 * pxstr->ulDelta will be set to 10% of ulPreAllocate. 130 * 128 131 * This is useful if you plan to add more stuff to 129 132 * the string later so we don't have to reallocate … … 135 138 * 136 139 *@@added V0.9.6 (2000-11-01) [umoeller] 140 *@@changed V0.9.9 (2001-03-09) [umoeller]: added ulDelta 137 141 */ 138 142 … … 147 151 // ulLength is still zero 148 152 *(pxstr->psz) = 0; 149 } 153 154 pxstr->ulDelta = ulPreAllocate * 10 / 100; 155 } 156 // else: pxstr->ulDelta is still 0 150 157 } 151 158 … … 170 177 * 171 178 *@@added V0.9.6 (2000-11-01) [umoeller] 179 *@@changed V0.9.9 (2001-03-09) [umoeller]: added ulDelta 172 180 */ 173 181 … … 175 183 PSZ pszNew) 176 184 { 177 pxstr->psz = pszNew;178 185 if (!pszNew) 179 186 { 180 pxstr->cbAllocated = 0; 181 pxstr->ulLength = 0; 187 memset(pxstr, 0, sizeof(XSTRING)); 182 188 } 183 189 else 184 190 { 191 pxstr->psz = pszNew; 185 192 pxstr->ulLength = strlen(pszNew); 186 193 pxstr->cbAllocated = pxstr->ulLength + 1; 194 pxstr->ulDelta = pxstr->ulLength * 10 / 100; 187 195 } 188 196 } … … 209 217 *@@added V0.9.6 (2000-11-01) [umoeller] 210 218 *@@changed V0.9.7 (2000-12-31) [umoeller]: added ulExtraAllocate 219 *@@changed V0.9.9 (2001-03-09) [umoeller]: added ulDelta 211 220 */ 212 221 … … 229 238 pxstr->psz = (PSZ)malloc(pxstr->cbAllocated); 230 239 strcpy(pxstr->psz, pcszSource); 240 241 pxstr->ulDelta = pxstr->cbAllocated * 10 / 100; 231 242 } 232 243 } … … 265 276 * this function does nothing. 266 277 * 278 * pxstr->ulDelta has no effect here. 279 * 267 280 * The XSTRING must be initialized before the 268 281 * call. … … 271 284 * 272 285 *@@added V0.9.7 (2001-01-07) [umoeller] 286 *@@changed V0.9.9 (2001-03-09) [umoeller]: now using ulDelta 273 287 */ 274 288 … … 282 296 // we need more memory than we have previously 283 297 // allocated: 284 if (pxstr->cbAllocated) 285 // appendee already had memory: 286 // reallocate 287 pxstr->psz = (PSZ)realloc(pxstr->psz, 288 cbNeeded); 298 ULONG cbAllocate; 299 if (pxstr->ulDelta) 300 { 301 // delta specified: allocate in chunks of that 302 // V0.9.9 (2001-03-07) [umoeller] 303 ULONG cbExtra = cbNeeded - pxstr->cbAllocated; 304 cbExtra = ( (cbExtra + pxstr->ulDelta) 305 / pxstr->ulDelta 306 ) 307 * pxstr->ulDelta; 308 // if we need 3 extra bytes and ulDelta is 10, 309 // this gives us 10 extra bytes 310 // if we need 3 extra bytes and ulDelta is 1000, 311 // this gives us 1000 extra bytes 312 cbAllocate = pxstr->cbAllocated + cbExtra; 313 } 289 314 else 290 { 291 // appendee has no memory: 292 pxstr->psz = (PSZ)malloc(cbNeeded); 293 *(pxstr->psz) = 0; 294 } 295 296 pxstr->cbAllocated = cbNeeded; 315 // no delta specified: 316 cbAllocate = cbNeeded; 317 // V0.9.9 (2001-03-05) [umoeller]: use realloc; 318 // this gives the C runtime a chance to expand the 319 // existing block 320 pxstr->psz = (PSZ)realloc(pxstr->psz, cbAllocate); 321 // if pxstr->psz is NULL, realloc behaves like malloc 322 pxstr->cbAllocated = cbAllocate; 297 323 // ulLength is unchanged 298 324 } 325 // else: we have enough memory 299 326 300 327 return (pxstr->cbAllocated); … … 369 396 pxstr->ulLength = strlen(pszNew); 370 397 pxstr->cbAllocated = pxstr->ulLength + 1; 398 399 pxstr->ulDelta = pxstr->cbAllocated * 10 / 100; 371 400 } 372 401 // else null string: cbAllocated and ulLength are 0 already … … 382 411 * If pxstr contains something, its contents are destroyed. 383 412 * 384 * With ulSourceLength, specify the length of pcszSource. 385 * If you specify 0, this function will run strlen(pcszSource) 386 * itself. 387 * 388 * If you already know the length of pcszSource, you can 389 * speed this function up a bit this way. 390 * 391 * You are required to specify ulSourceLength if you only want 392 * to copy a substring, or pcszSource is not zero-terminated. 413 * With ulSourceLength, specify the length of pcszSource 414 * or 0. 415 * 416 * -- If you specify 0, this function will run 417 * strlen(pcszSource) and copy the entire source 418 * string. 419 * 420 * -- If you already know the length of pcszSource, you 421 * can speed this function up by specifying the 422 * length. 423 * 424 * -- You are required to specify ulSourceLength if you 425 * only want to copy a substring, or if pcszSource is 426 * not zero-terminated. 393 427 * 394 428 * Returns the length of the new string (excluding the null … … 413 447 *@@changed V0.9.9 (2001-02-14) [umoeller]: fixed NULL target crash 414 448 *@@changed V0.9.9 (2001-02-16) [umoeller]: now supporting non-zero-terminated pcszSource 449 *@@changed V0.9.9 (2001-03-09) [umoeller]: now using xstrReserve 415 450 */ 416 451 … … 419 454 ULONG ulSourceLength) // in: length of pcszSource or 0 420 455 { 421 // xstrClear(pxstr); NOOOO! this frees the string, we want to keep the memory422 423 456 if (!pxstr) 424 457 return (0); // V0.9.9 (2001-02-14) [umoeller] … … 437 470 { 438 471 // we do have a source string: 439 ULONG cbNeeded = ulSourceLength + 1; 440 if (cbNeeded > pxstr->cbAllocated) 441 { 442 // we need more memory than we have previously 443 // allocated: 444 /* if (pxstr->psz) 445 free(pxstr->psz); // V0.9.9 (2001-01-28) [lafaix] 446 pxstr->cbAllocated = cbNeeded; 447 pxstr->psz = (PSZ)malloc(cbNeeded); */ 448 449 // V0.9.9 (2001-03-05) [umoeller]: use realloc; 450 // this gives the C runtime a chance to expand the 451 // existing block 452 pxstr->psz = (PSZ)realloc(pxstr->psz, cbNeeded); 453 // if pxstr->psz is NULL, realloc behaves like malloc 454 pxstr->cbAllocated = cbNeeded; 455 } 456 // else: we have enough memory 472 xstrReserve(pxstr, 473 // required memory: 474 ulSourceLength + 1); 457 475 458 476 memcpy(pxstr->psz, … … 544 562 *@@changed V0.9.7 (2001-01-15) [umoeller]: added ulSourceLength 545 563 *@@changed V0.9.9 (2001-02-16) [umoeller]: now supporting non-zero-terminated pcszSource 564 *@@changed V0.9.9 (2001-03-09) [umoeller]: now using xstrReserve 546 565 */ 547 566 … … 564 583 565 584 // 1) memory management 566 ULONG cbNeeded = pxstr->ulLength + ulSourceLength + 1; 567 if (cbNeeded > pxstr->cbAllocated) 568 { 569 // we need more memory than we have previously 570 // allocated: 571 if (pxstr->cbAllocated) 572 // appendee already had memory: 573 // reallocate 574 pxstr->psz = (PSZ)realloc(pxstr->psz, 575 cbNeeded); 576 else 577 // appendee has no memory: 578 pxstr->psz = (PSZ)malloc(cbNeeded); 579 580 pxstr->cbAllocated = cbNeeded; 581 // ulLength is unchanged yet 582 } 583 // else: we have enough memory, both if appendee 584 // is empty or not empty 585 586 // now we have: 587 // -- if appendee (pxstr) had enough memory, no problem 588 // -- if appendee (pxstr) needed more memory 589 // -- and was not empty: pxstr->psz now points to a 590 // reallocated copy of the old string 591 // -- and was empty: pxstr->psz now points to a 592 // new (unitialized) buffer 585 xstrReserve(pxstr, 586 // required memory: 587 pxstr->ulLength + ulSourceLength + 1); 593 588 594 589 // 2) append source string: … … 645 640 * 646 641 *@@added V0.9.7 (2000-12-10) [umoeller] 642 *@@changed V0.9.9 (2001-03-09) [umoeller]: now using xstrReserve 647 643 */ 648 644 … … 656 652 // ULONG ulSourceLength = 1; 657 653 // 1) memory management 658 ULONG cbNeeded = pxstr->ulLength // existing length, without null terminator 659 + 1 // new character 660 + 1; // null terminator 661 if (cbNeeded > pxstr->cbAllocated) 662 { 663 // we need more memory than we have previously 664 // allocated: 665 if (pxstr->cbAllocated) 666 // appendee already had memory: 667 // reallocate 668 pxstr->psz = (PSZ)realloc(pxstr->psz, 669 cbNeeded); 670 else 671 // appendee has no memory: 672 pxstr->psz = (PSZ)malloc(cbNeeded); 673 674 pxstr->cbAllocated = cbNeeded; 675 // ulLength is unchanged yet 676 } 677 // else: we have enough memory, both if appendee 678 // is empty or not empty 679 680 // now we have: 681 // -- if appendee (pxstr) had enough memory, no problem 682 // -- if appendee (pxstr) needed more memory 683 // -- and was not empty: pxstr->psz now points to a 684 // reallocated copy of the old string 685 // -- and was empty: pxstr->psz now points to a 686 // new (unitialized) buffer 687 654 xstrReserve(pxstr, 655 // required memory: 656 pxstr->ulLength // existing length, without null terminator 657 + 1 // new character 658 + 1); // null terminator 688 659 // 2) append character: 689 660 pxstr->psz[pxstr->ulLength] = c; … … 691 662 692 663 // in all cases, set new length 693 pxstr->ulLength++;664 (pxstr->ulLength)++; 694 665 ulrc = pxstr->ulLength; 695 666 … … 712 683 return (0); 713 684 714 return (xstrcat(pxstr, pcstrSource->psz, pcstrSource->ulLength)); 685 return (xstrcat(pxstr, 686 pcstrSource->psz, 687 pcstrSource->ulLength)); 715 688 } 716 689 … … 753 726 *@@changed V0.9.9 (2001-01-29) [lafaix]: fixed unnecessary allocation when pxstr was big enough 754 727 *@@changed V0.9.9 (2001-02-14) [umoeller]: fixed NULL target crash 728 *@@changed V0.9.9 (2001-03-09) [umoeller]: now using xstrReserve 755 729 */ 756 730 … … 772 746 // can be 0! 773 747 774 // length of new string748 // size of new buffer: 775 749 ULONG cbNeeded = pxstr->ulLength 776 750 + cReplaceLen … … 778 752 + 1; // null terminator 779 753 // offset where pszSearch was found 780 // ulFirstReplOfs = pFound - pxstr->psz; now ulFirstReplOfs781 754 PSZ pFound = pxstr->psz + ulFirstReplOfs; 782 755 783 756 // now check if we have enough memory... 784 if ( pxstr->cbAllocated < cbNeeded)757 if (cbNeeded > pxstr->cbAllocated) 785 758 { 786 // no, we need more memory: 759 // we need more memory than we have previously 760 // allocated: 761 // reallocate using ulDelta V0.9.9 (2001-03-07) [umoeller] 762 ULONG cbAllocate; 763 PSZ pszNew; 764 if (pxstr->ulDelta) 765 { 766 // delta specified: allocate in chunks of that 767 // V0.9.9 (2001-03-07) [umoeller] 768 ULONG cbExtra = cbNeeded - pxstr->cbAllocated; 769 cbExtra = ( (cbExtra + pxstr->ulDelta) 770 / pxstr->ulDelta 771 ) 772 * pxstr->ulDelta; 773 // if we need 3 extra bytes and ulDelta is 10, 774 // this gives us 10 extra bytes 775 // if we need 3 extra bytes and ulDelta is 1000, 776 // this gives us 1000 extra bytes 777 cbAllocate = pxstr->cbAllocated + cbExtra; 778 } 779 else 780 // no delta specified: 781 cbAllocate = cbNeeded; 787 782 // allocate new buffer 788 PSZ pszNew = (PSZ)malloc(cbNeeded); 783 pszNew = (PSZ)malloc(cbAllocate); 784 // end V0.9.9 (2001-03-07) [umoeller] 789 785 790 786 if (ulFirstReplOfs) … … 824 820 pxstr->psz = pszNew; 825 821 pxstr->ulLength = cbNeeded - 1; 826 pxstr->cbAllocated = cb Needed;822 pxstr->cbAllocated = cbAllocate; // V0.9.9 (2001-03-07) [umoeller] 827 823 } // end if (pxstr->cbAllocated < cbNeeded) 828 824 else … … 1355 1351 ULONG ulOfs = 0; 1356 1352 1357 xstrInit(&str, 100);1353 xstrInit(&str, 0); 1358 1354 xstrInit(&strFind, 0); 1359 1355 xstrInit(&strReplace, 0); 1356 1357 str.ulDelta = 50; 1360 1358 1361 1359 xstrcpy(&str, "Test string 1. Test string 2. Test string 3. !", 0); … … 1363 1361 xstrcpy(&strReplace, "Dummy", 0); 1364 1362 1365 printf("Old string is: \"%s\" (%d/%d )\n", str.psz, str.ulLength, str.cbAllocated);1363 printf("Old string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1366 1364 1367 1365 printf("Replacing \"%s\" with \"%s\".\n", strFind.psz, strReplace.psz); … … 1376 1374 ; 1377 1375 1378 printf("New string is: \"%s\" (%d/%d)\n", str.psz, str.ulLength, str.cbAllocated); 1376 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1377 1378 printf("Appending \"blah\".\n"); 1379 xstrcat(&str, "blah", 0); 1380 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1379 1381 1380 1382 xstrcpy(&strFind, strReplace.psz, 0); … … 1392 1394 ; 1393 1395 1394 printf("New string is: \"%s\" (%d/%d )\n", str.psz, str.ulLength, str.cbAllocated);1396 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1395 1397 1396 1398 xstrcpy(&strFind, " ", 0); … … 1408 1410 ; 1409 1411 1410 printf("New string is: \"%s\" (%d/%d )\n", str.psz, str.ulLength, str.cbAllocated);1412 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1411 1413 1412 1414 xstrcpy(&strFind, ".", 0); … … 1424 1426 ; 1425 1427 1426 printf("New string is: \"%s\" (%d/%d)\n", str.psz, str.ulLength, str.cbAllocated); 1427 1428 printf("Reserving extra mem.\n"); 1429 1430 xstrReserve(&str, 6000); 1431 printf("New string is: \"%s\" (%d/%d)\n", str.psz, str.ulLength, str.cbAllocated); 1428 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1432 1429 1433 1430 xstrcpy(&strFind, "..........", 0); … … 1445 1442 ; 1446 1443 1447 printf("New string is: \"%s\" (%d/%d )\n", str.psz, str.ulLength, str.cbAllocated);1444 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1448 1445 1449 1446 printf("Encoding @* chars.\n"); 1450 1447 xstrEncode(&str, "@*"); 1451 printf("New string is: \"%s\" (%d/%d )\n", str.psz, str.ulLength, str.cbAllocated);1448 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1452 1449 1453 1450 printf("Decoding @* chars.\n"); 1454 1451 xstrDecode(&str); 1455 printf("New string is: \"%s\" (%d/%d )\n", str.psz, str.ulLength, str.cbAllocated);1452 printf("New string is: \"%s\" (%d/%d/%d)\n", str.psz, str.ulLength, str.cbAllocated, str.ulDelta); 1456 1453 1457 1454 return (0); 1458 } 1459 1460 */ 1455 } */ 1456 1457
Note:
See TracChangeset
for help on using the changeset viewer.