1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Ustr - 1.0.4 reference documentation -- functions</title>
<style type="text/css">
A:visited { color: #ff4040; }
A:hover { color: #20b2aa; }
P { text-indent: 1em; }
body { background: #FFF; color: #000; }
h2.ind { background: #DDF; }
td.title { background: #DFD; }
td.sect { background: #DDF; }
td.obj { background: #DDD; }
ul li { list-style-type: lower-roman; }
ul li:hover { list-style-type: square; }
ul:hover li { list-style-type: decimal; }
ul li:hover ul li.obj { list-style-type: decimal; }
ul li:hover ul li.obj:hover { list-style-type: square; }
</style>
</head>
<body>
<table width="100%"><tr><td class="title"><h1>Ustr - 1.0.4 reference documentation -- functions (301)</h1>
</td></tr></table><table width="90%"><tr><td>
<h2 class="ind">Index of sections</h2>
<ul>
<li><a href="#indx-Creating_readonly_Ustr_functions">Creating read-only Ustr functions (14)</a>
<li><a href="#indx-Creating_fixed_Ustr_functions">Creating fixed Ustr functions (4)</a>
<li><a href="#indx-Debugging_functions">Debugging functions (12)</a>
<li><a href="#indx-Creating_allocated_Ustr_functions">Creating allocated Ustr functions (28)</a>
<li><a href="#indx-Deleting_a_Ustr_or_data_within_a_Ustr">Deleting a Ustr, or data within a Ustr (8)</a>
<li><a href="#indx-Adding_data_to_a_Ustr">Adding data to a Ustr (8)</a>
<li><a href="#indx-Setting_a_Ustr_to_some_data">Setting a Ustr to some data (9)</a>
<li><a href="#indx-Inserting_data_into_a_Ustr">Inserting data into a Ustr (8)</a>
<li><a href="#indx-Adding_duplicating_and_setting_formatted_data_to_a_Ustr">Adding, duplicating and setting formatted data to a Ustr (26)</a>
<li><a href="#indx-Accessing_the_variables_of_a_Ustr">Accessing the "variables" of a Ustr (16)</a>
<li><a href="#indx-Setting_the_flags_of_a_Ustr">Setting the "flags" of a Ustr (4)</a>
<li><a href="#indx-Comparing_data_in_a_Ustr">Comparing data in a Ustr (36)</a>
<li><a href="#indx-Searching_for_data_in_a_Ustr">Searching for data in a Ustr (20)</a>
<li><a href="#indx-Span_lengths_of_data_in_a_Ustr">Span lengths of data in a Ustr (28)</a>
<li><a href="#indx-Doing_IO_from_or_to_a_Ustr">Doing IO from or to a Ustr (10)</a>
<li><a href="#indx-String_substitutionreplacement">String substitution/replacement (18)</a>
<li><a href="#indx-Splitting_a_Ustr">Splitting a Ustr (6)</a>
<li><a href="#indx-Dealing_with_UTF8_in_a_Ustr">Dealing with UTF-8 in a Ustr (6)</a>
<li><a href="#indx-Parsing_ASCII_integer_numbers_from_a_Ustr">Parsing ASCII integer numbers from a Ustr (10)</a>
<li><a href="#indx-Misc_shortcut_helper_functions_for_Ustrs">Misc shortcut helper functions for Ustrs (18)</a>
<li><a href="#indx-Adding_binary_data_to_a_Ustr">Adding binary data to a Ustr (3)</a>
<li><a href="#indx-Parsing_binary_data_from_a_Ustr">Parsing binary data from a Ustr (3)</a>
<li><a href="#indx-Misc_functions">Misc. functions (2)</a>
<li><a href="#indx-Simple_Ustr_pool_API">Simple Ustr pool API (4)</a></ul>
<h2 class="ind">Index of sections, and their contents</h2>
<ul>
<li><a id="indx-Creating_readonly_Ustr_functions" href="#Creating_readonly_Ustr_functions">Creating read-only Ustr functions</a>
<ul>
<li class="obj"><a href="#USTR">USTR()</a>
<li class="obj"><a href="#USTRP">USTRP()</a>
<li class="obj"><a href="#USTR1">USTR1()</a>
<li class="obj"><a href="#USTR2">USTR2()</a>
<li class="obj"><a href="#USTR4">USTR4()</a>
<li class="obj"><a href="#USTR1_CHK">USTR1_CHK()</a>
<li class="obj"><a href="#USTR2_CHK">USTR2_CHK()</a>
<li class="obj"><a href="#USTR4_CHK">USTR4_CHK()</a>
<li class="obj"><a href="#USTRP1">USTRP1()</a>
<li class="obj"><a href="#USTRP2">USTRP2()</a>
<li class="obj"><a href="#USTRP4">USTRP4()</a>
<li class="obj"><a href="#USTRP1_CHK">USTRP1_CHK()</a>
<li class="obj"><a href="#USTRP2_CHK">USTRP2_CHK()</a>
<li class="obj"><a href="#USTRP4_CHK">USTRP4_CHK()</a>
</ul><li><a id="indx-Creating_fixed_Ustr_functions" href="#Creating_fixed_Ustr_functions">Creating fixed Ustr functions</a>
<ul>
<li class="obj"><a href="#USTR_SIZE_FIXED">USTR_SIZE_FIXED()</a>
<li class="obj"><a href="#ustr_init_fixed">ustr_init_fixed()</a>
<li class="obj"><a href="#USTR_SC_INIT_AUTO">USTR_SC_INIT_AUTO()</a>
<li class="obj"><a href="#USTR_SC_INIT_AUTO_OSTR">USTR_SC_INIT_AUTO_OSTR()</a>
</ul><li><a id="indx-Debugging_functions" href="#Debugging_functions">Debugging functions</a>
<ul>
<li class="obj"><a href="#ustr_assert_valid">ustr_assert_valid()</a>
<li class="obj"><a href="#ustr_assert_valid_subustr">ustr_assert_valid_subustr()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_BEG">USTR_CNTL_MALLOC_CHECK_BEG()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_LVL">USTR_CNTL_MALLOC_CHECK_LVL()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_MEM">USTR_CNTL_MALLOC_CHECK_MEM()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_MEM_SZ">USTR_CNTL_MALLOC_CHECK_MEM_SZ()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_MEM_MINSZ">USTR_CNTL_MALLOC_CHECK_MEM_MINSZ()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_MEM_USTR">USTR_CNTL_MALLOC_CHECK_MEM_USTR()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_MEM_USTRP">USTR_CNTL_MALLOC_CHECK_MEM_USTRP()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_END">USTR_CNTL_MALLOC_CHECK_END()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_ADD">USTR_CNTL_MALLOC_CHECK_ADD()</a>
<li class="obj"><a href="#USTR_CNTL_MALLOC_CHECK_DEL">USTR_CNTL_MALLOC_CHECK_DEL()</a>
</ul><li><a id="indx-Creating_allocated_Ustr_functions" href="#Creating_allocated_Ustr_functions">Creating allocated Ustr functions</a>
<ul>
<li class="obj"><a href="#ustr_init_size">ustr_init_size()</a>
<li class="obj"><a href="#ustr_init_alloc">ustr_init_alloc()</a>
<li class="obj"><a href="#ustr_dupx_empty">ustr_dupx_empty()</a>
<li class="obj"><a href="#ustr_dup_empty">ustr_dup_empty()</a>
<li class="obj"><a href="#ustr_dupx_undef">ustr_dupx_undef()</a>
<li class="obj"><a href="#ustr_dup_undef">ustr_dup_undef()</a>
<li class="obj"><a href="#ustr_dup">ustr_dup()</a>
<li class="obj"><a href="#ustr_dupx">ustr_dupx()</a>
<li class="obj"><a href="#ustr_sc_dup">ustr_sc_dup()</a>
<li class="obj"><a href="#ustr_sc_dupx">ustr_sc_dupx()</a>
<li class="obj"><a href="#ustr_dup_buf">ustr_dup_buf()</a>
<li class="obj"><a href="#ustr_dupx_buf">ustr_dupx_buf()</a>
<li class="obj"><a href="#ustr_dup_cstr">ustr_dup_cstr()</a>
<li class="obj"><a href="#ustr_dupx_cstr">ustr_dupx_cstr()</a>
<li class="obj"><a href="#USTR_DUP_OSTR">USTR_DUP_OSTR()</a>
<li class="obj"><a href="#USTR_DUP_OBJ">USTR_DUP_OBJ()</a>
<li class="obj"><a href="#ustr_dup_subustr">ustr_dup_subustr()</a>
<li class="obj"><a href="#ustr_dupx_subustr">ustr_dupx_subustr()</a>
<li class="obj"><a href="#ustr_dup_rep_chr">ustr_dup_rep_chr()</a>
<li class="obj"><a href="#ustr_dupx_rep_chr">ustr_dupx_rep_chr()</a>
<li class="obj"><a href="#ustr_sc_vjoin">ustr_sc_vjoin()</a>
<li class="obj"><a href="#ustr_sc_join">ustr_sc_join()</a>
<li class="obj"><a href="#ustr_sc_vjoinx">ustr_sc_vjoinx()</a>
<li class="obj"><a href="#ustr_sc_joinx">ustr_sc_joinx()</a>
<li class="obj"><a href="#ustr_sc_vconcat">ustr_sc_vconcat()</a>
<li class="obj"><a href="#ustr_sc_concat">ustr_sc_concat()</a>
<li class="obj"><a href="#ustr_sc_vconcatx">ustr_sc_vconcatx()</a>
<li class="obj"><a href="#ustr_sc_concatx">ustr_sc_concatx()</a>
</ul><li><a id="indx-Deleting_a_Ustr_or_data_within_a_Ustr" href="#Deleting_a_Ustr_or_data_within_a_Ustr">Deleting a Ustr, or data within a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_free">ustr_free()</a>
<li class="obj"><a href="#ustrp_free">ustrp_free()</a>
<li class="obj"><a href="#ustr_sc_free">ustr_sc_free()</a>
<li class="obj"><a href="#ustr_sc_free2">ustr_sc_free2()</a>
<li class="obj"><a href="#ustr_sc_free_shared">ustr_sc_free_shared()</a>
<li class="obj"><a href="#ustr_del">ustr_del()</a>
<li class="obj"><a href="#ustr_del_subustr">ustr_del_subustr()</a>
<li class="obj"><a href="#ustr_sc_del">ustr_sc_del()</a>
</ul><li><a id="indx-Adding_data_to_a_Ustr" href="#Adding_data_to_a_Ustr">Adding data to a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_add_undef">ustr_add_undef()</a>
<li class="obj"><a href="#ustr_add_buf">ustr_add_buf()</a>
<li class="obj"><a href="#ustr_add_cstr">ustr_add_cstr()</a>
<li class="obj"><a href="#USTR_ADD_OSTR">USTR_ADD_OSTR()</a>
<li class="obj"><a href="#USTR_ADD_OBJ">USTR_ADD_OBJ()</a>
<li class="obj"><a href="#ustr_add">ustr_add()</a>
<li class="obj"><a href="#ustr_add_subustr">ustr_add_subustr()</a>
<li class="obj"><a href="#ustr_add_rep_chr">ustr_add_rep_chr()</a>
</ul><li><a id="indx-Setting_a_Ustr_to_some_data" href="#Setting_a_Ustr_to_some_data">Setting a Ustr to some data</a>
<ul>
<li class="obj"><a href="#ustr_set_undef">ustr_set_undef()</a>
<li class="obj"><a href="#ustr_set_empty">ustr_set_empty()</a>
<li class="obj"><a href="#ustr_set_buf">ustr_set_buf()</a>
<li class="obj"><a href="#ustr_set_cstr">ustr_set_cstr()</a>
<li class="obj"><a href="#USTR_SET_OSTR">USTR_SET_OSTR()</a>
<li class="obj"><a href="#USTR_SET_OBJ">USTR_SET_OBJ()</a>
<li class="obj"><a href="#ustr_set">ustr_set()</a>
<li class="obj"><a href="#ustr_set_subustr">ustr_set_subustr()</a>
<li class="obj"><a href="#ustr_set_rep_chr">ustr_set_rep_chr()</a>
</ul><li><a id="indx-Inserting_data_into_a_Ustr" href="#Inserting_data_into_a_Ustr">Inserting data into a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_ins_undef">ustr_ins_undef()</a>
<li class="obj"><a href="#ustr_ins_buf">ustr_ins_buf()</a>
<li class="obj"><a href="#ustr_ins_cstr">ustr_ins_cstr()</a>
<li class="obj"><a href="#USTR_INS_OSTR">USTR_INS_OSTR()</a>
<li class="obj"><a href="#USTR_INS_OBJ">USTR_INS_OBJ()</a>
<li class="obj"><a href="#ustr_ins">ustr_ins()</a>
<li class="obj"><a href="#ustr_ins_subustr">ustr_ins_subustr()</a>
<li class="obj"><a href="#ustr_ins_rep_chr">ustr_ins_rep_chr()</a>
</ul><li><a id="indx-Adding_duplicating_and_setting_formatted_data_to_a_Ustr" href="#Adding_duplicating_and_setting_formatted_data_to_a_Ustr">Adding, duplicating and setting formatted data to a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_add_vfmt_lim">ustr_add_vfmt_lim()</a>
<li class="obj"><a href="#ustr_add_vfmt">ustr_add_vfmt()</a>
<li class="obj"><a href="#ustr_add_fmt_lim">ustr_add_fmt_lim()</a>
<li class="obj"><a href="#ustr_add_fmt">ustr_add_fmt()</a>
<li class="obj"><a href="#ustr_dup_vfmt_lim">ustr_dup_vfmt_lim()</a>
<li class="obj"><a href="#ustr_dup_vfmt">ustr_dup_vfmt()</a>
<li class="obj"><a href="#ustr_dup_fmt_lim">ustr_dup_fmt_lim()</a>
<li class="obj"><a href="#ustr_dup_fmt">ustr_dup_fmt()</a>
<li class="obj"><a href="#ustr_dupx_fmt_lim">ustr_dupx_fmt_lim()</a>
<li class="obj"><a href="#ustr_dupx_fmt">ustr_dupx_fmt()</a>
<li class="obj"><a href="#ustr_set_vfmt_lim">ustr_set_vfmt_lim()</a>
<li class="obj"><a href="#ustr_set_vfmt">ustr_set_vfmt()</a>
<li class="obj"><a href="#ustr_set_fmt_lim">ustr_set_fmt_lim()</a>
<li class="obj"><a href="#ustr_set_fmt">ustr_set_fmt()</a>
<li class="obj"><a href="#ustr_ins_vfmt_lim">ustr_ins_vfmt_lim()</a>
<li class="obj"><a href="#ustr_ins_vfmt">ustr_ins_vfmt()</a>
<li class="obj"><a href="#ustr_ins_fmt_lim">ustr_ins_fmt_lim()</a>
<li class="obj"><a href="#ustr_ins_fmt">ustr_ins_fmt()</a>
<li class="obj"><a href="#ustr_sub_vfmt_lim">ustr_sub_vfmt_lim()</a>
<li class="obj"><a href="#ustr_sub_vfmt">ustr_sub_vfmt()</a>
<li class="obj"><a href="#ustr_sub_fmt_lim">ustr_sub_fmt_lim()</a>
<li class="obj"><a href="#ustr_sub_fmt">ustr_sub_fmt()</a>
<li class="obj"><a href="#ustr_sc_sub_vfmt_lim">ustr_sc_sub_vfmt_lim()</a>
<li class="obj"><a href="#ustr_sc_sub_vfmt">ustr_sc_sub_vfmt()</a>
<li class="obj"><a href="#ustr_sc_sub_fmt_lim">ustr_sc_sub_fmt_lim()</a>
<li class="obj"><a href="#ustr_sc_sub_fmt">ustr_sc_sub_fmt()</a>
</ul><li><a id="indx-Accessing_the_variables_of_a_Ustr" href="#Accessing_the_variables_of_a_Ustr">Accessing the "variables" of a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_len">ustr_len()</a>
<li class="obj"><a href="#ustr_cstr">ustr_cstr()</a>
<li class="obj"><a href="#ustr_wstr">ustr_wstr()</a>
<li class="obj"><a href="#ustr_alloc">ustr_alloc()</a>
<li class="obj"><a href="#ustr_exact">ustr_exact()</a>
<li class="obj"><a href="#ustr_sized">ustr_sized()</a>
<li class="obj"><a href="#ustr_ro">ustr_ro()</a>
<li class="obj"><a href="#ustr_fixed">ustr_fixed()</a>
<li class="obj"><a href="#ustr_enomem">ustr_enomem()</a>
<li class="obj"><a href="#ustr_shared">ustr_shared()</a>
<li class="obj"><a href="#ustr_limited">ustr_limited()</a>
<li class="obj"><a href="#ustr_owner">ustr_owner()</a>
<li class="obj"><a href="#ustr_size">ustr_size()</a>
<li class="obj"><a href="#ustr_size_alloc">ustr_size_alloc()</a>
<li class="obj"><a href="#ustr_size_overhead">ustr_size_overhead()</a>
<li class="obj"><a href="#ustr_conf">ustr_conf()</a>
</ul><li><a id="indx-Setting_the_flags_of_a_Ustr" href="#Setting_the_flags_of_a_Ustr">Setting the "flags" of a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_setf_enomem_err">ustr_setf_enomem_err()</a>
<li class="obj"><a href="#ustr_setf_enomem_clr">ustr_setf_enomem_clr()</a>
<li class="obj"><a href="#ustr_setf_share">ustr_setf_share()</a>
<li class="obj"><a href="#ustr_setf_owner">ustr_setf_owner()</a>
</ul><li><a id="indx-Comparing_data_in_a_Ustr" href="#Comparing_data_in_a_Ustr">Comparing data in a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_cmp_buf">ustr_cmp_buf()</a>
<li class="obj"><a href="#ustr_cmp">ustr_cmp()</a>
<li class="obj"><a href="#ustr_cmp_subustr">ustr_cmp_subustr()</a>
<li class="obj"><a href="#ustr_cmp_cstr">ustr_cmp_cstr()</a>
<li class="obj"><a href="#ustr_cmp_fast_buf">ustr_cmp_fast_buf()</a>
<li class="obj"><a href="#ustr_cmp_fast">ustr_cmp_fast()</a>
<li class="obj"><a href="#ustr_cmp_fast_subustr">ustr_cmp_fast_subustr()</a>
<li class="obj"><a href="#ustr_cmp_fast_cstr">ustr_cmp_fast_cstr()</a>
<li class="obj"><a href="#ustr_cmp_case_buf">ustr_cmp_case_buf()</a>
<li class="obj"><a href="#ustr_cmp_case">ustr_cmp_case()</a>
<li class="obj"><a href="#ustr_cmp_case_subustr">ustr_cmp_case_subustr()</a>
<li class="obj"><a href="#ustr_cmp_case_cstr">ustr_cmp_case_cstr()</a>
<li class="obj"><a href="#ustr_cmp_eq">ustr_cmp_eq()</a>
<li class="obj"><a href="#ustr_cmp_buf_eq">ustr_cmp_buf_eq()</a>
<li class="obj"><a href="#ustr_cmp_subustr_eq">ustr_cmp_subustr_eq()</a>
<li class="obj"><a href="#ustr_cmp_cstr_eq">ustr_cmp_cstr_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_eq">ustr_cmp_case_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_buf_eq">ustr_cmp_case_buf_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_subustr_eq">ustr_cmp_case_subustr_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_cstr_eq">ustr_cmp_case_cstr_eq()</a>
<li class="obj"><a href="#ustr_cmp_prefix_eq">ustr_cmp_prefix_eq()</a>
<li class="obj"><a href="#ustr_cmp_prefix_buf_eq">ustr_cmp_prefix_buf_eq()</a>
<li class="obj"><a href="#ustr_cmp_prefix_cstr_eq">ustr_cmp_prefix_cstr_eq()</a>
<li class="obj"><a href="#ustr_cmp_prefix_subustr_eq">ustr_cmp_prefix_subustr_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_prefix_eq">ustr_cmp_case_prefix_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_prefix_buf_eq">ustr_cmp_case_prefix_buf_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_prefix_cstr_eq">ustr_cmp_case_prefix_cstr_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_prefix_subustr_eq">ustr_cmp_case_prefix_subustr_eq()</a>
<li class="obj"><a href="#ustr_cmp_suffix_eq">ustr_cmp_suffix_eq()</a>
<li class="obj"><a href="#ustr_cmp_suffix_buf_eq">ustr_cmp_suffix_buf_eq()</a>
<li class="obj"><a href="#ustr_cmp_suffix_cstr_eq">ustr_cmp_suffix_cstr_eq()</a>
<li class="obj"><a href="#ustr_cmp_suffix_subustr_eq">ustr_cmp_suffix_subustr_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_suffix_eq">ustr_cmp_case_suffix_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_suffix_buf_eq">ustr_cmp_case_suffix_buf_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_suffix_cstr_eq">ustr_cmp_case_suffix_cstr_eq()</a>
<li class="obj"><a href="#ustr_cmp_case_suffix_subustr_eq">ustr_cmp_case_suffix_subustr_eq()</a>
</ul><li><a id="indx-Searching_for_data_in_a_Ustr" href="#Searching_for_data_in_a_Ustr">Searching for data in a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_srch_chr_fwd">ustr_srch_chr_fwd()</a>
<li class="obj"><a href="#ustr_srch_chr_rev">ustr_srch_chr_rev()</a>
<li class="obj"><a href="#ustr_srch_buf_fwd">ustr_srch_buf_fwd()</a>
<li class="obj"><a href="#ustr_srch_buf_rev">ustr_srch_buf_rev()</a>
<li class="obj"><a href="#ustr_srch_fwd">ustr_srch_fwd()</a>
<li class="obj"><a href="#ustr_srch_rev">ustr_srch_rev()</a>
<li class="obj"><a href="#ustr_srch_cstr_fwd">ustr_srch_cstr_fwd()</a>
<li class="obj"><a href="#ustr_srch_cstr_rev">ustr_srch_cstr_rev()</a>
<li class="obj"><a href="#ustr_srch_subustr_fwd">ustr_srch_subustr_fwd()</a>
<li class="obj"><a href="#ustr_srch_subustr_rev">ustr_srch_subustr_rev()</a>
<li class="obj"><a href="#ustr_srch_case_chr_fwd">ustr_srch_case_chr_fwd()</a>
<li class="obj"><a href="#ustr_srch_case_chr_rev">ustr_srch_case_chr_rev()</a>
<li class="obj"><a href="#ustr_srch_case_buf_fwd">ustr_srch_case_buf_fwd()</a>
<li class="obj"><a href="#ustr_srch_case_buf_rev">ustr_srch_case_buf_rev()</a>
<li class="obj"><a href="#ustr_srch_case_fwd">ustr_srch_case_fwd()</a>
<li class="obj"><a href="#ustr_srch_case_rev">ustr_srch_case_rev()</a>
<li class="obj"><a href="#ustr_srch_case_cstr_fwd">ustr_srch_case_cstr_fwd()</a>
<li class="obj"><a href="#ustr_srch_case_cstr_rev">ustr_srch_case_cstr_rev()</a>
<li class="obj"><a href="#ustr_srch_case_subustr_fwd">ustr_srch_case_subustr_fwd()</a>
<li class="obj"><a href="#ustr_srch_case_subustr_rev">ustr_srch_case_subustr_rev()</a>
</ul><li><a id="indx-Span_lengths_of_data_in_a_Ustr" href="#Span_lengths_of_data_in_a_Ustr">Span lengths of data in a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_spn_chr_fwd">ustr_spn_chr_fwd()</a>
<li class="obj"><a href="#ustr_spn_chr_rev">ustr_spn_chr_rev()</a>
<li class="obj"><a href="#ustr_spn_chrs_fwd">ustr_spn_chrs_fwd()</a>
<li class="obj"><a href="#ustr_spn_chrs_rev">ustr_spn_chrs_rev()</a>
<li class="obj"><a href="#ustr_spn_fwd">ustr_spn_fwd()</a>
<li class="obj"><a href="#ustr_spn_rev">ustr_spn_rev()</a>
<li class="obj"><a href="#ustr_spn_cstr_fwd">ustr_spn_cstr_fwd()</a>
<li class="obj"><a href="#ustr_spn_cstr_rev">ustr_spn_cstr_rev()</a>
<li class="obj"><a href="#ustr_cspn_chr_fwd">ustr_cspn_chr_fwd()</a>
<li class="obj"><a href="#ustr_cspn_chr_rev">ustr_cspn_chr_rev()</a>
<li class="obj"><a href="#ustr_cspn_chrs_fwd">ustr_cspn_chrs_fwd()</a>
<li class="obj"><a href="#ustr_cspn_chrs_rev">ustr_cspn_chrs_rev()</a>
<li class="obj"><a href="#ustr_cspn_fwd">ustr_cspn_fwd()</a>
<li class="obj"><a href="#ustr_cspn_rev">ustr_cspn_rev()</a>
<li class="obj"><a href="#ustr_cspn_cstr_fwd">ustr_cspn_cstr_fwd()</a>
<li class="obj"><a href="#ustr_cspn_cstr_rev">ustr_cspn_cstr_rev()</a>
<li class="obj"><a href="#ustr_utf8_spn_chrs_fwd">ustr_utf8_spn_chrs_fwd()</a>
<li class="obj"><a href="#ustr_utf8_spn_chrs_rev">ustr_utf8_spn_chrs_rev()</a>
<li class="obj"><a href="#ustr_utf8_spn_fwd">ustr_utf8_spn_fwd()</a>
<li class="obj"><a href="#ustr_utf8_spn_rev">ustr_utf8_spn_rev()</a>
<li class="obj"><a href="#ustr_utf8_spn_cstr_fwd">ustr_utf8_spn_cstr_fwd()</a>
<li class="obj"><a href="#ustr_utf8_spn_cstr_rev">ustr_utf8_spn_cstr_rev()</a>
<li class="obj"><a href="#ustr_utf8_cspn_chrs_fwd">ustr_utf8_cspn_chrs_fwd()</a>
<li class="obj"><a href="#ustr_utf8_cspn_chrs_rev">ustr_utf8_cspn_chrs_rev()</a>
<li class="obj"><a href="#ustr_utf8_cspn_fwd">ustr_utf8_cspn_fwd()</a>
<li class="obj"><a href="#ustr_utf8_cspn_rev">ustr_utf8_cspn_rev()</a>
<li class="obj"><a href="#ustr_utf8_cspn_cstr_fwd">ustr_utf8_cspn_cstr_fwd()</a>
<li class="obj"><a href="#ustr_utf8_cspn_cstr_rev">ustr_utf8_cspn_cstr_rev()</a>
</ul><li><a id="indx-Doing_IO_from_or_to_a_Ustr" href="#Doing_IO_from_or_to_a_Ustr">Doing IO from or to a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_io_get">ustr_io_get()</a>
<li class="obj"><a href="#ustr_io_getfile">ustr_io_getfile()</a>
<li class="obj"><a href="#ustr_io_getfilename">ustr_io_getfilename()</a>
<li class="obj"><a href="#ustr_io_getdelim">ustr_io_getdelim()</a>
<li class="obj"><a href="#ustr_io_getline">ustr_io_getline()</a>
<li class="obj"><a href="#ustr_io_put">ustr_io_put()</a>
<li class="obj"><a href="#ustr_io_putline">ustr_io_putline()</a>
<li class="obj"><a href="#ustr_io_putfile">ustr_io_putfile()</a>
<li class="obj"><a href="#ustr_io_putfileline">ustr_io_putfileline()</a>
<li class="obj"><a href="#ustr_io_putfilename">ustr_io_putfilename()</a>
</ul><li><a id="indx-String_substitutionreplacement" href="#String_substitutionreplacement">String substitution/replacement</a>
<ul>
<li class="obj"><a href="#ustr_sub_undef">ustr_sub_undef()</a>
<li class="obj"><a href="#ustr_sub_buf">ustr_sub_buf()</a>
<li class="obj"><a href="#ustr_sub_cstr">ustr_sub_cstr()</a>
<li class="obj"><a href="#USTR_SUB_OSTR">USTR_SUB_OSTR()</a>
<li class="obj"><a href="#USTR_SUB_OBJ">USTR_SUB_OBJ()</a>
<li class="obj"><a href="#ustr_sub">ustr_sub()</a>
<li class="obj"><a href="#ustr_sub_subustr">ustr_sub_subustr()</a>
<li class="obj"><a href="#ustr_sc_sub_undef">ustr_sc_sub_undef()</a>
<li class="obj"><a href="#ustr_sc_sub_buf">ustr_sc_sub_buf()</a>
<li class="obj"><a href="#ustr_sc_sub_cstr">ustr_sc_sub_cstr()</a>
<li class="obj"><a href="#ustr_sc_sub">ustr_sc_sub()</a>
<li class="obj"><a href="#ustr_sc_sub_subustr">ustr_sc_sub_subustr()</a>
<li class="obj"><a href="#USTR_SC_SUB_OSTR">USTR_SC_SUB_OSTR()</a>
<li class="obj"><a href="#USTR_SC_SUB_OBJ">USTR_SC_SUB_OBJ()</a>
<li class="obj"><a href="#ustr_replace_buf">ustr_replace_buf()</a>
<li class="obj"><a href="#ustr_replace_cstr">ustr_replace_cstr()</a>
<li class="obj"><a href="#ustr_replace">ustr_replace()</a>
<li class="obj"><a href="#ustr_replace_rep_chr">ustr_replace_rep_chr()</a>
</ul><li><a id="indx-Splitting_a_Ustr" href="#Splitting_a_Ustr">Splitting a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_split_buf">ustr_split_buf()</a>
<li class="obj"><a href="#ustr_split">ustr_split()</a>
<li class="obj"><a href="#ustr_split_cstr">ustr_split_cstr()</a>
<li class="obj"><a href="#ustr_split_spn_chrs">ustr_split_spn_chrs()</a>
<li class="obj"><a href="#ustr_split_spn_cstr">ustr_split_spn_cstr()</a>
<li class="obj"><a href="#ustr_split_spn">ustr_split_spn()</a>
</ul><li><a id="indx-Dealing_with_UTF8_in_a_Ustr" href="#Dealing_with_UTF8_in_a_Ustr">Dealing with UTF-8 in a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_utf8_valid">ustr_utf8_valid()</a>
<li class="obj"><a href="#ustr_utf8_len">ustr_utf8_len()</a>
<li class="obj"><a href="#ustr_utf8_width">ustr_utf8_width()</a>
<li class="obj"><a href="#ustr_utf8_chars2bytes">ustr_utf8_chars2bytes()</a>
<li class="obj"><a href="#ustr_utf8_bytes2chars">ustr_utf8_bytes2chars()</a>
<li class="obj"><a href="#ustr_sc_utf8_reverse">ustr_sc_utf8_reverse()</a>
</ul><li><a id="indx-Parsing_ASCII_integer_numbers_from_a_Ustr" href="#Parsing_ASCII_integer_numbers_from_a_Ustr">Parsing ASCII integer numbers from a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_parse_uintmaxx">ustr_parse_uintmaxx()</a>
<li class="obj"><a href="#ustr_parse_uintmax">ustr_parse_uintmax()</a>
<li class="obj"><a href="#ustr_parse_intmax">ustr_parse_intmax()</a>
<li class="obj"><a href="#ustr_parse_ulongx">ustr_parse_ulongx()</a>
<li class="obj"><a href="#ustr_parse_ulong">ustr_parse_ulong()</a>
<li class="obj"><a href="#ustr_parse_long">ustr_parse_long()</a>
<li class="obj"><a href="#ustr_parse_uint">ustr_parse_uint()</a>
<li class="obj"><a href="#ustr_parse_int">ustr_parse_int()</a>
<li class="obj"><a href="#ustr_parse_ushort">ustr_parse_ushort()</a>
<li class="obj"><a href="#ustr_parse_short">ustr_parse_short()</a>
</ul><li><a id="indx-Misc_shortcut_helper_functions_for_Ustrs" href="#Misc_shortcut_helper_functions_for_Ustrs">Misc shortcut helper functions for Ustrs</a>
<ul>
<li class="obj"><a href="#ustr_sc_ensure_owner">ustr_sc_ensure_owner()</a>
<li class="obj"><a href="#ustr_sc_wstr">ustr_sc_wstr()</a>
<li class="obj"><a href="#ustr_sc_export_subustr">ustr_sc_export_subustr()</a>
<li class="obj"><a href="#ustr_sc_export">ustr_sc_export()</a>
<li class="obj"><a href="#ustrp_sc_export_subustrp">ustrp_sc_export_subustrp()</a>
<li class="obj"><a href="#ustrp_sc_export">ustrp_sc_export()</a>
<li class="obj"><a href="#ustr_sc_reverse">ustr_sc_reverse()</a>
<li class="obj"><a href="#ustr_sc_tolower">ustr_sc_tolower()</a>
<li class="obj"><a href="#ustr_sc_toupper">ustr_sc_toupper()</a>
<li class="obj"><a href="#ustr_sc_ltrim_chrs">ustr_sc_ltrim_chrs()</a>
<li class="obj"><a href="#ustr_sc_ltrim">ustr_sc_ltrim()</a>
<li class="obj"><a href="#ustr_sc_ltrim_cstr">ustr_sc_ltrim_cstr()</a>
<li class="obj"><a href="#ustr_sc_rtrim_chrs">ustr_sc_rtrim_chrs()</a>
<li class="obj"><a href="#ustr_sc_rtrim">ustr_sc_rtrim()</a>
<li class="obj"><a href="#ustr_sc_rtrim_cstr">ustr_sc_rtrim_cstr()</a>
<li class="obj"><a href="#ustr_sc_trim_chrs">ustr_sc_trim_chrs()</a>
<li class="obj"><a href="#ustr_sc_trim">ustr_sc_trim()</a>
<li class="obj"><a href="#ustr_sc_trim_cstr">ustr_sc_trim_cstr()</a>
</ul><li><a id="indx-Adding_binary_data_to_a_Ustr" href="#Adding_binary_data_to_a_Ustr">Adding binary data to a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_add_b_uint16">ustr_add_b_uint16()</a>
<li class="obj"><a href="#ustr_add_b_uint32">ustr_add_b_uint32()</a>
<li class="obj"><a href="#ustr_add_b_uint64">ustr_add_b_uint64()</a>
</ul><li><a id="indx-Parsing_binary_data_from_a_Ustr" href="#Parsing_binary_data_from_a_Ustr">Parsing binary data from a Ustr</a>
<ul>
<li class="obj"><a href="#ustr_parse_b_uint16">ustr_parse_b_uint16()</a>
<li class="obj"><a href="#ustr_parse_b_uint32">ustr_parse_b_uint32()</a>
<li class="obj"><a href="#ustr_parse_b_uint64">ustr_parse_b_uint64()</a>
</ul><li><a id="indx-Misc_functions" href="#Misc_functions">Misc. functions</a>
<ul>
<li class="obj"><a href="#ustr_realloc">ustr_realloc()</a>
<li class="obj"><a href="#ustr_cntl_opt">ustr_cntl_opt()</a>
</ul><li><a id="indx-Simple_Ustr_pool_API" href="#Simple_Ustr_pool_API">Simple Ustr pool API</a>
<ul>
<li class="obj"><a href="#ustr_pool_ll_make">ustr_pool_ll_make()</a>
<li class="obj"><a href="#ustr_pool_make_subpool">ustr_pool_make_subpool()</a>
<li class="obj"><a href="#ustr_pool_free">ustr_pool_free()</a>
<li class="obj"><a href="#ustr_pool_clear">ustr_pool_clear()</a>
</ul></ul>
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Creating%20read%2donly%20Ustr%20functions">Creating read-only Ustr functions</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR">USTR()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to Ustr data<br>Type<strong>[1]</strong>: void *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This macro function is normally used with the empty string "".
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> There is basically just a simple cast behind the macro.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP">USTRP()</a>
<br>Returns: <a href="design.html">Ustrp string</a><br>Type: struct Ustrp *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to Ustrp data<br>Type<strong>[1]</strong>: void *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This macro function is normally used with the empty string "".
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> There is basically just a simple cast behind the macro.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR1">USTR1()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This macro function simplifies the creation of read-only <a href="design.html">Ustr string</a>'s. And
is normally used like...
</p><pre>
USTR1(\x4, "abcd")
</pre><p> ...it is worth pointing out that running with debugging turned on
(<a href="constants.html#USTR_CONF_USE_ASSERT">USTR_CONF_USE_ASSERT</a>) will complain if the length isn't encoded correctly, as
in...
</p><pre>
USTR1(\x3, "abcd")
</pre><p> ...here <a href="functions.html#ustr_assert_valid">ustr_assert_valid()</a> will fail, which is called before most functions do
anything in debugging mode. Note also that extra debugging
(<a href="constants.html#USTR_CONF_USE_EOS_MARK">USTR_CONF_USE_EOS_MARK</a>) will still catch cases like...
</p><pre>
USTR1(\x3, "abc\0d")
</pre><p> ...at least using debugging is esp. important if you are putting UTF-8
characters into the strings.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Having <a href="functions.html#ustr_ro">ustr_ro()</a> return true means that the Ustr cannot be written to without
be reallocated into allocation space ... not that <a href="functions.html#ustr_add">ustr_add()</a> etc. will fail.
</p><p> There is now USTR1_CHK() which performs a compile time check so you can never
have an invalid ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR2">USTR2()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works in the same way as <a href="functions.html#USTR1">USTR1()</a> but takes two length bytes, so
the read-only string can be upto 65,535 (2**16 - 1) bytes in length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR4">USTR4()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 4th byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 3rd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[4]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[4]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[5]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works in the same way as <a href="functions.html#USTR1">USTR1()</a> but takes four length bytes, so
the read-only string can be upto 2**32 - 1 bytes in length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR1_CHK">USTR1_CHK()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works in the same way as <a href="functions.html#USTR1">USTR1()</a> but it does a check against
the length of (Parameter[2]) using sizeof() - 1.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the check fails the returned Ustr * will be "", so you can check
<a href="functions.html#ustr_len">ustr_len()</a> to see if you screwed something up.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR2_CHK">USTR2_CHK()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works in the same way as <a href="functions.html#USTR2">USTR2()</a> but it does a check against
the length of (Parameter[2]) using sizeof() - 1.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the check fails the returned Ustr * will be "".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR4_CHK">USTR4_CHK()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 4th byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 3rd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[4]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[4]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[5]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works in the same way as <a href="functions.html#USTR4">USTR4()</a> but it does a check against
the length of (Parameter[2]) using sizeof() - 1.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the check fails the returned Ustr * will be "".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP1">USTRP1()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#USTR1">USTR1()</a>, but returns a Ustrp instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP2">USTRP2()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#USTR4">USTR4()</a>, but returns a Ustrp instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP4">USTRP4()</a>
<br>Returns: <a href="design.html">Ustrp string</a><br>Type: struct Ustrp *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 4th byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 3rd byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[3]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[4]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[4]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[5]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#USTR2">USTR2()</a>, but returns a Ustrp instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP1_CHK">USTRP1_CHK()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like USTR1_CHK(), but returns a Ustrp instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP2_CHK">USTRP2_CHK()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like USTR4_CHK(), but returns a Ustrp instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTRP4_CHK">USTRP4_CHK()</a>
<br>Returns: <a href="design.html">Ustrp string</a><br>Type: struct Ustrp *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Encoded 4th byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[1]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[2]</strong>: Encoded 3rd byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[2]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[3]</strong>: Encoded 2nd byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[3]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[4]</strong>: Encoded 1st byte of number of the length of <a href="design.html">Ustrp string</a><br>Type<strong>[4]</strong>: symbol
</td></tr><tr><td>Parameter<strong>[5]</strong>: Data for <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const char[]
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like USTR2_CHK(), but returns a Ustrp instead.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Creating%20fixed%20Ustr%20functions">Creating fixed Ustr functions</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SIZE_FIXED">USTR_SIZE_FIXED()</a>
<br>Returns: Size of area of memory<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of area of memory<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This macro function is replaced by a static conversion from the max length
desired (Parameter[1]) to the storage size needed. In other words it works out
what <a href="functions.html#ustr_size_overhead">ustr_size_overhead()</a> will be, and adds that value.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is useful is you want a small fixed size allocation, as you can declare
it like so:
</p><p> char buf[USTR_SIZE_FIXED(4)];
...to give you exactly 4 bytes as a maximum, this is esp. useful if you want
a limited (<a href="functions.html#ustr_limited">ustr_limited()</a> == <a href="constants.html#USTR_TRUE">USTR_TRUE</a>) <a href="design.html">Ustr string</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_init_fixed">ustr_init_fixed()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to area of memory to use as a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: void *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Size of area of memory<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Whether the fixed size Ustr should be limited<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: The initial length of the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This creates a new <a href="design.html">Ustr string</a>, which is "fixed". This means the Ustr storage
is managed outside of the ustr_* API, it is often used for stack allocated
strings.
</p><p> As you add data to the Ustr past the size allowed via. the fixed storge the
Ustr will automatically be converted into an allocated Ustr. So if this is
possible you should always call <a href="functions.html#ustr_free">ustr_free()</a>, as this does nothing if given a
fixed size Ustr.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> For simplicity you probably want to use <a href="functions.html#USTR_SC_INIT_AUTO">USTR_SC_INIT_AUTO()</a> or
<a href="functions.html#USTR_SC_INIT_AUTO">USTR_SC_INIT_AUTO()</a> when possible.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SC_INIT_AUTO">USTR_SC_INIT_AUTO()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Area of memory to use as a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: char[]
</td></tr><tr><td>Parameter<strong>[2]</strong>: Whether the fixed size Ustr should be limited<br>Type<strong>[2]</strong>: int
</td></tr><tr><td>Parameter<strong>[3]</strong>: The initial length of the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This calls <a href="functions.html#ustr_init_fixed">ustr_init_fixed()</a> with sizeof() the area of memory (Parameter[1])
as the second argument.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This does mean that the first argument must be the correct size, as far as
sizeof() is concerned, as in...
</p><pre>
char buf_sz[1024];
Ustr *s1 = USTR_SC_INIT_AUTO(buf_sz, USTR_FALSE, 0);
</pre><p> ...so passing pointers to memory from malloc() will probably just return NULL.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SC_INIT_AUTO_OSTR">USTR_SC_INIT_AUTO_OSTR()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Area of memory to use as a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: char[]
</td></tr><tr><td>Parameter<strong>[2]</strong>: Whether the fixed size Ustr should be limited<br>Type<strong>[2]</strong>: int
</td></tr><tr><td>Parameter<strong>[3]</strong>: The initial string in the buffer, as a constant string<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This calls <a href="functions.html#ustr_init_fixed">ustr_init_fixed()</a> with sizeof() the area of memory (Parameter[1])
as the second argument, given as an "object string".
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This does mean that the first argument must be the correct size, as far as
sizeof() is concerned, as in...
</p><pre>
char buf_sz[1024] = USTR_BEG_FIXED2 "abcd";
Ustr *s1 = USTR_SC_INIT_AUTO_OSTR(buf_sz, USTR_FALSE, "abcd");
</pre><p> ...so passing pointers to memory from malloc() will probably just return NULL.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Debugging%20functions">Debugging functions</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_assert_valid">ustr_assert_valid()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function asserts a few internal consistency checks, and can help point
out when a Ustr is invalid.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This calls <a href="functions.html#ustr_assert_ret">ustr_assert_ret()</a> so that when <a href="constants.html#USTR_DEBUG">USTR_DEBUG</a> if off the checks are
still performed and the result is returned.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_assert_valid_subustr">ustr_assert_valid_subustr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position in the Ustr<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length to delete from the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls <a href="functions.html#ustr_assert_valid">ustr_assert_valid()</a> and also checks that the position and
length are within the Ustr. If they aren't valid it returns 0, if they are
valid it returns <a href="functions.html#ustr_len">ustr_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_BEG">USTR_CNTL_MALLOC_CHECK_BEG()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Condition for begin malloc checking or not<br>Type<strong>[1]</strong>: int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function begins malloc checking, meaning all ustr allocations will go
through the malloc check routines, but it fails if the condition
check (Parameter[1]) fails.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Turning malloc checking on after one or more allocations has happened will
lead to false failures unless you really known what you are doing.
</p><p> You can automatically turn malloc checking on by giving the <a href="constants.html#USTR_CNTL_MC">USTR_CNTL_MC</a>
environment variable the value of "1", "yes" or "on".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_LVL">USTR_CNTL_MALLOC_CHECK_LVL()</a>
<br>Returns: Level of current malloc check<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Nothing<br>Type<strong>[1]</strong>: void
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the current "level" of the malloc check, with 0
indicating that malloc check isn't enabled.
</p><p> The level goes up by one whenever <a href="functions.html#USTR_CNTL_MALLOC_CHECK_BEG">USTR_CNTL_MALLOC_CHECK_BEG()</a> or
<a href="functions.html#USTR_CNTL_MALLOC_CHECK_ADD">USTR_CNTL_MALLOC_CHECK_ADD()</a> returns success, and goes down by one whenever
<a href="functions.html#USTR_CNTL_MALLOC_CHECK_DEL">USTR_CNTL_MALLOC_CHECK_DEL()</a> or <a href="functions.html#USTR_CNTL_MALLOC_CHECK_END">USTR_CNTL_MALLOC_CHECK_END()</a> returns success.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_MEM">USTR_CNTL_MALLOC_CHECK_MEM()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer returned from malloc check<br>Type<strong>[1]</strong>: void *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function asserts that the pointer (Parameter[1]) was allocated from
malloc checking.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Unless you are doing something special, or using a builtin Ustr_pool it is
very likely you want to just call <a href="functions.html#USTR_CNTL_MALLOC_CHECK_MEM_USTR">USTR_CNTL_MALLOC_CHECK_MEM_USTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_MEM_SZ">USTR_CNTL_MALLOC_CHECK_MEM_SZ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer returned from malloc check<br>Type<strong>[1]</strong>: void *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Length of allocated memory<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function asserts that the pointer (Parameter[1]) was allocated from
malloc checking, and has the specified size (Parameter[2]).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Unless you are doing something special, or using a builtin Ustr_pool it is
very likely you want to just call <a href="functions.html#USTR_CNTL_MALLOC_CHECK_MEM_USTR">USTR_CNTL_MALLOC_CHECK_MEM_USTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_MEM_MINSZ">USTR_CNTL_MALLOC_CHECK_MEM_MINSZ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer returned from malloc check<br>Type<strong>[1]</strong>: void *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Length of allocated memory<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function asserts that the pointer (Parameter[1]) was allocated from
malloc checking, and has at least the specified size (Parameter[2]).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Unless you are doing something special, or using a builtin Ustr_pool it is
very likely you want to just call <a href="functions.html#USTR_CNTL_MALLOC_CHECK_MEM_USTR">USTR_CNTL_MALLOC_CHECK_MEM_USTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_MEM_USTR">USTR_CNTL_MALLOC_CHECK_MEM_USTR()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function asserts that the pointer (Parameter[1]) is a Ustr allocated from
malloc checking, if the Ustr is allocated (if not it returns TRUE).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Because of the layering between the Ustr code and the pool code, if you
allocate an implicity sized Ustrp from a pool and then delete some data from
it (which fails) the Ustr layer will think it has an implicit less than the
actual size so this function will fail. This is what
<a href="functions.html#USTR_CNTL_MALLOC_CHECK_MEM_USTRP">USTR_CNTL_MALLOC_CHECK_MEM_USTRP()</a> is for.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_MEM_USTRP">USTR_CNTL_MALLOC_CHECK_MEM_USTRP()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html">Ustrp string</a><br>Type<strong>[1]</strong>: Ustrp *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function asserts that the pointer (Parameter[1]) is a Ustr allocated from
a builtin pool using malloc checking, if the Ustr is allocated (if not it
returns TRUE).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_END">USTR_CNTL_MALLOC_CHECK_END()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Nothing<br>Type<strong>[1]</strong>: void
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This macro will cleanup any memory used by malloc check, and assert that
no memory is left allocated.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If any memory is left allocated, each one found is output to stderr with
the file/line/function of the level it was allocated from.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_ADD">USTR_CNTL_MALLOC_CHECK_ADD()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Condition to begin malloc checking or not<br>Type<strong>[1]</strong>: int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#USTR_CNTL_MALLOC_CHECK_END">USTR_CNTL_MALLOC_CHECK_END()</a> but it fails if the
condition check (Parameter[1]) fails, or if <a href="functions.html#USTR_CNTL_MALLOC_CHECK_LVL">USTR_CNTL_MALLOC_CHECK_LVL()</a> is
zero.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_CNTL_MALLOC_CHECK_DEL">USTR_CNTL_MALLOC_CHECK_DEL()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Condition to end malloc checking or not<br>Type<strong>[1]</strong>: int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#USTR_CNTL_MALLOC_CHECK_END">USTR_CNTL_MALLOC_CHECK_END()</a> but it fails if the
condition check (Parameter[1]) fails, or if <a href="functions.html#USTR_CNTL_MALLOC_CHECK_LVL">USTR_CNTL_MALLOC_CHECK_LVL()</a> is
one.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The condition (Parameter[1]) to this macro should almost certainly be the
return value from <a href="functions.html#USTR_CNTL_MALLOC_CHECK_ADD">USTR_CNTL_MALLOC_CHECK_ADD()</a>.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Creating%20allocated%20Ustr%20functions">Creating allocated Ustr functions</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_init_size">ustr_init_size()</a>
<br>Returns: Size that needs to be allocated<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of data in the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function finds out the exact size of memory needed to store the
specified Ustr of the given configuration.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_init_alloc">ustr_init_alloc()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to area of memory to use as a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: void *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Size of area of memory<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Whether Ustr should store the size<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Number of bytes to use for references<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Whether the Ustr should use exact allocations<br>Type<strong>[5]</strong>: int
</td></tr><tr><td>Parameter<strong>[6]</strong>: Whether the Ustr should have the "enomem" flag set<br>Type<strong>[6]</strong>: int
</td></tr><tr><td>Parameter<strong>[7]</strong>: The initial length of the Ustr<br>Type<strong>[7]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This creates a new <a href="design.html">Ustr string</a>, you should have allocated the data via.
<a href="functions.html#USTR_CONF_MALLOC">USTR_CONF_MALLOC()</a> or bad things will happen if the <a href="design.html">Ustr string</a> is ever free'd
or reallocated.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_empty">ustr_dupx_empty()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocation flag<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function creates an empty Ustr, owned by you, that is allocated
from system memory, or it returns NULL.
</p><p> The size is the desired allocation size for the entire Ustr, including
overhead for metadata. This value will be rounded up, if it's too small, so
passing 1 as the size means you want a stored size but to allocate the smallest
amount of memory possible.
</p><p> The exact memory allocation flag says if the Ustr should round allocations up
to the nearest half power of two or should be no more than needed.
</p><p> The ENOMEM memory error flag sets the iniital state of the user visible flag
for memory allocation errors. Eg. <a href="functions.html#ustr_enomem">ustr_enomem()</a>, <a href="functions.html#ustr_setf_enomem_clr">ustr_setf_enomem_clr()</a> and
<a href="functions.html#ustr_setf_enomem_err">ustr_setf_enomem_err()</a>
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The reference byte count can only be one of the following values: 0, 1, 2 or
4, or 8 (on environments with a 64bit size_t).
</p><p> It can be useful to ensure that the Ustr is in system memory, so that you can
add things to it and check for errors with <a href="functions.html#ustr_enomem">ustr_enomem()</a>.
</p><p> If you chose to store the allocated size in the Ustr then the number of bytes
allocated for the reference count will be a minimum of 2.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_empty">ustr_dup_empty()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Nothing<br>Type<strong>[1]</strong>: void
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function is the same as calling <a href="functions.html#ustr_dupx_empty">ustr_dupx_empty()</a> with the current set
of default options.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_undef">ustr_dupx_undef()</a>
<br>Returns: <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of new undefined data<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like you called <a href="functions.html#ustr_dupx_empty">ustr_dupx_empty()</a> and then
<a href="functions.html#ustr_add_undef">ustr_add_undef()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_undef">ustr_dup_undef()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Length of new undefined data<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function is the same as calling <a href="functions.html#ustr_dupx_undef">ustr_dupx_undef()</a> with the current set
of default options.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup">ustr_dup()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function tries to increase the reference count on the passed <a href="design.html">Ustr string</a>,
and if that succeeds returns that as an argument. If that fails it tries
creates a new <a href="design.html">Ustr string</a> that looks identical to the old <a href="design.html">Ustr string</a>, apart
from the reference count.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Because the new <a href="design.html">Ustr string</a> is configured identically to the old <a href="design.html">Ustr string</a>
this means the result can be very different to what you get if you call
<a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a> with <a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> from the original string where
the configuration would be whatever the default is.
</p><p> Esp. worth of note is that if you <a href="functions.html#ustr_dup">ustr_dup()</a> a <a href="design.html">Ustr string</a> with an explicit
size of 900 but a length of 1, and the reference count is full the returned
<a href="design.html">Ustr string</a> will have a size of 900 bytes and so will have allocated a little
over that. <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a>, even with a sized configuration would only allocate
about 12 bytes and have a size a little less than that.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx">ustr_dupx()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function tries to add a reference if the value of the size, reference
bytes, exact memory allocations and ENOMEM are the same as those in the passed
<a href="design.html">Ustr string</a> (Parameter[5]). If the comparison fails or the addition of a
reference fails it works like <a href="functions.html#ustr_dupx_buf">ustr_dupx_buf()</a> using <a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_dup">ustr_sc_dup()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_dup">ustr_dup()</a>, but if the reference count is
maxed out then and so a new <a href="design.html">Ustr string</a> has been allocated then that is stored
in the passed argument (Parameter[1]) and the "old" <a href="design.html">Ustr string</a> is returned.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The reason to use this is that if you have a "main" <a href="design.html">Ustr string</a> pointer that
a lot of things are getting references too then when the reference count maxes
out you'll degrade into worst case behaviour which acts as though there are no
reference counts. This function stops that problem.
</p><p> As an example, if you have a 1 byte reference count and have 255 * 2
references then using <a href="functions.html#ustr_dup">ustr_dup()</a> will create 256 Ustr strings using this
function will create 4 Ustr strings.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_dupx">ustr_sc_dupx()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_dupx">ustr_dupx()</a>, but if the reference count is
maxed out then and so a new <a href="design.html">Ustr string</a> is allocated then that is stored in
the passed argument (Parameter[1]) and the "old" <a href="design.html">Ustr string</a> is returned.
</p><p> If the configurations of the new <a href="design.html">Ustr string</a> and the old <a href="design.html">Ustr string</a> are not
the same, this function works identically to <a href="functions.html#ustr_dupx">ustr_dupx()</a>.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The reason to use this is that if you have a "main" <a href="design.html">Ustr string</a> pointer that
a lot of things are getting references too then when the reference count maxes
out you'll degrade into worst case behaviour which acts as though there are no
reference counts. This function stops that problem.
</p><p> As an example, if you have a 1 byte reference count and have 255 * 2
references then using <a href="functions.html#ustr_dupx">ustr_dupx()</a> will create 256 Ustr strings using this
function will create 4 Ustr strings.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_buf">ustr_dup_buf()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to data<br>Type<strong>[1]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Length of data<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dup_undef">ustr_dup_undef()</a> and then copied the
data into the new undefined space.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_buf">ustr_dupx_buf()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Pointer to data<br>Type<strong>[5]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Length of data<br>Type<strong>[6]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dupx_undef">ustr_dupx_undef()</a> and then copied the
data into the new undefined space.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_cstr">ustr_dup_cstr()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to constant C-style string<br>Type<strong>[1]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a> and passed strlen() as
the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_cstr">ustr_dupx_cstr()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Pointer to constant C-style string<br>Type<strong>[5]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dupx_buf">ustr_dupx_buf()</a> and passed strlen()
as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_DUP_OSTR">USTR_DUP_OSTR()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A constant C-style string<br>Type<strong>[1]</strong>: const char []
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a> and passed
sizeof() - 1 as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_DUP_OBJ">USTR_DUP_OBJ()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A symbol<br>Type<strong>[1]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a> and passed
sizeof() as the length.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> In most cases you'll want to use <a href="functions.html#USTR_DUP_OSTR">USTR_DUP_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_subustr">ustr_dup_subustr()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position in the Ustr<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length to add from the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly works as if you had called <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> + position - 1 and length values of the <a href="design.html">Ustr string</a> to be added.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the position is 1 and the length is the length of the <a href="design.html">Ustr string</a> then it
just calls <a href="functions.html#ustr_dup">ustr_dup()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_subustr">ustr_dupx_subustr()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Position in the Ustr<br>Type<strong>[6]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[7]</strong>: Length to add from the Ustr<br>Type<strong>[7]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly works as if you had called <a href="functions.html#ustr_dupx_buf">ustr_dupx_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> + position - 1 and length values of the <a href="design.html">Ustr string</a> to be added.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the position is 1 and the length is the length of the <a href="design.html">Ustr string</a> then it
just calls <a href="functions.html#ustr_dupx">ustr_dupx()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_rep_chr">ustr_dup_rep_chr()</a>
<br>Returns: A pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Byte value of data<br>Type<strong>[1]</strong>: char
</td></tr><tr><td>Parameter<strong>[2]</strong>: Length of bytes as data<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dup_undef">ustr_dup_undef()</a> and then copied the
byte value to each position.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_rep_chr">ustr_dupx_rep_chr()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Byte value of data<br>Type<strong>[5]</strong>: char
</td></tr><tr><td>Parameter<strong>[6]</strong>: Length of bytes as data<br>Type<strong>[6]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_dupx_undef">ustr_dupx_undef()</a> and then copied the
byte value to each position.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_vjoin">ustr_sc_vjoin()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Separator to go between Ustr strings<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to the second constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[4]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you called <a href="functions.html#ustr_dup">ustr_dup()</a> on the first Ustr
string (Parameter[2]), and then <a href="functions.html#ustr_add">ustr_add()</a> on the separator (Parameter[1])
followed by <a href="functions.html#ustr_add">ustr_add()</a> on the second <a href="design.html">Ustr string</a> (Parameter[3]). This process
then repeats for all the Ustr strings in the variable argument list
(Parameter[4]) until a <a href="constants.html#USTR_NULL">USTR_NULL</a> is reached.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function doesn't guarantee to just take a reference to one of the passed
Ustr strings, even if that is what would happen if you called the above
manually.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_join">ustr_sc_join()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Separator to go between Ustr strings<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to the second constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Zero or more pointers to constant Ustr strings and then USTR_NULL<br>Type<strong>[4]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls va_start() to get a variable argument list and then calls
<a href="functions.html#ustr_sc_vjoin">ustr_sc_vjoin()</a>.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function doesn't guarantee to just take a reference to one of the passed
Ustr strings, even if that is what would happen if you called the above
manually.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_vjoinx">ustr_sc_vjoinx()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Separator to go between Ustr strings<br>Type<strong>[5]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[6]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[7]</strong>: A pointer to the second constant <a href="design.html">Ustr string</a><br>Type<strong>[7]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[8]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[8]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you called <a href="functions.html#ustr_dupx">ustr_dupx()</a> on the first Ustr
string (Parameter[2]), and then <a href="functions.html#ustr_add">ustr_add()</a> on the separator (Parameter[1])
followed by <a href="functions.html#ustr_add">ustr_add()</a> on the second <a href="design.html">Ustr string</a> (Parameter[3]). This process
then repeats for all the Ustr strings in the variable argument list
(Parameter[4]) until a <a href="constants.html#USTR_NULL">USTR_NULL</a> is reached.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function doesn't guarantee to just take a reference to one of the passed
Ustr strings, even if that is what would happen if you called the above
manually.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_joinx">ustr_sc_joinx()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Separator to go between Ustr strings<br>Type<strong>[5]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[6]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[7]</strong>: A pointer to the second constant <a href="design.html">Ustr string</a><br>Type<strong>[7]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[8]</strong>: Zero or more pointers to constant Ustr strings and then USTR_NULL<br>Type<strong>[8]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls va_start() to get a variable argument list and then calls
<a href="functions.html#ustr_sc_vjoinx">ustr_sc_vjoinx()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_vconcat">ustr_sc_vconcat()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[2]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you called <a href="functions.html#ustr_dup">ustr_dup()</a> on the first Ustr
string (Parameter[1]), and then <a href="functions.html#ustr_add">ustr_add()</a> on the second Ustr
string (Parameter[3]). This process then repeats for all the Ustr strings in
the variable argument list (Parameter[4]) until a <a href="constants.html#USTR_NULL">USTR_NULL</a> is reached.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function doesn't guarantee to just take a reference to one of the passed
Ustr strings, even if that is what would happen if you called the above
manually.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_concat">ustr_sc_concat()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Zero or more pointers to constant Ustr strings and then USTR_NULL<br>Type<strong>[2]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls va_start() to get a variable argument list and then calls
<a href="functions.html#ustr_sc_vconcat">ustr_sc_vconcat()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_vconcatx">ustr_sc_vconcatx()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[6]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you called <a href="functions.html#ustr_dupx">ustr_dupx()</a> on the first Ustr
string (Parameter[1]), and then <a href="functions.html#ustr_add">ustr_add()</a> on the second Ustr
string (Parameter[3]). This process then repeats for all the Ustr strings in
the variable argument list (Parameter[4]) until a <a href="constants.html#USTR_NULL">USTR_NULL</a> is reached.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function doesn't guarantee to just take a reference to one of the passed
Ustr strings, even if that is what would happen if you called the above
manually.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_concatx">ustr_sc_concatx()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: A pointer to the first constant <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Zero or more pointers to constant Ustr strings and then USTR_NULL<br>Type<strong>[6]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls va_start() to get a variable argument list and then calls
<a href="functions.html#ustr_sc_vconcatx">ustr_sc_vconcatx()</a>.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Deleting%20a%20Ustr%2c%20or%20data%20within%20a%20Ustr">Deleting a Ustr, or data within a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_free">ustr_free()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function decrements the reference count on a Ustr, if there is one, and
free's it if it is allocated and the reference count becomes zero.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function does nothing if passed <a href="constants.html#USTR_NULL">USTR_NULL</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustrp_free">ustrp_free()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type<strong>[1]</strong>: struct Ustr_pool *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to a Ustrp (pool allocated Ustr)<br>Type<strong>[2]</strong>: struct Ustrp *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_free">ustr_free()</a> but calls the pool_free member function
of the Ustr_pool (Parameter[1]) instead of the ustr system free.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_free">ustr_sc_free()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls <a href="functions.html#ustr_free">ustr_free()</a> and then sets the pointer (Parameter[1]) to
<a href="constants.html#USTR_NULL">USTR_NULL</a>, which is a noop when passed to <a href="functions.html#ustr_free">ustr_free()</a>. This can be used to
help prevent "double free" errors.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> While the point to the pointer must be non-NULL, this function also accepts
a NULL ustr and does nothing. So you can pass the same pointer to this function
multiple times and only the first one will do anything.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_free2">ustr_sc_free2()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_sc_free">ustr_sc_free()</a> but instead of setting the
pointer (Parameter[1]) to <a href="constants.html#USTR_NULL">USTR_NULL</a> it sets it to the Ustr
string (Parameter[2]).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> While the point to the pointer must be non-NULL, this function also accepts
a NULL ustr to be free'd and does nothing. So you can pass the same pointer to
<a href="functions.html#ustr_sc_free">ustr_sc_free()</a> and then this function safely.
</p><p> The passed value (Parameter[2]) shouldn't be <a href="constants.html#USTR_NULL">USTR_NULL</a>, and in debugging mode
the function will assert() that it isn't.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_free_shared">ustr_sc_free_shared()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function is a simple way to "free" a <a href="design.html">Ustr string</a> that has been
shared (<a href="functions.html#ustr_shared">ustr_shared()</a> returns <a href="constants.html#USTR_TRUE">USTR_TRUE</a>), normally <a href="functions.html#ustr_free">ustr_free()</a> is ignored on a
shared <a href="design.html">Ustr string</a>. It just calls <a href="functions.html#ustr_setf_owner">ustr_setf_owner()</a> and then <a href="functions.html#ustr_sc_free">ustr_sc_free()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_del">ustr_del()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Length to delete from the Ustr<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function deletes data from the end of Ustr, possibly re-sizing the Ustr
at the same time.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The Ustr is never re-sized when the size is stored explicitly, so the pointer
never changes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_del_subustr">ustr_del_subustr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position in the Ustr<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length to delete from the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_del">ustr_del()</a> but can delete an arbitrary section of the
Ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_del">ustr_sc_del()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function is like calling <a href="functions.html#ustr_del">ustr_del()</a> with <a href="functions.html#ustr_len">ustr_len()</a> as the length,
however if that fails it does a <a href="functions.html#ustr_free">ustr_free()</a> and then sets the pointer to
USTR("").
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> While the benifit is that you don't have to check for memory failure errors,
if there is a memory failure and you have a non-default configuration the
configuration will revert back to the default.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Adding%20data%20to%20a%20Ustr">Adding data to a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_undef">ustr_add_undef()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Length of new undefined data<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> The <a href="design.html">Ustr string</a> is expanded (possibly reallocated) so that it can contain
length (Parameter[2]) extra data, if the length is not zero the Ustr will
be writable. Or it'll return <a href="constants.html#USTR_FALSE">USTR_FALSE</a> (zero) on failure.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_buf">ustr_add_buf()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to data<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_add_undef">ustr_add_undef()</a> and then copied the
data into the new undefined space.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_cstr">ustr_add_cstr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_add_buf">ustr_add_buf()</a> and passed strlen() as
the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_ADD_OSTR">USTR_ADD_OSTR()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A constant C-style string<br>Type<strong>[2]</strong>: const char []
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_add_buf">ustr_add_buf()</a> and passed
sizeof() - 1 as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_ADD_OBJ">USTR_ADD_OBJ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A symbol<br>Type<strong>[2]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_add_buf">ustr_add_buf()</a> and passed
sizeof() as the length.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> In most cases you'll want to use <a href="functions.html#USTR_ADD_OSTR">USTR_ADD_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add">ustr_add()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly works as if you had called <a href="functions.html#ustr_add_buf">ustr_add_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> to be added.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the <a href="design.html">Ustr string</a> is zero length and isn't writable this function may just
add a reference, this is fine for Ustr strings that are "constant" because if
the Ustr is read-only then the memory will not be written to.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_subustr">ustr_add_subustr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to add from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly works as if you had called <a href="functions.html#ustr_add_buf">ustr_add_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> + position - 1 and length values of the <a href="design.html">Ustr string</a> to be added.
The exception being if you add a ustr to itself, while only having a single
reference count, the simple method would access a free'd ustr, but this
function just works.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If the position is 1 and the length is the length of the <a href="design.html">Ustr string</a> then it
just calls <a href="functions.html#ustr_add">ustr_add()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_rep_chr">ustr_add_rep_chr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Byte value of data<br>Type<strong>[2]</strong>: char
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of bytes as data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_add_undef">ustr_add_undef()</a> and then copied the
byte value to each position.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Setting%20a%20Ustr%20to%20some%20data">Setting a Ustr to some data</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_undef">ustr_set_undef()</a>
<br>Returns: Success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: size_t<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
the <a href="functions.html#ustr_add_undef">ustr_add_undef()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_empty">ustr_set_empty()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string,
however the string will be allocated if this completes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_buf">ustr_set_buf()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Buffer containting data<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of Buffer<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
the <a href="functions.html#ustr_add_buf">ustr_add_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_cstr">ustr_set_cstr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
then <a href="functions.html#ustr_add_cstr">ustr_add_cstr()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SET_OSTR">USTR_SET_OSTR()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A constant C-style string<br>Type<strong>[2]</strong>: const char []
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
then <a href="functions.html#USTR_ADD_OSTR">USTR_ADD_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SET_OBJ">USTR_SET_OBJ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A symbol<br>Type<strong>[2]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
then <a href="functions.html#USTR_ADD_OBJ">USTR_ADD_OBJ()</a>.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> In most cases you'll want to use <a href="functions.html#USTR_SET_OSTR">USTR_SET_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set">ustr_set()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
the <a href="functions.html#ustr_add">ustr_add()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_subustr">ustr_set_subustr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to set from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
the <a href="functions.html#ustr_add_subustr">ustr_add_subustr()</a>. The exception being if you set a ustr to itself, while
only having a single reference count, the simple method would access a
free'd ustr data, but this function just works.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_rep_chr">ustr_set_rep_chr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Byte value of data<br>Type<strong>[2]</strong>: char
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of bytes as data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_del">ustr_del()</a> for the entire string and
the <a href="functions.html#ustr_add_rep_chr">ustr_add_rep_chr()</a>.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Inserting%20data%20into%20a%20Ustr">Inserting data into a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_undef">ustr_ins_undef()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of new undefined data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> The <a href="design.html">Ustr string</a> is expanded (possibly reallocated) so that it can contain
length (Parameter[2]) extra data, from after the required position. If the
length is not zero the Ustr will be writable. Or it'll return
<a href="constants.html#USTR_FALSE">USTR_FALSE</a> (zero) on failure. The data in the Ustr is moved as needed to put
the new data at position (Parameter[2]) + 1.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_buf">ustr_ins_buf()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Pointer to data<br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of data<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_ins_undef">ustr_ins_undef()</a> and then copied the
data into the new undefined space.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_cstr">ustr_ins_cstr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Pointer to constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a> and passed strlen() as
the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_INS_OSTR">USTR_INS_OSTR()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A constant C-style string<br>Type<strong>[3]</strong>: const char []
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a> and passed
sizeof() - 1 as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_INS_OBJ">USTR_INS_OBJ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A symbol<br>Type<strong>[3]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a> and passed
sizeof() as the length.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> In most cases you'll want to use <a href="functions.html#USTR_INS_OSTR">USTR_INS_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins">ustr_ins()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> to be added.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_subustr">ustr_ins_subustr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to ins from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly as if you had called <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> + position - 1 and length values of the <a href="design.html">Ustr string</a> to be insed.
The exception being if you insert a ustr to itself, while only having a single
reference count, the simple method would access a free'd ustr data, but this
function just works.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_rep_chr">ustr_ins_rep_chr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Byte value of data<br>Type<strong>[2]</strong>: char
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of bytes as data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_ins_undef">ustr_ins_undef()</a> and then copied the
byte value to each position.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Adding%2c%20duplicating%20and%20setting%20formatted%20data%20to%20a%20Ustr">Adding, duplicating and setting formatted data to a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_vfmt_lim">ustr_add_vfmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Limit of data to add<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[4]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() with the limit
(Parameter[2]) as the limit to vsnprintf() and then calling <a href="functions.html#ustr_add_buf">ustr_add_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_vfmt">ustr_add_vfmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[3]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() and then calling
<a href="functions.html#ustr_add_buf">ustr_add_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_fmt_lim">ustr_add_fmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Limit of data to add<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Options depending on value of Parameter[3]<br>Type<strong>[4]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() with the limit
(Parameter[2]) as the limit to snprintf() and then calling <a href="functions.html#ustr_add_buf">ustr_add_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_fmt">ustr_add_fmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Options depending on value of Parameter[2]<br>Type<strong>[3]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() and then calling
<a href="functions.html#ustr_add_buf">ustr_add_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_vfmt_lim">ustr_dup_vfmt_lim()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Limit of data to dup<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[3]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() with the limit
(Parameter[2]) as the limit to vsnprintf() and then calling <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_vfmt">ustr_dup_vfmt()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Limit of data to dup<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[3]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() and then calling
<a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_fmt_lim">ustr_dup_fmt_lim()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Limit of data to dup<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Options depending on value of Parameter[2]<br>Type<strong>[3]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() with the limit
(Parameter[2]) as the limit to snprintf() and then calling <a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dup_fmt">ustr_dup_fmt()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Options depending on value of Parameter[1]<br>Type<strong>[2]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() and then calling
<a href="functions.html#ustr_dup_buf">ustr_dup_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_fmt_lim">ustr_dupx_fmt_lim()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Limit of data to dup<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[6]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[6]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[7]</strong>: Options depending on value of Parameter[6]<br>Type<strong>[7]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() with the limit
(Parameter[2]) as the limit to snprintf() and then calling <a href="functions.html#ustr_dupx_buf">ustr_dupx_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_dupx_fmt">ustr_dupx_fmt()</a>
<br>Returns: Pointer to a <a href="design.html">Ustr string</a><br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Size of allocated storage<br>Type<strong>[1]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[2]</strong>: Number of bytes to use for reference count<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Exact memory allocations<br>Type<strong>[3]</strong>: int
</td></tr><tr><td>Parameter<strong>[4]</strong>: ENOMEM, memory error flag<br>Type<strong>[4]</strong>: int
</td></tr><tr><td>Parameter<strong>[5]</strong>: Pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[5]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Options depending on value of Parameter[5]<br>Type<strong>[6]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() and then calling
<a href="functions.html#ustr_dup_bufx">ustr_dup_bufx()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_vfmt_lim">ustr_set_vfmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Limit of data to set<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[4]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_del">ustr_del()</a> for all the data and then
<a href="functions.html#ustr_add_vfmt_lim">ustr_add_vfmt_lim()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_vfmt">ustr_set_vfmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[3]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_del">ustr_del()</a> for all the data and then
<a href="functions.html#ustr_add_vfmt">ustr_add_vfmt()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_fmt_lim">ustr_set_fmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Limit of data to set<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Options depending on value of Parameter[3]<br>Type<strong>[4]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_del">ustr_del()</a> for all the data and then
<a href="functions.html#ustr_add_fmt_lim">ustr_add_fmt_lim()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_set_fmt">ustr_set_fmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Options depending on value of Parameter[2]<br>Type<strong>[3]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_del">ustr_del()</a> for all the data and then
<a href="functions.html#ustr_add_fmt">ustr_add_fmt()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_vfmt_lim">ustr_ins_vfmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Limit of data to insert<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[5]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() with the limit
(Parameter[3]) as the limit to vsnprintf() and then calling <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_vfmt">ustr_ins_vfmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[4]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() and then calling
<a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_fmt_lim">ustr_ins_fmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Limit of data to insert<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Options depending on value of Parameter[4]<br>Type<strong>[5]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() with the limit
(Parameter[3]) as the limit to snprintf() and then calling <a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ins_fmt">ustr_ins_fmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position after which the data should be added<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Options depending on value of Parameter[3]<br>Type<strong>[4]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() and then calling
<a href="functions.html#ustr_ins_buf">ustr_ins_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_vfmt_lim">ustr_sub_vfmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Limit of data to substitute<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[5]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() with the limit
(Parameter[3]) as the limit to vsnprintf() and then calling <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_vfmt">ustr_sub_vfmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[4]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() and then calling
<a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_fmt_lim">ustr_sub_fmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Limit of data to substitute<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Options depending on value of Parameter[4]<br>Type<strong>[5]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() with the limit
(Parameter[3]) as the limit to snprintf() and then calling <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_fmt">ustr_sub_fmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Options depending on value of Parameter[3]<br>Type<strong>[4]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() and then calling
<a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_vfmt_lim">ustr_sc_sub_vfmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Limit of data to substitute<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: A pointer to a constant C-style string<br>Type<strong>[5]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[6]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() with the limit
(Parameter[4]) as the limit to vsnprintf() and then calling <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_vfmt">ustr_sc_sub_vfmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Variable argument list variable, from va_start()<br>Type<strong>[5]</strong>: va_list
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system vsnprintf() and then calling
<a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_fmt_lim">ustr_sc_sub_fmt_lim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Limit of data to substitute<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: A pointer to a constant C-style string<br>Type<strong>[5]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Options depending on value of Parameter[5]<br>Type<strong>[6]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() with the limit
(Parameter[3]) as the limit to snprintf() and then calling <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_fmt">ustr_sc_sub_fmt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Options depending on value of Parameter[5]<br>Type<strong>[5]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling the system snprintf() and then calling
<a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a>.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Accessing%20the%20%22variables%22%20of%20a%20Ustr">Accessing the "variables" of a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_len">ustr_len()</a>
<br>Returns: The length of the Ustr<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the data within the Ustr, much like
strlen() but without getting the value wrong in the case of extra NIL bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cstr">ustr_cstr()</a>
<br>Returns: Read-only pointer to the start of data in the Ustr<br>Type: const char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns a read-only pointer to the start of the data of the
<a href="design.html">Ustr string</a>. Due to there always being a terminating NIL byte in a Ustr, this
is also a valid C-style string.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_wstr">ustr_wstr()</a>
<br>Returns: Writable pointer to the start of data in the Ustr, or NULL<br>Type: char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns a writable pointer to the start of the data of the
<a href="design.html">Ustr string</a>. Due to there always being a terminating NIL byte in a Ustr, this
is also a valid C-style string.
</p><p> If the ustr is read-only (<a href="functions.html#ustr_ro">ustr_ro()</a> == <a href="constants.html#USTR_TRUE">USTR_TRUE</a>) then this function will
return NULL.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Unless the string is owned (<a href="functions.html#ustr_owner">ustr_owner()</a> == <a href="constants.html#USTR_TRUE">USTR_TRUE</a>) it can be a very bad
idea to use this to change data, as then all references will be updated. See
<a href="functions.html#ustr_sc_wstr">ustr_sc_wstr()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_alloc">ustr_alloc()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr is currently in allocated storage.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_exact">ustr_exact()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr is doing exact allocations, so as the Ustr
grows it will only have storage allocated exactly as required and not in half
powers of two.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This will always be <a href="constants.html#USTR_FALSE">USTR_FALSE</a> for read-only Ustr strings
(<a href="functions.html#ustr_ro">ustr_ro()</a> == <a href="constants.html#USTR_TRUE">USTR_TRUE</a>), even though the default may be to used exact sized
allocations when adding data to them etc.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sized">ustr_sized()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr stores an explicit allocation size, if not
the size is implied as the next highest half power of two.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_ro">ustr_ro()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr is current in read-only storage.
</p><p> Read-only storage is not writable but can be referenced via. <a href="functions.html#ustr_dup">ustr_dup()</a> an
infinite amount of times.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_fixed">ustr_fixed()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr is current in fixed size storage.
</p><p> Fixed size storage is writable but cannot be referenced.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Fixed size storage always explicitly stores the size of the storage.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_enomem">ustr_enomem()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function just returns the value of the user settable flag in the Ustr. It
can be set via. <a href="functions.html#ustr_setf_enomem_err">ustr_setf_enomem_err()</a> and cleared by <a href="functions.html#ustr_setf_enomem_clr">ustr_setf_enomem_clr()</a>.
</p><p> This function is automatically set to on whever a memory allocation failure
happens for a Ustr.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If a Ustr is referenced multiple times, <a href="functions.html#ustr_setf_enomem_err">ustr_setf_enomem_err()</a> will fail.
</p><p> This always fails for Ustr's in read-only storage.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_shared">ustr_shared()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr is in the "shared" mode. It can be set via.
<a href="functions.html#ustr_setf_shared">ustr_setf_shared()</a> and cleared by <a href="functions.html#ustr_setf_owner">ustr_setf_owner()</a> on allocated Ustr's.
</p><p> Shared mode means that a Ustr can be referenced and unreferenced an infinite
number of times.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This always succeeds for Ustr's in read-only storage.
</p><p> This always fails for Ustr's in fixed size storage.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_limited">ustr_limited()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if the Ustr is currently in fixed size storage and cannot
move to allocated storage.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This always fails for Ustr's in allocated storage.
</p><p> This always fails for Ustr's in read-only storage.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_owner">ustr_owner()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function says if there is only a single reference to the <a href="design.html">Ustr string</a>.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This always fails for Ustr's in read-only storage.
</p><p> This always succeeds for Ustr's in fixed size storage.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_size">ustr_size()</a>
<br>Returns: size_t <br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calculates the maximum amount of data that could be stored (Ie.
the max <a href="functions.html#ustr_len">ustr_len()</a>) without having to re-size the <a href="design.html">Ustr string</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_size_alloc">ustr_size_alloc()</a>
<br>Returns: size_t <br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the size of the storage for the Ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_size_overhead">ustr_size_overhead()</a>
<br>Returns: size_t <br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the difference between the size of the storage and the
maximum amount of data that could be stored without having to re-size the Ustr
string.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_conf">ustr_conf()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Return size allocated number<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Return number of bytes used in the reference count<br>Type<strong>[3]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return exact allocations flag<br>Type<strong>[4]</strong>: int *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return number of bytes used in the length<br>Type<strong>[5]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return number of references to this Ustr<br>Type<strong>[5]</strong>: size_t *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function gives the configuration of the current Ustr needed to duplicate
it via. the ustr_dupx_*() functions. It also gives the number of bytes used
for the length and the number of references, which are mainly informational.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function differs from calling the <a href="functions.html#ustr_exact">ustr_exact()</a> etc. functions in that
it returns the global options if this Ustr isn't allocated, thus telling you
what the configuration would be if the Ustr was turned into an allocated Ustr
by adding data etc.
</p><p> Zero references for an allocated Ustr with a non-zero number of bytes for a
reference count means it's in "shared" mode).
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Setting%20the%20%22flags%22%20of%20a%20Ustr">Setting the "flags" of a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_setf_enomem_err">ustr_setf_enomem_err()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function sets the enomem flag, which can be observed via. the
<a href="functions.html#ustr_enomem">ustr_enomem()</a> function.
</p><p> The implication of setting this flag is that a memory error has occured in a
previous function call on this Ustr.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function fails if <a href="functions.html#ustr_owner">ustr_owner()</a> fails for the Ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_setf_enomem_clr">ustr_setf_enomem_clr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function clears the enomem flag, which can be observed via. the
<a href="functions.html#ustr_enomem">ustr_enomem()</a> function.
</p><p> The implication of this flag being set is that a memory error has occured in
a previous function call on this Ustr, so on clearing the flag you should
know you have brought the Ustr back to a known state.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function fails if <a href="functions.html#ustr_owner">ustr_owner()</a> fails for the Ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_setf_share">ustr_setf_share()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function sets the shared mode, which can be observed via. the
<a href="functions.html#ustr_shared">ustr_shared()</a> function.
</p><p> This is used on a Ustr so that it can have more references than it is able
to hold in it's reference count. After this call the Ustr can be referenced and
unreferenced an infinite number of times.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> After this call the Ustr will never be deleted until <a href="functions.html#ustr_setf_owner">ustr_setf_owner()</a> is
called.
</p><p> This function fails if <a href="functions.html#ustr_alloc">ustr_alloc()</a> fails for the Ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_setf_owner">ustr_setf_owner()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function removes the shared mode, which can be observed via. the
<a href="functions.html#ustr_shared">ustr_shared()</a> function.
</p><p> This is used so that a Ustr in shared mode can be free'd.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function fails if <a href="functions.html#ustr_alloc">ustr_alloc()</a> fails for the Ustr.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Comparing%20data%20in%20a%20Ustr">Comparing data in a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_buf">ustr_cmp_buf()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like memcmp() on the Ustr and the passed data.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp">ustr_cmp()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_buf">ustr_cmp_buf()</a> but with the data from <a href="functions.html#ustr_cstr">ustr_cstr()</a>
and the length from <a href="functions.html#ustr_len">ustr_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_subustr">ustr_cmp_subustr()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp">ustr_cmp()</a> but with a limit on the data and length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_cstr">ustr_cmp_cstr()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_buf">ustr_cmp_buf()</a> but with a length from strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_fast_buf">ustr_cmp_fast_buf()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_buf">ustr_cmp_buf()</a> but the order of comparison is
optimized for speed, but is much less friendly to humans.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_fast">ustr_cmp_fast()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_fast_buf">ustr_cmp_fast_buf()</a> but with the data from
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and the length from <a href="functions.html#ustr_len">ustr_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_fast_subustr">ustr_cmp_fast_subustr()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_fast">ustr_cmp_fast()</a> but with a limit on the data and
length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_fast_cstr">ustr_cmp_fast_cstr()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_fast_buf">ustr_cmp_fast_buf()</a> but with a length from strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_buf">ustr_cmp_case_buf()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_buf">ustr_cmp_buf()</a> but the order of comparison ignores
ASCII case.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case">ustr_cmp_case()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_case_buf">ustr_cmp_case_buf()</a> but with the data from
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and the length from <a href="functions.html#ustr_len">ustr_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_subustr">ustr_cmp_case_subustr()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_case">ustr_cmp_case()</a> but with a limit on the data and
length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_cstr">ustr_cmp_case_cstr()</a>
<br>Returns: Less then zero, zero or greater than zero depending on comparison<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_case_buf">ustr_cmp_case_buf()</a> but with a length from strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_eq">ustr_cmp_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp">ustr_cmp()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_buf_eq">ustr_cmp_buf_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_buf">ustr_cmp_buf()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_subustr_eq">ustr_cmp_subustr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_subustr">ustr_cmp_subustr()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_cstr_eq">ustr_cmp_cstr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_cstr">ustr_cmp_cstr()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_eq">ustr_cmp_case_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case">ustr_cmp_case()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_buf_eq">ustr_cmp_case_buf_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_buf">ustr_cmp_case_buf()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_subustr_eq">ustr_cmp_case_subustr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_subustr">ustr_cmp_case_subustr()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_cstr_eq">ustr_cmp_case_cstr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_cstr">ustr_cmp_case_cstr()</a> against 0.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_prefix_eq">ustr_cmp_prefix_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp">ustr_cmp()</a> against 0, but the comparison
is limited to the length of the right hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_prefix_buf_eq">ustr_cmp_prefix_buf_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_buf">ustr_cmp_buf()</a> against 0, but the
comparison is limited to the length of the right hand side (Parameter[3]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_prefix_cstr_eq">ustr_cmp_prefix_cstr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_cstr">ustr_cmp_cstr()</a> against 0, but the
comparison is limited to the length of the right hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_prefix_subustr_eq">ustr_cmp_prefix_subustr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_subustr">ustr_cmp_subustr()</a> against 0, but the
comparison is limited to the given length (Parameter[4]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_prefix_eq">ustr_cmp_case_prefix_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case">ustr_cmp_case()</a> against 0, but the
comparison is limited to the length of the right hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_prefix_buf_eq">ustr_cmp_case_prefix_buf_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_buf">ustr_cmp_case_buf()</a> against 0, but the
comparison is limited to the length of the right hand side (Parameter[3]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_prefix_cstr_eq">ustr_cmp_case_prefix_cstr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_cstr">ustr_cmp_case_cstr()</a> against 0, but the
comparison is limited to the length of the right hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_prefix_subustr_eq">ustr_cmp_case_prefix_subustr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_subustr">ustr_cmp_case_subustr()</a> against 0, but the
comparison is limited to the given length (Parameter[4]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_suffix_eq">ustr_cmp_suffix_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_prefix_eq">ustr_cmp_prefix_eq()</a> but compares the end of the left
hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_suffix_buf_eq">ustr_cmp_suffix_buf_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_prefix_buf_eq">ustr_cmp_prefix_buf_eq()</a> but compares the end of
the left hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_suffix_cstr_eq">ustr_cmp_suffix_cstr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_prefix_cstr_eq">ustr_cmp_prefix_cstr_eq()</a> but compares the end of
the left hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_suffix_subustr_eq">ustr_cmp_suffix_subustr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_subustr">ustr_cmp_subustr()</a> against 0, but
compares the end of the left hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_suffix_eq">ustr_cmp_case_suffix_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_case_prefix_eq">ustr_cmp_case_prefix_eq()</a> but compares the end of
the left hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_suffix_buf_eq">ustr_cmp_case_suffix_buf_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to constant bytes, to compare<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of comparison bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_case_prefix_buf_eq">ustr_cmp_case_prefix_buf_eq()</a> but compares the end of
the left hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_suffix_cstr_eq">ustr_cmp_case_suffix_cstr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cmp_case_prefix_cstr_eq">ustr_cmp_case_prefix_cstr_eq()</a> but compares the end
of the left hand side.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cmp_case_suffix_subustr_eq">ustr_cmp_case_suffix_subustr_eq()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to compare from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like comparing <a href="functions.html#ustr_cmp_case_subustr">ustr_cmp_case_subustr()</a> against 0, but
compares the end of the left hand side.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Searching%20for%20data%20in%20a%20Ustr">Searching for data in a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_chr_fwd">ustr_srch_chr_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data to search for<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function searches for the data (Parameter[3]) in the Ustr, skipping an
offset (Parameter[2]) number of bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_chr_rev">ustr_srch_chr_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data to search for<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_chr_fwd">ustr_srch_chr_fwd()</a> but it searches from the end of
the string to the beginning.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The searching starts from the end of the string, and so the offset is the
offset from the end. However the position of a byte is always relative to
the begining, so to do a loop you need to take the position from the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_buf_fwd">ustr_srch_buf_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to data to search for<br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the data to search for<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function searches for the data (Parameter[3]) of length (Parameter[4])
in the Ustr, skipping an offset (Parameter[2]) number of bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_buf_rev">ustr_srch_buf_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to data to search for<br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the data to search for<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_buf_fwd">ustr_srch_buf_fwd()</a> but it searches from the end of
the string to the beginning.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The searching starts from the end of the string, and so the offset is the
offset from the end. However the position of a byte is always relative to
the begining, so to do a loop you need to take the position from the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_fwd">ustr_srch_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, to search for<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_buf_fwd">ustr_srch_buf_fwd()</a> but it gets the data pointer by
calling <a href="functions.html#ustr_cstr">ustr_cstr()</a> and the length by calling <a href="functions.html#ustr_len">ustr_len()</a> on the passed
Ustr (Parameter[3]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_rev">ustr_srch_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, to search for<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_fwd">ustr_srch_fwd()</a> but it searches from the end of
the string to the beginning.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The searching starts from the end of the string, and so the offset is the
offset from the end. However the position of a byte is always relative to
the begining, so to do a loop you need to take the position from the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_cstr_fwd">ustr_srch_cstr_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to C-style string data, to search for<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_buf_fwd">ustr_srch_buf_fwd()</a> but it gets the length by
calling strlen() on the passed data (Parameter[3]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_cstr_rev">ustr_srch_cstr_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to C-style string data, to search for<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_cstr_fwd">ustr_srch_cstr_fwd()</a> but it searches from the end of
the string to the beginning.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The searching starts from the end of the string, and so the offset is the
offset from the end. However the position of a byte is always relative to
the begining, so to do a loop you need to take the position from the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_subustr_fwd">ustr_srch_subustr_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Position in the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of data to search, from the Ustr<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_fwd">ustr_srch_fwd()</a> but it moves the data to start at
the correct position and limits the length to the value specified.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_subustr_rev">ustr_srch_subustr_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Position in the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of data to search, from the Ustr<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_rev">ustr_srch_rev()</a> but it moves the data to start at
the correct position and limits the length to the value specified.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The searching starts from the end of the string, and so the offset is the
offset from the end. However the position of a byte is always relative to
the begining, so to do a loop you need to take the position from the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_chr_fwd">ustr_srch_case_chr_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data to search for<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_chr_fwd">ustr_srch_chr_fwd()</a>, but treats ASCII uppercase
and lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_chr_rev">ustr_srch_case_chr_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data to search for<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_chr_fwd">ustr_srch_chr_fwd()</a>, but treats ASCII uppercase
and lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_buf_fwd">ustr_srch_case_buf_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to data to search for<br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the data to search for<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_buf_fwd">ustr_srch_buf_fwd()</a>, but treats ASCII uppercase and
lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_buf_rev">ustr_srch_case_buf_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to data to search for<br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the data to search for<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_buf_rev">ustr_srch_buf_rev()</a>, but treats ASCII uppercase and
lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_fwd">ustr_srch_case_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, to search for<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_fwd">ustr_srch_fwd()</a>, but treats ASCII uppercase and
lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_rev">ustr_srch_case_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, to search for<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_rev">ustr_srch_rev()</a>, but treats ASCII uppercase and
lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_cstr_fwd">ustr_srch_case_cstr_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to C-style string data, to search for<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_cstr_fwd">ustr_srch_cstr_fwd()</a>, but treats ASCII uppercase
and lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_cstr_rev">ustr_srch_case_cstr_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to C-style string data, to search for<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_cstr_rev">ustr_srch_cstr_rev()</a>, but treats ASCII uppercase
and lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_subustr_fwd">ustr_srch_case_subustr_fwd()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Position in the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of data to search, from the Ustr<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_subustr_fwd">ustr_srch_subustr_fwd()</a>, but treats ASCII uppercase
and lowercase as equivalent.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_srch_case_subustr_rev">ustr_srch_case_subustr_rev()</a>
<br>Returns: Position in the Ustr, or zero if not found<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start searching at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Position in the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of data to search, from the Ustr<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_srch_subustr_rev">ustr_srch_subustr_rev()</a>, but treats ASCII uppercase
and lowercase as equivalent.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Span%20lengths%20of%20data%20in%20a%20Ustr">Span lengths of data in a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_chr_fwd">ustr_spn_chr_fwd()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the start of the Ustr (Parameter[1]) that
only contains bytes that are equal to the data (Parameter[3]), skipping
offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_chr_rev">ustr_spn_chr_rev()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the end of the Ustr (Parameter[1]) that
only contains bytes that are equal to the data (Parameter[3]), skipping
offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_chrs_fwd">ustr_spn_chrs_fwd()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Array of byte data, for spanning<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of byte data, for spanning<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the start of the Ustr (Parameter[1]) that
only contains bytes that are equal to any byte in the data (Parameter[3]),
skipping offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_chrs_rev">ustr_spn_chrs_rev()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Array of byte data<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of byte data<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the end of the Ustr (Parameter[1]) that
only contains bytes that are equal to any byte in the data (Parameter[3]),
skipping offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_fwd">ustr_spn_fwd()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing spanning bytes<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_buf_fwd">ustr_spn_buf_fwd()</a> but passing <a href="functions.html#ustr_cstr">ustr_cstr()</a> and
<a href="functions.html#ustr_len">ustr_len()</a>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_rev">ustr_spn_rev()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing spanning bytes<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_buf_rev">ustr_spn_buf_rev()</a> but passing <a href="functions.html#ustr_cstr">ustr_cstr()</a> and
<a href="functions.html#ustr_len">ustr_len()</a>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_cstr_fwd">ustr_spn_cstr_fwd()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string, containing spanning bytes<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_buf_fwd">ustr_spn_buf_fwd()</a> but passing strlen() for the
length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_spn_cstr_rev">ustr_spn_cstr_rev()</a>
<br>Returns: Number of bytes in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string, containing spanning bytes<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_buf_rev">ustr_spn_buf_rev()</a> but passing strlen() for the
length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_chr_fwd">ustr_cspn_chr_fwd()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the start of the Ustr (Parameter[1]) that
only contains bytes that are not equal to the data (Parameter[3]), skipping
offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_chr_rev">ustr_cspn_chr_rev()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Byte data<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the end of the Ustr (Parameter[1]) that
only contains bytes that are not equal to the data (Parameter[3]), skipping
offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_chrs_fwd">ustr_cspn_chrs_fwd()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Array of byte data<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of byte data<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the start of the Ustr (Parameter[1]) that
only contains bytes that are not equal to any byte in the data (Parameter[3]),
skipping offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_chrs_rev">ustr_cspn_chrs_rev()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Array of byte data<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of byte data<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the length of the end of the Ustr (Parameter[1]) that
only contains bytes that are not equal to any byte in the data (Parameter[3]),
skipping offset (Parameter[2]) bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_fwd">ustr_cspn_fwd()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing spanning bytes<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_buf_fwd">ustr_cspn_buf_fwd()</a> but passing <a href="functions.html#ustr_cstr">ustr_cstr()</a> and
<a href="functions.html#ustr_len">ustr_len()</a>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_rev">ustr_cspn_rev()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing spanning bytes<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_buf_rev">ustr_cspn_buf_rev()</a> but passing <a href="functions.html#ustr_cstr">ustr_cstr()</a> and
<a href="functions.html#ustr_len">ustr_len()</a>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_cstr_fwd">ustr_cspn_cstr_fwd()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string, containing spanning bytes<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_buf_fwd">ustr_cspn_buf_fwd()</a> but passing strlen() for the
length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cspn_cstr_rev">ustr_cspn_cstr_rev()</a>
<br>Returns: Number of bytes not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string, containing spanning bytes<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_buf_rev">ustr_cspn_buf_rev()</a> but passing strlen() for the
length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_spn_chrs_fwd">ustr_utf8_spn_chrs_fwd()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style UTF-8 string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the C-style UTF-8 string<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_chrs_fwd">ustr_spn_chrs_fwd()</a> but the return value, offset, and
length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_chrs_fwd">ustr_spn_chrs_fwd()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the span over "xyxz" is 1 UTF-8 character
and not 3 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_spn_chrs_rev">ustr_utf8_spn_chrs_rev()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style UTF-8 string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: <br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_chrs_rev">ustr_spn_chrs_rev()</a> but the return value, offset, and
length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_chrs_rev">ustr_spn_chrs_rev()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the span over "xyxz" is 1 UTF-8 character
and not 3 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_spn_fwd">ustr_utf8_spn_fwd()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_fwd">ustr_spn_fwd()</a> but the return value, offset, and
length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_fwd">ustr_spn_fwd()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the span over "xyxz" is 1 UTF-8 character
and not 3 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_spn_rev">ustr_utf8_spn_rev()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_rev">ustr_spn_rev()</a> but the return value, offset, and
length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_rev">ustr_spn_rev()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the span over "xyxz" is 1 UTF-8 character
and not 3 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_spn_cstr_fwd">ustr_utf8_spn_cstr_fwd()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style UTF-8 string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_cstr_fwd">ustr_spn_cstr_fwd()</a> but the return value, offset, and
length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_cstr_fwd">ustr_spn_cstr_fwd()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the span over "xyxz" is 1 UTF-8 character
and not 3 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_spn_cstr_rev">ustr_utf8_spn_cstr_rev()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style UTF-8 string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_spn_cstr_rev">ustr_spn_cstr_rev()</a> but the return value, offset, and
length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_cstr_rev">ustr_spn_cstr_rev()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the span over "xyxz" is 1 UTF-8 character
and not 3 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_cspn_chrs_fwd">ustr_utf8_cspn_chrs_fwd()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style UTF-8 string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the C-style UTF-8 string<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_chrs_fwd">ustr_cspn_chrs_fwd()</a> but the return value, offset,
and length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_cspn_chrs_fwd">ustr_cspn_chrs_fwd()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the compliment span over "xzxy" is 1 UTF-8
character and not 0 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_cspn_chrs_rev">ustr_utf8_cspn_chrs_rev()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style UTF-8 string<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the C-style UTF-8 string<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_chrs_rev">ustr_cspn_chrs_rev()</a> but the return value, offset,
and length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_cspn_chrs_rev">ustr_cspn_chrs_rev()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the compliment span over "xzxy" is 1 UTF-8
character and not 0 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_cspn_fwd">ustr_utf8_cspn_fwd()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant Ustr UTF-8 string, containing spanning data<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_fwd">ustr_cspn_fwd()</a> but the return value, offset,
and length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_cspn_fwd">ustr_cspn_fwd()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the compliment span over "xzxy" is 1 UTF-8
character and not 0 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_cspn_rev">ustr_utf8_cspn_rev()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to constant Ustr UTF-8 string data, containing spanning data<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_rev">ustr_cspn_rev()</a> but the return value, offset,
and length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_cspn_rev">ustr_cspn_rev()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the compliment span over "xzxy" is 1 UTF-8
character and not 0 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_cspn_cstr_fwd">ustr_utf8_cspn_cstr_fwd()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to constant C-style UTF-8 string data, containing spanning data<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_cstr_fwd">ustr_cspn_cstr_fwd()</a> but the return value, offset,
and length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_cspn_cstr_fwd">ustr_cspn_cstr_fwd()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the compliment span over "xzxy" is 1 UTF-8
character and not 0 bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_cspn_cstr_rev">ustr_utf8_cspn_cstr_rev()</a>
<br>Returns: Number of UTF-8 characters not in the span<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant Ustr UTF-8 string<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string, in UTF-8 characters, to start compliment spanning from<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to C-style UTF-8 string data, containing spanning data<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_cspn_cstr_rev">ustr_cspn_cstr_rev()</a> but the return value, offset,
and length all use UTF-8 characters and not bytes.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This is much slower than <a href="functions.html#ustr_spn_cstr_rev">ustr_spn_cstr_rev()</a> but given "xy" as a multi-byte
UTF-8 character it understands that the compliment span over "xzxy" is 1 UTF-8
character and not 0 bytes.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Doing%20IO%20from%20or%20to%20a%20Ustr">Doing IO from or to a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_get">ustr_io_get()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Number of bytes to read<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Returned number of bytes read<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function tries to read a minimum number of bytes from the file object,
into the <a href="design.html">Ustr string</a>. The exact number read is returned, unless (Parameter[4])
is NULL.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_getfile">ustr_io_getfile()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function calls <a href="functions.html#ustr_io_get">ustr_io_get()</a> rpeatedly until EOF is encountered.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The errno value when this function ends could either be from fopen(),
fread(), or if both of the those succeeded from fclose().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_getfilename">ustr_io_getfilename()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A C-style string of a filename<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function opens a specified file, and then calls <a href="functions.html#ustr_io_getfile">ustr_io_getfile()</a>.
Finally closing the FILE * object.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_getdelim">ustr_io_getdelim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td>Parameter<strong>[3]</strong>: A delimiter byte to stop reading at<br>Type<strong>[3]</strong>: char
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function reads bytes from the file until it hits the delimiter byte.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The delimiter is included, use <a href="functions.html#ustr_del">ustr_del()</a> to remove 1 byte from the end if you
don't want it.
</p><p> This function assumes a delimiter will happen every 80 bytes or so.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_getline">ustr_io_getline()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_io_getdelim">ustr_io_getdelim()</a> with '\n' as the
delimiter.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_put">ustr_io_put()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Number of bytes to write<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function is the opposite of <a href="functions.html#ustr_io_get">ustr_io_get()</a>, taking bytes from the
beginning of the Ustr and writting them to the file.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Deleting bytes from the begining of a <a href="design.html">Ustr string</a> is the most inefficient
thing to do, so it is recommended to use <a href="functions.html#ustr_io_putfile">ustr_io_putfile()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_putline">ustr_io_putline()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Number of bytes to write<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_io_put">ustr_io_put()</a>, and then writting a '\n' to
the file.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This doesn't write a line from the Ustr to the file, if you want that call
<a href="functions.html#ustr_io_put">ustr_io_put()</a> directly, using the return from <a href="functions.html#ustr_srch_chr_fwd">ustr_srch_chr_fwd()</a> (with a '\n')
as the number of bytes argument.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_putfile">ustr_io_putfile()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_io_put">ustr_io_put()</a> with <a href="functions.html#ustr_len">ustr_len()</a> as the number
of bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_putfileline">ustr_io_putfileline()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a C file object<br>Type<strong>[2]</strong>: FILE *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_io_putline">ustr_io_putline()</a> with <a href="functions.html#ustr_len">ustr_len()</a> as the
number of bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_io_putfilename">ustr_io_putfilename()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A C-style string of a filename<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: A C-style string of a filemode (the second argument to fopen)<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function opens a specified file, and then calls <a href="functions.html#ustr_io_putfile">ustr_io_putfile()</a>.
Finally closing the FILE * object.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> The errno value when this function ends could either be from fopen(),
fwrite(), or if both of the those succeeded from fclose().
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="String%20substitution%2freplacement">String substitution/replacement</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_undef">ustr_sub_undef()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of undefined data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> The <a href="design.html">Ustr string</a> is expanded as required (possibly reallocated) so that it can
contain length (Parameter[2]) data, from the required position. If the length
is not zero the Ustr will be writable. Or it'll return <a href="constants.html#USTR_FALSE">USTR_FALSE</a> (zero) on
failure.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> You can think of the operation as two seperate tasks, one which makes the
current data in the Ustr undefined and the second which adds undefined data
to the ustr to accomodate the desired length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_buf">ustr_sub_buf()</a>
<br>Returns: Success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Buffer containing substitution string <br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of buffer<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sub_undef">ustr_sub_undef()</a> and then copied the
data into the new undefined space.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_cstr">ustr_sub_cstr()</a>
<br>Returns: success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string, which is the substitution<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a> but the length is worked out
automatically by strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SUB_OSTR">USTR_SUB_OSTR()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A constant C-style string<br>Type<strong>[3]</strong>: const char []
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a> and passed
sizeof() - 1 as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SUB_OBJ">USTR_SUB_OBJ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A symbol<br>Type<strong>[3]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a> and passed
sizeof() as the length.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> In most cases you'll want to use <a href="functions.html#USTR_SUB_OSTR">USTR_SUB_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub">ustr_sub()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> to be added.
The exception being if you substitute a ustr into itself, while only having a
single reference count, the simple method could access a free'd ustr data, but
this function just works.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sub_subustr">ustr_sub_subustr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Position in the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length to substitute from the Ustr<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly as if you had called <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> + position - 1 and length values of the <a href="design.html">Ustr string</a> to be insed.
The exception being if you insert a ustr to itself, while only having a single
reference count, the simple method would access a free'd ustr data, but this
function just works.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_undef">ustr_sc_sub_undef()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of undefined data<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had done <a href="functions.html#ustr_del_subustr">ustr_del_subustr()</a> followed by
<a href="functions.html#ustr_ins_undef">ustr_ins_undef()</a>, however it is significantly more efficient.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_buf">ustr_sc_sub_buf()</a>
<br>Returns: Success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Buffer containting substitute data<br>Type<strong>[4]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of Buffer<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function will substitute a specific number of characters in a Ustr with
the data from a buffer, this function does the job of one or more of
<a href="functions.html#ustr_add_buf">ustr_add_buf()</a>, <a href="functions.html#ustr_sub_buf">ustr_sub_buf()</a> and <a href="functions.html#ustr_del">ustr_del()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_cstr">ustr_sc_sub_cstr()</a>
<br>Returns: Success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start replacement <br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant C-style string, containing spanning bytes<br>Type<strong>[4]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a> but the length is worked out
automatically by strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub">ustr_sc_sub()</a>
<br>Returns: success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Pointer to a Ustr containing the substitute string<br>Type<strong>[4]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> to be added.
The exception being if you substitute a ustr into itself, while only having a
single reference count, the simple method could access a free'd ustr data, but
this function just works.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_sub_subustr">ustr_sc_sub_subustr()</a>
<br>Returns: Success or failure <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[4]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Position in the Ustr<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[6]</strong>: Length to substitute from the Ustr<br>Type<strong>[6]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function mostly as if you had called <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a> with the
<a href="functions.html#ustr_cstr">ustr_cstr()</a> + position - 1 and length values of the <a href="design.html">Ustr string</a> to be insed.
The exception being if you insert a ustr to itself, while only having a single
reference count, the simple method would access a free'd ustr data, but this
function just works.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SC_SUB_OSTR">USTR_SC_SUB_OSTR()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A constant C-style string<br>Type<strong>[4]</strong>: const char []
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a> and passed
sizeof() - 1 as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="USTR_SC_SUB_OBJ">USTR_SC_SUB_OBJ()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position where to start substitution<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of substitution<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: A symbol<br>Type<strong>[4]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_sub_buf">ustr_sc_sub_buf()</a> and passed
sizeof() as the length.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> In most cases you'll want to use <a href="functions.html#USTR_SUB_OSTR">USTR_SUB_OSTR()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_replace_buf">ustr_replace_buf()</a>
<br>Returns: Number of tokens replaced <br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr (haystack)<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Buffer containting search data<br>Type<strong>[2]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of search buffer<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Buffer containting replacement data<br>Type<strong>[4]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Length of replacement buffer<br>Type<strong>[5]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[6]</strong>: Maximum number of matches to replace (0 for unlimited)<br>Type<strong>[6]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function scans the "haystack" (Parameter[1]) for "needle" (Parameter[2])
and replaces max_replacements (Parameter[6]) matches with the
"replacement" (Parameter[4]).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If max_replacements (Parameter[6]) is 0, this function will replace ALL
occurrences.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_replace_cstr">ustr_replace_cstr()</a>
<br>Returns: Number of tokens replaced <br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr (haystack)<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string, containing search bytes<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: A pointer to a constant C-style string, containing replacement bytes<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Maximum number of matches to replace (0 for unlimited)<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_replace_buf">ustr_replace_buf()</a> but gets the lengths for the
buffer automatically from strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_replace">ustr_replace()</a>
<br>Returns: Number of tokens replaced <br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a Ustr (haystack)<br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Ustr to search for (needle)<br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Ustr to replace needle with<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Maximum number of matches to replace (0 for unlimited)<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_replace_buf">ustr_replace_buf()</a> but gets the lengths from the
ustr automatically.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_replace_rep_chr">ustr_replace_rep_chr()</a>
<br>Returns: number of replacements made<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: pointer to a pointer to a Ustr to be modified<br>Type<strong>[1]</strong>: struct Ustr **ps1
</td></tr><tr><td>Parameter<strong>[2]</strong>: character to replace<br>Type<strong>[2]</strong>: char
</td></tr><tr><td>Parameter<strong>[3]</strong>: number of characters to replace<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: character to replace with<br>Type<strong>[4]</strong>: char
</td></tr><tr><td>Parameter<strong>[5]</strong>: number of characters to replace with<br>Type<strong>[5]</strong>: size_t nlen
</td></tr><tr><td>Parameter<strong>[6]</strong>: maximum number of replacements to make (use 0 for unlimited)<br>Type<strong>[6]</strong>: size_t lim
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function replaces a repeating sequence of characters with another
repeating sequence of characters.
For example...
</p><pre>
Ustr *data = ustr_dup_cstr("xxxBxxCxDxxx");
ustr_replace_rep_chr(&data,'x',2,'y',1, 0)
</pre><p> ...would change data to be "yxByCxDyx".
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Changing the same letter the same number of times is considered a No-op
since it is a vast performance improvement this way. So passing in
(&data,'y',2,'y',2 ,0) will have a return value of 0 and the string will be
unchanged.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Splitting%20a%20Ustr">Splitting a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_split_buf">ustr_split_buf()</a>
<br>Returns: pointer to a Ustr representing the next token<br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a constant Ustr to be split<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to an offset<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Buffer to use as split search pattern <br>Type<strong>[3]</strong>: const void *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of buffer<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Pointer to a Ustr to be used as the return value<br>Type<strong>[5]</strong>: struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: Flags with the prefix USTR_FLAG_SPLIT_<br>Type<strong>[6]</strong>: unsigned int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works in a manner similar to strtok(). Each time the function
is called, the string inside of the buffer (Parameter[3]) is used as a search
pattern at which to split. If the pattern is not found, the entire string
will be returned. A <a href="constants.html#USTR_NULL">USTR_NULL</a> return value indicates there are no more
tokens remaining.
</p><p> Parameter[5] is a a pointer to a Ustr where the return value will be placed.
Passing a <a href="constants.html#USTR_NULL">USTR_NULL</a> to this parameter will cause the string to be allocated
and <b>MUST</b> be freed <b>manually</b>. If, however, you pass in a non-null Ustr to
this parameter, each call to <a href="functions.html#ustr_split_buf">ustr_split_buf()</a> will free what is in this
pointer and place the new token there (when <a href="constants.html#USTR_NULL">USTR_NULL</a> is returned, nothing
needs to be free'd).
For example, given...
</p><pre>
Ustr *data = ...;
Ustr *tok = USTR_NULL;
const char *sep = ",";
size_t off = 0;
unsigned int flags = USTR_FLAGS_SPLIT_DEF;
</pre><p> ...there are two options...
</p><pre>
while ((tok = ustr_split_buf(data, &off, sep, strlen(sep), tok, flags)))
{
/* Do something with tok -- but next iteration of the loop will free
* and overwrite tok, so you must ustr_dup() if you want to keep it */
}
/* tok is now NULL again after the loop */
</pre><p> ...or...
</p><pre>
while ((tok = ustr_split_buf(data, &off, sep, strlen(sep), USTR_NULL, flags)))
{
/* Do something with tok, and it will NOT be freed in the next iteration of
* the loop */
ustr_free(tok); /* have to free to avoid mem leaks */
}
</pre><p> ...the former of which being the safer option.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> There are several flags that will alter the behaviour of this function,
all of which have a common with the default being <a href="constants.html#USTR_FLAG_SPLIT_DEF">USTR_FLAG_SPLIT_DEF</a>.
</p><p> If you are calling this function directly, it is very likely that you'd want
to use <a href="functions.html#ustr_split_cstr">ustr_split_cstr()</a> instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_split">ustr_split()</a>
<br>Returns: Pointer to a Ustr representing the next token<br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a constant Ustr to be split<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to an offset variable<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Pointer to a constant Ustr to use as the split search pattern<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Pointer to a Ustr where the return value will be placed<br>Type<strong>[4]</strong>: struct Ustr *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Flags<br>Type<strong>[5]</strong>: unsigned int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> Works like <a href="functions.html#ustr_split_buf">ustr_split_buf()</a> but takes a Ustr as the split search pattern
</p><p> instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_split_cstr">ustr_split_cstr()</a>
<br>Returns: Pointer to a Ustr representing the next token<br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a constant Ustr to be split<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to an offset variable<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: C string to use as split search pattern<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Pointer to a Ustr where the return value will be placed<br>Type<strong>[4]</strong>: struct Ustr *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Flags<br>Type<strong>[5]</strong>: unsigned int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> Works like <a href="functions.html#ustr_split_buf">ustr_split_buf()</a> but takes a C string as the split search
pattern, and so gets the length via. strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_split_spn_chrs">ustr_split_spn_chrs()</a>
<br>Returns: Pointer to a Ustr representing the next token<br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a Ustr to be split<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to an offset variable<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: String representing a set of bytes to use as split chars<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length of the string of set of bytes<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Pointer to a Ustr where the return value will be placed<br>Type<strong>[5]</strong>: struct Ustr *
</td></tr><tr><td>Parameter<strong>[6]</strong>: flags<br>Type<strong>[6]</strong>: unsigned int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> Works like <a href="functions.html#ustr_split_buf">ustr_split_buf()</a> but uses the individual ASCII bytes in the
separator string (Parameter[3]) as search patterns. It will split if <b>ANY</b> of
these individual characters are matched (much like strtok()). For example:
if splitting "this, is,a test" with the separator string ", " the tokens
returned would be {"this" "is" "a" "test"};
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If you are calling this function directly, it is very likely that you'd want
to use <a href="functions.html#ustr_split_spn_cstr">ustr_split_spn_cstr()</a> instead.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_split_spn_cstr">ustr_split_spn_cstr()</a>
<br>Returns: Pointer to a Ustr representing the next token<br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a Ustr to be split<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to an offset variable<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: String representing a set of bytes to use as split chars<br>Type<strong>[3]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Pointer to a Ustr where the return value will be placed<br>Type<strong>[4]</strong>: struct Ustr *
</td></tr><tr><td>Parameter<strong>[5]</strong>: flags<br>Type<strong>[5]</strong>: unsigned int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> Works like <a href="functions.html#ustr_split_spn_chrs">ustr_split_spn_chrs()</a> but gets the length automatically via.
strlen().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_split_spn">ustr_split_spn()</a>
<br>Returns: Pointer to a Ustr representing the next token<br>Type: struct Ustr *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a constant Ustr to be split<br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Pointer to an offset variable<br>Type<strong>[2]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Pointer to a constant Ustr to use as the split search pattern<br>Type<strong>[3]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[4]</strong>: Pointer to a Ustr where the return value will be placed<br>Type<strong>[4]</strong>: struct Ustr *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Flags<br>Type<strong>[5]</strong>: unsigned int
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> Works like <a href="functions.html#ustr_split_spn_chrs">ustr_split_spn_chrs()</a> but takes a Ustr as the split chars instead.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Dealing%20with%20UTF%2d8%20in%20a%20Ustr">Dealing with UTF-8 in a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_valid">ustr_utf8_valid()</a>
<br>Returns: A boolean flag of either <a href="constants.html#USTR_TRUE">USTR_TRUE</a> or USTR_FALSE<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function tries it's best to find out if the string is a valid utf-8
string.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_len">ustr_utf8_len()</a>
<br>Returns: The number of the utf-8 characters in the Ustr<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function counts the number of utf-8 characters inn the Ustr.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This function gives undefined answers on strings that aren't utf-8 valid.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_width">ustr_utf8_width()</a>
<br>Returns: ssize_t <br>Type: ssize_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function returns the visible width of the string, assuming it is a valid
utf-8 string. This is like converting to wide characters and using wcwidth().
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_chars2bytes">ustr_utf8_chars2bytes()</a>
<br>Returns: Length of span in bytes <br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position of a span in utf-8 characters<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of a span in utf-8 characters<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Returns the position of the span in bytes<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function converts a span, in utf-8 characters, to the same span in bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_utf8_bytes2chars">ustr_utf8_bytes2chars()</a>
<br>Returns: Returns the position of a span in utf-8 characters<br>Type: size_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position of a span in bytes<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of a span in bytes<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Returns length of a span in utf-8 characters<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function converts a span, in bytes, to the same span in utf-8 characters.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Because a byte span can start or end within a utf-8 character, converting the
return values back into bytes via. <a href="functions.html#ustr_utf8_chars2bytes">ustr_utf8_chars2bytes()</a> may make the span
be slightly bigger (position slightly earlier, and the length slightly longer).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_utf8_reverse">ustr_sc_utf8_reverse()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function reverses the utf-8 characters in the <a href="design.html">Ustr string</a>, assuming it
is a valid utf-8 string, so the last one becomes the first and the second to
last becomes the second etc.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Parsing%20ASCII%20integer%20numbers%20from%20a%20Ustr">Parsing ASCII integer numbers from a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_uintmaxx">ustr_parse_uintmaxx()</a>
<br>Returns: Parsed number, or zero on error<br>Type: uintmax_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Absolute minimum value<br>Type<strong>[4]</strong>: uintmax_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Absolute maximum value<br>Type<strong>[5]</strong>: uintmax_t
</td></tr><tr><td>Parameter<strong>[6]</strong>: Thousands separator<br>Type<strong>[6]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[7]</strong>: Return length of parsed number<br>Type<strong>[7]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[8]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[8]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function parses an ASCII representation of a number from a
Ustr (Parameter[1]) starting at the offset (Parameter[2]).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If stdint.h isn't available this function won't be available.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_uintmax">ustr_parse_uintmax()</a>
<br>Returns: Parsed number, or zero on error<br>Type: uintmax_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_uintmaxx">ustr_parse_uintmaxx()</a> with the minimum and maximum
values taken as 0 and UINTMAX_MAX, and the thousands separator as "_".
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If stdint.h isn't available this function won't be available.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_intmax">ustr_parse_intmax()</a>
<br>Returns: Parsed number, or zero on error<br>Type: intmax_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_uintmaxx">ustr_parse_uintmaxx()</a> with the minimum and maximum
values taken as -INTMAX_MIN and INTMAX_MAX, and the thousands separator as "_".
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> If stdint.h isn't available this function won't be available.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_ulongx">ustr_parse_ulongx()</a>
<br>Returns: Parsed number, or zero on error<br>Type: unsigned long
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Absolute minimum value<br>Type<strong>[4]</strong>: unsigned long
</td></tr><tr><td>Parameter<strong>[5]</strong>: Absolute maximum value<br>Type<strong>[5]</strong>: unsigned long
</td></tr><tr><td>Parameter<strong>[6]</strong>: Thousands separator<br>Type<strong>[6]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[7]</strong>: Return length of parsed number<br>Type<strong>[7]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[8]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[8]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_uintmaxx">ustr_parse_uintmaxx()</a> but returns an unsigned long,
it is always available even when stdint.h isn't.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_ulong">ustr_parse_ulong()</a>
<br>Returns: Parsed number, or zero on error<br>Type: unsigned long
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_ulongx">ustr_parse_ulongx()</a> with the minimum and maximum
values taken as 0 and ULONG_MAX, and the thousands separator as "_".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_long">ustr_parse_long()</a>
<br>Returns: Parsed number, or zero on error<br>Type: long
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_ulongx">ustr_parse_ulongx()</a> with the minimum and maximum
values taken as -LONG_MIN and LONG_MAX, and the thousands separator as "_".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_uint">ustr_parse_uint()</a>
<br>Returns: Parsed number, or zero on error<br>Type: unsigned int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_ulongx">ustr_parse_ulongx()</a> with the minimum and maximum
values taken as 0 and UINT_MAX, and the thousands separator as "_".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_int">ustr_parse_int()</a>
<br>Returns: Parsed number, or zero on error<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_ulongx">ustr_parse_ulongx()</a> with the minimum and maximum
values taken as -INT_MIN and INT_MAX, and the thousands separator as "_".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_ushort">ustr_parse_ushort()</a>
<br>Returns: Parsed number, or zero on error<br>Type: unsigned short
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_ulongx">ustr_parse_ulongx()</a> with the minimum and maximum
values taken as 0 and USHRT_MAX, and the thousands separator as "_".
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_short">ustr_parse_short()</a>
<br>Returns: Parsed number, or zero on error<br>Type: short
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Base (2-36) and flags, starting with USTR_FLAG_PARSE_NUM_<br>Type<strong>[3]</strong>: unsigned int
</td></tr><tr><td>Parameter<strong>[4]</strong>: Return length of parsed number<br>Type<strong>[4]</strong>: size_t *
</td></tr><tr><td>Parameter<strong>[5]</strong>: Return error code, starting with USTR_TYPE_PARSE_NUM_ERR_<br>Type<strong>[5]</strong>: unsigned int *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like <a href="functions.html#ustr_parse_ulongx">ustr_parse_ulongx()</a> with the minimum and maximum
values taken as -SHRT_MIN and SHRT_MAX, and the thousands separator as "_".
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Misc%20shortcut%20helper%20functions%20for%20Ustrs">Misc shortcut helper functions for Ustrs</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_ensure_owner">ustr_sc_ensure_owner()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function makes sure that the <a href="design.html">Ustr string</a> is owned when it returns (Ie.
<a href="functions.html#ustr_owner">ustr_owner()</a> returns <a href="constants.html#USTR_TRUE">USTR_TRUE</a>), or it fails to allocate.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_wstr">ustr_sc_wstr()</a>
<br>Returns: Writable pointer to the start of data in the Ustr, or NULL<br>Type: char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_sc_ensure_owner">ustr_sc_ensure_owner()</a>, to make sure the
<a href="design.html">Ustr string</a> is writable, and if that succeeds it returns <a href="functions.html#ustr_wstr">ustr_wstr()</a>. On
failure it returns NULL.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_export_subustr">ustr_sc_export_subustr()</a>
<br>Returns: A pointer to newly allocated block of memory<br>Type: char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Position in the Ustr<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length to export from the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Allocation function (like malloc)<br>Type<strong>[4]</strong>: void *(*)(size_t)
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function allocates a block of memory of size Length (Parameter[3]) + 1
using the provided allocation function (Parameter[4]) and copies the data
starting from Position (Parameter[2]) within the ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_export">ustr_sc_export()</a>
<br>Returns: A pointer to newly allocated block of memory<br>Type: char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Allocation function (like malloc)<br>Type<strong>[2]</strong>: void *(*)(size_t)
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustr_sc_export_subustr">ustr_sc_export_subustr()</a> with a position of
1 and a length of <a href="functions.html#ustr_len">ustr_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustrp_sc_export_subustrp">ustrp_sc_export_subustrp()</a>
<br>Returns: A pointer to newly allocated block of memory<br>Type: char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type<strong>[1]</strong>: struct Ustr_pool *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Position in the Ustr<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[4]</strong>: Length to export from the Ustr<br>Type<strong>[4]</strong>: size_t
</td></tr><tr><td>Parameter<strong>[5]</strong>: Allocation function (like malloc), or NULL<br>Type<strong>[5]</strong>: void *(*)(size_t)
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function allocates a block of memory of size Length (Parameter[4]) + 1
using either the provided allocation function (Parameter[5]), or from the pool
object if the allocation function is NUL, and copies the data starting from
Position (Parameter[3]) within the ustr.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustrp_sc_export">ustrp_sc_export()</a>
<br>Returns: A pointer to newly allocated block of memory<br>Type: char *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type<strong>[1]</strong>: struct Ustr_pool *
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Allocation function (like malloc)<br>Type<strong>[3]</strong>: void *(*)(size_t)
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works like calling <a href="functions.html#ustrp_sc_export_subustrp">ustrp_sc_export_subustrp()</a> with a position of
1 and a length of <a href="functions.html#ustrp_len">ustrp_len()</a>.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_reverse">ustr_sc_reverse()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function reverses all the bytes in the <a href="design.html">Ustr string</a>, so the last one
becomes the first and the second to last becomes the second etc.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_tolower">ustr_sc_tolower()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function changes any ASCII upper case bytes into ASCII lower case bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_toupper">ustr_sc_toupper()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function changes any ASCII lower case bytes into ASCII upper case bytes.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_ltrim_chrs">ustr_sc_ltrim_chrs()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Array of bytes, containing trimming data<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of byte data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function deletes the bytes at the begining of the Ustr (Parameter[1])
that are in the span (Parameter[2]) of the specificed length (parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_ltrim">ustr_sc_ltrim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing trimming bytes<br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_ltrim_chrs">ustr_sc_ltrim_chrs()</a> and passed
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> (Parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_ltrim_cstr">ustr_sc_ltrim_cstr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string, containing trimming bytes<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_ltrim_chrs">ustr_sc_ltrim_chrs()</a> and passed
strlen() as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_rtrim_chrs">ustr_sc_rtrim_chrs()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Array of bytes, containing trimming data<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of byte data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function deletes the bytes at the end of the Ustr (Parameter[1])
that are in the span (Parameter[2]) of the specificed length (parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_rtrim">ustr_sc_rtrim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing trimming bytes<br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_rtrim_chrs">ustr_sc_rtrim_chrs()</a> and passed
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> (Parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_rtrim_cstr">ustr_sc_rtrim_cstr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string, containing trimming bytes<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_rtrim_chrs">ustr_sc_rtrim_chrs()</a> and passed
strlen() as the length.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_trim_chrs">ustr_sc_trim_chrs()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Array of bytes, containing trimming data<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td>Parameter<strong>[3]</strong>: Length of byte data<br>Type<strong>[3]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function deletes the bytes at the begining or end of the
Ustr (Parameter[1]) that are in the span (Parameter[2]) of the specificed
length (parameter[2]).
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> Calling this function is much more efficient than calling <a href="functions.html#ustr_sc_rtrim_chrs">ustr_sc_rtrim_chrs()</a>
and then <a href="functions.html#ustr_sc_ltrim_chrs">ustr_sc_ltrim_chrs()</a>, as both ends are trimmed in a single pass.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_trim">ustr_sc_trim()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant <a href="design.html">Ustr string</a>, containing trimming bytes<br>Type<strong>[2]</strong>: const struct Ustr *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_trim_chrs">ustr_sc_trim_chrs()</a> and passed
<a href="functions.html#ustr_cstr">ustr_cstr()</a> and <a href="functions.html#ustr_len">ustr_len()</a> values of the <a href="design.html">Ustr string</a> (Parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_sc_trim_cstr">ustr_sc_trim_cstr()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: A pointer to a constant C-style string, containing trimming bytes<br>Type<strong>[2]</strong>: const char *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function works as if you had called <a href="functions.html#ustr_sc_trim_chrs">ustr_sc_trim_chrs()</a> and passed
strlen() as the length.
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Adding%20binary%20data%20to%20a%20Ustr">Adding binary data to a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_b_uint16">ustr_add_b_uint16()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Binary value to add to the Ustr<br>Type<strong>[2]</strong>: uint_least16_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function adds a binary representation of a value (Parameter[2]) to the
Ustr (Parameter[1]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_b_uint32">ustr_add_b_uint32()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Binary value to add to the Ustr<br>Type<strong>[2]</strong>: uint_least32_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function adds a binary representation of a value (Parameter[2]) to the
Ustr (Parameter[1]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_add_b_uint64">ustr_add_b_uint64()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Binary value to add to the Ustr<br>Type<strong>[2]</strong>: uint_least64_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function adds a binary representation of a value (Parameter[2]) to the
Ustr (Parameter[1]).
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Parsing%20binary%20data%20from%20a%20Ustr">Parsing binary data from a Ustr</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_b_uint16">ustr_parse_b_uint16()</a>
<br>Returns: uint_least16_t <br>Type: uint_least16_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function parses a binary representation from a Ustr (Parameter[1])
starting at the offset (Parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_b_uint32">ustr_parse_b_uint32()</a>
<br>Returns: uint_least32_t <br>Type: uint_least32_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function parses a binary representation from a Ustr (Parameter[1])
starting at the offset (Parameter[2]).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_parse_b_uint64">ustr_parse_b_uint64()</a>
<br>Returns: uint_least64_t <br>Type: uint_least64_t
</td></tr><tr><td>Parameter<strong>[1]</strong>: A pointer to a constant <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: const struct Ustr *
</td></tr><tr><td>Parameter<strong>[2]</strong>: Offset within string to start parsing at<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function parses a binary representation from a Ustr (Parameter[1])
starting at the offset (Parameter[2]).
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Misc%2e%20functions">Misc. functions</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_realloc">ustr_realloc()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a pointer to a <a href="design.html">Ustr string</a><br>Type<strong>[1]</strong>: struct Ustr **
</td></tr><tr><td>Parameter<strong>[2]</strong>: Size of allocation<br>Type<strong>[2]</strong>: size_t
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function is re-sizes the Ustr to the specified size (Parameter[2]).
</p><p> This is mostly used to shrink a sized Ustr that is now significantly
smaller than it once was. Although this function can also grow a Ustr.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> To have a size that isn't implied from the length the Ustr must store a size
value as well as a length (<a href="functions.html#ustr_sized">ustr_sized()</a> must return <a href="constants.html#USTR_TRUE">USTR_TRUE</a>).
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_cntl_opt">ustr_cntl_opt()</a>
<br>Returns: Success or failure<br>Type: int
</td></tr><tr><td>Parameter<strong>[1]</strong>: Optional value starting with USTR_CNTL_OPT_<br>Type<strong>[1]</strong>: int
</td></tr><tr><td>Parameter<strong>[2]</strong>: Arugments to option<br>Type<strong>[2]</strong>: ...
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This function views and/or changes global Ustr options, like whether ustr's
have an implicit or explicit size (<a href="constants.html#USTR_CNTL_OPT_GET_HAS_SIZE">USTR_CNTL_OPT_GET_HAS_SIZE</a>).
</td></tr></table><table width="90%"><tr><td class="sect"><h2><a id="Simple%20Ustr%20pool%20API">Simple <a href="design.html#possibilities">Ustr pool</a> API</a></h2>
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_pool_ll_make">ustr_pool_ll_make()</a>
<br>Returns: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type: struct Ustr_pool *
</td></tr><tr><td>Parameter<strong>[1]</strong>: Nothing<br>Type<strong>[1]</strong>: void
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This allocates a new pool using the "linked list" strategy, each allocation
in the pool is added to a linked list ... and any allocations not freed
directly are freed by the pool when it is cleared or freed.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_pool_make_subpool">ustr_pool_make_subpool()</a>
<br>Returns: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type: struct Ustr_pool *
</td></tr><tr><td>Parameter<strong>[1]</strong>: struct Ustr_pool *<br>Type<strong>[1]</strong>: struct Ustr_pool *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This allocates a new pool as a child of the passed in pool (Parameter[1]),
The pool can be freed and cleared independantly of the parent pool however
free and clear operations on the parent pool are automatically applied to all
child pools.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_pool_free">ustr_pool_free()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type<strong>[1]</strong>: struct Ustr_pool *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This deallocates a pool, and all sub-pools.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This also operates on all sub-pools.
</td></tr></table><table width="80%"><tr><td class="obj">
<strong>Function: </strong> <a id="ustr_pool_clear">ustr_pool_clear()</a>
<br>Returns: Nothing<br>Type: void
</td></tr><tr><td>Parameter<strong>[1]</strong>: Pointer to a <a href="design.html#possibilities">Ustr pool</a> object<br>Type<strong>[1]</strong>: struct Ustr_pool *
</td></tr><tr><td><strong>Explanation:</strong></td></tr><tr><td><p>
</p><p> This allows all the data in the pool to be reused, it may also free some/all
of the data in the pool, from the pool API.
</td></tr><tr><td><strong>Note:</strong></td></tr><tr><td><p>
</p><p> This also operates on all sub-pools.
</td></tr></table>
</body></html>
|