Changeset 65
- Timestamp:
- Apr 29, 2001, 2:10:31 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/comctl.h
r52 r65 486 486 HWND hwndToolOwner; 487 487 // in: handle to the window that contains the tool. If 488 // lpszText includes the PSZ_TEXTCALLBACK value, this488 // pszText includes the PSZ_TEXTCALLBACK value, this 489 489 // member identifies the window that receives TTN_NEEDTEXT 490 490 // notification messages. 491 491 HWND hwndTool; 492 492 // in: window handle of the tool. 493 // ### simple rectangles of hwndToolOwner not yet supported494 493 PSZ pszText; 495 494 // in: pointer to the buffer that contains the text for the … … 501 500 } TOOLINFO, *PTOOLINFO; 502 501 502 /* 503 * tooltip messages 504 * 505 */ 506 503 507 #define TTM_FIRST (WM_USER + 1000) 504 508 … … 519 523 #define TTDT_RESHOW 4 520 524 521 #define TTM_SETDELAYTIME (TTM_FIRST + 6) 525 #define TTM_GETDELAYTIME (TTM_FIRST + 6) 526 // added V0.9.12 (2001-04-28) [umoeller] 527 528 #define TTM_SETDELAYTIME (TTM_FIRST + 7) 522 529 523 530 #define TTFMT_PSZ 0x01 … … 556 563 } TOOLTIPTEXT, *PTOOLTIPTEXT; 557 564 558 #define TTM_GETTEXT (TTM_FIRST + 7)559 560 #define TTM_UPDATETIPTEXT (TTM_FIRST + 8)565 #define TTM_GETTEXT (TTM_FIRST + 8) 566 567 #define TTM_UPDATETIPTEXT (TTM_FIRST + 9) 561 568 562 569 /* … … 577 584 } TTHITTESTINFO, *PHITTESTINFO; 578 585 579 #define TTM_HITTEST (TTM_FIRST + 9)580 581 #define TTM_WINDOWFROMPOINT (TTM_FIRST + 1 0)582 583 #define TTM_ENUMTOOLS (TTM_FIRST + 1 1)584 585 #define TTM_GETCURRENTTOOL (TTM_FIRST + 1 2)586 587 #define TTM_GETTOOLCOUNT (TTM_FIRST + 1 3)588 589 #define TTM_GETTOOLINFO (TTM_FIRST + 1 4)590 591 #define TTM_SETTOOLINFO (TTM_FIRST + 1 5)586 #define TTM_HITTEST (TTM_FIRST + 10) 587 588 #define TTM_WINDOWFROMPOINT (TTM_FIRST + 11) 589 590 #define TTM_ENUMTOOLS (TTM_FIRST + 12) 591 592 #define TTM_GETCURRENTTOOL (TTM_FIRST + 13) 593 594 #define TTM_GETTOOLCOUNT (TTM_FIRST + 14) 595 596 #define TTM_GETTOOLINFO (TTM_FIRST + 15) 597 598 #define TTM_SETTOOLINFO (TTM_FIRST + 16) 592 599 593 600 // non-Win95 messages 594 601 595 #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 16) 602 #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 17) 603 604 /* 605 * tooltip notification codes (WM_CONTROL) 606 * 607 */ 596 608 597 609 /* -
trunk/src/helpers/cctl_tooltip.c
r54 r65 96 96 // linked list of all tools which were subclassed for tooltip 97 97 HMTX G_hmtxSubclassedTools = NULLHANDLE; 98 PLINKLIST G_pllSubclassedTools = NULL;// linked list of SUBCLASSEDTOOL items98 LINKLIST G_llSubclassedTools; // linked list of SUBCLASSEDTOOL items 99 99 100 100 /* ****************************************************************** … … 126 126 } 127 127 128 /* ****************************************************************** 129 * 130 * Subclassing 131 * 132 ********************************************************************/ 133 134 /* 135 *@@ LockSubclassedTools: 136 * locks the global list of subclassed tools. 137 * 138 *@@added V0.9.12 (2001-04-28) [umoeller] 139 */ 140 141 BOOL LockSubclassedTools(VOID) 142 { 143 if (!G_hmtxSubclassedTools) 144 { 145 // first call: 146 147 // initialize the list 148 lstInit(&G_llSubclassedTools, 149 TRUE); // auto-free 150 151 // create mutex and request it right away 152 return (!DosCreateMutexSem(NULL, 153 &G_hmtxSubclassedTools, 154 0, 155 TRUE)); // request! 156 } 157 158 return (!WinRequestMutexSem(G_hmtxSubclassedTools, SEM_INDEFINITE_WAIT)); 159 } 160 161 /* 162 *@@ UnlockSubclassedTools: 163 * unlocks the global list of subclassed tools. 164 * 165 *@@added V0.9.12 (2001-04-28) [umoeller] 166 */ 167 168 VOID UnlockSubclassedTools(VOID) 169 { 170 } 171 128 172 /* 129 173 *@@ SUBCLASSEDTOOL: … … 143 187 144 188 /* 145 *@@ ctl_fnwpSubclassedTool: 146 * window procedure for tools which were subclassed 147 * to support tooltips. 148 * 149 *@@added V0.9.0 [umoeller] 189 *@@ FindSubclassedTool: 190 * returns the SUBCLASSEDTOOL struct from the 191 * global list which matches hwndTool or NULL 192 * if not found. 193 * 194 * Preconditions: Caller must hold the subclassed 195 * tools mutex. 196 * 197 *@@added V0.9.12 (2001-04-28) [umoeller] 150 198 */ 151 199 152 MRESULT EXPENTRY ctl_fnwpSubclassedTool(HWND hwndTool, ULONG msg, MPARAM mp1, MPARAM mp2)200 PSUBCLASSEDTOOL FindSubclassedTool(HWND hwndTool) 153 201 { 154 MRESULT mrc = 0; 155 156 PSUBCLASSEDTOOL pst = NULL; 157 158 PLISTNODE pNode = lstQueryFirstNode(G_pllSubclassedTools); 202 PLISTNODE pNode = lstQueryFirstNode(&G_llSubclassedTools); 159 203 while (pNode) 160 204 { … … 162 206 if (pstThis->hwndTool == hwndTool) 163 207 { 164 pst = pstThis; 165 break; 208 return (pstThis); 166 209 } 167 210 pNode = pNode->pNext; 168 211 } 169 212 170 switch (msg) 213 return (NULL); 214 } 215 216 /* 217 *@@ ctl_fnwpSubclassedTool: 218 * window procedure for tools which were subclassed 219 * to support tooltips. 220 * 221 *@@added V0.9.0 [umoeller] 222 *@@changed V0.9.12 (2001-04-28) [umoeller]: added mutex protection 223 */ 224 225 MRESULT EXPENTRY ctl_fnwpSubclassedTool(HWND hwndTool, ULONG msg, MPARAM mp1, MPARAM mp2) 226 { 227 MRESULT mrc = 0; 228 229 PFNWP pfnwpOrig = NULL; 230 231 if (LockSubclassedTools()) 171 232 { 172 case WM_MOUSEMOVE: 173 case WM_BUTTON1DOWN: 174 case WM_BUTTON1UP: 175 case WM_BUTTON2DOWN: 176 case WM_BUTTON2UP: 177 case WM_BUTTON3DOWN: 178 case WM_BUTTON3UP: 233 PSUBCLASSEDTOOL pst = FindSubclassedTool(hwndTool); 234 235 switch (msg) 179 236 { 180 QMSG qmsg; 181 qmsg.hwnd = hwndTool; 182 qmsg.msg = msg; 183 qmsg.mp1 = mp1; 184 qmsg.mp2 = mp2; 185 // _Pmpf((__FUNCTION__ ": sending TTM_RELAYEVENT")); 186 WinSendMsg(pst->hwndTooltip, 187 TTM_RELAYEVENT, 188 (MPARAM)0, 189 (MPARAM)&qmsg); 190 mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2); 191 break; } 192 193 case WM_DESTROY: 194 lstRemoveItem(G_pllSubclassedTools, pst); // this frees the item 195 if (lstCountItems(G_pllSubclassedTools) == 0) 237 case WM_MOUSEMOVE: 238 case WM_BUTTON1DOWN: 239 case WM_BUTTON1UP: 240 case WM_BUTTON2DOWN: 241 case WM_BUTTON2UP: 242 case WM_BUTTON3DOWN: 243 case WM_BUTTON3UP: 196 244 { 197 // last item: destroy list 198 lstFree(G_pllSubclassedTools); 199 G_pllSubclassedTools = NULL; 200 // _Pmpf((__FUNCTION__ ": removed hwnd 0x%lX", hwndTool)); 201 } 202 mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2); 203 break; 204 205 default: 206 mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2); 245 QMSG qmsg; 246 qmsg.hwnd = hwndTool; 247 qmsg.msg = msg; 248 qmsg.mp1 = mp1; 249 qmsg.mp2 = mp2; 250 // _Pmpf((__FUNCTION__ ": sending TTM_RELAYEVENT")); 251 WinSendMsg(pst->hwndTooltip, 252 TTM_RELAYEVENT, 253 (MPARAM)0, 254 (MPARAM)&qmsg); 255 pfnwpOrig = pst->pfnwpOrig; // call default 256 break; } 257 258 case WM_DESTROY: 259 lstRemoveItem(&G_llSubclassedTools, pst); // this frees the item 260 pfnwpOrig = pst->pfnwpOrig; // call default 261 break; 262 263 default: 264 pfnwpOrig = pst->pfnwpOrig; // call default 265 } 266 267 UnlockSubclassedTools(); 207 268 } 269 270 if (pfnwpOrig) 271 mrc = (pfnwpOrig)(hwndTool, msg, mp1, mp2); 208 272 209 273 return (mrc); … … 211 275 212 276 /* 213 *@@ SubclassTool ForToolinfo:277 *@@ SubclassTool: 214 278 * this gets called from ctl_fnwpTooltip if a control 215 279 * is to be subclassed to support mouse messaging 216 280 * (TTF_SUBCLASS flag). 217 281 * 282 * Preconditions: Caller must hold the subclassed 283 * tools mutex. 284 * 218 285 *@@added V0.9.0 [umoeller] 286 *@@changed V0.9.12 (2001-04-28) [umoeller]: renamed from SubclassToolForToolInfo 219 287 */ 220 288 221 BOOL SubclassTool ForToolinfo(HWND hwndTooltip,222 289 BOOL SubclassTool(HWND hwndTooltip, 290 HWND hwndTool) 223 291 { 224 292 BOOL brc = FALSE; 225 PFNWP pfnwpOrig = WinSubclassWindow(hwndTool, 226 ctl_fnwpSubclassedTool); 227 if (pfnwpOrig) 293 294 // make sure the tool is not on the list yet 295 // V0.9.12 (2001-04-28) [umoeller] 296 if (!FindSubclassedTool(hwndTool)) 228 297 { 229 PSUBCLASSEDTOOL pst = (PSUBCLASSEDTOOL)malloc(sizeof(SUBCLASSEDTOOL)); 230 if (pst) 298 PFNWP pfnwpOrig = WinSubclassWindow(hwndTool, 299 ctl_fnwpSubclassedTool); 300 if (pfnwpOrig) 231 301 { 232 pst->pfnwpOrig = pfnwpOrig;233 pst->hwndTooltip = hwndTooltip;234 pst->hwndTool = hwndTool;235 pst->hab = WinQueryAnchorBlock(hwndTool);236 237 if (G_pllSubclassedTools == NULL)238 G_pllSubclassedTools = lstCreate(TRUE); // auto-free items239 240 lstAppendItem(G_pllSubclassedTools, pst);241 // _Pmpf((__FUNCTION__ ": subclassed hwnd 0x%lX", hwndTool));302 PSUBCLASSEDTOOL pst = (PSUBCLASSEDTOOL)malloc(sizeof(SUBCLASSEDTOOL)); 303 if (pst) 304 { 305 pst->pfnwpOrig = pfnwpOrig; 306 pst->hwndTooltip = hwndTooltip; 307 pst->hwndTool = hwndTool; 308 pst->hab = WinQueryAnchorBlock(hwndTool); 309 310 brc = !!lstAppendItem(&G_llSubclassedTools, pst); 311 } 242 312 } 243 313 } 314 244 315 return (brc); 245 316 } 317 318 /* 319 *@@ UnSubclassTool: 320 * un-subclasses a tool previously subclassed by 321 * SubclassToolForToolinfo. 322 * 323 * Preconditions: Caller must hold the subclassed 324 * tools mutex. 325 * 326 *@@added V0.9.12 (2001-04-28) [umoeller] 327 */ 328 329 BOOL UnSubclassTool(HWND hwndTool) 330 { 331 PSUBCLASSEDTOOL pst = FindSubclassedTool(hwndTool); 332 if (pst) 333 { 334 WinSubclassWindow(hwndTool, 335 pst->pfnwpOrig); 336 // orig winproc == un-subclass 337 return (lstRemoveItem(&G_llSubclassedTools, pst)); 338 // this frees the item 339 } 340 341 return (FALSE); 342 } 343 344 /* ****************************************************************** 345 * 346 * Implementation 347 * 348 ********************************************************************/ 246 349 247 350 /* … … 654 757 * 655 758 * To clarify: There is usually one tooltip control, which is hidden 656 * most of the time, for many tools(parts of a visible window).759 * most of the time, for many "tools" (parts of a visible window). 657 760 * When the user puts the cursor on a tool and leaves it there for 658 761 * approximately one-half second, the tooltip control is set up for … … 728 831 * 729 832 *@@added V0.9.0 [umoeller] 833 *@@changed V0.9.12 (2001-04-28) [umoeller]: various fixes WRT subclassing 730 834 */ 731 835 … … 826 930 if (pttd->pszPaintText) 827 931 free(pttd->pszPaintText); 932 933 // un-subclass all tools that we subclassed 934 // V0.9.12 (2001-04-28) [umoeller] 935 if (LockSubclassedTools()) 936 { 937 PLISTNODE pNode; 938 PSUBCLASSEDTOOL pst; 939 for (pNode = lstQueryFirstNode(&pttd->llTools); 940 pNode; 941 pNode = pNode->pNext) 942 { 943 PTOOLINFO pti = (PTOOLINFO)pNode->pItemData; 944 if (pst = FindSubclassedTool(pti->hwndTool)) 945 UnSubclassTool(pti->hwndTool); 946 } 947 948 UnlockSubclassedTools(); 949 } 950 // end V0.9.12 (2001-04-28) [umoeller] 951 828 952 lstClear(&pttd->llTools); 953 829 954 free(pttd); 830 955 … … 963 1088 * rectangular areas within a window's client area. 964 1089 * 965 * -- When you add a tool implemented as a rectangular area, the 966 * "hwndToolOwner" member of TOOLINFO must specify the handle 967 * of the window that contains the area, and the "rect" member must 968 * specify the client coordinates of the area's bounding 969 * rectangle. 970 * 971 * -- When you add a tool implemented as a window, the "hwndTool" 972 * member of TOOLINFO must contain the window handle of the 973 * tool. hwndToolOwner should be the owner of the tool. 1090 * -- When you add a tool implemented as a rectangular 1091 * area, the "hwndToolOwner" member of TOOLINFO must 1092 * specify the handle of the window that contains the 1093 * area, and the "rect" member must specify the client 1094 * coordinates of the area's bounding rectangle. 1095 * 1096 * -- When you add a tool implemented as a window, the 1097 * "hwndTool" member of TOOLINFO must contain the 1098 * window handle of the tool. hwndToolOwner should be 1099 * the owner of the tool. 974 1100 * 975 1101 * When you add a tool to a tooltip control, the "pszText" … … 1004 1130 ptiNew); 1005 1131 1006 if (ptiPassed->ulFlags & TTF_SUBCLASS) 1007 SubclassToolForToolinfo(hwndTooltip, 1008 ptiPassed->hwndTool); 1132 if ( (ptiPassed->ulFlags & TTF_SUBCLASS) 1133 && (LockSubclassedTools()) // V0.9.12 (2001-04-28) [umoeller] 1134 ) 1135 { 1136 // caller wants this tool to be subclassed: 1137 // well, do it then 1138 SubclassTool(hwndTooltip, 1139 ptiPassed->hwndTool); 1140 1141 UnlockSubclassedTools(); 1142 } 1009 1143 1010 1144 mrc = (MPARAM)TRUE; … … 1040 1174 { 1041 1175 // found: 1176 1177 // V0.9.12 (2001-04-28) [umoeller] 1178 // unsubclass if this was subclassed 1179 if (ptiThis->ulFlags & TTF_SUBCLASS) 1180 { 1181 if (LockSubclassedTools()) 1182 { 1183 UnSubclassTool(ptiSearch->hwndTool); 1184 } 1185 } 1186 1187 // remove the tool from the list 1042 1188 lstRemoveNode(&pttd->llTools, pToolNode); 1189 1043 1190 break; 1044 1191 } … … 1072 1219 1073 1220 case TTM_NEWTOOLRECT: 1221 1074 1222 break; 1075 1223 … … 1209 1357 1210 1358 /* 1359 *@@ TTM_GETDELAYTIME: 1360 * returns the current value of the specified 1361 * timeout value. See TTM_SETDELAYTIME. 1362 * 1363 * Parameters: 1364 * 1365 * -- USHORT mp1: timer value to query. One of: 1366 * -- TTDT_AUTOPOP 1367 * -- TTDT_INITIAL 1368 * -- TTDT_RESHOW 1369 * 1370 * Returns: ULONG timeout value. 1371 * 1372 *@@added V0.9.12 (2001-04-28) [umoeller] 1373 */ 1374 1375 case TTM_GETDELAYTIME: 1376 switch ((USHORT)mp1) 1377 { 1378 case TTDT_AUTOPOP: 1379 mrc = (MRESULT)pttd->ulTimeoutAutopop; 1380 break; 1381 1382 case TTDT_INITIAL: 1383 mrc = (MRESULT)pttd->ulTimeoutInitial; 1384 break; 1385 1386 case TTDT_RESHOW: 1387 mrc = (MRESULT)pttd->ulTimeoutReshow; 1388 break; 1389 } 1390 break; 1391 1392 /* 1211 1393 *@@ TTM_SETDELAYTIME: 1212 1394 * overrides a few default timeout values for the … … 1232 1414 * -- USHORT mp1: parameter selection. One of the following: 1233 1415 * -- TTDT_AUTOMATIC: automatically calculates the initial, 1234 * reshow, and autopopup durations based on the value of iDelay.1416 * reshow, and autopopup durations based on the value of mp2. 1235 1417 * -- TTDT_AUTOPOP: sets the length of time before the tooltip 1236 1418 * window is hidden if the cursor remains stationary … … 1279 1461 * Parameters: 1280 1462 * -- mp1: always 0 1281 * -- PTOOLINFO mp2: pointer to a TOOLINFO structure. When sending the 1282 * message, the hwnd and uId members identify a tool. If the tooltip 1283 * control includes the tool, the lpszText member receives the pointer 1284 * to the string. 1463 * -- PTOOLINFO mp2: pointer to a TOOLINFO structure. 1464 * When sending the message, the hwnd and uId members 1465 * identify a tool. If the tooltip control includes 1466 * the tool, the lpszText member receives the pointer 1467 * to the string. 1285 1468 * 1286 1469 * Return value: 0 always. … … 1289 1472 * this sends the TTN_NEEDTEXT notification to TOOLINFO.hwnd. 1290 1473 * 1291 *@@todo add TTFMT_STRINGRES1292 1474 */ 1293 1475 … … 1322 1504 1323 1505 case TTFMT_STRINGRES: 1324 1506 // @@todo 1325 1507 break; 1326 1508 } … … 1334 1516 * Parameters: 1335 1517 * -- mp1: always 0. 1336 * -- PTOOLINFO mp2: pointer to a TOOLINFO structure. The "hinst" 1337 * and "lpszText" members must specify the instance handle and 1338 * the pointer to the text. 1339 * The "hwnd" and "uId" members identify the tool to update. 1518 * -- PTOOLINFO mp2: pointer to a TOOLINFO structure. 1519 * The "hinst" and "lpszText" members must specify 1520 * the instance handle and the pointer to the text. 1521 * The "hwnd" and "uId" members identify the tool 1522 * to update. 1340 1523 */ 1341 1524 -
trunk/src/helpers/dialog.c
r61 r65 400 400 401 401 VOID ProcessColumn(PCOLUMNDEF pColumnDef, 402 PROWDEF pOwningRow, 403 PROCESSMODE ProcessMode, 402 PROWDEF pOwningRow, // in: current row from ProcessRow 403 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 404 404 PLONG plX, // in/out: PROCESS_CALC_POSITIONS only 405 405 PDLGPRIVATE pDlgData) … … 673 673 /* 674 674 *@@ ProcessRow: 675 * 675 * level-3 procedure (called from ProcessTable), 676 * which in turn calls ProcessColumn for each column 677 * in the row. 678 * 679 * See ProcessAll for the meaning of ProcessMode. 676 680 */ 677 681 678 682 VOID ProcessRow(PROWDEF pRowDef, 679 PTABLEDEF pOwningTable, 680 PROCESSMODE ProcessMode, 681 PLONG plY, 683 PTABLEDEF pOwningTable, // in: current table from ProcessTable 684 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 685 PLONG plY, // in/out: current y position (decremented) 682 686 PDLGPRIVATE pDlgData) 683 687 { … … 727 731 /* 728 732 *@@ ProcessTable: 729 * 730 * This routine is a bit sick because it can be 731 * called recursively if a nested table is found 732 * in a COLUMNDEF. 733 * level-2 procedure (called from ProcessAll), 734 * which in turn calls ProcessRow for each row 735 * in the table (which in turn calls ProcessColumn 736 * for each column in the row). 737 * 738 * See ProcessAll for the meaning of ProcessMode. 739 * 740 * This routine is a bit sick because it can even be 741 * called recursively from ProcessColumn (!) if a 742 * nested table is found in a COLUMNDEF. 733 743 * 734 744 * With PROCESS_CALC_POSITIONS, pptl must specify … … 742 752 VOID ProcessTable(PTABLEDEF pTableDef, 743 753 const CONTROLPOS *pcpTable, // in: table position with PROCESS_CALC_POSITIONS 744 PROCESSMODE ProcessMode, 754 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 745 755 PDLGPRIVATE pDlgData) 746 756 { … … 783 793 /* 784 794 *@@ ProcessAll: 795 * level-1 procedure, which in turn calls ProcessTable 796 * for each root-level table found (which in turn 797 * calls ProcessRow for each row in the table, which 798 * in turn calls ProcessColumn for each column in 799 * the row). 800 * 801 * The first trick to formatting is that ProcessAll will 802 * get three times, thus going down the entire tree three 803 * times, with ProcessMode being set to one of the 804 * following for each call (in this order): 785 805 * 786 806 * -- PROCESS_CALC_SIZES: calculates the sizes 787 807 * of all tables, rows, columns, and controls. 788 808 * 809 * After this first call, we know all the sizes 810 * only and then then calculate the positions. 811 * 789 812 * -- PROCESS_CALC_POSITIONS: calculates the positions 790 813 * based on the sizes calculated before. … … 793 816 * positions and sizes calculated before. 794 817 * 818 * The second trick is the precondition that tables may 819 * nest by allowing a table definition instead of a 820 * control definition in a column. This way we can 821 * recurse from columns back into tables and thus 822 * know the size and position of a nested table column 823 * just as if it were a regular control. 795 824 */ 796 825 -
trunk/src/helpers/xml.c
r63 r65 8 8 * 9 9 * -- The bottom layer is implemented by @expat, which I have 10 * ported and hacked to the xwphelpers. See xmlparse.c for 11 * an introduction. 10 * ported and hacked to the xwphelpers. 11 * 12 * See xmlparse.c for an introduction. 12 13 * 13 14 * -- Because expat requires so many callbacks and is non-validating, -
trunk/src/helpers/xprf.c
r21 r65 39 39 * If you open the profile on one thread and write and read 40 40 * concurrently on two threads, there's no protection, and everything 41 * will blow up. The functions are ree antrant though, so for different41 * will blow up. The functions are reentrant though, so for different 42 42 * profiles there will be no problems. 43 43 * -
trunk/src/helpers/xstring.c
r63 r65 523 523 * If pxstr is empty, this behaves just like xstrcpy. 524 524 * 525 * With ulSourceLength, specify the length of pcszSource. 526 * If you specify 0, this function will run strlen(pcszSource) 527 * itself. 528 * 529 * If you already know the length of pcszSource, you can 530 * speed this function up a bit this way. 531 * 532 * You are required to specify ulSourceLength if you only want 533 * to copy a substring, or pcszSource is not zero-terminated. 525 * With ulSourceLength, specify the length of pcszSource 526 * or 0 (see xstrcpy for details). 534 527 * 535 528 * Returns the length of the new string (excluding the null … … 590 583 memcpy(pxstr->psz + pxstr->ulLength, 591 584 pcszSource, 592 ulSourceLength); // null terminator585 ulSourceLength); 593 586 594 587 *(pxstr->psz + pxstr->ulLength + ulSourceLength) = '\0'; … … 629 622 + XSTRING str; 630 623 + xstrInit(&str, 0); 631 + xstrcpy(&str, "blu" );624 + xstrcpy(&str, "blu", 0); 632 625 + xstrcatc(&str, 'p'); 633 626 *
Note:
See TracChangeset
for help on using the changeset viewer.