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 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631
|
# Czech translation for gnome-devel-docs.
# Copyright (C) 2016 gnome-devel-docs's COPYRIGHT HOLDER
# This file is distributed under the same license as the gnome-devel-docs package.
# Marek Černocký <marek@manet.cz>, 2016, 2017, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: gnome-devel-docs master\n"
"POT-Creation-Date: 2019-03-01 02:11+0000\n"
"PO-Revision-Date: 2019-03-10 00:11+0100\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: čeština <gnome-cs-list@gnome.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Gtranslator 2.91.7\n"
#. Put one translator per line, in the form NAME <EMAIL>, YEAR1, YEAR2
msgctxt "_"
msgid "translator-credits"
msgstr "Marek Černocký <marek@manet.cz>"
#. (itstool) path: credit/name
#: C/additional-materials.page:10 C/c-coding-style.page:10
#: C/documentation.page:11 C/index.page:8 C/writing-good-code.page:10
msgid "Federico Mena-Quintero"
msgstr "Federico Mena-Quintero"
#. (itstool) path: credit/years
#: C/additional-materials.page:12 C/c-coding-style.page:12
#: C/documentation.page:13 C/index.page:10 C/writing-good-code.page:12
msgid "2013"
msgstr "2013"
#. (itstool) path: info/desc
#: C/additional-materials.page:17
msgid "Other style guides and books about organizing free software projects"
msgstr ""
"Pokyny k dalším stylům a knihy o organizování svobodných softwarových "
"projektů"
#. (itstool) path: page/title
#: C/additional-materials.page:21
msgid "Additional Materials"
msgstr "Doplňující materiály"
#. (itstool) path: page/p
#: C/additional-materials.page:23
msgid ""
"Here we give you links to other materials that you may want to read. These "
"will teach you a lot about how to work on large distributed teams of free "
"software developers, and about good programming style in general."
msgstr ""
"Zde uvádíme odkazy na další materiály, které by vás mohly zajímat. Dozvíte "
"se v nich, jak pracovat ve velkých týmech vývojářů svobodného softwaru "
"roztroušených po celém světě a obecně o kvalitním stylu programování."
#. (itstool) path: item/p
#: C/additional-materials.page:32
msgid ""
"<link href=\"http://producingoss.com/\">Producing Open Source Software</"
"link>, by Karl Fogel. This is a truly excellent book of good practices that "
"free software projects should follow. This is about <em>social aspects</em> "
"of the project: how to treat contributors, how to organize and moderate "
"communication, how to deal with non-profit foundations. If you ask yourself "
"at any time, \"how should I deal with $human_situation in the project?\", "
"this book may provide the answer."
msgstr ""
"<link href=\"http://producingoss.com/\">Producing Open Source Software</"
"link> od Karla Fogela. Jedná se o opravdu skvělou knihu o dobrých zvycích, "
"kterých by se měli držet projekty svobodného softwaru. Zabývá se "
"<em>sociální stránkou</em> projektů: jak se chovat k přispěvatelům, jak "
"organizovat a moderovat komunikaci, jak řídit neziskové nadace. Jestliže "
"jste se někdy sami sebe zeptali: „co bych měl v projektu udělat v "
"$SITUACE_S_LIDMI?“, dá vám tato kniha odpověď."
#. (itstool) path: item/p
#: C/additional-materials.page:46
msgid ""
"<link href=\"http://www.gnu.org/prep/standards/\">GNU Coding Standards</"
"link>. This is an old document, but it still has lots of excellent advice. "
"It talks about C coding style, issues when dealing with plug-in systems, "
"common option names for command-line programs, conventions for Makefiles, "
"and some very GNU-ish details like using Texinfo for documentation."
msgstr ""
"<link href=\"http://www.gnu.org/prep/standards/\">GNU Coding Standards</"
"link>. Jedná se o starší dokument, který může ale i dnes poskytnout cenné "
"rady. Rozebírá styl kódování v jazyce C, problémy při zacházení se zásuvnými "
"moduly, běžné volby názvů pro programy příkazové řádky, zvyklosti pro "
"Makefile a některými detaily okolo GNU, jako je používání Texinfo pro "
"dokumentaci."
#. (itstool) path: item/p
#: C/additional-materials.page:57
msgid ""
"<link href=\"https://www.kernel.org/doc/Documentation/process/coding-style."
"rst\"> Linux Kernel Coding Style</link>. Explains the rationale for \"big "
"indentation\", brace placement, concise but unambiguous naming, and "
"centralized exit of functions."
msgstr ""
"<link href=\"https://www.kernel.org/doc/Documentation/process/coding-style."
"rst\">Linux Kernel Coding Style</link>. Vysvětluje důvody pro „velké "
"odsazení“, umísťování závorek, stručné, ale při tom jednoznačné pojmenování "
"a opouštění funkcí v jediném bodě."
#. (itstool) path: credit/name
#: C/api-stability.page:10 C/async-programming.page:11 C/databases.page:11
#: C/documentation.page:16 C/file-system.page:11 C/gerror.page:11
#: C/glist.page:11 C/index.page:21 C/introspection.page:10 C/logging.page:11
#: C/main-contexts.page:11 C/memory-management.page:10 C/namespacing.page:10
#: C/parallel-installability.page:18 C/preconditions.page:11
#: C/threading.page:11 C/tooling.page:10 C/unit-testing.page:10
#: C/version-control.page:10 C/versioning.page:10
msgid "Philip Withnall"
msgstr "Philip Withnall"
#. (itstool) path: credit/years
#: C/api-stability.page:12 C/async-programming.page:13 C/databases.page:13
#: C/documentation.page:18 C/file-system.page:13 C/gerror.page:13
#: C/glist.page:13 C/index.page:23 C/introspection.page:12 C/logging.page:13
#: C/memory-management.page:12 C/parallel-installability.page:20
#: C/preconditions.page:13 C/threading.page:13 C/tooling.page:12
#: C/unit-testing.page:12 C/version-control.page:12 C/versioning.page:12
msgid "2015"
msgstr "2015"
#. (itstool) path: info/desc
#: C/api-stability.page:17
msgid "Backwards compatibility in APIs"
msgstr "Zpětná kompatibilita v API"
#. (itstool) path: page/title
#: C/api-stability.page:20
msgid "API stability"
msgstr "Stabilita API"
#. (itstool) path: synopsis/title
#: C/api-stability.page:23 C/async-programming.page:26 C/databases.page:24
#: C/documentation.page:32 C/file-system.page:24 C/introspection.page:23
#: C/logging.page:26 C/main-contexts.page:27 C/memory-management.page:65
#: C/namespacing.page:25 C/parallel-installability.page:33 C/threading.page:24
#: C/tooling.page:45 C/unit-testing.page:23 C/version-control.page:23
#: C/versioning.page:23
msgid "Summary"
msgstr "Shrnutí"
#. (itstool) path: item/p
#: C/api-stability.page:26
msgid ""
"Define API stability guarantees for your project. (<link xref=\"#stability\"/"
">)"
msgstr ""
"Definujte stabilitu API zaručovanou ve vašem projektu. (<link xref="
"\"#stability\"/>)"
#. (itstool) path: item/p
#: C/api-stability.page:30
msgid ""
"Ensure version numbers are changed as appropriate when API changes. (<link "
"xref=\"#versioning\"/>)"
msgstr ""
"Zajistěte změnu čísla verze příslušně ke změnám v API. (<link xref="
"\"#versioning\"/>)"
#. (itstool) path: section/title
#: C/api-stability.page:38
msgid "API and ABI"
msgstr "API a ABI"
#. (itstool) path: section/p
#: C/api-stability.page:40
msgid ""
"At a high level, an API – <em>Application Programming Interface</em> – is "
"the boundary between two components when developing against them. It is "
"closely related to an ABI – <em>Application Binary Interface</em> – which is "
"the boundary at runtime. It defines the possible ways in which other "
"components can interact with a component. More concretely, this normally "
"means the C headers of a library form its API, and compiled library symbols "
"its ABI. The difference between an API and ABI is given by compilation of "
"the code: there are certain things in a C header, such as <code>#define</"
"code>s, which can cause a library’s API to change without changing its ABI. "
"But these differences are mostly academic, and for all practical purposes, "
"API and ABI can be treated interchangeably."
msgstr ""
"Ve vysokoúrovňovém programování je API (<em>Application Programming "
"Interface</em> – rozhraní pro programování aplikací) hranicí mezi dvěma "
"komponentami použitými při vývoji. Úzce souvisí s ABI (<em>Application "
"Binary Interface</em> – nízkoúrovňové rozhraní aplikací), které je tou "
"stejnou hranicí, ale za běhu. Definuje možné způsoby, kterými mohou s "
"komponentou spolupracovat ostatní komponenty. Z praktického hlediska jsou "
"formou API běžné hlavičkové soubory C knihovny a zkompilované knihovní "
"symboly jsou pak ABI. Rozdíl mezi API a ABI je jen v kompilaci kódu: "
"existují určité věci v hlavičkách C, jako třeba <code>#define</code>, které "
"mohou způsobit, že se změní API knihovny, aniž by se změnilo ABI. Ale tyto "
"rozdíly jsou spíše akademického rázu a v praktickém životě můžete API a ABI "
"považovat za jinou formu téhož."
#. (itstool) path: section/p
#: C/api-stability.page:54
msgid ""
"Examples of API-incompatible changes to a C function would be to add a new "
"parameter, change the function’s return type, or remove a parameter."
msgstr ""
"Příkladem změn narušujících kompatibilitu API ve funkci C by bylo přidání "
"nového parametru, změna typu vraceného funkcí nebo odstranění parametru."
#. (itstool) path: section/p
#: C/api-stability.page:59
msgid ""
"However, many other parts of a project can form an API. If a daemon exposes "
"itself on D-Bus, the interfaces exported there form an API. Similarly, if a "
"C API is exposed in higher level languages by use of GIR, the GIR file forms "
"another API — if it changes, any higher level code using it must also change."
msgstr ""
"Ale i další části projektu mohou mít formu API. Když démon vystavuje sám "
"sebe na sběrnici D-Bus, tak tam exportovaná rozhraní mají podobu API. "
"Obdobně, když je API C vystaveno v jazycích vyšší úrovně pomocí GIR, tvoří "
"soubor GIR další API — když se změní, kterýkoliv kód vyšší úrovně, který jej "
"používá, se musí změnit také."
#. (itstool) path: section/p
#: C/api-stability.page:67
msgid ""
"Other examples of more unusual APIs are configuration file locations and "
"formats, and GSettings schemas. Any changes to these could require code "
"using your library to change."
msgstr ""
"Dalšími příklady méně obvyklých API jsou umístění a formáty souborů s "
"nastavením a schémata GSettings. Jakékoliv změny v nich vyžadují, aby se "
"změnil kód používající vaši knihovnu."
#. (itstool) path: section/title
#: C/api-stability.page:75
msgid "Stability"
msgstr "Stabilita"
#. (itstool) path: section/p
#: C/api-stability.page:77
msgid ""
"API stability refers to some level of guarantee from a project that its API "
"will only change in defined ways in the future, or will not change at all. "
"Generally, an API is considered ‘stable’ if it commits to backwards-"
"compatibility (defined below); but APIs could also commit to being unstable "
"or even forwards-compatible. The purpose of API stability guarantees is to "
"allow people to use your project from their own code without worrying about "
"constantly updating their code to keep up with API changes. Typical API "
"stability guarantees mean that code which is compiled against one version of "
"a library will run without problems against all future versions of that "
"library with the same major version number — or similarly that code which "
"runs against a daemon will continue to run against all future versions of "
"that daemon with the same major version number."
msgstr ""
"Stabilitou API se míní určitá úroveň záruky od projektu, že se jeho API bude "
"v budoucnu měnit jen jasně daným způsobem, případně vůbec. Obecně je API "
"považováno za „stabilní“, pokud přináší zpětnou kompatibilitu (viz níže). "
"Může ale být také prohlášeno za nestabilní nebo dopředně kompatibilní. "
"Účelem záruky na stabilitu API je umožnit lidem používat váš projekt v rámci "
"jejich vlastního programového kódu bez obav, že jej neustále budou muset "
"aktualizovat kvůli změnám v API. Typická záruka na stabilitu API znamená, že "
"kód, který ke kompilován vůči jedné verzi knihovny, poběží bez problémů vůči "
"všem budoucím verzím knihovny se stejným hlavním číslem verze, nebo obdobně, "
"že kód, který běží vůči démonovi, poběží i vůči všem budoucím verzím démona "
"se stejným hlavním číslem verze."
#. (itstool) path: section/p
#: C/api-stability.page:93
msgid ""
"It is possible to apply different levels of API stability to components "
"within a project. For example, the core functions in a library could be "
"stable, and hence their API left unchanged in future; while the newer, less "
"core functions could be left unstable and allowed to change wildly until the "
"right design is found, at which point they could be marked as stable."
msgstr ""
"Je možné použít pro různé komponenty projektu různé úrovně stability API. "
"Například základní funkce v knihovně budou stabilní, takže jejich API "
"zůstane v budoucnu beze změn, zatímco novější, méně základní funkce, by "
"zůstaly nestabilní a mohly by se značně měnit, dokud by návrh nebyl vyladěn "
"a pak by teprve byly označené za stabilní."
#. (itstool) path: section/p
#: C/api-stability.page:102
msgid "Several types of stability commonly considered:"
msgstr "Obvykle se počítá s několika běžnými typy kompatibility:"
#. (itstool) path: item/title
#: C/api-stability.page:107
msgid "Unstable"
msgstr "Nestabilní"
#. (itstool) path: item/p
#: C/api-stability.page:108
msgid "The API could change or be removed in future."
msgstr "API se může v budoucnu změnit nebo může být zrušeno."
#. (itstool) path: item/title
#: C/api-stability.page:111
msgid "Backwards compatible"
msgstr "Zpětně kompatibilní"
#. (itstool) path: item/p
#: C/api-stability.page:112
msgid ""
"Only changes which permit code compiled against the unmodified API to "
"continue running against the modified API are allowed (for example, "
"functions cannot be removed)."
msgstr ""
"Jsou povoleny jen změny, které umožní kódu kompilovanému vůči nezměněnému "
"API nadále fungovat vůči změněnému API (například nesmí být odebrány funkce)."
#. (itstool) path: item/title
#: C/api-stability.page:119
msgid "Forwards compatible"
msgstr "Dopředně kompatibilní"
#. (itstool) path: item/p
#: C/api-stability.page:120
msgid ""
"Only changes which permit code compiled against the modified API to run "
"against the unmodified API are allowed (for example, functions cannot be "
"added)."
msgstr ""
"Jsou povoleny jen změny, které umožní kódu kompilovanému vůči změněnému API "
"fungovat i vůči nezměněnému API (například nesmí být přidány funkce)."
#. (itstool) path: item/title
#: C/api-stability.page:127
msgid "Totally stable"
msgstr "Zcela stabilní"
#. (itstool) path: item/p
#: C/api-stability.page:128
msgid "No changes are allowed to the API, only to the implementation."
msgstr "Nejsou umožněny žádné změny v API, jen v implementaci."
#. (itstool) path: section/p
#: C/api-stability.page:132
msgid ""
"Typically, projects commit to backwards-compatibility when they say an API "
"is ‘stable’. Very few projects commit to total stability because it would "
"prevent almost all further development of the project."
msgstr ""
"Když nějaký projekt o svém API řekne, že je stabilní, můžete si to vyložit "
"jako zpětnou kompatibilitu. Jen velmi málo projektů se řadí mezi úplně "
"stabilní, protože by to bránilo skoro všem budoucím změnám v projektu."
#. (itstool) path: section/title
#. (itstool) path: page/title
#: C/api-stability.page:140 C/versioning.page:20
msgid "Versioning"
msgstr "Číslování verzí"
#. (itstool) path: section/p
#: C/api-stability.page:142
msgid ""
"API stability guarantees are strongly linked to project versioning; both "
"package versioning and libtool versioning. Libtool versioning exists "
"entirely for the purpose of tracking ABI stability, and is explained in "
"detail on the <link href=\"https://autotools.io/libtool/version.html"
"\">Autotools Mythbuster</link> or <link xref=\"versioning\"/>."
msgstr ""
"Záruky stability API jsou úzce svázány s číslováním verze projektu, jak s "
"číslováním balíčku, tak s číslováním pro libtool. Číslování verzí pro "
"libtool existuje čistě pro účely sledování stability ABI a podrobně je "
"vysvětleno v článku <link href=\"https://autotools.io/libtool/version.html"
"\">Autotools Mythbuster</link> nebo v kapitole <link xref=\"versioning\"/>."
#. (itstool) path: section/p
#: C/api-stability.page:151
msgid ""
"Package versioning (<em>major.minor.micro</em>) is strongly linked to API "
"stability: typically, the major version number is incremented when backwards-"
"incompatible changes are made (for example, when functions are renamed, "
"parameters are changed, or functions are removed). The minor version number "
"is incremented when forwards-incompatible changes are made (for example, "
"when new public API is added). The micro version number is incremented when "
"code changes are made without modifying API. See <link xref=\"versioning\"/> "
"for more information."
msgstr ""
"Číslování verzí balíčků (<em>hlavní.vedlejší.setinkové</em>) má úzkou "
"souvislost se stabilitou API: typicky se hlavní číslo verze zvyšuje, když "
"dojde ke změně ve zpětné kompatibilitě (například, když je přejmenována "
"funkce, změněn parametr nebo odstraněna funkce). Vedlejší číslo verze se "
"zvyšuje, když dojde ke změnám v dopředné kompatibilitě (například, když je "
"přidáno nové veřejné API). Setinkové číslo verze se zvyšuje, když změny v "
"kódu nijak neovlivnily API. Další informace viz <link xref=\"versioning\"/>."
#. (itstool) path: section/p
#: C/api-stability.page:162
msgid ""
"API versioning is just as important for D-Bus APIs and GSettings schemas (if "
"they are likely to change) as for C APIs. See the <link href=\"http://dbus."
"freedesktop.org/doc/dbus-api-design.html#api-versioning\">documentation on D-"
"Bus API versioning</link> for details."
msgstr ""
"Číslování verzí API není důležité jen pro C, ale i pro D-Bus a schémata "
"GSettings (pokud je předpoklad, že se budou měnit). Podrobnosti viz <link "
"href=\"http://dbus.freedesktop.org/doc/dbus-api-design.html#api-versioning"
"\">dokumentace k číslování verzí API pro D-Bus</link>."
#. (itstool) path: section/p
#: C/api-stability.page:169
msgid ""
"For GIR APIs, their stability typically follows the C API stability, as they "
"are generated from the C API. One complexity is that their stability "
"additionally depends on the version of gobject-introspection used in "
"generating the GIR, but recent versions have not changed much so this is not "
"a major concern."
msgstr ""
"U API pro GIR se jejich stabilita obvykle řídí stabilitou API v C, protože "
"je z něj generováno. Jedinou komplikací je, že jeho stabilita závisí navíc "
"na verzi gobject-introspection použité při generování GIR. Ta se ale v "
"posledních verzích příliš nemění, takže to není až tak důležité."
#. (itstool) path: section/title
#: C/api-stability.page:179 C/unit-testing.page:272 C/version-control.page:161
msgid "External Links"
msgstr "Externí odkazy"
#. (itstool) path: section/p
#: C/api-stability.page:181
msgid "The topic of API stability is covered in the following articles:"
msgstr "Tématem stability API se zabývají následující články:"
#. (itstool) path: item/p
#: C/api-stability.page:185
msgid ""
"<link href=\"https://en.wikipedia.org/wiki/Application_programming_interface"
"\">Wikipedia page on APIs</link>"
msgstr ""
"<link href=\"https://cs.wikipedia.org/wiki/API\">Stránka o API na Wikipedii</"
"link>"
#. (itstool) path: item/p
#: C/api-stability.page:189
msgid ""
"<link href=\"https://en.wikipedia.org/wiki/Application_binary_interface"
"\">Wikipedia page on ABIs</link>"
msgstr ""
"<link href=\"https://cs.wikipedia.org/wiki/ABI\">Stránka o ABI na Wikipedii</"
"link>"
#. (itstool) path: item/p
#: C/api-stability.page:193
msgid ""
"<link href=\"http://dbus.freedesktop.org/doc/dbus-api-design.html#api-"
"versioning\">D-Bus API versioning documentation</link>"
msgstr ""
"<link href=\"http://dbus.freedesktop.org/doc/dbus-api-design.html#api-"
"versioning\">Dokumentace k číslování verzí D-Bus</link>"
#. (itstool) path: info/desc
#: C/async-programming.page:18
msgid "Use of GLib-style asynchronous methods in various situations"
msgstr "Jak použít asynchronní metody ve stylu GLib v různých situacích"
#. (itstool) path: page/title
#: C/async-programming.page:23
msgid "Asynchronous Programming"
msgstr "Asynchronní programování"
#. (itstool) path: item/p
#: C/async-programming.page:29
msgid ""
"Use asynchronous calls in preference to synchronous calls or explicit use of "
"threads (<link xref=\"#concepts\"/>)"
msgstr ""
"Dávejte přednost asynchronním voláním před synchronním voláním, nebo "
"výslovným použitím vláken (<link xref=\"#concepts\"/>)"
#. (itstool) path: item/p
#: C/async-programming.page:33
msgid ""
"Learn and follow the GLib pattern for declaring asynchronous APIs (<link "
"xref=\"#api-pattern\"/>)"
msgstr ""
"Naučte se a dodržujte vzory GLib pro deklarování asynchronních API (<link "
"xref=\"#api-pattern\"/>)"
#. (itstool) path: item/p
#: C/async-programming.page:37
msgid ""
"Place callbacks from asynchronous functions in order down the file, so "
"control flow is easy to follow (<link xref=\"#single-call\"/>)"
msgstr ""
"Zpětná volání z asynchronních funkcí umístěte v souboru v pořadí jejich "
"provádění, aby byl snadný přehled toku provádění kódu (<link xref=\"#single-"
"call\"/>)"
#. (itstool) path: item/p
#: C/async-programming.page:41
msgid ""
"Use the presence of a <link href=\"https://developer.gnome.org/gio/stable/"
"GTask.html\"><code>GTask</code></link> or <link href=\"https://developer."
"gnome.org/gio/stable/GCancellable.html\"><code>GCancellable</code></link> to "
"indicate whether an operation is ongoing (<link xref=\"#single-call\"/>, "
"<link xref=\"#gtask\"/>)"
msgstr ""
"Používejte přítomnosti <link href=\"https://developer.gnome.org/gio/stable/"
"GTask.html\"><code>GTask</code></link> nebo <link href=\"https://developer."
"gnome.org/gio/stable/GCancellable.html\"><code>GCancellable</code></link> k "
"indikaci, jestli operace probíhá (<link xref=\"#single-call\"/>, <link xref="
"\"#gtask\"/>)"
#. (itstool) path: item/p
#: C/async-programming.page:48
msgid ""
"If running operations in parallel, track how many operations are yet to "
"start, and how many are yet to finish — the overall operation is complete "
"once both counts are zero (<link xref=\"#parallel\"/>)"
msgstr ""
"Když spouštíte paralelní operace, sledujte kolik jich bylo spuštěno a kolik "
"bylo dokončeno. Po dokončení celé operace by rozdíl obou hodnot měl být nula "
"(<link xref=\"#parallel\"/>)"
#. (itstool) path: item/p
#: C/async-programming.page:54
msgid ""
"Separate state for operations into ‘task data’ structures for <link href="
"\"https://developer.gnome.org/gio/stable/GTask.html\"><code>GTask</code>s</"
"link>, allowing operations to be reused more easily without needing changes "
"to global state handling (<link xref=\"#gtask\"/>)"
msgstr ""
"Oddělte stavy pro operace do struktury „data úlohy“ pro objekty <link href="
"\"https://developer.gnome.org/gio/stable/GTask.html\"><code>GTask</code></"
"link>, aby se operace daly snáze znovu použít bez potřeby změn v globální "
"obsluze stavu (<link xref=\"#gtask\"/>)"
#. (itstool) path: item/p
#: C/async-programming.page:60
msgid ""
"Consider how asynchronous methods on an object instance interact with "
"finalization of that instance (<link xref=\"#lifetimes\"/>)"
msgstr ""
"Popřemýšlejte, jak asynchronní metody v instanci objektu souvisí s "
"finalizací instance (<link xref=\"#lifetimes\"/>)"
#. (itstool) path: section/title
#: C/async-programming.page:68
msgid "Concepts"
msgstr "Koncepty"
#. (itstool) path: section/p
#: C/async-programming.page:70
msgid ""
"GLib supports <em>asynchronous</em> programming, where long-running "
"operations can be started, run ‘in the background’, and a callback invoked "
"when they are finished and their results are available. This is in direct "
"contrast to <em>synchronous</em> long-running operations, which are a single "
"function call which blocks program control flow until complete."
msgstr ""
"GLib podporuje <em>asynchronní</em> programování, kdy dlouhotrvající operace "
"mohou být spuštěny, běžet „na pozadí“ a vyvolat zpětné volání, když jsou "
"dokončeny a jejich výsledky jsou k dispozici. Což je v přímém kontrastu se "
"<em>synchronními</em> dlouhotrvajícími operacemi, které jsou samostatnými "
"voláními funkcí blokujícími až do svého dokončení řízení toku programu."
#. (itstool) path: section/p
#: C/async-programming.page:78
msgid ""
"As discussed in <link xref=\"main-contexts\"/> and <link xref="
"\"threading#when-to-use-threading\"/>, asynchronous operations should be "
"favoured over synchronous ones and over explicit use of threading. They do "
"not block the main context like sychronous operations do; and are easier to "
"use correctly than threads. They often also have a lower performance penalty "
"than spawning a thread and sending work to it."
msgstr ""
"Jak je vysvětleno v kapitolách <link xref=\"main-contexts\"/> a <link xref="
"\"threading#when-to-use-threading\"/>, asynchronní operace by měly být "
"upřednostňovány před synchronními, i před cíleným použitím vláken. Na rozdíl "
"od synchronních neblokují hlavní kontext a jejich správné použití je snazší "
"než u vláken. Navíc často mají nižší dopad na výkon, než spouštění vláken."
#. (itstool) path: section/title
#: C/async-programming.page:89
msgid "API Pattern"
msgstr "Vzory API"
#. (itstool) path: section/p
#: C/async-programming.page:91
msgid ""
"Asynchronous calls follow a standard pattern in GLib code. For an operation "
"named <code>load_data</code> on the <code>File</code> class in the "
"<code>Foo</code> namespace, there will be:"
msgstr ""
"Asynchronní volání se řídí standardními vzory v kódu GLib. Pro operaci "
"nazvanou <code>load_data</code> na třídě <code>File</code> ve jmenném "
"prostoru <code>Foo</code> to bude:"
#. (itstool) path: item/code
#: C/async-programming.page:98
#, no-wrap
msgid ""
"\n"
"foo_file_load_data_async (FooFile *self,\n"
" …,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)"
msgstr ""
"\n"
"foo_file_load_data_async (FooFile *self,\n"
" …,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)"
#. (itstool) path: item/code
#: C/async-programming.page:106
#, no-wrap
msgid ""
"\n"
"foo_file_load_data_finish (FooFile *self,\n"
" GAsyncResult *result,\n"
" …,\n"
" GError **error)"
msgstr ""
"\n"
"foo_file_load_data_finish (FooFile *self,\n"
" GAsyncResult *result,\n"
" …,\n"
" GError **error)"
#. (itstool) path: section/p
#: C/async-programming.page:114
msgid ""
"The <code>…</code> parameters to <code>foo_file_load_data_async()</code> are "
"those specific to the operation — in this case, perhaps the size of a buffer "
"to load into. Similarly for <code>foo_file_load_data_finish()</code> they "
"are the operation-specific return values — perhaps a location to return a "
"content type string in this case."
msgstr ""
"Parametry <code>…</code> z <code>foo_file_load_data_async()</code> jsou "
"specifické pro operaci. V tomto případě je o velikost vyrovnávací paměti, do "
"které se načítá. Obdobně u <code>foo_file_load_data_finish()</code> jsou "
"specifické pro operaci návratové hodnoty, v tomto případě se jako typ "
"řetězec vrací umístění."
#. (itstool) path: section/p
#: C/async-programming.page:123
msgid ""
"When <code>foo_file_load_data_async()</code> is called, it schedules the "
"load operation in the background (as a new file descriptor on the <link xref="
"\"main-contexts\"><code>GMainContext</code></link> or as a worker thread, "
"for example), then returns without blocking."
msgstr ""
"Když je zavolána funkce <code>foo_file_load_data_async()</code>, naplánuje "
"operaci načtení na pozadí (jako nový popisovač souboru v <link xref=\"main-"
"contexts\"><code>GMainContext</code></link>, nebo jako pracovní vlákno), a "
"bez blokování se vrátí."
#. (itstool) path: section/p
#: C/async-programming.page:130
msgid ""
"When the operation is complete, the <code>callback</code> is executed in the "
"same <code>GMainContext</code> as the original asynchronous call. The "
"callback is invoked <em>exactly</em> once, whether the operation succeeded "
"or failed."
msgstr ""
"Když je operace dokončena, je provedeno <code>zpětné volání</code> ve "
"stejném <code>GMainContext</code>, jako původní asynchronní volání. Zpětné "
"volání je zavoláno <em>právě</em> jednou, nezávisle na tom, jestli operace "
"dopadla dobře, nebo selhala."
#. (itstool) path: section/p
#: C/async-programming.page:137
msgid ""
"From the callback, <code>foo_file_load_data_finish()</code> may be called by "
"the user’s code to retrieve return values and error details, passing the "
"<link href=\"https://developer.gnome.org/gio/stable/GAsyncResult.html"
"\"><code>GAsyncResult</code></link> instance which was passed to the "
"callback."
msgstr ""
"Ze zpětného volání může být uživatelským kódem zavolána funkce "
"<code>foo_file_load_data_finish()</code> kvůli získání návratové hodnoty a "
"podrobností o chybě, přičemž se jí předává instance <link href=\"https://"
"developer.gnome.org/gio/stable/GAsyncResult.html\"><code>GAsyncResult</"
"code></link>, která byla předána zpětnému volání."
#. (itstool) path: section/title
#: C/async-programming.page:146
msgid "Operation Lifetimes"
msgstr "Životní průběh operace"
#. (itstool) path: section/p
#: C/async-programming.page:148
msgid ""
"When writing asynchronous operations, it is common to write them as methods "
"of a class. In this case, it is important to define how ongoing operations "
"on a class instance interact with finalization of that instance. There are "
"two approaches:"
msgstr ""
"Když se píše asynchronní operace, je běžné ji napsat jako metodu třídy. V "
"tomto případě je důležité definovat, jak běžící operace nad instancí třídy "
"komunikují s finalizací instance. Existují dva přístupy:"
#. (itstool) path: item/title
#: C/async-programming.page:157
msgid "Strong"
msgstr "Silný"
#. (itstool) path: item/p
#: C/async-programming.page:158
msgid ""
"The ongoing operation keeps a reference to the class instance, forcing it to "
"remain alive for the duration of the operation. The class should provide "
"some kind of ‘close’ or ‘cancel’ method which can be used by other classes "
"to force cancellation of the operation and allow that instance to be "
"finalized."
msgstr ""
"Běžící operace zachovává odkaz na instanci třídy a nutí ji zůstat naživu po "
"dobu operace. Třída může poskytovat nějaký druh metody „close“ nebo "
"„cancel“, které mohou být použity jinou třídou k vynucení zrušení operace a "
"umožnit této instanci finalizaci."
#. (itstool) path: item/title
#: C/async-programming.page:168
msgid "Weak"
msgstr "Slabý"
#. (itstool) path: item/p
#: C/async-programming.page:169
msgid ""
"The ongoing operation does <em>not</em> keep a reference to the class "
"instance, and the class cancels the operation (using <link href=\"https://"
"developer.gnome.org/gio/stable/GCancellable.html#g-cancellable-cancel"
"\"><code>g_cancellable_cancel()</code></link>) in its dispose function."
msgstr ""
"Běžící operace <em>ne</em>zachovává odkaz na instanci třídy a třída ruší "
"operaci (pomocí <link href=\"https://developer.gnome.org/gio/stable/"
"GCancellable.html#g-cancellable-cancel\"><code>g_cancellable_cancel()</"
"code></link>) ve své uvolňovací funkci."
#. (itstool) path: section/p
#: C/async-programming.page:178
msgid ""
"Which approach is used depends on the class’ design. A class which wraps a "
"particular operation (perhaps a <code>MyFileTransfer</code> class, for "
"example) might want to use the <em style=\"strong\">weak</em> approach. A "
"class which manages multiple network connections and asynchronous operations "
"on them may use the <em style=\"strong\">strong</em> approach instead. Due "
"to incoming network connections, for example, it might not be in complete "
"control of the scheduling of its asynchronous calls, so the weak approach "
"would not be appropriate — any code dropping a reference to the object could "
"not be sure it was not accidentally killing a new network connection."
msgstr ""
"To, který přístup je použit, závisí na návrhu třídy. Třída, která obaluje "
"konkrétní operaci (třída <code>MyFileTransfer</code> například), může chtít "
"používat <em style=\"strong\">slabý</em> přístup. Třída, která spravuje více "
"síťových připojení a asynchronních operací nad nimi, může naopak používat "
"<em style=\"strong\">silný</em> přístup. Například kvůli příchozím síťovým "
"připojením nemusí mít úplné řízení nad plánováním svých asynchronních "
"volání, takže slabý přístup by nebyl vhodný – kód zahazující odkaz na objekt "
"by si nemohl být jistý, jestli nešťastnou náhodou nezabije nové síťové "
"připojení."
#. (itstool) path: section/title
#: C/async-programming.page:193
msgid "Examples of Using Asynchronous Functions"
msgstr "Příklad použití asynchronních funkcí"
#. (itstool) path: section/p
#: C/async-programming.page:195
msgid ""
"It is often the case that multiple asynchronous calls need to be used to "
"complete an operation. For example, opening a file for reading, then "
"performing a couple of reads, and then closing the file. Or opening several "
"network sockets in parallel and waiting until they are all open before "
"continuing with other work. Some examples of these situations are given "
"below."
msgstr ""
"Častým případem je, že je k dokončení operace zapotřebí více asynchronních "
"volání. Například, otevření souboru pro čtení, následně provedení několika "
"čtení a pak zavření souboru. Nebo otevření několika síťových soketů souběžně "
"a čekání, dokud se všechny neotevřou, než se může pokračovat s další prací "
"se sítí. Nějaké příklady těchto situací jsou uvedeny níže."
#. (itstool) path: section/title
#: C/async-programming.page:205
msgid "Single Operation"
msgstr "Jedna samostatná operace"
#. (itstool) path: section/p
#: C/async-programming.page:207
msgid ""
"A single asynchronous call requires two functions: one to start the "
"operation, and one to complete it. In C, the demanding part of performing an "
"asynchronous call is correctly storing state between these two functions, "
"and handling changes to that state in the time between those two functions "
"being called. For example, cancellation of an ongoing asynchronous call is a "
"state change, and if not implemented carefully, any UI updates (for example) "
"made when cancelling an operation will be undone by updates in the "
"operation’s callback."
msgstr ""
"Jedna samostatná asynchronní operace vyžaduje dvě funkce: jednu pro spuštění "
"operace a jednu pro její dokončení. V jazyce C žádanou částí provádění "
"asynchronního volání je správně uchovaný stav mezi těmito dvěma funkcemi a "
"obsluha změn tohoto stavu v čase mezi zavoláním těchto dvou funkcí. "
"Například, zrušení probíhajícího asynchronního volání je změna stavu, a když "
"není implementováno pečlivě, aktualizace uživatelského rozhraní (například) "
"provedené při rušení operace budou vráceny do původního stavu aktualizací ve "
"zpětném volání operace."
#. (itstool) path: example/p
#: C/async-programming.page:219
msgid ""
"This example demonstrates copying a file from one location in the file "
"system to another. The key principles demonstrated here are:"
msgstr ""
"Tento příklad předvádí kopírování souboru z jednoho místa v souborovém "
"systému na druhé. Předvedené klíčové principy jsou:"
#. (itstool) path: item/p
#: C/async-programming.page:224
msgid ""
"Placing the <code>copy_button_clicked_cb()</code> (start) and "
"<code>copy_finish_cb()</code> (finish) functions in order by using a forward "
"declaration for <code>copy_finish_cb()</code>. This means the control flow "
"continues linearly down the file, rather than getting to the bottom of "
"<code>copy_button_clicked_cb()</code> and resuming in "
"<code>copy_finish_cb()</code> somewhere else in the file."
msgstr ""
"Umístění funkcí <code>copy_button_clicked_cb()</code> (spuštění) a "
"<code>copy_finish_cb()</code> (dokončení) v postupném pořadí pomocí dopředné "
"deklarace pro <code>copy_finish_cb()</code>. To znamená, že řízení toku "
"pokračuje lineárně od začátku do konce souboru se zdrojovým kódem, místo aby "
"se <code>copy_button_clicked_cb()</code> bralo z konce a pokračovalo se na "
"<code>copy_button_clicked_cb()</code> někde jinde v souboru."
#. (itstool) path: item/p
#: C/async-programming.page:233
msgid ""
"Use of a <link href=\"https://developer.gnome.org/gio/stable/GCancellable."
"html\"><code>GCancellable</code></link> to allow cancelling the operation "
"after it has started. The code in <code>cancel_button_clicked_cb()</code> is "
"very simple: as the <code>copy_finish_cb()</code> callback is "
"<em>guaranteed</em> to be invoked when the operation completes (even when "
"completing early due to cancellation), all the UI and state updates for "
"cancellation can be handled there, rather than in "
"<code>cancel_button_clicked_cb()</code>."
msgstr ""
"Používejte <link href=\"https://developer.gnome.org/gio/stable/GCancellable."
"html\"><code>GCancellable</code></link>, aby se operace po té, co je "
"spuštěna, dala zrušit. Kód v <code>cancel_button_clicked_cb()</code> je "
"velmi jednoduchý: jelikož je <em>zaručeno</em> vyvolání zpětného volání "
"<code>copy_finish_cb()</code>, když je operace dokončena (i když je "
"dokončena předčasně zrušením), všechny aktualizace uživatelského rozhraní a "
"stavu pro zrušení mohou být obslouženy zde, místo aby se tak stalo v "
"<code>cancel_button_clicked_cb()</code>."
#. (itstool) path: item/p
#: C/async-programming.page:245
msgid ""
"An operation is ongoing exactly while <code>MyObjectPrivate."
"copy_cancellable</code> is non-<code>NULL</code>, making it easy to track "
"running operations. Note that this means only one file copy operation can be "
"started via <code>copy_button_clicked_cb()</code> at a time. One "
"<code>GCancellable</code> cannot easily be used for multiple operations like "
"this."
msgstr ""
"Operace běží přesně po dobu, kdy <code>MyObjectPrivate.copy_cancellable</"
"code> není <code>NULL</code>, díky čemuž je jednoduché sledovat běžící "
"operace. Uvědomte si, že to znamená, že jen jedna kopírovací operace může "
"být spuštěna přes <code>copy_button_clicked_cb()</code> v jeden okamžik. "
"Tímto způsobem nejde jednoduše použít jednu <code>GCancellable</code> pro "
"více operací."
#. (itstool) path: example/code
#: C/async-programming.page:256
#, no-wrap
msgid ""
"\n"
"static void\n"
"copy_finish_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"static void\n"
"copy_button_clicked_cb (GtkButton *button\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source = NULL, *destination = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Operation already in progress? */\n"
" if (priv->copy_cancellable != NULL)\n"
" {\n"
" g_debug (\"Copy already in progress.\");\n"
" return;\n"
" }\n"
"\n"
" /* Build source and destination file paths. */\n"
" source = g_file_new_for_path (/* some path generated from UI */);\n"
" destination = g_file_new_for_path (/* some other path generated from UI */);\n"
"\n"
" /* Set up a cancellable. */\n"
" priv->copy_cancellable = g_cancellable_new ();\n"
"\n"
" g_file_copy_async (source, destination, G_FILE_COPY_NONE, G_PRIORITY_DEFAULT,\n"
" priv->copy_cancellable, NULL, NULL,\n"
" copy_finish_cb, user_data);\n"
"\n"
" g_object_unref (destination);\n"
" g_object_unref (source);\n"
"\n"
" /* Update UI to show copy is in progress. */\n"
" …\n"
"}\n"
"\n"
"static void\n"
"copy_finish_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" source = G_FILE (source_object);\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Handle completion of the operation. */\n"
" g_file_copy_finish (source, result, &error);\n"
"\n"
" if (error != NULL &&\n"
" !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" /* Should update the UI to signal failure.\n"
" * Ignore failure due to cancellation. */\n"
" g_warning (\"Failed to copy file: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_error (&error);\n"
"\n"
" /* Clear the cancellable to signify the operation has finished. */\n"
" g_clear_object (&priv->copy_cancellable);\n"
"\n"
" /* Update UI to show copy as complete. */\n"
" …\n"
"}\n"
"\n"
"static void\n"
"cancel_button_clicked_cb (GtkButton *button,\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source = NULL, *destination = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Operation in progress? No-op if @copy_cancellable is %NULL. */\n"
" g_cancellable_cancel (priv->copy_cancellable);\n"
"}\n"
"\n"
"static void\n"
"my_object_dispose (GObject *obj)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (obj));\n"
"\n"
" /* Cancel any ongoing copy operation.\n"
" *\n"
" * This ensures that if #MyObject is disposed part-way through a copy, the\n"
" * callback doesn’t get invoked with an invalid #MyObject pointer. */\n"
" g_cancellable_cancel (priv->copy_cancellable);\n"
"\n"
" /* Do other dispose calls here. */\n"
" …\n"
"\n"
" /* Chain up. */\n"
" G_OBJECT_CLASS (my_object_parent_class)->dispose (obj);\n"
"}"
msgstr ""
"\n"
"static void\n"
"copy_finish_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"static void\n"
"copy_button_clicked_cb (GtkButton *button\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source = NULL, *destination = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Operace již běží? */\n"
" if (priv->copy_cancellable != NULL)\n"
" {\n"
" g_debug (\"Copy already in progress.\");\n"
" return;\n"
" }\n"
"\n"
" /* Sestaví cestu k zdrojovému a cílovému souboru */\n"
" source = g_file_new_for_path (/* nějaká cesta vygenerovaná z uživ. rozhraní */);\n"
" destination = g_file_new_for_path (/* nějaká další cesta vygenerovaná z uživ. rozhraní */);\n"
"\n"
" /* Nastaví jako zrušitelné */\n"
" priv->copy_cancellable = g_cancellable_new ();\n"
"\n"
" g_file_copy_async (source, destination, G_FILE_COPY_NONE, G_PRIORITY_DEFAULT,\n"
" priv->copy_cancellable, NULL, NULL,\n"
" copy_finish_cb, user_data);\n"
"\n"
" g_object_unref (destination);\n"
" g_object_unref (source);\n"
"\n"
" /* Aktualizuje uživ. rozhraní, aby ukazovalo průběh */\n"
" …\n"
"}\n"
"\n"
"static void\n"
"copy_finish_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" source = G_FILE (source_object);\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Obsluha dokončení operace */\n"
" g_file_copy_finish (source, result, &error);\n"
"\n"
" if (error != NULL &&\n"
" !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" /* Mělo by aktualizovat uživatelské rozhraní, aby oznámilo selhání\n"
" * Ignoruje selhání kvůli zrušení */\n"
" g_warning (\"Failed to copy file: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_error (&error);\n"
"\n"
" /* Smaže příznak zrušitelnosti, aby dalo najevo dokončení operace */\n"
" g_clear_object (&priv->copy_cancellable);\n"
"\n"
" /* Aktualizace uživ. rozhraní, aby ukazovalo dokončení kopírování */\n"
" …\n"
"}\n"
"\n"
"static void\n"
"cancel_button_clicked_cb (GtkButton *button,\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source = NULL, *destination = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Operace probíhá? Žádná operace, když @copy_cancellable je %NULL. */\n"
" g_cancellable_cancel (priv->copy_cancellable);\n"
"}\n"
"\n"
"static void\n"
"my_object_dispose (GObject *obj)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (obj));\n"
"\n"
" /* Zrušení případné probíhající operace kopírování.\n"
" *\n"
" * Tím se zajistí, že když je #MyObject částečně uvolněn přes\n"
" * kopírování, není zpětné volání vyvoláno s neplatným\n"
" * ukazatelem na #MyObject. */\\n\"\n"
" g_cancellable_cancel (priv->copy_cancellable);\n"
"\n"
" /* Zde proveďte případná další uvolnění */\n"
" …\n"
"\n"
" /* Zřetězení */\n"
" G_OBJECT_CLASS (my_object_parent_class)->dispose (obj);\n"
"}"
#. (itstool) path: example/p
#: C/async-programming.page:361
msgid ""
"For comparison, here is the same code implemented using the <em>synchronous</"
"em> version of <link href=\"https://developer.gnome.org/gio/stable/GFile."
"html#g-file-copy\"><code>g_file_copy()</code></link>. Note how the order of "
"statements is almost identical. Cancellation cannot be supported here, as "
"the UI is blocked from receiving ‘click’ events on the cancellation button "
"while the copy is ongoing, so <code>NULL</code> is passed to the "
"<code>GCancellable</code> parameter. This is the main reason why this code "
"should <em>not</em> be used in practice."
msgstr ""
"Pro srovnání, zde je ten stejný kód implementovaný pomocí <em>synchronní</"
"em> verze <link href=\"https://developer.gnome.org/gio/stable/GFile.html#g-"
"file-copy\"><code>g_file_copy()</code></link>. Všimněte si, že pořadí "
"příkazů je povětšinou stejné. Rušení v tomto případě nelez podporovat, "
"protože uživatelské rozhraní je během kopírování blokované od příjmu události "
"„click“ z tlačítka „Zrušit“, takže do parametru <code>GCancellable</code> "
"předáváme <code>NULL</code>. To je také hlavní důvod, proč tento kód "
"<em>není</em> v praxi použitelný."
#. (itstool) path: example/code
#: C/async-programming.page:373
#, no-wrap
msgid ""
"\n"
"static void\n"
"copy_button_clicked_cb (GtkButton *button\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source = NULL, *destination = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Build source and destination file paths. */\n"
" source = g_file_new_for_path (/* some path generated from UI */);\n"
" destination = g_file_new_for_path (/* some other path generated from UI */);\n"
"\n"
" g_file_copy (source, destination, G_FILE_COPY_NONE,\n"
" NULL /* cancellable */, NULL, NULL,\n"
" &error);\n"
"\n"
" g_object_unref (destination);\n"
" g_object_unref (source);\n"
"\n"
" /* Handle completion of the operation. */\n"
" if (error != NULL)\n"
" {\n"
" /* Should update the UI to signal failure.\n"
" * Ignore failure due to cancellation. */\n"
" g_warning (\"Failed to copy file: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_error (&error);\n"
"\n"
" /* Update UI to show copy as complete. */\n"
" …\n"
"}"
msgstr ""
"\n"
"static void\n"
"copy_button_clicked_cb (GtkButton *button\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *source = NULL, *destination = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (user_data));\n"
"\n"
" /* Sestaví cestu k zdrojovému a cílovému souboru */\n"
" source = g_file_new_for_path (/* nějaká cesta vygenerovaná z uživ. rozhraní */);\n"
" destination = g_file_new_for_path (/* nějaká další cesta vygenerovaná z uživ. rozhraní */);\n"
"\n"
" g_file_copy (source, destination, G_FILE_COPY_NONE,\n"
" NULL /* cancellable */, NULL, NULL,\n"
" &error);\n"
"\n"
" g_object_unref (destination);\n"
" g_object_unref (source);\n"
"\n"
" /* Obsluha dokončení operace */\n"
" if (error != NULL)\n"
" {\n"
" /* Mělo by aktualizovat uživatelské rozhraní, aby oznámilo selhání\n"
" * Ignoruje selhání kvůli zrušení */\n"
" g_warning (\"Failed to copy file: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_error (&error);\n"
"\n"
" /* Aktualizace uživ. rozhraní, aby ukazovalo dokončení kopírování */\n"
" …\n"
"}"
#. (itstool) path: section/title
#: C/async-programming.page:411
msgid "Operations in Series"
msgstr "Operace prováděné sériově"
#. (itstool) path: section/p
#: C/async-programming.page:413
msgid ""
"A common situation is to run multiple asynchronous operations in series, "
"when each operation depends on the previous one completing."
msgstr ""
"Běžnou situací je spuštění více asynchronních operací po sobě, když každá z "
"operací závisí na dokončení předchozí."
#. (itstool) path: example/p
#: C/async-programming.page:419
msgid ""
"In this example, the application reads a socket address from a file, opens a "
"connection to that address, reads a message, and then finishes."
msgstr ""
"V tomto příkladu aplikace čte adresu soketu ze souboru, otevře připojení na tuto "
"adresu, přečte zprávu a pak skončí."
#. (itstool) path: example/p
#: C/async-programming.page:425 C/async-programming.page:710
#: C/async-programming.page:880
msgid "Key points in this example are:"
msgstr "Klíčové body v tomto příkladu:"
#. (itstool) path: item/p
#: C/async-programming.page:429
msgid ""
"Each callback is numbered consistently, and they are all placed in order in "
"the file so the code follows sequentially."
msgstr ""
"Jednotlivá zpětná volání jsou jednotně očíslovaná a ve správném pořadí "
"umístěná v souboru se zdrojovým kódem, takže kód je provádět postupně ve "
"stejném pořadí."
#. (itstool) path: item/p
#: C/async-programming.page:433
msgid ""
"As in <link xref=\"#single-call\"/>, a single <code>GCancellable</code> "
"indicates that the series of operations is ongoing. Cancelling it aborts the "
"entire sequence."
msgstr ""
"Stejně jako v kapitole <link xref=\"#single-call\"/>, jediné "
"<code>GCancellable</code> indikuje, že běží série operací. Její zrušení "
"přeruší celou posloupnost."
#. (itstool) path: item/p
#: C/async-programming.page:438
msgid ""
"As in <link xref=\"#single-call\"/>, the pending operation is cancelled if "
"the owning <code>MyObject</code> instance is disposed, to prevent callbacks "
"being called later with an invalid <code>MyObject</code> pointer."
msgstr ""
"Stejně jako v <link xref=\"#single-call\"/> jsou čekající operace zrušeny, "
"když je vlastnící instance <code>MyObject</code> uvolněna, aby se zabránilo "
"pozdějšímu zavolání zpětného volání s neplatným ukazatelem <code>MyObject</"
"code>."
#. (itstool) path: example/p
#: C/async-programming.page:446
msgid ""
"<link xref=\"#gtask\"/> gives a version of this example wrapped in a <link "
"href=\"https://developer.gnome.org/gio/stable/GTask.html\"><code>GTask</"
"code></link> for convenience."
msgstr ""
"<link xref=\"#gtask\"/> poskytuje verzi tohoto příkladu obalenou pro pohodlí "
"do <link href=\"https://developer.gnome.org/gio/stable/GTask.html"
"\"><code>GTask</code></link>."
#. (itstool) path: example/code
#: C/async-programming.page:452
#, no-wrap
msgid ""
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"static void\n"
"connect_to_server (MyObject *self)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *address_file = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" if (priv->connect_cancellable != NULL)\n"
" {\n"
" /* Already connecting. */\n"
" return;\n"
" }\n"
"\n"
" /* Set up a cancellable. */\n"
" priv->connect_cancellable = g_cancellable_new ();\n"
"\n"
" /* Read the socket address. */\n"
" address_file = build_address_file ();\n"
" g_file_load_contents_async (address_file, priv->connect_cancellable,\n"
" connect_to_server_cb1, self);\n"
" g_object_unref (address_file);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GFile *address_file; /* unowned */\n"
" gchar *address = NULL; /* owned */\n"
" gsize address_size = 0;\n"
" GInetAddress *inet_address = NULL; /* owned */\n"
" GInetSocketAddress *inet_socket_address = NULL; /* owned */\n"
" guint16 port = 123;\n"
" GSocketClient *socket_client = NULL; /* owned */\n"
" GError *error = NULL;\n"
"\n"
" address_file = G_FILE (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish loading the address. */\n"
" g_file_load_contents_finish (address_file, result, &address,\n"
" &address_size, NULL, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Parse the address. */\n"
" inet_address = g_inet_address_new_from_string (address);\n"
"\n"
" if (inet_address == NULL)\n"
" {\n"
" /* Error. */\n"
" g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,\n"
" \"Invalid address ‘%s’.\", address);\n"
" goto done;\n"
" }\n"
"\n"
" inet_socket_address = g_inet_socket_address_new (inet_address, port);\n"
"\n"
" /* Connect to the given address. */\n"
" socket_client = g_socket_client_new ();\n"
"\n"
" g_socket_client_connect_async (socket_client,\n"
" G_SOCKET_CONNECTABLE (inet_socket_address),\n"
" priv->connect_cancellable,\n"
" connect_to_server_cb2,\n"
" self);\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Stop the operation. */\n"
" if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Failed to load server address: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_object (&priv->connect_cancellable);\n"
" g_error_free (error);\n"
" }\n"
"\n"
" g_free (address);\n"
" g_clear_object (&inet_address);\n"
" g_clear_object (&inet_socket_address);\n"
" g_clear_object (&socket_client);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GSocketClient *socket_client; /* unowned */\n"
" GSocketConnection *connection = NULL; /* owned */\n"
" GInputStream *input_stream; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" socket_client = G_SOCKET_CLIENT (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish connecting to the socket. */\n"
" connection = g_socket_client_connect_finish (socket_client, result,\n"
" &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Store a reference to the connection so it is kept open while we read from\n"
" * it: #GInputStream does not keep a reference to a #GIOStream which contains\n"
" * it. */\n"
" priv->connection = g_object_ref (connection);\n"
"\n"
" /* Read a message from the connection. This uses a single buffer stored in\n"
" * #MyObject, meaning that only one connect_to_server() operation can run at\n"
" * any time. The buffer could instead be allocated dynamically if this is a\n"
" * problem. */\n"
" input_stream = g_io_stream_get_input_stream (G_IO_STREAM (connection));\n"
"\n"
" g_input_stream_read_async (input_stream,\n"
" priv->message_buffer,\n"
" sizeof (priv->message_buffer),\n"
" G_PRIORITY_DEFAULT, priv->connect_cancellable,\n"
" connect_to_server_cb3, self);\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Stop the operation. */\n"
" if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Failed to connect to server: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_object (&priv->connect_cancellable);\n"
" g_clear_object (&priv->connection);\n"
" g_error_free (error);\n"
" }\n"
"\n"
" g_clear_object (&connection);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GInputStream *input_stream; /* unowned */\n"
" gssize len = 0;\n"
" GError *error = NULL;\n"
"\n"
" input_stream = G_INPUT_STREAM (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish reading from the socket. */\n"
" len = g_input_stream_read_finish (input_stream, result, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Handle the message. */\n"
" g_assert_cmpint (len, >=, 0);\n"
" g_assert_cmpuint ((gsize) len, <=, sizeof (priv->message_buffer));\n"
"\n"
" handle_received_message (self, priv->message_buffer, len, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
"done:\n"
" /* Unconditionally mark the operation as finished.\n"
" *\n"
" * The streams should automatically close as this\n"
" * last reference is dropped. */\n"
" g_clear_object (&priv->connect_cancellable);\n"
" g_clear_object (&priv->connection);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" /* Warn about the error. */\n"
" if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Failed to read from the server: %s\", error->message);\n"
" }\n"
"\n"
" g_error_free (error);\n"
" }\n"
"}\n"
"\n"
"static void\n"
"my_object_dispose (GObject *obj)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (obj));\n"
"\n"
" /* Cancel any ongoing connection operations.\n"
" *\n"
" * This ensures that if #MyObject is disposed part-way through the\n"
" * connect_to_server() sequence of operations, the sequence gets cancelled and\n"
" * doesn’t continue with an invalid #MyObject pointer. */\n"
" g_cancellable_cancel (priv->connect_cancellable);\n"
"\n"
" /* Do other dispose calls here. */\n"
" …\n"
"\n"
" /* Chain up. */\n"
" G_OBJECT_CLASS (my_object_parent_class)->dispose (obj);\n"
"}"
msgstr ""
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"static void\n"
"connect_to_server (MyObject *self)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *address_file = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" if (priv->connect_cancellable != NULL)\n"
" {\n"
" /* Již se připojuje */\n"
" return;\n"
" }\n"
"\n"
" /* Nastavení jako zrušitelné */\n"
" priv->connect_cancellable = g_cancellable_new ();\n"
"\n"
" /* Čtení adresy soketu */\n"
" address_file = build_address_file ();\n"
" g_file_load_contents_async (address_file, priv->connect_cancellable,\n"
" connect_to_server_cb1, self);\n"
" g_object_unref (address_file);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GFile *address_file; /* unowned */\n"
" gchar *address = NULL; /* owned */\n"
" gsize address_size = 0;\n"
" GInetAddress *inet_address = NULL; /* owned */\n"
" GInetSocketAddress *inet_socket_address = NULL; /* owned */\n"
" guint16 port = 123;\n"
" GSocketClient *socket_client = NULL; /* owned */\n"
" GError *error = NULL;\n"
"\n"
" address_file = G_FILE (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení načítání adresy */\n"
" g_file_load_contents_finish (address_file, result, &address,\n"
" &address_size, NULL, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Zpracování adresy */\n"
" inet_address = g_inet_address_new_from_string (address);\n"
"\n"
" if (inet_address == NULL)\n"
" {\n"
" /* Chyba */\n"
" g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,\n"
" \"Invalid address ‘%s’.\", address);\n"
" goto done;\n"
" }\n"
"\n"
" inet_socket_address = g_inet_socket_address_new (inet_address, port);\n"
"\n"
" /* Připojení na zadanou adresu */\n"
" socket_client = g_socket_client_new ();\n"
"\n"
" g_socket_client_connect_async (socket_client,\n"
" G_SOCKET_CONNECTABLE (inet_socket_address),\n"
" priv->connect_cancellable,\n"
" connect_to_server_cb2,\n"
" self);\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Zastavení operace */\n"
" if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Failed to load server address: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_object (&priv->connect_cancellable);\n"
" g_error_free (error);\n"
" }\n"
"\n"
" g_free (address);\n"
" g_clear_object (&inet_address);\n"
" g_clear_object (&inet_socket_address);\n"
" g_clear_object (&socket_client);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GSocketClient *socket_client; /* unowned */\n"
" GSocketConnection *connection = NULL; /* owned */\n"
" GInputStream *input_stream; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" socket_client = G_SOCKET_CLIENT (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení připojování k soketu */\n"
" connection = g_socket_client_connect_finish (socket_client, result,\n"
" &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Uchování odkazu na připojení, takže je udržované otevřené po dobu co z něj\n"
" * čteme: #GInputStream neudržuje odkaz na #GIOStream, který jej obsahuje */\n"
" priv->connection = g_object_ref (connection);\n"
"\n"
" /* Čtení zprávy z připojení. Používá jedinou vyrovnávací paměť uchovanou v\n"
" * #MyObject, což znamená, že v danou chvíli může běžet jen jediná operace\n"
" * connect_to_server(). Pokud je to problém , může být vyrovnávací paměť\n"
" * místo toho alokována dynamicky. */\n"
" input_stream = g_io_stream_get_input_stream (G_IO_STREAM (connection));\n"
"\n"
" g_input_stream_read_async (input_stream,\n"
" priv->message_buffer,\n"
" sizeof (priv->message_buffer),\n"
" G_PRIORITY_DEFAULT, priv->connect_cancellable,\n"
" connect_to_server_cb3, self);\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Zastavení operace */\n"
" if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Failed to connect to server: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_object (&priv->connect_cancellable);\n"
" g_clear_object (&priv->connection);\n"
" g_error_free (error);\n"
" }\n"
"\n"
" g_clear_object (&connection);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GInputStream *input_stream; /* unowned */\n"
" gssize len = 0;\n"
" GError *error = NULL;\n"
"\n"
" input_stream = G_INPUT_STREAM (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení čtení ze soketu */\n"
" len = g_input_stream_read_finish (input_stream, result, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Obsluha zprávy */\n"
" g_assert_cmpint (len, >=, 0);\n"
" g_assert_cmpuint ((gsize) len, <=, sizeof (priv->message_buffer));\n"
"\n"
" handle_received_message (self, priv->message_buffer, len, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
"done:\n"
" /* Nepodmíněné označení operace za dokončenou.\n"
" *\n"
" * Proud dat by se měl automaticky zavřít, protože\n"
" * je zahozen poslední odkaz. */\n"
" g_clear_object (&priv->connect_cancellable);\n"
" g_clear_object (&priv->connection);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" /* Varování o chybě */\n"
" if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Failed to read from the server: %s\", error->message);\n"
" }\n"
"\n"
" g_error_free (error);\n"
" }\n"
"}\n"
"\n"
"static void\n"
"my_object_dispose (GObject *obj)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (obj));\n"
"\n"
" /* Zrušení případných probíhajících operací mazání.\n"
" *\n"
" * Tím se zajistí, že když je #MyObject částečně uvolněn přes\n"
" * sadu operací delete_files(), sada obdrží zrušení a nepokračuje\n"
" * s neplatným ukazatelem na #MyObject. */\n"
" g_cancellable_cancel (priv->connect_cancellable);\n"
"\n"
" /* Zde proveďte případná další uvolnění */\n"
" …\n"
"\n"
" /* Zřetězení */\n"
" G_OBJECT_CLASS (my_object_parent_class)->dispose (obj);\n"
"}"
#. (itstool) path: section/title
#: C/async-programming.page:697
msgid "Operations in Parallel"
msgstr "Operace prováděné paralelně"
#. (itstool) path: section/p
#: C/async-programming.page:699
msgid ""
"Another common situation is to run multiple asynchronous operations in "
"parallel, considering the overall operation complete when all its "
"constituents are complete."
msgstr ""
"Jinou běžnou situací je spustit více asynchronních operací souběžně s "
"předpokladem, že celková operace bude dokončena, jakmile všechny její "
"součásti doběhnou."
#. (itstool) path: example/p
#: C/async-programming.page:706
msgid "In this example, the application deletes multiple files in parallel."
msgstr "V tomto příkladu aplikace maže souběžně několik souborů."
#. (itstool) path: item/p
#: C/async-programming.page:714
msgid ""
"The number of pending asynchronous operations (ones which have started but "
"not yet finished) is tracked as <code>n_deletions_pending</code>. The "
"<code>delete_files_cb()</code> callback only considers the entire operation "
"complete once this reaches zero."
msgstr ""
"Počet čekajících asynchronních operací (tj. těch, které byly spuštěny a "
"ještě nedoběhly) je sledován v <code>n_deletions_pending</code>. Zpětné "
"volání <code>delete_files_cb()</code> bere celkovou operaci za dokončenou, "
"až když tato hodnota dosáhne nuly."
#. (itstool) path: item/p
#: C/async-programming.page:721
msgid ""
"<code>n_deletions_to_start</code> tracks deletion operations being started, "
"in case <link href=\"https://developer.gnome.org/gio/stable/GFile.html#g-"
"file-delete-async\"><code>g_file_delete_async()</code></link> manages to use "
"a fast path and complete synchronously (without blocking)."
msgstr ""
"<code>n_deletions_to_start</code> sleduje spouštění operací mazání, v "
"případě <link href=\"https://developer.gnome.org/gio/stable/GFile.html#g-"
"file-delete-async\"><code>g_file_delete_async()</code></link> spravuje "
"použití rychlé cesty a dokončení synchronně (bez blokování)."
#. (itstool) path: item/p
#: C/async-programming.page:728
msgid ""
"As in <link xref=\"#single-call\"/>, all pending deletions are cancelled if "
"the owning <code>MyObject</code> instance is disposed, to prevent callbacks "
"being called later with an invalid <code>MyObject</code> pointer."
msgstr ""
"Stejně jako v <link xref=\"#single-call\"/>, jsou všechna čekající mazání "
"zrušena v situaci, kdy je vlastnící instance <code>MyObject</code> uvolněna, "
"aby se zabránilo pozdějšímu zavolání zpětného volání s neplatným ukazatelem "
"<code>MyObject</code>."
#. (itstool) path: example/code
#: C/async-programming.page:736
#, no-wrap
msgid ""
"\n"
"static void\n"
"delete_files_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"static void\n"
"delete_files (MyObject *self,\n"
" GPtrArray/*<owned GFile*>>*/ *files)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *address_file = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Set up a cancellable if no operation is ongoing already. */\n"
" if (priv->delete_cancellable == NULL)\n"
" {\n"
" priv->delete_cancellable = g_cancellable_new ();\n"
" priv->n_deletions_pending = 0;\n"
" priv->n_deletions_total = 0;\n"
" }\n"
"\n"
" /* Update internal state, and temporarily set @n_deletions_to_start. This is\n"
" * used in delete_files_cb() to avoid indicating the overall operation has\n"
" * completed while deletions are still being started. This can happen if\n"
" * g_file_delete_async() completes synchronously, for example if there’s a\n"
" * non-blocking fast path for the given file system. */\n"
" priv->n_deletions_pending += files->len;\n"
" priv->n_deletions_total += files->len;\n"
" priv->n_deletions_to_start = files->len;\n"
"\n"
" /* Update the UI to indicate the files are being deleted. */\n"
" update_ui_to_show_progress (self,\n"
" priv->n_deletions_pending,\n"
" priv->n_deletions_total);\n"
"\n"
" /* Start all the deletion operations in parallel. They share the same\n"
" * #GCancellable. */\n"
" for (i = 0; i < files->len; i++)\n"
" {\n"
" GFile *file = files->pdata[i];\n"
"\n"
" priv->n_deletions_to_start--;\n"
" g_file_delete_async (file, G_PRIORITY_DEFAULT, priv->delete_cancellable,\n"
" delete_files_cb, self);\n"
" }\n"
"}\n"
"\n"
"static void\n"
"delete_files_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GFile *file; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" file = G_FILE (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish deleting the file. */\n"
" g_file_delete_finish (file, result, &error);\n"
"\n"
" if (error != NULL &&\n"
" !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Error deleting file: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_error (&error);\n"
"\n"
" /* Update the internal state. */\n"
" g_assert_cmpuint (priv->n_deletions_pending, >, 0);\n"
" priv->n_deletions_pending--;\n"
"\n"
" /* Update the UI to show progress. */\n"
" update_ui_to_show_progress (self,\n"
" priv->n_deletions_pending,\n"
" priv->n_deletions_total);\n"
"\n"
" /* If all deletions have completed, and no more are being started,\n"
" * update the UI to show completion. */\n"
" if (priv->n_deletions_pending == 0 && priv->n_deletions_to_start == 0)\n"
" {\n"
" update_ui_to_show_completion (self);\n"
"\n"
" /* Clear the operation state. */\n"
" g_clear_object (&priv->delete_cancellable);\n"
" priv->n_deletions_total = 0;\n"
" }\n"
"}\n"
"\n"
"static void\n"
"my_object_dispose (GObject *obj)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (obj));\n"
"\n"
" /* Cancel any ongoing deletion operations.\n"
" *\n"
" * This ensures that if #MyObject is disposed part-way through the\n"
" * delete_files() set of operations, the set gets cancelled and\n"
" * doesn’t continue with an invalid #MyObject pointer. */\n"
" g_cancellable_cancel (priv->delete_cancellable);\n"
"\n"
" /* Do other dispose calls here. */\n"
" …\n"
"\n"
" /* Chain up. */\n"
" G_OBJECT_CLASS (my_object_parent_class)->dispose (obj);\n"
"}"
msgstr ""
"\n"
"static void\n"
"delete_files_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"static void\n"
"delete_files (MyObject *self,\n"
" GPtrArray/*<owned GFile*>>*/ *files)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GFile *address_file = NULL; /* owned */\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Nastavení jako zrušitelné, pokud již neběží žádná operace */\n"
" if (priv->delete_cancellable == NULL)\n"
" {\n"
" priv->delete_cancellable = g_cancellable_new ();\n"
" priv->n_deletions_pending = 0;\n"
" priv->n_deletions_total = 0;\n"
" }\n"
"\n"
" /* Aktualizace interního stavu a dočasné nastavení @n_deletions_to_start.\n"
" * To se používá v delete_files_cb(), aby se předešlo oznámení, že je celá\n"
" * operace dokončená, zatím co ona stále běží. To by se mohlo stát, když\n"
" * g_file_delete_async() doběhne synchronně, například, když existuje\n"
" * neblokující rychlá cesta pro zadaný souborový systém. */\n"
" priv->n_deletions_pending += files->len;\n"
" priv->n_deletions_total += files->len;\n"
" priv->n_deletions_to_start = files->len;\n"
"\n"
" /* Aktulazice uživatelského rozhraní, aby dalo najevo, že je soubor mazán */\n"
" update_ui_to_show_progress (self,\n"
" priv->n_deletions_pending,\n"
" priv->n_deletions_total);\n"
"\n"
" /* Začne souběžně všechny operace mazání. Sdílejí stejný #GCancellable. */\n"
" for (i = 0; i < files->len; i++)\n"
" {\n"
" GFile *file = files->pdata[i];\n"
"\n"
" priv->n_deletions_to_start--;\n"
" g_file_delete_async (file, G_PRIORITY_DEFAULT, priv->delete_cancellable,\n"
" delete_files_cb, self);\n"
" }\n"
"}\n"
"\n"
"static void\n"
"delete_files_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GFile *file; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" file = G_FILE (source_object);\n"
" self = MY_OBJECT (user_data);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení mazání souboru */\n"
" g_file_delete_finish (file, result, &error);\n"
"\n"
" if (error != NULL &&\n"
" !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))\n"
" {\n"
" g_warning (\"Error deleting file: %s\", error->message);\n"
" }\n"
"\n"
" g_clear_error (&error);\n"
"\n"
" /* Aktualizace interního stavu */\n"
" g_assert_cmpuint (priv->n_deletions_pending, >, 0);\n"
" priv->n_deletions_pending--;\n"
"\n"
" /* Aktualizace uživatelského rozhraní, aby ukazovalo průběh */\n"
" update_ui_to_show_progress (self,\n"
" priv->n_deletions_pending,\n"
" priv->n_deletions_total);\n"
"\n"
" /* Jestliže je všechno mazání dokončeno a žádné další nezačíná, aktualizuje se,\n"
" * uživatelské rozhraní, aby ukazovalo, že je vše dokončeno. */\n"
" if (priv->n_deletions_pending == 0 && priv->n_deletions_to_start == 0)\n"
" {\n"
" update_ui_to_show_completion (self);\n"
"\n"
" /* Vyčištění stavu operace */\n"
" g_clear_object (&priv->delete_cancellable);\n"
" priv->n_deletions_total = 0;\n"
" }\n"
"}\n"
"\n"
"static void\n"
"my_object_dispose (GObject *obj)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" priv = my_object_get_instance_private (MY_OBJECT (obj));\n"
"\n"
" /* Zrušení případných probíhajících operací mazání.\n"
" *\n"
" * Tím se zajistí, že když je #MyObject částečně uvolněn přes\n"
" * sadu operací delete_files(), sada obdrží zrušení a nepokračuje\n"
" * s neplatným ukazatelem na #MyObject. */\n"
" g_cancellable_cancel (priv->delete_cancellable);\n"
"\n"
" /* Zde proveďte případná další uvolnění */\n"
" …\n"
"\n"
" /* Zřetězení */\n"
" G_OBJECT_CLASS (my_object_parent_class)->dispose (obj);\n"
"}"
#. (itstool) path: section/title
#: C/async-programming.page:855
msgid "Wrapping with <code>GTask</code>"
msgstr "Obalení pomocí <code>GTask</code>"
#. (itstool) path: section/p
#: C/async-programming.page:857
msgid ""
"Often when an asynchronous operation (or set of operations) becomes more "
"complex, it needs associated state. This is typically stored in a custom "
"structure — but defining a new structure to store the standard callback, "
"user data and cancellable tuple is laborious. <link href=\"https://developer."
"gnome.org/gio/stable/GTask.html\"><code>GTask</code></link> eases this by "
"providing a standardized way to wrap all three, plus extra custom ‘task "
"data’."
msgstr ""
"Asynchronní operace (nebo sady operací) často, když se stanou více "
"komplexními, potřebují přiřazený stav. Ten bývá typicky uchován ve vlastní "
"struktuře, ale definování nové struktury pro uchování standardního zpětného "
"volání, uživatelských dat a n-tice zrušitelných je pracné. <link href="
"\"https://developer.gnome.org/gio/stable/GTask.html\"><code>GTask</code></"
"link> to zjednodušuje poskytnutím standardního způsobu obalení všech tří "
"věcí, plus navíc vlastními „daty úlohy“."
#. (itstool) path: section/p
#: C/async-programming.page:867
msgid ""
"The use of a <code>GTask</code> can replace the use of a <link href="
"\"https://developer.gnome.org/gio/stable/GCancellable.html"
"\"><code>GCancellable</code></link> for indicating whether an operation is "
"ongoing."
msgstr ""
"Použití <code>GTask</code> může nahradit použití <link href=\"https://"
"developer.gnome.org/gio/stable/GCancellable.html\"><code>GCancellable</"
"code></link> pro indikaci, jestli běží nějaká operace."
#. (itstool) path: example/p
#: C/async-programming.page:874
msgid ""
"This example is functionally the same as <link xref=\"#series\"/>, but "
"refactored to use a <code>GTask</code> to wrap the sequence of operations."
msgstr ""
"Tento příklad se z hlediska funkcionality shoduje s <link xref=\"#series\"/"
">, ale je přepracován tak, aby používal <code>GTask</code> k obalení "
"posloupnosti operací."
#. (itstool) path: item/p
#: C/async-programming.page:884
msgid ""
"State which was in <code>MyObjectPrivate</code> in <link xref=\"#series\"/> "
"is now in the <code>ConnectToServerData</code> closure, which is set as the "
"‘task data’ of the <code>GTask</code> representing the overall operation. "
"This means it’s automatically freed after the operation returns."
msgstr ""
"Stav, který byl v <link xref=\"#series\"/> v <code>MyObjectPrivate</code>, je "
"nyní uzavřen v <code>ConnectToServerData</code>, který je nastaven jako "
"„daty úlohy“ objektu <code>GTask</code> představujícího celkovou operaci. To "
"znamená, že je automaticky uvolněn po návratu z operace."
#. (itstool) path: item/p
#: C/async-programming.page:891
msgid ""
"Furthermore, this means that manipulations of <code>MyObjectPrivate</code> "
"state are limited to the start and end of the sequence of operations, so "
"reusing the task in different situations becomes easier — for example, it is "
"now a lot easier to support running multiple such tasks in parallel."
msgstr ""
"Navíc to znamená, že zacházení se stavem <code>MyObjectPrivate</code> je "
"omezeno na začátek a konec posloupnosti operací, takže znovupoužití úlohy v "
"jiné situaci se stává snazší. Například je nyní mnohem snazší podporovat běh "
"více takovýchto úloh souběžně."
#. (itstool) path: item/p
#: C/async-programming.page:898
msgid ""
"As the <code>GTask</code> holds a reference to <code>MyObject</code>, it is "
"impossible for the object to be disposed while the sequence of operations is "
"ongoing, so the <code>my_object_dispose()</code> code has been removed. "
"Instead, a <code>my_object_close()</code> method exists to allow any pending "
"operations can be cancelled so <code>MyObject</code> can be disposed when "
"desired."
msgstr ""
"Protože <code>GTask</code> udržuje odkaz na <code>MyObject</code>, není "
"objekt možné uvolnit, když probíhá posloupnost operací. Proto byl kód "
"<code>my_object_dispose()</code> odstraněn. Místo něj je teď metoda "
"<code>my_object_close()</code>, která umožňuje zrušení případných čekajících "
"operací, takže <code>MyObject</code> může být v případě potřeby uvolněn."
#. (itstool) path: example/code
#: C/async-programming.page:909
#, no-wrap
msgid ""
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"typedef struct {\n"
" GSocketConnection *connection; /* nullable; owned */\n"
" guint8 message_buffer[128];\n"
"} ConnectToServerData;\n"
"\n"
"static void\n"
"connect_to_server_data_free (ConnectToServerData *data)\n"
"{\n"
" g_clear_object (&data->connection);\n"
"}\n"
"\n"
"void\n"
"my_object_connect_to_server_async (MyObject *self,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" ConnectToServerData *data = NULL; /* owned */\n"
" GFile *address_file = NULL; /* owned */\n"
"\n"
" g_return_if_fail (MY_IS_OBJECT (self));\n"
" g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" if (priv->connect_task != NULL)\n"
" {\n"
" g_task_report_new_error (self, callback, user_data, NULL,\n"
" G_IO_ERROR, G_IO_ERROR_PENDING,\n"
" \"Already connecting to the server.\");\n"
" return;\n"
" }\n"
"\n"
" /* Set up a cancellable. */\n"
" if (cancellable != NULL)\n"
" {\n"
" g_object_ref (cancellable);\n"
" }\n"
" else\n"
" {\n"
" cancellable = g_cancellable_new ();\n"
" }\n"
"\n"
" /* Set up the task. */\n"
" task = g_task_new (self, cancellable, callback, user_data);\n"
" g_task_set_check_cancellable (task, FALSE);\n"
"\n"
" data = g_malloc0 (sizeof (ConnectToServerData));\n"
" g_task_set_task_data (task, data,\n"
" (GDestroyNotify) connect_to_server_data_free);\n"
"\n"
" g_object_unref (cancellable);\n"
"\n"
" priv->connect_task = g_object_ref (task);\n"
"\n"
" /* Read the socket address. */\n"
" address_file = build_address_file ();\n"
" g_file_load_contents_async (address_file, g_task_get_cancellable (task),\n"
" connect_to_server_cb1, g_object_ref (task));\n"
" g_object_unref (address_file);\n"
"\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" GFile *address_file; /* unowned */\n"
" gchar *address = NULL; /* owned */\n"
" gsize address_size = 0;\n"
" GInetAddress *inet_address = NULL; /* owned */\n"
" GInetSocketAddress *inet_socket_address = NULL; /* owned */\n"
" guint16 port = 123;\n"
" GSocketClient *socket_client = NULL; /* owned */\n"
" GError *error = NULL;\n"
"\n"
" address_file = G_FILE (source_object);\n"
" task = G_TASK (user_data);\n"
" self = g_task_get_source_object (task);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish loading the address. */\n"
" g_file_load_contents_finish (address_file, result, &address,\n"
" &address_size, NULL, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Parse the address. */\n"
" inet_address = g_inet_address_new_from_string (address);\n"
"\n"
" if (inet_address == NULL)\n"
" {\n"
" /* Error. */\n"
" g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,\n"
" \"Invalid address ‘%s’.\", address);\n"
" goto done;\n"
" }\n"
"\n"
" inet_socket_address = g_inet_socket_address_new (inet_address, port);\n"
"\n"
" /* Connect to the given address. */\n"
" socket_client = g_socket_client_new ();\n"
"\n"
" g_socket_client_connect_async (socket_client,\n"
" G_SOCKET_CONNECTABLE (inet_socket_address),\n"
" g_task_get_cancellable (task),\n"
" connect_to_server_cb2,\n"
" g_object_ref (task));\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Stop the operation and propagate the error. */\n"
" g_clear_object (&priv->connect_task);\n"
" g_task_return_error (task, error);\n"
" }\n"
"\n"
" g_free (address);\n"
" g_clear_object (&inet_address);\n"
" g_clear_object (&inet_socket_address);\n"
" g_clear_object (&socket_client);\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" ConnectToServerData *data; /* unowned */\n"
" GSocketClient *socket_client; /* unowned */\n"
" GSocketConnection *connection = NULL; /* owned */\n"
" GInputStream *input_stream; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" socket_client = G_SOCKET_CLIENT (source_object);\n"
" task = G_TASK (user_data);\n"
" data = g_task_get_task_data (task);\n"
" self = g_task_get_source_object (task);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish connecting to the socket. */\n"
" connection = g_socket_client_connect_finish (socket_client, result,\n"
" &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Store a reference to the connection so it is kept open while we read from\n"
" * it: #GInputStream does not keep a reference to a #GIOStream which contains\n"
" * it. */\n"
" data->connection = g_object_ref (connection);\n"
"\n"
" /* Read a message from the connection. As the buffer is allocated as part of\n"
" * the per-task @data, multiple tasks can run concurrently. */\n"
" input_stream = g_io_stream_get_input_stream (G_IO_STREAM (connection));\n"
"\n"
" g_input_stream_read_async (input_stream,\n"
" data->message_buffer,\n"
" sizeof (data->message_buffer),\n"
" G_PRIORITY_DEFAULT, g_task_get_cancellable (task),\n"
" connect_to_server_cb3, g_object_ref (task));\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Stop the operation and propagate the error. */\n"
" g_clear_object (&priv->connect_task);\n"
" g_task_return_error (task, error);\n"
" }\n"
"\n"
" g_clear_object (&connection);\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" ConnectToServerData *data; /* unowned */\n"
" GInputStream *input_stream; /* unowned */\n"
" gssize len = 0;\n"
" GError *error = NULL;\n"
"\n"
" input_stream = G_INPUT_STREAM (source_object);\n"
" task = G_TASK (user_data);\n"
" data = g_task_get_task_data (task);\n"
" self = g_task_get_source_object (task);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Finish reading from the socket. */\n"
" len = g_input_stream_read_finish (input_stream, result, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Handle the message. */\n"
" g_assert_cmpint (len, >=, 0);\n"
" g_assert_cmpuint ((gsize) len, <=, sizeof (data->message_buffer));\n"
"\n"
" handle_received_message (self, data->message_buffer, len, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Success! */\n"
" g_task_return_boolean (task, TRUE);\n"
"\n"
"done:\n"
" /* Unconditionally mark the operation as finished.\n"
" *\n"
" * The streams should automatically close as this\n"
" * last reference is dropped. */\n"
" g_clear_object (&priv->connect_task);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" /* Stop the operation and propagate the error. */\n"
" g_task_return_error (task, error);\n"
" }\n"
"\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"void\n"
"my_object_connect_to_server_finish (MyObject *self,\n"
" GAsyncResult *result,\n"
" GError **error)\n"
"{\n"
" g_return_if_fail (MY_IS_OBJECT (self));\n"
" g_return_if_fail (g_task_is_valid (result, self));\n"
" g_return_if_fail (error == NULL || *error == NULL);\n"
"\n"
" g_task_propagate_boolean (G_TASK (result), error);\n"
"}\n"
"\n"
"void\n"
"my_object_close (MyObject *self)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" g_return_if_fail (MY_IS_OBJECT (self));\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" if (priv->connect_task != NULL)\n"
" {\n"
" GCancellable *cancellable = g_task_get_cancellable (priv->connect_task);\n"
" g_cancellable_cancel (cancellable);\n"
" }\n"
"}"
msgstr ""
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data);\n"
"\n"
"typedef struct {\n"
" GSocketConnection *connection; /* nullable; owned */\n"
" guint8 message_buffer[128];\n"
"} ConnectToServerData;\n"
"\n"
"static void\n"
"connect_to_server_data_free (ConnectToServerData *data)\n"
"{\n"
" g_clear_object (&data->connection);\n"
"}\n"
"\n"
"void\n"
"my_object_connect_to_server_async (MyObject *self,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" ConnectToServerData *data = NULL; /* owned */\n"
" GFile *address_file = NULL; /* owned */\n"
"\n"
" g_return_if_fail (MY_IS_OBJECT (self));\n"
" g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" if (priv->connect_task != NULL)\n"
" {\n"
" g_task_report_new_error (self, callback, user_data, NULL,\n"
" G_IO_ERROR, G_IO_ERROR_PENDING,\n"
" \"Already connecting to the server.\");\n"
" return;\n"
" }\n"
"\n"
" /* Nastavení, že je zrušitelné */\n"
" if (cancellable != NULL)\n"
" {\n"
" g_object_ref (cancellable);\n"
" }\n"
" else\n"
" {\n"
" cancellable = g_cancellable_new ();\n"
" }\n"
"\n"
" /* Nastavení úlohy */\n"
" task = g_task_new (self, cancellable, callback, user_data);\n"
" g_task_set_check_cancellable (task, FALSE);\n"
"\n"
" data = g_malloc0 (sizeof (ConnectToServerData));\n"
" g_task_set_task_data (task, data,\n"
" (GDestroyNotify) connect_to_server_data_free);\n"
"\n"
" g_object_unref (cancellable);\n"
"\n"
" priv->connect_task = g_object_ref (task);\n"
"\n"
" /* Čtení adresy soketu */\n"
" address_file = build_address_file ();\n"
" g_file_load_contents_async (address_file, g_task_get_cancellable (task),\n"
" connect_to_server_cb1, g_object_ref (task));\n"
" g_object_unref (address_file);\n"
"\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb1 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" GFile *address_file; /* unowned */\n"
" gchar *address = NULL; /* owned */\n"
" gsize address_size = 0;\n"
" GInetAddress *inet_address = NULL; /* owned */\n"
" GInetSocketAddress *inet_socket_address = NULL; /* owned */\n"
" guint16 port = 123;\n"
" GSocketClient *socket_client = NULL; /* owned */\n"
" GError *error = NULL;\n"
"\n"
" address_file = G_FILE (source_object);\n"
" task = G_TASK (user_data);\n"
" self = g_task_get_source_object (task);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení načtení adresy */\n"
" g_file_load_contents_finish (address_file, result, &address,\n"
" &address_size, NULL, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Zpracování adresy */\n"
" inet_address = g_inet_address_new_from_string (address);\n"
"\n"
" if (inet_address == NULL)\n"
" {\n"
" /* Chyba */\n"
" g_set_error (&error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,\n"
" \"Invalid address ‘%s’.\", address);\n"
" goto done;\n"
" }\n"
"\n"
" inet_socket_address = g_inet_socket_address_new (inet_address, port);\n"
"\n"
" /* Připojení k zadané adrese */\n"
" socket_client = g_socket_client_new ();\n"
"\n"
" g_socket_client_connect_async (socket_client,\n"
" G_SOCKET_CONNECTABLE (inet_socket_address),\n"
" g_task_get_cancellable (task),\n"
" connect_to_server_cb2,\n"
" g_object_ref (task));\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Zastavení operace a propagace chyby */\n"
" g_clear_object (&priv->connect_task);\n"
" g_task_return_error (task, error);\n"
" }\n"
"\n"
" g_free (address);\n"
" g_clear_object (&inet_address);\n"
" g_clear_object (&inet_socket_address);\n"
" g_clear_object (&socket_client);\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb2 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" ConnectToServerData *data; /* unowned */\n"
" GSocketClient *socket_client; /* unowned */\n"
" GSocketConnection *connection = NULL; /* owned */\n"
" GInputStream *input_stream; /* unowned */\n"
" GError *error = NULL;\n"
"\n"
" socket_client = G_SOCKET_CLIENT (source_object);\n"
" task = G_TASK (user_data);\n"
" data = g_task_get_task_data (task);\n"
" self = g_task_get_source_object (task);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení připojení k soketu */\n"
" connection = g_socket_client_connect_finish (socket_client, result,\n"
" &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Uchování odkazu na připojení, takže je udržované otevřené po dobu co z něj\n"
" * čteme: #GInputStream neudržuje odkaz na #GIOStream, který jej obsahuje */\n"
" data->connection = g_object_ref (connection);\n"
"\n"
" /* Čtení zprávy z připojení. Protože je vyrovnávací paměť alokovaná jako\n"
" * součást @data pro jednotlivé úlohy, může běžet víc úloh naráz. */\n"
" input_stream = g_io_stream_get_input_stream (G_IO_STREAM (connection));\n"
"\n"
" g_input_stream_read_async (input_stream,\n"
" data->message_buffer,\n"
" sizeof (data->message_buffer),\n"
" G_PRIORITY_DEFAULT, g_task_get_cancellable (task),\n"
" connect_to_server_cb3, g_object_ref (task));\n"
"\n"
"done:\n"
" if (error != NULL)\n"
" {\n"
" /* Zastavení operace a propagace chyby */\n"
" g_clear_object (&priv->connect_task);\n"
" g_task_return_error (task, error);\n"
" }\n"
"\n"
" g_clear_object (&connection);\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"static void\n"
"connect_to_server_cb3 (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" MyObject *self;\n"
" MyObjectPrivate *priv;\n"
" GTask *task = NULL; /* owned */\n"
" ConnectToServerData *data; /* unowned */\n"
" GInputStream *input_stream; /* unowned */\n"
" gssize len = 0;\n"
" GError *error = NULL;\n"
"\n"
" input_stream = G_INPUT_STREAM (source_object);\n"
" task = G_TASK (user_data);\n"
" data = g_task_get_task_data (task);\n"
" self = g_task_get_source_object (task);\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" /* Dokončení čtení ze soketu */\n"
" len = g_input_stream_read_finish (input_stream, result, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Obsluha zprávy */\n"
" g_assert_cmpint (len, >=, 0);\n"
" g_assert_cmpuint ((gsize) len, <=, sizeof (data->message_buffer));\n"
"\n"
" handle_received_message (self, data->message_buffer, len, &error);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" /* Úspěch! */\n"
" g_task_return_boolean (task, TRUE);\n"
"\n"
"done:\n"
" /* Nepodmíněné označení operace za dokončenou.\n"
" *\n"
" * Proud dat by se měl automaticky zavřít, protože\n"
" * je zahozen poslední odkaz. */\n"
" g_clear_object (&priv->connect_task);\n"
"\n"
" if (error != NULL)\n"
" {\n"
" /* Zastavení operace a propagace chyby */\n"
" g_task_return_error (task, error);\n"
" }\n"
"\n"
" g_clear_object (&task);\n"
"}\n"
"\n"
"void\n"
"my_object_connect_to_server_finish (MyObject *self,\n"
" GAsyncResult *result,\n"
" GError **error)\n"
"{\n"
" g_return_if_fail (MY_IS_OBJECT (self));\n"
" g_return_if_fail (g_task_is_valid (result, self));\n"
" g_return_if_fail (error == NULL || *error == NULL);\n"
"\n"
" g_task_propagate_boolean (G_TASK (result), error);\n"
"}\n"
"\n"
"void\n"
"my_object_close (MyObject *self)\n"
"{\n"
" MyObjectPrivate *priv;\n"
"\n"
" g_return_if_fail (MY_IS_OBJECT (self));\n"
"\n"
" priv = my_object_get_instance_private (self);\n"
"\n"
" if (priv->connect_task != NULL)\n"
" {\n"
" GCancellable *cancellable = g_task_get_cancellable (priv->connect_task);\n"
" g_cancellable_cancel (cancellable);\n"
" }\n"
"}"
#. (itstool) path: credit/name
#: C/c-coding-style.page:15 C/documentation.page:21
msgid "The GTK+ Team"
msgstr "Tým GTK+"
#. (itstool) path: info/desc
#: C/c-coding-style.page:20
msgid "Our guidelines for C code in GNOME"
msgstr "Naše pokyny pro psaní kódu v jazyce C pro GNOME"
#. (itstool) path: page/title
#: C/c-coding-style.page:23
msgid "C Coding Style"
msgstr "Styl psaní kódu v C"
#. (itstool) path: page/p
#: C/c-coding-style.page:25
msgid ""
"This document presents the preferred coding style for C programs in GNOME. "
"While coding style is very much a matter of taste, in GNOME we favor a "
"coding style that promotes consistency, readability, and maintainability."
msgstr ""
"Dokument ukazuje preferovaný styl psaní kódu pro programy v jazyce C v "
"GNOME. Ačkoliv je styl psaní kódu hodně záležitostí osobního vkusu, v GNOME "
"dáváme přednost stylu, který poskytne jednotnost, čitelnost a půjde dobře "
"spravovat."
#. (itstool) path: page/p
#: C/c-coding-style.page:32
msgid ""
"We present examples of good coding style as well as examples of bad style "
"that is not acceptable in GNOME. Please try to submit patches that conform "
"to GNOME’s coding style; this indicates that you have done your homework to "
"respect the project’s goal of long-term maintainability. Patches with "
"GNOME’s coding style will also be easier to review!"
msgstr ""
"Ukážeme si příklady správného stylu kódu i příklady špatného stylu, který je "
"v GNOME nepřijatelný. Snažte se prosím své příspěvky zasílat ve stylu, který "
"GNOME vyhovuje. Dáte tím najevo, že jste svoji práci odvedli s úctou k cílům "
"projektu, k nimž patří udržitelnost kódu. Takovéto příspěvky se také mnohem "
"lépe kontrolují."
#. (itstool) path: note/p
#: C/c-coding-style.page:42
msgid ""
"This document is for C code. For other languages, check the <link xref="
"\"index\">main page</link> of the GNOME Programming Guidelines."
msgstr ""
"Tento dokument se týká kódu v jazyce C. Na další jazyky se podívejte na "
"<link xref=\"index\">hlavní stránku</link> pokynů k programování v GNOME."
#. (itstool) path: page/p
#: C/c-coding-style.page:49
msgid ""
"These guidelines are heavily inspired by GTK’s CODING-STYLE document, the "
"Linux Kernel’s CodingStyle, and the GNU Coding Standards. These are slight "
"variations of each other, with particular modifications for each project’s "
"particular needs and culture, and GNOME’s version is no different."
msgstr ""
"Tato příručka je významně inspirována dokumenty GTK’s CODING-STYLE, Linux "
"Kernel’s CodingStyle a GNU Coding Standards. Ty se od sebe navzájem lehce "
"odlišují konkrétními úpravami pro konkrétní potřeby projektu a jeho kulturu, "
"a verze pro GNOME v tom není výjimkou."
#. (itstool) path: section/title
#: C/c-coding-style.page:58
msgid "The Single Most Important Rule"
msgstr "Jednoduché nejdůležitější pravidlo"
#. (itstool) path: section/p
#: C/c-coding-style.page:60
msgid ""
"The single most important rule when writing code is this: <em>check the "
"surrounding code and try to imitate it</em>."
msgstr ""
"Prosté a přitom nejdůležitější pravidlo při psaní kódu je: <em>podívejte se "
"na kód okolo a snažte se jej napodobit</em>."
#. (itstool) path: section/p
#: C/c-coding-style.page:65
msgid ""
"As a maintainer it is dismaying to receive a patch that is obviously in a "
"different coding style to the surrounding code. This is disrespectful, like "
"someone tromping into a spotlessly-clean house with muddy shoes."
msgstr ""
"Správce bývá zděšen, když obdrží záplatu, která se vyloženě liší stylem "
"kódování od okolního kódu. Je to bezohledné, jako když někdo vstoupí do "
"uklizeného domu se zablácenými botami."
#. (itstool) path: section/p
#: C/c-coding-style.page:72
msgid ""
"So, whatever this document recommends, if there is already written code and "
"you are patching it, keep its current style consistent even if it is not "
"your favorite style."
msgstr ""
"Takže to, co tento dokument doporučuje, je, abyste při psaní záplaty pro již "
"existující kód, zachovali jeho stávající styl jednotný, i přesto že to není "
"zrovna váš oblíbený."
#. (itstool) path: section/title
#: C/c-coding-style.page:80
msgid "Line Width"
msgstr "Šířka řádku"
#. (itstool) path: section/p
#: C/c-coding-style.page:82
msgid ""
"Try to use lines of code between 80 and 120 characters long. This amount of "
"text is easy to fit in most monitors with a decent font size. Lines longer "
"than that become hard to read, and they mean that you should probably "
"restructure your code. If you have too many levels of indentation, it means "
"that you should fix your code anyway."
msgstr ""
"Snažte se délku řádků v kódu udržet v rozmezí 80 až 120 znaků. Takové "
"množství textu se vleze na většinu monitorů při použití slušné velikosti "
"písma. Delší řádky může být obtížné číst a znamenají, že byste se měli "
"zamyslet nad restrukturalizací svého kódu. Pokud mát příliš mnoho úrovní "
"odsazení, rovněž to znamená, že byste měli svůj kód opravit."
#. (itstool) path: section/title
#: C/c-coding-style.page:93
msgid "Indentation"
msgstr "Odsazení"
#. (itstool) path: section/p
#: C/c-coding-style.page:95
msgid ""
"In general there are two preferred indentation styles for code in GNOME."
msgstr "Obecně je v kódu GNOME dávána přednost dvěma stylům odsazení."
#. (itstool) path: item/p
#: C/c-coding-style.page:102
msgid ""
"Linux Kernel style. Tabs with a length of 8 characters are used for the "
"indentation, with K&R brace placement:"
msgstr ""
"Styl linuxového jádra. K odsazení se používají tabulátory o šířce 8 znaků a "
"složené závorky se umisťují neodsazené (tento styl bývá označován zkratkou "
"K&R podle autorů Kernighan a Ritchie kultovní knihy The C Programming "
"Language):"
#. (itstool) path: item/code
#: C/c-coding-style.page:107
#, no-wrap
msgid ""
"\n"
"for (i = 0; i < num_elements; i++) {\n"
"\tfoo[i] = foo[i] + 42;\n"
"\n"
"\tif (foo[i] < 35) {\n"
"\t\tprintf (\"Foo!\");\n"
"\t\tfoo[i]--;\n"
"\t} else {\n"
"\t\tprintf (\"Bar!\");\n"
"\t\tfoo[i]++;\n"
"\t}\n"
"}"
msgstr ""
"\n"
"for (i = 0; i < num_elements; i++) {\n"
"\tfoo[i] = foo[i] + 42;\n"
"\n"
"\tif (foo[i] < 35) {\n"
"\t\tprintf (\"Foo!\");\n"
"\t\tfoo[i]--;\n"
"\t} else {\n"
"\t\tprintf (\"Bar!\");\n"
"\t\tfoo[i]++;\n"
"\t}\n"
"}"
#. (itstool) path: item/p
#: C/c-coding-style.page:122
msgid ""
"GNU style. Each new level is indented by 2 spaces, braces go on a line by "
"themselves, and they are indented as well."
msgstr ""
"Styl GNU. Každá nová úroveň je odsazena 2 mezerami, složené závorky jsou "
"samostatně na novém řádku a rovněž jsou odsazené."
#. (itstool) path: item/code
#: C/c-coding-style.page:128
#, no-wrap
msgid ""
"\n"
"for (i = 0; i < num_elements; i++)\n"
" {\n"
" foo[i] = foo[i] + 42;\n"
"\n"
" if (foo[i] < 35)\n"
" {\n"
" printf (\"Foo!\");\n"
" foo[i]--;\n"
" }\n"
" else\n"
" {\n"
" printf (\"Bar!\");\n"
" foo[i]++;\n"
" }\n"
" }"
msgstr ""
"\n"
"for (i = 0; i < num_elements; i++)\n"
" {\n"
" foo[i] = foo[i] + 42;\n"
"\n"
" if (foo[i] < 35)\n"
" {\n"
" printf (\"Foo!\");\n"
" foo[i]--;\n"
" }\n"
" else\n"
" {\n"
" printf (\"Bar!\");\n"
" foo[i]++;\n"
" }\n"
" }"
#. (itstool) path: section/p
#: C/c-coding-style.page:148
msgid ""
"Both styles have their pros and cons. The most important things is to <em>be "
"consistent</em> with the surrounding code. For example, the GTK+ library, "
"which is GNOME’s widget toolkit, is written with the GNU style. Nautilus, "
"GNOME’s file manager, is written in Linux kernel style. Both styles are "
"perfectly readable and consistent when you get used to them."
msgstr ""
"Oba styly mají své pro a proti. Nejdůležitější věcí ale je, aby okolní kód "
"<em>byl jednotný</em>. Například knihovna GTK+, což je vývojářská sada pro "
"widgety GNOME, je napsaná ve stylu GNU. Nautilus, což je správce souborů v "
"GNOME, je napsán ve stylu linuxového jádra. Čitelné a jednotné jsou oba "
"styly, ať použijete kterýkoliv z nich."
#. (itstool) path: section/p
#: C/c-coding-style.page:157
msgid ""
"Your first feeling when having to study or work on a piece of code that "
"doesn’t have your preferred indentation style may be, how shall we put it, "
"gut-wrenching. You should resist your inclination to reindent everything, or "
"to use an inconsistent style for your patch. Remember the first rule: <em>be "
"consistent</em> and respectful of that code’s customs, and your patches will "
"have a much higher chance of being accepted without a lot of arguing about "
"the right indentation style."
msgstr ""
"Když musíte studovat kus cizího kódu, který nemá vámi oblíbený styl "
"odsazování, nebo na něm dokonce pracovat, dělá se vám z toho zle. Měli byste "
"ale překonat své touhy všchno odsazení předělat nebo použít ve své záplatě "
"jiný styl odsazování. Pamatujte na první pravidlo: <em>dodržujte jednotnost</"
"em> a respektujte zvyky daného kódu, a vaše záplata bude mít daleko větší "
"šanci na přijetí, aniž byste museli vést dohady o tom, který styl odsazování "
"je lepší."
#. (itstool) path: section/title
#: C/c-coding-style.page:170
msgid "Tab Characters"
msgstr "Znaky tabulátor"
#. (itstool) path: section/p
#: C/c-coding-style.page:172
msgid ""
"<em>Do not ever change the size of tabs in your editor</em>; leave them as 8 "
"spaces. Changing the size of tabs means that code that you didn’t write "
"yourself will be perpetually misaligned."
msgstr ""
"<em>Nikdy neměňte šířku tabulátoru ve svém editoru</em>. Ponechte ji na 8 "
"mezerách. Pokud byste ji změnili, budete mít kód, který jste nepsali vy, "
"věčně rozházený."
#. (itstool) path: section/p
#: C/c-coding-style.page:178
msgid ""
"Instead, set the <em>indentation size</em> as appropriate for the code you "
"are editing. When writing in something other than Linux kernel style, you "
"may even want to tell your editor to automatically convert all tabs to 8 "
"spaces, so that there is no ambiguity about the intended amount of space."
msgstr ""
"Místo toho si nastavte <em>šířku odsazení</em> odpovídající kódu, který "
"upravujete. Když píšete v jiném stylu než linuxového jádra, můžete chtít "
"říci svému editoru, aby automaticky převáděl všechny tabulátory na 8 mezer, "
"takže nevzniknou žádné nejednoznačnosti týkající se množství mezer."
#. (itstool) path: section/title
#: C/c-coding-style.page:188
msgid "Braces"
msgstr "Závorky"
#. (itstool) path: section/p
#: C/c-coding-style.page:190
msgid "Curly braces should not be used for single statement blocks:"
msgstr "Složené závorky by se neměly používat pro blok s jediným příkazem:"
#. (itstool) path: section/code
#: C/c-coding-style.page:194
#, no-wrap
msgid ""
"\n"
"/* valid */\n"
"if (condition)\n"
"\tsingle_statement ();\n"
"else\n"
"\tanother_single_statement (arg1);"
msgstr ""
"\n"
"/* dobře */\n"
"if (condition)\n"
"\tsingle_statement ();\n"
"else\n"
"\tanother_single_statement (arg1);"
#. (itstool) path: section/p
#: C/c-coding-style.page:201
msgid "The “no block for single statements” rule has only four exceptions:"
msgstr "Z tohoto pravidla existují čtyři výjimky:"
#. (itstool) path: item/p
#: C/c-coding-style.page:208
msgid ""
"In GNU style, if either side of an if-else statement has braces, both sides "
"should, to match up indentation:"
msgstr ""
"Ve stylu GNU, když má jedna část výrazu if-else závorky, měly by je mít obě, "
"aby měly i stejné odsazení:"
#. (itstool) path: item/code
#: C/c-coding-style.page:213
#, no-wrap
msgid ""
"\n"
"/* valid GNU style */\n"
"if (condition)\n"
" {\n"
" foo ();\n"
" bar ();\n"
" }\n"
"else\n"
" {\n"
" baz ();\n"
" }"
msgstr ""
"\n"
"/* platný styl GNU */\n"
"if (condition)\n"
" {\n"
" foo ();\n"
" bar ();\n"
" }\n"
"else\n"
" {\n"
" baz ();\n"
" }"
#. (itstool) path: item/code
#: C/c-coding-style.page:225
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"if (condition)\n"
" {\n"
" foo ();\n"
" bar ();\n"
" }\n"
"else\n"
" baz ();"
msgstr ""
"\n"
"/* špatně */\n"
"if (condition)\n"
" {\n"
" foo ();\n"
" bar ();\n"
" }\n"
"else\n"
" baz ();"
#. (itstool) path: item/p
#: C/c-coding-style.page:237
msgid ""
"If the single statement covers multiple lines, e.g. for functions with many "
"arguments, and it is followed by <code>else</code> or <code>else if</code>:"
msgstr ""
"Samostatný výraz roztažený přes více řádků, např. funkce s hodně argumenty, "
"a následovaný <code>else</code> nebo <code>else if</code>:"
#. (itstool) path: item/code
#: C/c-coding-style.page:243
#, no-wrap
msgid ""
"\n"
"/* valid Linux kernel style */\n"
"if (condition) {\n"
"\ta_single_statement_with_many_arguments (some_lengthy_argument,\n"
"\t\t\t\t\t\tanother_lengthy_argument,\n"
"\t\t\t\t\t\tand_another_one,\n"
"\t\t\t\t\t\tplus_one);\n"
"} else\n"
"\tanother_single_statement (arg1, arg2);\n"
"\n"
"/* valid GNU style */\n"
"if (condition)\n"
" {\n"
" a_single_statement_with_many_arguments (some_lengthy_argument,\n"
" another_lengthy_argument,\n"
" and_another_one,\n"
" plus_one);\n"
" }\n"
"else\n"
" {\n"
" another_single_statement (arg1, arg2);\n"
" }"
msgstr ""
"\n"
"/* platný styl linuxového jádra */\n"
"if (condition) {\n"
"\ta_single_statement_with_many_arguments (some_lengthy_argument,\n"
"\t\t\t\t\t\tanother_lengthy_argument,\n"
"\t\t\t\t\t\tand_another_one,\n"
"\t\t\t\t\t\tplus_one);\n"
"} else\n"
"\tanother_single_statement (arg1, arg2);\n"
"\n"
"/* platný styl GNU */\n"
"if (condition)\n"
" {\n"
" a_single_statement_with_many_arguments (some_lengthy_argument,\n"
" another_lengthy_argument,\n"
" and_another_one,\n"
" plus_one);\n"
" }\n"
"else\n"
" {\n"
" another_single_statement (arg1, arg2);\n"
" }"
#. (itstool) path: item/p
#: C/c-coding-style.page:268
msgid "If the condition is composed of many lines:"
msgstr "Když je podmínka rozdělená na více řádků:"
#. (itstool) path: item/code
#: C/c-coding-style.page:272
#, no-wrap
msgid ""
"\n"
"/* valid Linux kernel style */\n"
"if (condition1 ||\n"
" (condition2 && condition3) ||\n"
" condition4 ||\n"
" (condition5 && (condition6 || condition7))) {\n"
"\ta_single_statement ();\n"
"}\n"
"\n"
"/* valid GNU style */\n"
"if (condition1 ||\n"
" (condition2 && condition3) ||\n"
" condition4 ||\n"
" (condition5 && (condition6 || condition7)))\n"
" {\n"
" a_single_statement ();\n"
" }"
msgstr ""
"\n"
"/* platný styl linuxového jádra */\n"
"if (condition1 ||\n"
" (condition2 && condition3) ||\n"
" condition4 ||\n"
" (condition5 && (condition6 || condition7))) {\n"
"\ta_single_statement ();\n"
"}\n"
"\n"
"/* platný styl GNU */\n"
"if (condition1 ||\n"
" (condition2 && condition3) ||\n"
" condition4 ||\n"
" (condition5 && (condition6 || condition7)))\n"
" {\n"
" a_single_statement ();\n"
" }"
#. (itstool) path: item/p
#: C/c-coding-style.page:290
msgid ""
"Note that such long conditions are usually hard to understand. A good "
"practice is to set the condition to a boolean variable, with a good name for "
"that variable. Another way is to move the long condition to a function."
msgstr ""
"Uvědomte si ale, že takovéto dlouhé podmínky jsou náročné na porozumění. "
"Proto je dobrým zvykem nastavit jednotlivé části podmínky do pravdivostních "
"proměnných s popisnými názvy. Jinou možností je přesunout dlouhou podmínku "
"do funkce."
#. (itstool) path: item/p
#: C/c-coding-style.page:299
msgid ""
"Nested <code>if</code>s, in which case the block should be placed on the "
"outermost <code>if</code>:"
msgstr ""
"Vnořené <code>if</code> v případě, že má být blok umístěn v nadřazeném "
"<code>if</code>:"
#. (itstool) path: item/code
#: C/c-coding-style.page:304
#, no-wrap
msgid ""
"\n"
"/* valid Linux kernel style */\n"
"if (condition) {\n"
"\tif (another_condition)\n"
"\t\tsingle_statement ();\n"
"\telse\n"
"\t\tanother_single_statement ();\n"
"}\n"
"\n"
"/* valid GNU style */\n"
"if (condition)\n"
" {\n"
" if (another_condition)\n"
" single_statement ();\n"
" else\n"
" another_single_statement ();\n"
" }"
msgstr ""
"\n"
"/* platný styl linuxového jádra */\n"
"if (condition) {\n"
"\tif (another_condition)\n"
"\t\tsingle_statement ();\n"
"\telse\n"
"\t\tanother_single_statement ();\n"
"}\n"
"\n"
"/* platný styl GNU */\n"
"if (condition)\n"
" {\n"
" if (another_condition)\n"
" single_statement ();\n"
" else\n"
" another_single_statement ();\n"
" }"
#. (itstool) path: item/code
#: C/c-coding-style.page:322
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"if (condition)\n"
"\tif (another_condition)\n"
"\t\tsingle_statement ();\n"
"\telse if (yet_another_condition)\n"
"\t\tanother_single_statement ();"
msgstr ""
"\n"
"/* špatně */\n"
"if (condition)\n"
"\tif (another_condition)\n"
"\t\tsingle_statement ();\n"
"\telse if (yet_another_condition)\n"
"\t\tanother_single_statement ();"
#. (itstool) path: section/p
#: C/c-coding-style.page:332
msgid ""
"In general, new blocks should be placed on a new indentation level, like "
"this:"
msgstr ""
"Obecně by nový blok měl být umístěn v nové úrovni odsazení, nějak takto:"
#. (itstool) path: section/code
#: C/c-coding-style.page:337
#, no-wrap
msgid ""
"\n"
"int retval = 0;\n"
"\n"
"statement_1 ();\n"
"statement_2 ();\n"
"\n"
"{\n"
"\tint var1 = 42;\n"
"\tgboolean res = FALSE;\n"
"\n"
"\tres = statement_3 (var1);\n"
"\n"
"\tretval = res ? -1 : 1;\n"
"}"
msgstr ""
"\n"
"int retval = 0;\n"
"\n"
"statement_1 ();\n"
"statement_2 ();\n"
"\n"
"{\n"
"\tint var1 = 42;\n"
"\tgboolean res = FALSE;\n"
"\n"
"\tres = statement_3 (var1);\n"
"\n"
"\tretval = res ? -1 : 1;\n"
"}"
#. (itstool) path: section/p
#: C/c-coding-style.page:352
msgid ""
"While curly braces for function definitions should rest on a new line they "
"should not add an indentation level:"
msgstr ""
"I když mají být složené závorky pro definici funkce na novém řádku, neměly "
"by být odsazené:"
#. (itstool) path: section/code
#: C/c-coding-style.page:357
#, no-wrap
msgid ""
"\n"
"/* valid Linux kernel style*/\n"
"static void\n"
"my_function (int argument)\n"
"{\n"
"\tdo_my_things ();\n"
"}\n"
"\n"
"/* valid GNU style*/\n"
"static void\n"
"my_function (int argument)\n"
"{\n"
" do_my_things ();\n"
"}"
msgstr ""
"\n"
"/* platný styl linuxového jádra*/\n"
"static void\n"
"my_function (int argument)\n"
"{\n"
"\tdo_my_things ();\n"
"}\n"
"\n"
"/* platný styl GNU */\n"
"static void\n"
"my_function (int argument)\n"
"{\n"
" do_my_things ();\n"
"}"
#. (itstool) path: section/code
#: C/c-coding-style.page:372
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"static void\n"
"my_function (int argument) {\n"
"\tdo_my_things ();\n"
"}\n"
"\n"
"/* invalid */\n"
"static void\n"
"my_function (int argument)\n"
" {\n"
" do_my_things ();\n"
" }"
msgstr ""
"\n"
"/* špatně */\n"
"static void\n"
"my_function (int argument) {\n"
"\tdo_my_things ();\n"
"}\n"
"\n"
"/* špatně */\n"
"static void\n"
"my_function (int argument)\n"
" {\n"
" do_my_things ();\n"
" }"
#. (itstool) path: section/title
#: C/c-coding-style.page:388
msgid "Conditions"
msgstr "Podmínky"
#. (itstool) path: section/p
#: C/c-coding-style.page:390
msgid ""
"Do not check boolean values for equality. By using implicit comparisons, the "
"resulting code can be read more like conversational English. Another "
"rationale is that a ‘true’ value may not be necessarily equal to whatever "
"the <code>TRUE</code> macro uses. For example:"
msgstr ""
"U pravdivostních hodnot neprovádějte kontrolu na rovnost. Když ponecháte "
"výchozí porovnání, bude výsledný kód čitelnější jakoby přirozená angličtina. "
"Dalším logickým důvodem je, že skutečná hodnota „pravda“ nemusí nutně být "
"totéž, co použití makra <code>TRUE</code>. Například:"
#. (itstool) path: section/code
#: C/c-coding-style.page:397
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"if (found == TRUE)\n"
"\tdo_foo ();\n"
"\n"
"/* invalid */\n"
"if (found == FALSE)\n"
"\tdo_bar ();"
msgstr ""
"\n"
"/* špatně */\n"
"if (found == TRUE)\n"
"\tdo_foo ();\n"
"\n"
"/* špatně */\n"
"if (found == FALSE)\n"
"\tdo_bar ();"
#. (itstool) path: section/code
#: C/c-coding-style.page:406
#, no-wrap
msgid ""
"\n"
"/* valid */\n"
"if (found)\n"
"\tdo_foo ();\n"
"\n"
"/* valid */\n"
"if (!found)\n"
"\tdo_bar ();"
msgstr ""
"\n"
"/* dobře */\n"
"if (found)\n"
"\tdo_foo ();\n"
"\n"
"/* dobře */\n"
"if (!found)\n"
"\tdo_bar ();"
#. (itstool) path: section/p
#: C/c-coding-style.page:415
msgid ""
"The C language uses the value 0 for many purposes. As a numeric value, the "
"end of a string, a null pointer and the <code>FALSE</code> boolean. To make "
"the code clearer, you should write code that highlights the specific way 0 "
"is used. So when reading a comparison, it is possible to know the variable "
"type. For boolean variables, an implicit comparison is appropriate because "
"it’s already a logical expression. Other variable types are not logical "
"expressions by themselves, so an explicit comparison is better:"
msgstr ""
"Jazyk C používá hodnotu 0 k mnoha účelům. Jako číselnou hodnotu, zakončení "
"řetězce, prázdný ukazatel a pravdivostní hodnotu <code>FALSE</code>. Aby byl "
"kód lépe čitelný, měli byste jej psát tak, aby byl konkrétní význam 0 "
"zdůrazněn. Proto je při porovnávání dobré vědět, o jaký typ proměnné se "
"jedná. U pravdivostních proměnných je výchozí porovnání v pořádku, protože "
"se jedná o logický výraz. U ostatních typů samotných o logický výraz nejde, "
"takže výslovné porovnání je lepší:"
#. (itstool) path: section/code
#: C/c-coding-style.page:426
#, no-wrap
msgid ""
"\n"
"/* valid */\n"
"if (some_pointer == NULL)\n"
"\tdo_blah ();\n"
"\n"
"/* valid */\n"
"if (number == 0)\n"
"\tdo_foo ();\n"
"\n"
"/* valid */\n"
"if (str != NULL && *str != '\\0')\n"
"\tdo_bar ();"
msgstr ""
"\n"
"/* dobře */\n"
"if (some_pointer == NULL)\n"
"\tdo_blah ();\n"
"\n"
"/* dobře */\n"
"if (number == 0)\n"
"\tdo_foo ();\n"
"\n"
"/* dobře */\n"
"if (str != NULL && *str != '\\0')\n"
"\tdo_bar ();"
#. (itstool) path: section/code
#: C/c-coding-style.page:439
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"if (!some_pointer)\n"
"\tdo_blah ();\n"
"\n"
"/* invalid */\n"
"if (!number)\n"
"\tdo_foo ();\n"
"\n"
"/* invalid */\n"
"if (str && *str)\n"
"\tdo_bar ();"
msgstr ""
"\n"
"/* špatně */\n"
"if (!some_pointer)\n"
"\tdo_blah ();\n"
"\n"
"/* špatně */\n"
"if (!number)\n"
"\tdo_foo ();\n"
"\n"
"/* špatně */\n"
"if (str && *str)\n"
"\tdo_bar ();"
#. (itstool) path: section/title
#: C/c-coding-style.page:454
msgid "Functions"
msgstr "Funkce"
#. (itstool) path: section/p
#: C/c-coding-style.page:456
msgid ""
"Functions should be declared by placing the returned value on a separate "
"line from the function name:"
msgstr ""
"Funkce by měly být deklarovány s návratovou hodnotou umístěnou na zvláštní "
"řádek před názvem funkce:"
#. (itstool) path: section/code
#: C/c-coding-style.page:461
#, no-wrap
msgid ""
"\n"
"void\n"
"my_function (void)\n"
"{\n"
" …\n"
"}"
msgstr ""
"\n"
"void\n"
"my_function (void)\n"
"{\n"
" …\n"
"}"
#. (itstool) path: section/p
#: C/c-coding-style.page:468
msgid ""
"The argument list must be broken into a new line for each argument, with the "
"argument names right aligned, taking into account pointers:"
msgstr ""
"Seznam argumentů musí být rozdělen na jednotlivé řádky pro každý z argumentů "
"a názvy argumentů jsou správně zarovnané, přičemž se berou do úvahy "
"ukazatele:"
#. (itstool) path: section/code
#: C/c-coding-style.page:474
#, no-wrap
msgid ""
"\n"
"void\n"
"my_function (some_type_t type,\n"
" another_type_t *a_pointer,\n"
" double_ptr_t **double_pointer,\n"
" final_type_t another_type)\n"
"{\n"
" …\n"
"}"
msgstr ""
"\n"
"void\n"
"my_function (some_type_t type,\n"
" another_type_t *a_pointer,\n"
" double_ptr_t **double_pointer,\n"
" final_type_t another_type)\n"
"{\n"
" …\n"
"}"
#. (itstool) path: section/p
#: C/c-coding-style.page:484
msgid ""
"If you use Emacs, you can use <code>M-x align</code> to do this kind of "
"alignment automatically. Just put the point and mark around the function’s "
"prototype, and invoke that command."
msgstr ""
"Pokud používáte Emacs, můžete vyžít <code>M-x align</code> k automatickému "
"zarovnání tohoto typu. Stačí vložit okolo prototypu funkce bod a značku a "
"vyvolat tento příkaz."
#. (itstool) path: section/p
#: C/c-coding-style.page:490
msgid ""
"The alignment also holds when invoking a function without breaking the line "
"length limit:"
msgstr ""
"Zarovnání se dodržuje i při vyvolání funkce, která neporušuje omezení délky "
"řádku:"
#. (itstool) path: section/code
#: C/c-coding-style.page:495
#, no-wrap
msgid ""
"\n"
"align_function_arguments (first_argument,\n"
" second_argument,\n"
" third_argument);"
msgstr ""
"\n"
"align_function_arguments (first_argument,\n"
" second_argument,\n"
" third_argument);"
#. (itstool) path: section/title
#: C/c-coding-style.page:502
msgid "Whitespace"
msgstr "Bílé znaky"
#. (itstool) path: section/p
#: C/c-coding-style.page:504
msgid "Always put a space before an opening parenthesis but never after:"
msgstr "Vždy dejte mezeru před otevírací závorku, ale nikdy ne za ni:"
#. (itstool) path: section/code
#: C/c-coding-style.page:508
#, no-wrap
msgid ""
"\n"
"/* valid */\n"
"if (condition)\n"
"\tdo_my_things ();\n"
"\n"
"/* valid */\n"
"switch (condition) {\n"
"}"
msgstr ""
"\n"
"/* dobře */\n"
"if (condition)\n"
"\tdo_my_things ();\n"
"\n"
"/* dobře */\n"
"switch (condition) {\n"
"}"
#. (itstool) path: section/code
#: C/c-coding-style.page:517
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"if(condition)\n"
"\tdo_my_things();\n"
"\n"
"/* invalid */\n"
"if ( condition )\n"
"\tdo_my_things ( );"
msgstr ""
"\n"
"/* špatně */\n"
"if(condition)\n"
"\tdo_my_things();\n"
"\n"
"/* špatně */\n"
"if ( condition )\n"
"\tdo_my_things ( );"
#. (itstool) path: section/p
#: C/c-coding-style.page:526
msgid ""
"When declaring a structure type use newlines to separate logical sections of "
"the structure:"
msgstr ""
"Při deklaraci struktury oddělte její logické části pomocí prázdného řádku:"
#. (itstool) path: section/code
#: C/c-coding-style.page:531
#, no-wrap
msgid ""
"\n"
"struct _GtkWrapBoxPrivate\n"
"{\n"
"\tGtkOrientation orientation;\n"
"\tGtkWrapAllocationMode mode;\n"
"\n"
"\tGtkWrapBoxSpreading horizontal_spreading;\n"
"\tGtkWrapBoxSpreading vertical_spreading;\n"
"\n"
"\tguint16 vertical_spacing;\n"
"\tguint16 horizontal_spacing;\n"
"\n"
"\tguint16 minimum_line_children;\n"
"\tguint16 natural_line_children;\n"
"\n"
"\tGList *children;\n"
"};"
msgstr ""
"\n"
"struct _GtkWrapBoxPrivate\n"
"{\n"
"\tGtkOrientation orientation;\n"
"\tGtkWrapAllocationMode mode;\n"
"\n"
"\tGtkWrapBoxSpreading horizontal_spreading;\n"
"\tGtkWrapBoxSpreading vertical_spreading;\n"
"\n"
"\tguint16 vertical_spacing;\n"
"\tguint16 horizontal_spacing;\n"
"\n"
"\tguint16 minimum_line_children;\n"
"\tguint16 natural_line_children;\n"
"\n"
"\tGList *children;\n"
"};"
#. (itstool) path: section/p
#: C/c-coding-style.page:549
msgid ""
"Do not eliminate whitespace and newlines just because something would fit on "
"a single line:"
msgstr ""
"Neodstraňujte bílé znaky a zalomení jen proto, že by se něco vlezlo na jeden "
"řádek:"
#. (itstool) path: section/code
#: C/c-coding-style.page:554
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"if (condition) foo (); else bar ();"
msgstr ""
"\n"
"/* špatně */\n"
"if (condition) foo (); else bar ();"
#. (itstool) path: section/p
#: C/c-coding-style.page:558
msgid ""
"Do eliminate trailing whitespace on any line, preferably as a separate patch "
"or commit. Never use empty lines at the beginning or at the end of a file."
msgstr ""
"Odstraňte bílé znaky na koncích řádků, hlavně u samostatných záplat nebo "
"zařazení. Nikdy nepoužívejte prázdné řádky na začátku nebo na konci souboru."
#. (itstool) path: section/p
#: C/c-coding-style.page:564
msgid ""
"This is a little Emacs function that you can use to clean up lines with "
"trailing whitespace:"
msgstr ""
"Zde je drobná funkce pro Emacs, kterou můžete použít k vyčištění bílých "
"znaků na koncích řádků:"
#. (itstool) path: section/code
#: C/c-coding-style.page:569
#, no-wrap
msgid ""
"\n"
"(defun clean-line-ends ()\n"
" (interactive)\n"
" (if (not buffer-read-only)\n"
" (save-excursion\n"
"\t(goto-char (point-min))\n"
"\t(let ((count 0))\n"
"\t (while (re-search-forward \"[ \t]+$\" nil t)\n"
"\t (setq count (+ count 1))\n"
"\t (replace-match \"\" t t))\n"
"\t (message \"Cleaned %d lines\" count)))))"
msgstr ""
"\n"
"(defun clean-line-ends ()\n"
" (interactive)\n"
" (if (not buffer-read-only)\n"
" (save-excursion\n"
"\t(goto-char (point-min))\n"
"\t(let ((count 0))\n"
"\t (while (re-search-forward \"[ \t]+$\" nil t)\n"
"\t (setq count (+ count 1))\n"
"\t (replace-match \"\" t t))\n"
"\t (message \"Cleaned %d lines\" count)))))"
#. (itstool) path: section/title
#: C/c-coding-style.page:583
msgid "The <code>switch</code> Statement"
msgstr "Výraz <code>switch</code>"
#. (itstool) path: section/p
#: C/c-coding-style.page:585
msgid ""
"A <code>switch</code> should open a block on a new indentation level, and "
"each <code>case</code> should start on the same indentation level as the "
"curly braces, with the case block on a new indentation level:"
msgstr ""
"Příkaz <code>switch</code> by měl otevírat blok na nové úrovni odsazení a "
"každý <code>case</code> by měl začínat na stejné úrovni, jako složené "
"závorky, s příslušným blokem na nové úrovni odsazení:"
#. (itstool) path: section/code
#: C/c-coding-style.page:592
#, no-wrap
msgid ""
"\n"
"/* valid Linux kernel style */\n"
"switch (condition) {\n"
"case FOO:\n"
"\tdo_foo ();\n"
"\tbreak;\n"
"\n"
"case BAR:\n"
"\tdo_bar ();\n"
"\tbreak;\n"
"}\n"
"\n"
"/* valid GNU style */\n"
"switch (condition)\n"
" {\n"
" case FOO:\n"
" do_foo ();\n"
" break;\n"
"\n"
" case BAR:\n"
" do_bar ();\n"
" break;\n"
" }"
msgstr ""
"\n"
"/* platný styl linuxového jádra */\n"
"switch (condition) {\n"
"case FOO:\n"
"\tdo_foo ();\n"
"\tbreak;\n"
"\n"
"case BAR:\n"
"\tdo_bar ();\n"
"\tbreak;\n"
"}\n"
"\n"
"/* platný styl GNU */\n"
"switch (condition)\n"
" {\n"
" case FOO:\n"
" do_foo ();\n"
" break;\n"
"\n"
" case BAR:\n"
" do_bar ();\n"
" break;\n"
" }"
#. (itstool) path: section/code
#: C/c-coding-style.page:616
#, no-wrap
msgid ""
"\n"
"/* invalid */\n"
"switch (condition) {\n"
" case FOO: do_foo (); break;\n"
" case BAR: do_bar (); break;\n"
"}\n"
"\n"
"/* invalid */\n"
"switch (condition)\n"
" {\n"
" case FOO: do_foo ();\n"
" break;\n"
" case BAR: do_bar ();\n"
" break;\n"
" }\n"
"\n"
"/* invalid */\n"
"switch (condition)\n"
" {\n"
" case FOO:\n"
" do_foo ();\n"
" break;\n"
" case BAR:\n"
" do_bar ();\n"
" break;\n"
" }"
msgstr ""
"\n"
"/* špatně */\n"
"switch (condition) {\n"
" case FOO: do_foo (); break;\n"
" case BAR: do_bar (); break;\n"
"}\n"
"\n"
"/* špatně */\n"
"switch (condition)\n"
" {\n"
" case FOO: do_foo ();\n"
" break;\n"
" case BAR: do_bar ();\n"
" break;\n"
" }\n"
"\n"
"/* špatně */\n"
"switch (condition)\n"
" {\n"
" case FOO:\n"
" do_foo ();\n"
" break;\n"
" case BAR:\n"
" do_bar ();\n"
" break;\n"
" }"
#. (itstool) path: section/p
#: C/c-coding-style.page:643
msgid ""
"It is preferable, though not mandatory, to separate the various cases with a "
"newline:"
msgstr ""
"Preferované, ale ne povinné, je oddělení různých případů prázdným řádkem:"
#. (itstool) path: section/code
#: C/c-coding-style.page:648
#, no-wrap
msgid ""
"\n"
"switch (condition) {\n"
"case FOO:\n"
"\tdo_foo ();\n"
"\tbreak;\n"
"\n"
"case BAR:\n"
"\tdo_bar ();\n"
"\tbreak;\n"
"\n"
"default:\n"
"\tdo_default ();\n"
"}"
msgstr ""
"\n"
"switch (condition) {\n"
"case FOO:\n"
"\tdo_foo ();\n"
"\tbreak;\n"
"\n"
"case BAR:\n"
"\tdo_bar ();\n"
"\tbreak;\n"
"\n"
"default:\n"
"\tdo_default ();\n"
"}"
#. (itstool) path: section/p
#: C/c-coding-style.page:662
msgid ""
"The <code>break</code> statement for the <code>default</code> case is not "
"mandatory."
msgstr "Výraz <code>break</code> pro případ <code>default</code> není povinný."
#. (itstool) path: section/p
#: C/c-coding-style.page:667
msgid ""
"If switching over an enumerated type, a <code>case</code> statement must "
"exist for every member of the enumerated type. For members you do not want "
"to handle, alias their <code>case</code> statements to <code>default</code>:"
msgstr ""
"Pokud přepínáte podle výčtového typu, musí být výraz <code>case</code> "
"uveden pro všechny hodnoty daného výčtu. Hodnoty, které není potřeba "
"obsloužit, uveďte dohromady s případem <code>default</code>:"
#. (itstool) path: section/code
#: C/c-coding-style.page:674
#, no-wrap
msgid ""
"\n"
"switch (enumerated_condition) {\n"
"case HANDLED_1:\n"
"\tdo_foo ();\n"
"\tbreak;\n"
"\n"
"case HANDLED_2:\n"
"\tdo_bar ();\n"
"\tbreak;\n"
"\n"
"case IGNORED_1:\n"
"case IGNORED_2:\n"
"default:\n"
"\tdo_default ();\n"
"}"
msgstr ""
"\n"
"switch (enumerated_condition) {\n"
"case HANDLED_1:\n"
"\tdo_foo ();\n"
"\tbreak;\n"
"\n"
"case HANDLED_2:\n"
"\tdo_bar ();\n"
"\tbreak;\n"
"\n"
"case IGNORED_1:\n"
"case IGNORED_2:\n"
"default:\n"
"\tdo_default ();\n"
"}"
#. (itstool) path: section/p
#: C/c-coding-style.page:690
msgid ""
"If most members of the enumerated type should not be handled, consider using "
"an <code>if</code> statement instead of a <code>switch</code>."
msgstr ""
"Pokud není potřeba obsloužit většinu z hodnot výčtu, měli byste pouvažovat "
"spíš o výrazu <code>if</code> namísto <code>switch</code>."
#. (itstool) path: section/p
#: C/c-coding-style.page:695
msgid ""
"If a <code>case</code> block needs to declare new variables, the same rules "
"as the inner blocks apply (see above); the <code>break</code> statement "
"should be placed outside of the inner block:"
msgstr ""
"Když blok <code>case</code> potřebuje deklarovat nové proměnné, použije se "
"stejné pravidlo jako pro vnitřní blok (viz výše). Příkaz <code>break</code> "
"by měl být umístěn mimo vnitřní blok:"
#. (itstool) path: section/code
#: C/c-coding-style.page:701
#, no-wrap
msgid ""
"\n"
"/* valid GNU style */\n"
"switch (condition)\n"
" {\n"
" case FOO:\n"
" {\n"
" int foo;\n"
"\n"
" foo = do_foo ();\n"
" }\n"
" break;\n"
"\n"
" …\n"
" }"
msgstr ""
"\n"
"/* platný styl GNU */\n"
"switch (condition)\n"
" {\n"
" case FOO:\n"
" {\n"
" int foo;\n"
"\n"
" foo = do_foo ();\n"
" }\n"
" break;\n"
"\n"
" …\n"
" }"
#. (itstool) path: section/title
#: C/c-coding-style.page:718
msgid "Header Files"
msgstr "Hlavičkové soubory"
#. (itstool) path: section/p
#: C/c-coding-style.page:720
msgid ""
"The only major rule for headers is that the function definitions should be "
"vertically aligned in three columns:"
msgstr ""
"Jediné hlavní pravidlo pro hlavičkové soubory je, že definici funkcí by měly "
"být svisle zarovnané do tří sloupců:"
#. (itstool) path: section/code
#: C/c-coding-style.page:725
#, no-wrap
msgid ""
"\n"
"return_type function_name (type argument,\n"
" type argument,\n"
" type argument);"
msgstr ""
"\n"
"return_type function_name (type argument,\n"
" type argument,\n"
" type argument);"
#. (itstool) path: section/p
#: C/c-coding-style.page:730
msgid ""
"The maximum width of each column is given by the longest element in the "
"column:"
msgstr ""
"Maximální šířka jednotlivých sloupců je určena nejdelším prvkem ve sloupci:"
#. (itstool) path: section/code
#: C/c-coding-style.page:735
#, no-wrap
msgid ""
"\n"
"void gtk_type_set_property (GtkType *type,\n"
" const gchar *value,\n"
" GError **error);\n"
"const gchar *gtk_type_get_property (GtkType *type);"
msgstr ""
"\n"
"void gtk_type_set_property (GtkType *type,\n"
" const gchar *value,\n"
" GError **error);\n"
"const gchar *gtk_type_get_property (GtkType *type);"
#. (itstool) path: section/p
#: C/c-coding-style.page:741
msgid "It is also possible to align the columns to the next tab:"
msgstr "Sloupce je možné zarovnávat také na nejbližší tabulátor:"
#. (itstool) path: section/code
#: C/c-coding-style.page:745
#, no-wrap
msgid ""
"\n"
"void gtk_type_set_prop (GtkType *type,\n"
" gfloat value);\n"
"gfloat gtk_type_get_prop (GtkType *type);\n"
"gint gtk_type_update_foobar (GtkType *type);"
msgstr ""
"\n"
"void gtk_type_set_prop (GtkType *type,\n"
" gfloat value);\n"
"gfloat gtk_type_get_prop (GtkType *type);\n"
"gint gtk_type_update_foobar (GtkType *type);"
#. (itstool) path: section/p
#: C/c-coding-style.page:751
msgid ""
"As before, you can use <code>M-x align</code> in Emacs to do this "
"automatically."
msgstr ""
"Jak již bylo uvedeno dříve, můžete v editoru Emacs použít <code>M-x align</"
"code>, aby se to provedlo automaticky."
#. (itstool) path: section/p
#: C/c-coding-style.page:756
msgid ""
"If you are creating a public library, try to export a single public header "
"file that in turn includes all the smaller header files into it. This is so "
"that public headers are never included directly; rather a single include is "
"used in applications. For example, GTK+ uses the following in its header "
"files that should not be included directly by applications:"
msgstr ""
"Když vytváříte veřejnou knihovnu, zkuste exportovat jediný veřejný "
"hlavičkový soubor, ve kterém budou pomocí include vložené všechny menší "
"hlavičkové soubory. Je to proto, aby veřejné hlavičky nikdy nebyly vložené "
"přímo. Místo toho se v aplikacích použije jediná direktiva include. "
"Například GTK+ ve svých hlavičkových souborech, který by neměl být aplikací "
"vloženy přímo, používá následující:"
#. (itstool) path: section/code
#: C/c-coding-style.page:766
#, no-wrap
msgid ""
"\n"
"#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)\n"
"#error \"Only <gtk/gtk.h> can be included directly.\"\n"
"#endif"
msgstr ""
"\n"
"#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)\n"
"#error \"Only <gtk/gtk.h> can be included directly.\"\n"
"#endif"
#. (itstool) path: section/p
#: C/c-coding-style.page:771
msgid ""
"For libraries, all headers should have inclusion guards (for internal usage) "
"and C++ guards. These provide the <code>extern \"C\"</code> magic that C++ "
"requires to include plain C headers:"
msgstr ""
"U knihoven by všechny hlavičkové soubory měly mít ochranu proti "
"vícenásobnému vložení (pro interní použití) a pro integraci s C++. Ta "
"poskytuje magické <code>extern \"C\"</code>, které vyžaduje C++ při vložení "
"hlavičkového souboru prostého C:"
#. (itstool) path: section/code
#: C/c-coding-style.page:777
#, no-wrap
msgid ""
"\n"
"#ifndef MYLIB_FOO_H_\n"
"#define MYLIB_FOO_H_\n"
"\n"
"#include <gtk/gtk.h>\n"
"\n"
"G_BEGIN_DECLS\n"
"\n"
"…\n"
"\n"
"G_END_DECLS\n"
"\n"
"#endif /* MYLIB_FOO_H_ */"
msgstr ""
"\n"
"#ifndef MYLIB_FOO_H_\n"
"#define MYLIB_FOO_H_\n"
"\n"
"#include <gtk/gtk.h>\n"
"\n"
"G_BEGIN_DECLS\n"
"\n"
"…\n"
"\n"
"G_END_DECLS\n"
"\n"
"#endif /* MYLIB_FOO_H_ */"
#. (itstool) path: section/title
#: C/c-coding-style.page:793
msgid "GObject Classes"
msgstr "Třídy GObject"
#. (itstool) path: section/p
#: C/c-coding-style.page:795
msgid ""
"GObject class definitions and implementations require some additional coding "
"style notices, and should always be <link xref=\"namespacing#gobject"
"\">correctly namespaced</link>."
msgstr ""
"Definice a implementace třídy GObject vyžadují pár doplňujících poznámek ke "
"stylu kódování a vždy by měly mít uveden <link xref=\"namespacing#gobject"
"\">správný jmenný prostor</link>."
#. (itstool) path: section/p
#: C/c-coding-style.page:801
msgid "Typedef declarations should be placed at the beginning of the file:"
msgstr "Deklarace typedef by měly být umístěny na začátku souboru:"
#. (itstool) path: section/code
#: C/c-coding-style.page:805
#, no-wrap
msgid ""
"\n"
"typedef struct _GtkBoxedStruct GtkBoxedStruct;\n"
"typedef struct _GtkMoreBoxedStruct GtkMoreBoxedStruct;"
msgstr ""
"\n"
"typedef struct _GtkBoxedStruct GtkBoxedStruct;\n"
"typedef struct _GtkMoreBoxedStruct GtkMoreBoxedStruct;"
#. (itstool) path: section/p
#: C/c-coding-style.page:809
msgid "This includes enumeration types:"
msgstr "Včetně výčtových typů:"
#. (itstool) path: section/code
#: C/c-coding-style.page:813
#, no-wrap
msgid ""
"\n"
"typedef enum\n"
"{\n"
" GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,\n"
" GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH\n"
"} GtkSizeRequestMode;"
msgstr ""
"\n"
"typedef enum\n"
"{\n"
" GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,\n"
" GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH\n"
"} GtkSizeRequestMode;"
#. (itstool) path: section/p
#: C/c-coding-style.page:820
msgid "And callback types:"
msgstr "A typů zpětných volání:"
#. (itstool) path: section/code
#: C/c-coding-style.page:824
#, no-wrap
msgid ""
"\n"
"typedef void (* GtkCallback) (GtkWidget *widget,\n"
" gpointer user_data);"
msgstr ""
"\n"
"typedef void (* GtkCallback) (GtkWidget *widget,\n"
" gpointer user_data);"
#. (itstool) path: section/p
#: C/c-coding-style.page:828
msgid ""
"Instance structures should be declared using <code>G_DECLARE_FINAL_TYPE</"
"code> or <code>G_DECLARE_DERIVABLE_TYPE</code>:"
msgstr ""
"Struktury instance by měly být deklarovány pomocí "
"<code>G_DECLARE_FINAL_TYPE</code> nebo <code>G_DECLARE_DERIVABLE_TYPE</code>:"
#. (itstool) path: section/code
#: C/c-coding-style.page:834
#, no-wrap
msgid ""
"\n"
"#define GTK_TYPE_FOO (gtk_foo_get_type ())\n"
"G_DECLARE_FINAL_TYPE (GtkFoo, gtk_foo, GTK, FOO, GtkWidget)"
msgstr ""
"\n"
"#define GTK_TYPE_FOO (gtk_foo_get_type ())\n"
"G_DECLARE_FINAL_TYPE (GtkFoo, gtk_foo, GTK, FOO, GtkWidget)"
#. (itstool) path: section/p
#: C/c-coding-style.page:838
msgid ""
"For final types, private data can be stored in the object struct, which "
"should be defined in the C file:"
msgstr ""
"Pro konečné typy mohou být privátní data uchována ve struktuře, která by "
"měla být definována v souboru C:"
#. (itstool) path: section/code
#: C/c-coding-style.page:843
#, no-wrap
msgid ""
"\n"
"struct _GtkFoo\n"
"{\n"
" GObject parent_instance;\n"
"\n"
" guint private_data;\n"
" gpointer more_private_data;\n"
"};"
msgstr ""
"\n"
"struct _GtkFoo\n"
"{\n"
" GObject parent_instance;\n"
"\n"
" guint private_data;\n"
" gpointer more_private_data;\n"
"};"
#. (itstool) path: section/p
#: C/c-coding-style.page:852
msgid ""
"For derivable types, private data must be stored in a private struct in the "
"C file, configured using <code>G_DEFINE_TYPE_WITH_PRIVATE()</code> and "
"accessed using a <code>_get_instance_private()</code> function:"
msgstr ""
"Pro typy, z který lze odvozovat další typy, musí být privátní data uchována "
"v privátní struktuře v souboru C, která je nastavena pomocí "
"<code>G_DEFINE_TYPE_WITH_PRIVATE()</code> a dostanete se k ní pomocí funkce "
"<code>_get_instance_private()</code>:"
#. (itstool) path: section/code
#: C/c-coding-style.page:858
#, no-wrap
msgid ""
"\n"
"#define GTK_TYPE_FOO gtk_foo_get_type ()\n"
"G_DECLARE_DERIVABLE_TYPE (GtkFoo, gtk_foo, GTK, FOO, GtkWidget)\n"
"\n"
"struct _GtkFooClass\n"
"{\n"
" GtkWidgetClass parent_class;\n"
"\n"
" void (* handle_frob) (GtkFrobber *frobber,\n"
" guint n_frobs);\n"
"\n"
" gpointer padding[12];\n"
"};"
msgstr ""
"\n"
"#define GTK_TYPE_FOO gtk_foo_get_type ()\n"
"G_DECLARE_DERIVABLE_TYPE (GtkFoo, gtk_foo, GTK, FOO, GtkWidget)\n"
"\n"
"struct _GtkFooClass\n"
"{\n"
" GtkWidgetClass parent_class;\n"
"\n"
" void (* handle_frob) (GtkFrobber *frobber,\n"
" guint n_frobs);\n"
"\n"
" gpointer padding[12];\n"
"};"
#. (itstool) path: section/p
#: C/c-coding-style.page:872
msgid ""
"Always use the <code>G_DEFINE_TYPE()</code>, "
"<code>G_DEFINE_TYPE_WITH_PRIVATE()</code>, and "
"<code>G_DEFINE_TYPE_WITH_CODE()</code> macros, or their abstract variants "
"<code>G_DEFINE_ABSTRACT_TYPE()</code>, "
"<code>G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE()</code>, and "
"<code>G_DEFINE_ABSTRACT_TYPE_WITH_CODE()</code>; also, use the similar "
"macros for defining interfaces and boxed types."
msgstr ""
"Vždy používejte makra <code>G_DEFINE_TYPE()</code>, "
"<code>G_DEFINE_TYPE_WITH_PRIVATE()</code> a <code>G_DEFINE_TYPE_WITH_CODE()</"
"code> nebo jejich abstraktní varianty <code>G_DEFINE_ABSTRACT_TYPE()</code>, "
"<code>G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE()</code> a "
"<code>G_DEFINE_ABSTRACT_TYPE_WITH_CODE()</code>. Podobná makra používejte "
"také pro definování rozhraní a boxované typy."
#. (itstool) path: section/p
#: C/c-coding-style.page:882
msgid "Interface types should always have the dummy typedef for cast purposes:"
msgstr ""
"Mezi typy rozhraní by vždy měla být i vzorová definice typu pro účely "
"přetypování:"
#. (itstool) path: section/code
#: C/c-coding-style.page:887
#, no-wrap
msgid ""
"\n"
"typedef struct _GtkFooable GtkFooable;"
msgstr ""
"\n"
"typedef struct _GtkFooable GtkFooable;"
#. (itstool) path: section/p
#: C/c-coding-style.page:890
msgid ""
"The interface structure should have ‘Interface’ postfixed to the dummy "
"typedef:"
msgstr ""
"Struktura rozhraní by měla mít v definici typu k názvu přidáno „Interface“:"
#. (itstool) path: section/code
#: C/c-coding-style.page:895
#, no-wrap
msgid ""
"\n"
"typedef struct _GtkFooableInterface GtkFooableInterface;"
msgstr ""
"\n"
"typedef struct _GtkFooableInterface GtkFooableInterface;"
#. (itstool) path: section/p
#: C/c-coding-style.page:898
msgid "Interfaces must have the following macros:"
msgstr "Rozhraní musí mít následující makra:"
#. (itstool) path: td/p
#: C/c-coding-style.page:905
msgid "Macro"
msgstr "Makro"
#. (itstool) path: td/p
#: C/c-coding-style.page:906
msgid "Expands to"
msgstr "Rozbalí se na"
#. (itstool) path: td/p
#: C/c-coding-style.page:911
msgid "<code>GTK_TYPE_<var>iface_name</var></code>"
msgstr "<code>GTK_TYPE_<var>iface_name</var></code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:912
msgid "<code><var>iface_name</var>_get_type</code>"
msgstr "<code><var>iface_name</var>_get_type</code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:915
msgid "<code>GTK_<var>iface_name</var></code>"
msgstr "<code>GTK_<var>iface_name</var></code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:916
msgid "<code>G_TYPE_CHECK_INSTANCE_CAST</code>"
msgstr "<code>G_TYPE_CHECK_INSTANCE_CAST</code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:919
msgid "<code>GTK_IS_<var>iface_name</var></code>"
msgstr "<code>GTK_IS_<var>iface_name</var></code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:920
msgid "<code>G_TYPE_CHECK_INSTANCE_TYPE</code>"
msgstr "<code>G_TYPE_CHECK_INSTANCE_TYPE</code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:923
msgid "<code>GTK_<var>iface_name</var>_GET_IFACE</code>"
msgstr "<code>GTK_<var>iface_name</var>_GET_IFACE</code>"
#. (itstool) path: td/p
#: C/c-coding-style.page:924
msgid "<code>G_TYPE_INSTANCE_GET_INTERFACE</code>"
msgstr "<code>G_TYPE_INSTANCE_GET_INTERFACE</code>"
#. (itstool) path: section/title
#: C/c-coding-style.page:932
msgid "Memory Allocation"
msgstr "Přidělování paměti"
#. (itstool) path: section/p
#: C/c-coding-style.page:934
msgid "When dynamically allocating data on the heap use <code>g_new()</code>."
msgstr "Když dynamicky alokujete data na haldě, použijte <code>g_new()</code>."
#. (itstool) path: section/p
#: C/c-coding-style.page:938
msgid ""
"Public structure types should always be returned after being zero-ed, either "
"explicitly for each member, or by using <code>g_new0()</code>."
msgstr ""
"Veřejné typy struktur by měly být vraceny vždy vynulované, buď výslovně pro "
"jednotlivé členy struktury nebo pomocí <code>g_new0()</code>."
#. (itstool) path: section/p
#: C/c-coding-style.page:944
msgid "See <link xref=\"memory-management\"/> for more details."
msgstr "Další podrobnosti viz <link xref=\"memory-management\"/>."
#. (itstool) path: section/title
#: C/c-coding-style.page:950
msgid "Macros"
msgstr "Makra"
#. (itstool) path: section/p
#: C/c-coding-style.page:952
msgid ""
"Try to avoid private macros unless strictly necessary. Remember to "
"<code>#undef</code> them at the end of a block or a series of functions "
"needing them."
msgstr ""
"Snažte se vyhnout privátním makrům, pokud nejsou vysloveně nutná. Pamatujte "
"na jejich zrušení pomocí <code>#undef</code> na konci bloku nebo funkce nebo "
"série funkcí, které je potřebovali."
#. (itstool) path: section/p
#: C/c-coding-style.page:958
msgid "Inline functions are usually preferable to private macros."
msgstr "Před makry je obvykle dávána přednost vloženým funkcím."
#. (itstool) path: section/p
#: C/c-coding-style.page:962
msgid "Public macros should not be used unless they evaluate to a constant."
msgstr ""
"Veřejná makra by se neměla používat, pokud nejsou vyhodnocována do konstanty."
#. (itstool) path: section/title
#: C/c-coding-style.page:969
msgid "Public API"
msgstr "Veřejné API"
#. (itstool) path: section/p
#: C/c-coding-style.page:971
msgid ""
"Avoid exporting variables as public API, since this is cumbersome on some "
"platforms. It is always preferable to add getters and setters instead. Also, "
"beware global variables in general."
msgstr ""
"Vyhněte se exportování proměnných jako veřejné API, protože na některých "
"platformách to může být nevhodné. Vždy místo toho dejte přednost funkcím pro "
"získání a nastavení hodnoty. Zkuste se také vyhnout globálním proměnným."
#. (itstool) path: section/title
#: C/c-coding-style.page:980
msgid "Private API"
msgstr "Privátní API"
#. (itstool) path: section/p
#: C/c-coding-style.page:982
msgid ""
"Non-exported functions that are needed in more than one source file should "
"be prefixed with an underscore (‘_’), and declared in a private header file. "
"For example, <code>_mylib_internal_foo()</code>."
msgstr ""
"Neexportované funkce, které jsou zapotřebí ve více než jednom zdrojovém "
"souboru by měly mít prefix v podobě podtržítka („_“) a měly by být "
"deklarovány v privátním hlavičkovém souboru. Například "
"<code>_mylib_internal_foo()</code>."
#. (itstool) path: section/p
#: C/c-coding-style.page:988
msgid "Underscore-prefixed functions are never exported."
msgstr "Funkce začínající podtržítkem nejsou nikdy exportovány."
#. (itstool) path: section/p
#: C/c-coding-style.page:992
msgid ""
"Non-exported functions that are only needed in one source file should be "
"declared static."
msgstr ""
"Neexportované funkce, které jsou zapotřebí jen v jednom zdrojovém souboru by "
"měly být deklarované jako statické."
#. (itstool) path: p/link
#: C/cc-by-sa-3-0.xml:4
msgid "Creative Commons Attribution-Share Alike 3.0 United States License"
msgstr "Creative Commons Attribution-Share Alike 3.0 United States License"
#. (itstool) path: license/p
#: C/cc-by-sa-3-0.xml:3
msgid "This work is licensed under a <_:link-1/>."
msgstr "Toto dílo je licencováno pod <_:link-1/>."
#. (itstool) path: license/p
#: C/cc-by-sa-3-0.xml:6
msgid ""
"As a special exception, the copyright holders give you permission to copy, "
"modify, and distribute the example code contained in this document under the "
"terms of your choosing, without restriction."
msgstr ""
"Jako zvláštní výjimka se vám držitelem autorských práv uděluje svolení "
"kopírovat, upravovat a šířit ukázkový kód obsažený v tomto dokumentu za "
"podmínek, které si zvolíte, bez dalších omezení."
#. (itstool) path: info/desc
#: C/databases.page:18
msgid "Simple persistent object stores"
msgstr "Úložiště pro jednoduché trvalé objekty"
#. (itstool) path: page/title
#: C/databases.page:21
msgid "Databases"
msgstr "Databáze"
#. (itstool) path: item/p
#: C/databases.page:27
msgid ""
"Use databases for appropriate use cases: not configuration data (use "
"GSettings). (<link xref=\"#when-to-use-databases\"/>)"
msgstr ""
"Databáze používejte ve vhodných případech, tzn. ne pro nastavení (k tomu "
"slouží GSettings). (<link xref=\"#when-to-use-databases\"/>)"
#. (itstool) path: item/p
#: C/databases.page:31
msgid ""
"Choose between GOM and GVDB based on whether indexing is required. (<link "
"xref=\"#when-to-use-databases\"/>)"
msgstr ""
"Volte mezi GOM a GVDB podle toho, jestli je zapotřebí indexování. (<link "
"xref=\"#when-to-use-databases\"/>)"
#. (itstool) path: item/p
#: C/databases.page:35
msgid ""
"Consider your vacuuming policy before committing to using GOM. (<link xref="
"\"#when-to-use-databases\"/>)"
msgstr ""
"Popřemýšlejte o zásadách úklidu databáze, než zařadíte používání GOM. (<link "
"xref=\"#when-to-use-databases\"/>)"
#. (itstool) path: item/p
#: C/databases.page:39
msgid ""
"Avoid SQL injection vulnerabilities by using prepared statements. (<link "
"xref=\"#sql-injection\"/>)"
msgstr ""
"Zranitelnosti v podobě injektáže SQL se vyhněte pomocí předpřipravených "
"dotazů. (<link xref=\"#sql-injection\"/>)"
#. (itstool) path: section/title
#: C/databases.page:47
msgid "When to Use Databases"
msgstr "Kdy používat databáze"
#. (itstool) path: section/p
#: C/databases.page:49
msgid ""
"Configuration data should be stored in <link href=\"https://developer.gnome."
"org/gio/stable/GSettings.html\">GSettings</link>. As a rule of thumb, if "
"some data needs to be persistent and affects how an application behaves, it "
"is configuration data. If it could potentially be subject to policies "
"imposed by the system administrator (such as proxy or lockdown settings), it "
"is configuration data. If it contains user created content, it is not "
"configuration data, and should not be stored in GSettings."
msgstr ""
"Data nastavení by měla být uložena v <link href=\"https://developer.gnome."
"org/gio/stable/GSettings.html\">GSettings</link>. Platí, že data, která musí "
"být trvalá a ovlivňují chování aplikace, jsou data nastavení. Pokud se jedná "
"o záležitost, na kterou se vztahují zásady určené správcem systému (jako "
"třeba nastavení proxy nebo zamykání), jde o data nastavení. Jestliže to ale "
"obsahuje uživatelem vytvořený obsah, nejedná se o data nastavení a nemělo by "
"to být uloženo v GSettings."
#. (itstool) path: section/p
#: C/databases.page:60
msgid ""
"For such situations where user data is highly structured, storing it in a "
"database is sensible. There are two main databases suggested for use within "
"GNOME: GOM and GVDB. GOM is a wrapper around SQLite, and hence implements "
"indexing of fields and SQL-style queries. GVDB is a much simpler object "
"store, supporting fast serialization of a dictionary of objects to disk."
msgstr ""
"Pro situace, kdy jsou data vysoce strukturovaná, je pro uchování rozumným "
"řešením databáze. V GNOME jsou doporučovány dvě hlavní databáze: GOM a GVDB. "
"GOM ve skutečnosti obaluje SQLite a tudíž implementuje indexaci polí a "
"dotazy ve stylu SQL. GVDB je mnohem jednodušší úložiště objektů, které "
"podporuje rychlou serializaci slovníku objektů na disk."
#. (itstool) path: section/p
#: C/databases.page:69
msgid ""
"GOM should be used if you need advanced features, especially indexing. GVDB "
"should be used otherwise."
msgstr ""
"GOM by s měl použít, když jsou zapotřebí pokročilé funkce, především "
"indexování. V ostatních případech by mělo být použito GVDB."
#. (itstool) path: section/p
#: C/databases.page:74
msgid ""
"Before deciding to use GOM (and hence SQLite), you must consider a vacuuming "
"policy for the database, and whether your use case will interact well with "
"SQLite’s vacuuming system. Vacuuming is effectively SQLite’s term for "
"defragmenting the database — if a database is not vacuumed appropriately, "
"performance will degrade and the database size will increase indefinitely. "
"Read <link href=\"http://blogs.gnome.org/jnelson/2015/01/06/sqlite-vacuum-"
"and-auto_vacuum/\">this article</link> on vacuuming for more information; "
"please consider it before choosing to use GOM."
msgstr ""
"Dříve, než se rozhodnete použít GOM (a tím pádem SQLite), musíte zvážit "
"zásady úklidu databáze (vacuum) a jestli vaše použití bude dobře "
"spolupracovat s úklidovým systémem SQLite. Úklid je v podstatě výraz "
"používaný u SQLite (respektive u databází obecně) pro defragmentaci databáze "
"— pokud databáze není řádně defragmentovaná, degraduje to výkon a značně "
"narůstá její velikost. Více informací se dočtete v <link href=\"http://blogs."
"gnome.org/jnelson/2015/01/06/sqlite-vacuum-and-auto_vacuum/\">tomto článku</"
"link> na dané téma. Popřemýšlejte o něm, než zvolíte použití GOM."
#. (itstool) path: section/p
#: C/databases.page:86
msgid ""
"GNOME has another database library: GNOME Data Access (GDA). This is "
"targeted at abstracting access to various types of relational database, for "
"use in a database utility program or office program, for example. It is not "
"suitable for storing <link href=\"https://developer.gnome.org/gio/stable/"
"GSettings.html\">user settings</link>."
msgstr ""
"GNOME má ještě další databázovou knihovnu: GNOME Data Access (GDA). Je "
"zaměřená na abstraktní přístup k různým typům relačních databází, pro "
"použití například v programech pro administrační práci s databázemi nebo v "
"kancelářských programech. Naopak není vhodná pro ukládání <link href="
"\"https://developer.gnome.org/gio/stable/GSettings.html\">uživatelských "
"nastavení</link>."
#. (itstool) path: section/title
#: C/databases.page:97
msgid "Using GOM"
msgstr "Používání GOM"
#. (itstool) path: section/p
#: C/databases.page:99
msgid ""
"Providing a GOM tutorial is beyond the scope of this document, but a <link "
"href=\"https://developer.gnome.org/gom/\">reference manual is available</"
"link>."
msgstr ""
"Výuka použití GOM přesahuje rámec tohoto dokumentu, ale <link href=\"https://"
"developer.gnome.org/gom/\">je k dispozici referenční příručka</link>."
#. (itstool) path: section/title
#: C/databases.page:113
msgid "SQL Injection"
msgstr "Injektáž SQL"
#. (itstool) path: section/p
#: C/databases.page:115
msgid ""
"GOM does allow access to the lower level SQLite query APIs. When using them, "
"queries <em style=\"strong\">must</em> be constructed using SQLite’s <link "
"href=\"https://www.sqlite.org/c3ref/stmt.html\">prepared statement</link> "
"and <link href=\"https://www.sqlite.org/c3ref/bind_blob.html\">value "
"binding</link> API, rather than by constructing SQL strings then passing "
"them to SQLite to parse. Constructing strings makes <link href=\"https://en."
"wikipedia.org/wiki/SQL_injection\">SQL injection</link> vulnerabilities very "
"likely, which can give attackers access to arbitrary user data from the "
"database."
msgstr ""
"GOM neumožňuje přístup k nízkoúrovňovému dotazovacímu API databáze SQLite. "
"Když jej používáte, <em style=\"strong\">musíte</em> místo přímého sestavení "
"řetězce s SQL, a jeho následného předání ke zpracování, dotazy sestavovat "
"pomocí <link href=\"https://www.sqlite.org/c3ref/stmt.html"
"\">předpřipravených výrazů</link> SQLite a API pro <link href=\"https://www."
"sqlite.org/c3ref/bind_blob.html\">napojení hodnot</link>. Přímé sestavování "
"řetězců zvyšuje pravděpodobnost útoků typu <link href=\"https://cs.wikipedia."
"org/wiki/SQL_injection\">injektování SQL</link>, pomocí kterých může útočník "
"získat přístup k libovolným uživatelským datům v databázi."
#. (itstool) path: section/title
#: C/databases.page:131
msgid "Using GVDB"
msgstr "Používání GVDB"
#. (itstool) path: section/p
#: C/databases.page:133
msgid ""
"GVDB has a simple API which mirrors a conventional hash table. Presently, "
"GVDB is only available as a copy-and-paste library; fetch the most recent "
"copy of the code from <link href=\"https://gitlab.gnome.org/GNOME/gvdb"
"\">GVDB git</link> and copy it into your project. It is licensed under "
"LGPLv2.1+."
msgstr ""
"GVDB má jednoduché API, které zrcadlí běžné hašovací tabulky. V současnosti "
"je GVDB odstupné jen jako knihovna pro postup „kopírovat a vložit“. Stáhněte "
"si nejnovější kopii kódu z <link href=\"https://gitlab.gnome.org/GNOME/gvdb"
"\">gitu GVDB</link> a nakopírujte ji do svého projektu. Je licencována pod "
"LGPLv2.1+."
#. (itstool) path: section/p
#: C/databases.page:141
msgid "A full GVDB tutorial is beyond the scope of this document."
msgstr "Úplná výuka GVDB překračuje rozsah tohoto dokumentu."
#. (itstool) path: info/desc
#: C/documentation.page:26
msgid "Adding documentation to libraries and APIs"
msgstr "Doplnění dokumentace ke knihovnám a k API"
#. (itstool) path: page/title
#. (itstool) path: section/title
#: C/documentation.page:29 C/memory-management.page:473
msgid "Documentation"
msgstr "Dokumentace"
#. (itstool) path: item/p
#: C/documentation.page:35
msgid ""
"Use gtk-doc with up-to-date settings for API documentation. (<link xref="
"\"#gtk-doc\"/>)"
msgstr ""
"Pro dokumentaci API používejte gtk-doc s nastavením pro udržování aktuální "
"podoby. (<link xref=\"#gtk-doc\"/>)"
#. (itstool) path: item/p
#: C/documentation.page:39
msgid ""
"Use XML entities for including external symbols into the documentation. "
"(<link xref=\"#build-system\"/>)"
msgstr ""
"Používejte prvky XML pro zahrnutí externích symbolů do dokumentace. (<link "
"xref=\"#build-system\"/>)"
#. (itstool) path: item/p
#: C/documentation.page:43
msgid ""
"Use a consistent, standard, table of contents for all API documentation to "
"maintain familiarity. (<link xref=\"#standard-layout\"/>)"
msgstr ""
"Používejte jednotný standardní obsah ve všech dokumentacích k API, aby šla "
"udržovat podle běžných zvyklostí. (<link xref=\"#standard-layout\"/>)"
#. (itstool) path: item/p
#: C/documentation.page:47
msgid ""
"Use <cmd>gdbus-codegen</cmd> to generate D-Bus API documentation to include "
"in the gtk-doc build. (<link xref=\"#dbus-api\"/>)"
msgstr ""
"Používejte <cmd>gdbus-codegen</cmd> k vygenerování dokumentace k API pro D-"
"Bus, která se zahrne do sestavení gtk-doc. (<link xref=\"#dbus-api\"/>)"
#. (itstool) path: item/p
#: C/documentation.page:51
msgid ""
"Add introspection annotations to all API documentation. (<link xref="
"\"#introspection-annotations\"/>)"
msgstr ""
"Do veškeré dokumentace k API přidejte anotace k introspekci. (<link xref="
"\"#introspection-annotations\"/>)"
#. (itstool) path: item/p
#: C/documentation.page:55
msgid ""
"Add <code>Since</code> lines to all API documentation. (<link xref=\"#symbol-"
"versioning\"/>)"
msgstr ""
"Do všech dokumentací k API doplňte řádky <code>Since</code>. (<link xref="
"\"#symbol-versioning\"/>)"
#. (itstool) path: item/p
#: C/documentation.page:59
msgid "Enable gtk-doc tests. (<link xref=\"#keeping-up-to-date\"/>)"
msgstr "Povolte testy gtk-doc. (<link xref=\"#keeping-up-to-date\"/>)"
#. (itstool) path: section/title
#: C/documentation.page:66
msgid "gtk-doc"
msgstr "gtk-doc"
#. (itstool) path: section/p
#: C/documentation.page:68
msgid ""
"The preferred documentation system for GNOME libraries is <link href="
"\"http://www.gtk.org/gtk-doc/\">gtk-doc</link>, which extracts inline "
"comments from the code to let you build a <link href=\"http://docbook.org/"
"\">DocBook</link> document and collection of HTML pages. These can then be "
"read in <link href=\"https://wiki.gnome.org/Apps/Devhelp\">Devhelp</link>. A "
"lot of GNOME’s infrastructure is built to handle with documentation written "
"using gtk-doc."
msgstr ""
"Upřednostňovaným systémem pro dokumentovaní knihoven GNOME je <link href="
"\"http://www.gtk.org/gtk-doc/\">gtk-doc</link>, který získává vložené "
"komentáře z kódu, aby z nich sestavil dokument <link href=\"http://docbook."
"org/\">DocBook</link> a sadu stránek HTML. Ty je pak možné číst v aplikaci "
"<link href=\"https://wiki.gnome.org/Apps/Devhelp\">Devhelp</link>. Velká "
"část infrastruktury GNOME je postavena tak, aby pracoval s dokumentací "
"napsanou pomocí gtk-doc."
#. (itstool) path: section/title
#: C/documentation.page:81
msgid "Build System"
msgstr "Systém sestavení"
#. (itstool) path: section/p
#: C/documentation.page:83
msgid ""
"To integrate gtk-doc into a project’s build system, follow the <link href="
"\"https://developer.gnome.org/gtk-doc-manual/stable/settingup.html.en\"> "
"instructions in the gtk-doc manual</link>. Note that while the "
"<file>sections.txt</file> file is automatically generated the first time gtk-"
"doc is run, it is not generated subsequently, and should be kept up to date "
"manually. It should also be <link href=\"https://developer.gnome.org/gtk-doc-"
"manual/stable/settingup_vcs.html.en\"> in version control</link>."
msgstr ""
"Při začleňování gtk-doc do systému sestavení u projektu <link href=\"https://"
"developer.gnome.org/gtk-doc-manual/stable/settingup.html.en\">se řiďte "
"instrukcemi v příručce k gtk-doc</link>. Přípomínáme, že soubor "
"<file>sections.txt</file> je sice vygenerován automaticky, ale jen při "
"prvním spuštění gtk-doc. Následně již generován není a musí být udržován "
"ručně. Proto by měl být také <link href=\"https://developer.gnome.org/gtk-"
"doc-manual/stable/settingup_vcs.html.en\">v systému pro správu verzí</link>."
#. (itstool) path: section/p
#: C/documentation.page:94
msgid ""
"gtk-doc’s <code>no-tmpl</code> flavour should be used, and XML mode should "
"be used instead of SGML. (tmpl mode and SGML are both outdated and slower "
"than XML.)"
msgstr ""
"Měli byste používat variantu gtk-doc <code>no-tmpl</code> a režim XML "
"namísto SGML. (Režim tmpl a SGML jsou zastaralé a pomalejší než XML.)"
#. (itstool) path: section/p
#: C/documentation.page:106
msgid ""
"If the package version is needed to be substituted into the documentation, "
"create a file named <file>docs/version.xml.in</file>, containing:"
msgstr ""
"Když je zapotřebí vložit číslo balíčku do textu dokumentace, vytvořte soubor "
"s názvem <file>docs/version.xml.in</file>, který bude obsahovat:"
#. (itstool) path: section/code
#: C/documentation.page:110
#, no-wrap
msgid "@PACKAGE_VERSION@"
msgstr "@PACKAGE_VERSION@"
#. (itstool) path: section/p
#: C/documentation.page:111
msgid ""
"Add it to <code>AC_CONFIG_FILES</code> in <file>configure.ac</file>, then "
"include it into the main documentation file (<file>*-docs.xml</file>) using: "
"<code><!ENTITY version SYSTEM \"version.xml\"></code> in the "
"<code>DOCTYPE</code> at the top of the document. The package version can "
"then be used inline as <code>&version;</code>."
msgstr ""
"Přidejte jej do <code>AC_CONFIG_FILES</code> v <file>configure.ac</file> a "
"pak jej vložte do hlavního souboru dokumentace (<file>*-docs.xml</file>) "
"pomocí: <code><!ENTITY version SYSTEM \"version.xml\"></code> v "
"<code>DOCTYPE</code> na začátku dokumentu. Verzi balíčku pak můžete vkládat "
"pomocí <code>&version;</code>."
#. (itstool) path: section/title
#: C/documentation.page:121
msgid "Standard Layout"
msgstr "Standardní uspořádání"
#. (itstool) path: section/p
#: C/documentation.page:123
msgid ""
"Using a standard layout for the table of contents, sections, appendices, "
"etc. means the same <file><var>project-name</var>-docs.xml</file> template "
"can be reused with few changes between projects. It also means the "
"documentation layout is similar across all projects, making it more familiar "
"to developers."
msgstr ""
"Použití standardního uspořádání pro obsah, oddíly, dodatky atd. znamená, že "
"stejnou šablonu <file><var>název-projektu</var>-docs.xml</file> můžete znovu "
"použít s minimálními změnami pro různé projekty. A rovněž to znamená, že "
"uspořádání dokumentace bude obdobné napříč všemi projekty, takže se v ní "
"vývojáři budou lépe orientovat."
#. (itstool) path: section/p
#: C/documentation.page:131
msgid "The following layout is suggested:"
msgstr "Je doporučováno následující uspořádání:"
#. (itstool) path: listing/title
#: C/documentation.page:135
msgid "<file><var>project-name</var>-docs.xml</file>"
msgstr "<file><var>název-projektu</var>-docs.xml</file>"
#. (itstool) path: listing/desc
#: C/documentation.page:136
msgid "A template top-level gtk-doc file for a project"
msgstr "Soubor gtk-doc s šablonou nejvyšší úrovně pro projekt"
#. (itstool) path: section/title
#: C/documentation.page:142
msgid "Licensing"
msgstr "Licencování"
#. (itstool) path: section/p
#: C/documentation.page:150
msgid ""
"It is important to make the license used for API references clear, "
"especially if they contain code examples which could be copied around."
msgstr ""
"Je důležité, aby licence použitá pro referenční příručku k API, byla čistá, "
"hlavně když je součástí dokumentace i ukázkový kód, který je možné kopírovat."
#. (itstool) path: section/p
#: C/documentation.page:155
msgid ""
"Typically, projects use the same license for their API reference as for the "
"project’s code itself, to avoid confusion. Some other projects use CC-BY-SA "
"3.0 for all their reference documentation. The choice is yours."
msgstr ""
"Typicky používá projekt pro svoji referenční příručku tu stejnou licenci, "
"jako pro vlastní kód projektu, aby se předešlo nejasnostem. Některé projekty "
"zase používají pro veškerou svoji dokumentaci CC-BY-SA 3.0. Volba je čistě "
"na vás."
#. (itstool) path: section/p
#: C/documentation.page:161
msgid ""
"As shown in the <link xref=\"#standard-layout\">Standard Layout</link> you "
"should include a <file>license.xml</file> in the top-level gtk-doc DocBook "
"file which gives the full text of your documentation license."
msgstr ""
"Jak je ukázáno ve <link xref=\"#standard-layout\">Standardním uspořádání</"
"link>, měli byste do souboru gtk-doc DocBook nejvyšší úrovně vložit "
"<file>licence.xml</file>, který poskytne úplný text licence vaší dokumentace."
#. (itstool) path: section/title
#: C/documentation.page:169
msgid "Public APIs"
msgstr "Veřejná API"
#. (itstool) path: section/p
#: C/documentation.page:171
msgid ""
"All public APIs must have gtk-doc comments. For functions, these should be "
"placed in the source file, directly above the function."
msgstr ""
"Veškerá veřejná API musí mít komentáře gtk-doc. Pro funkce by měly být "
"umístěny ve zdrojovém souboru, přímo nad funkcí."
#. (itstool) path: section/code
#: C/documentation.page:176
#, no-wrap
msgid ""
"/**\n"
" * gtk_get_flow:\n"
" * @widget: a #GtkWidget\n"
" *\n"
" * Gets the flow of a widget.\n"
" *\n"
" * Note that flows may be laminar or turbulent...\n"
" *\n"
" * Returns: (transfer none): the flow of @widget\n"
" */\n"
"GtkFlow *\n"
"gtk_get_flow (GtkWidget *widget)\n"
"{\n"
"\n"
" ...\n"
"\n"
"}"
msgstr ""
"/**\n"
" * gtk_get_flow:\n"
" * @widget: a #GtkWidget\n"
" *\n"
" * Gets the flow of a widget.\n"
" *\n"
" * Note that flows may be laminar or turbulent...\n"
" *\n"
" * Returns: (transfer none): the flow of @widget\n"
" */\n"
"GtkFlow *\n"
"gtk_get_flow (GtkWidget *widget)\n"
"{\n"
"\n"
" ...\n"
"\n"
"}"
#. (itstool) path: section/p
#: C/documentation.page:194
msgid ""
"Documentation comments for macros, function types, class structs, etc. "
"should be placed next to the definitions, typically in header files."
msgstr ""
"Dokumentační komentáře pro makra, typy funkcí, struktury tříd atd. by měly "
"být umístěny vedle definici, typicky v hlavičkových souborech."
#. (itstool) path: section/p
#: C/documentation.page:200
msgid ""
"Section introductions should be placed in the source file they describe, "
"after the license header:"
msgstr ""
"Úvody k jednotlivým oddílům by měly být umístěné ve zdrojových souborech, "
"které popisují, za hlavičkou s licencí:"
#. (itstool) path: section/code
#: C/documentation.page:205
#, no-wrap
msgid ""
"/**\n"
" * SECTION:gtksizerequest\n"
" * @Short_Description: Height-for-width geometry management\n"
" * @Title: GtkSizeRequest\n"
" *\n"
" * The GtkSizeRequest interface is GTK+'s height-for-width (and\n"
" * width-for-height) geometry management system.\n"
" * ...\n"
" */"
msgstr ""
"/**\n"
" * SECTION:gtksizerequest\n"
" * @Short_Description: Height-for-width geometry management\n"
" * @Title: GtkSizeRequest\n"
" *\n"
" * The GtkSizeRequest interface is GTK+'s height-for-width (and\n"
" * width-for-height) geometry management system.\n"
" * ...\n"
" */"
#. (itstool) path: section/p
#: C/documentation.page:215
msgid ""
"Keep in mind that in order to include a function, macro, function type, or "
"struct type, it needs to be listed in your documentation’s <file>modulename-"
"sections.txt</file> file."
msgstr ""
"Mějte na paměti, že aby se funkce, makro, typ funkce nebo typ struktura byly "
"součástí, je zapotřebí je uvést v souboru <file>modulename-sections.txt</"
"file> vaší dokumentace."
#. (itstool) path: section/p
#: C/documentation.page:221
msgid ""
"To properly document a new class, it needs to be given its own section in "
"<file>modulename-sections.txt</file>, needs to be included in your toplevel "
"<file>modulename-docs.sgml</file>, and the <code>get_type()</code> function "
"for your class needs to be listed in your <file>modulename.types</file>."
msgstr ""
"Správné zdokumentování nové třídy vyžaduje poskytnutí jejího vlastního "
"oddílu v <file>modulename-sections.txt</file>, musí být vložená v vašem "
"<file>modulename-docs.sgml</file> nejvyšší úrovně a funkce <code>get_type()</"
"code> pro vaši třídu musí být uvedená v <file>modulename.types</file>."
#. (itstool) path: section/title
#: C/documentation.page:231
msgid "Introspection Annotations"
msgstr "Poznámky k introspekci"
#. (itstool) path: section/p
#: C/documentation.page:233
msgid ""
"Each gtk-doc comment should have appropriate <link href=\"https://wiki.gnome."
"org/Projects/GObjectIntrospection/Annotations\"> GObject introspection "
"annotations</link>. These are useful for two reasons:"
msgstr ""
"Každý komentář gtk-doc by měl mít příslušné <link href=\"https://wiki.gnome."
"org/Projects/GObjectIntrospection/Annotations\">anotace k introspekci "
"GObject</link>. To je užitečné ze dvou důvodů:"
#. (itstool) path: item/p
#: C/documentation.page:240
msgid ""
"They add important information about parameter types, nullability and memory "
"management to the C API documentation generated by gtk-doc."
msgstr ""
"Přidá to důležitou informaci o typech parametrů, možných prázdných hodnotách "
"a správě paměti do dokumentace k API C vygenerované pomocí gtk-doc."
#. (itstool) path: item/p
#: C/documentation.page:244
msgid ""
"They allow public APIs to be automatically bound in other languages, such as "
"Python or JavaScript."
msgstr ""
"Umožní to veřejným API navázat se automaticky na další jazyky, jako třeba "
"Python nebo JavaScript."
#. (itstool) path: section/p
#: C/documentation.page:250
msgid ""
"Introspection annotations add information to APIs (functions, function "
"parameters, function return values, structures, GObject properties, GObject "
"signals) which is otherwise not present in the machine readable C API and "
"only exists in the form of human readable documentation or convention. They "
"are very important."
msgstr ""
"Anotace k introspekci přidává do API (funkce, parametry funkcí, návratové "
"hodnoty funkcí, struktury, vlastnosti GObject, signály GObject) informace, "
"které ve strojově čitelné podobě API v C nejsou jinak dostupné a existují "
"jen ve formě čitelné člověkem v dokumentaci nebo jako zvyklosti. Proto jsou "
"velmi důležité."
#. (itstool) path: section/p
#: C/documentation.page:258
msgid ""
"In gtk-doc comments, annotations should be preferred over human-readable "
"equivalents. For example, when documenting a function parameter which may be "
"<code>NULL</code>, use the <code>(nullable)</code> annotation rather than "
"some text:"
msgstr ""
"V komentářích gtk-doc by se měla dávat přednost anotacím před variantou "
"čitelnou pro člověka. Například, když dokumentujete parametr funkce, který "
"může nabývat hodnoty <code>NULL</code>, použijte namísto nějakého textu "
"raději anotaci <code>(nullable)</code>:"
#. (itstool) path: section/code
#: C/documentation.page:264
#, no-wrap
msgid ""
"/**\n"
" * my_function:\n"
" * @parameter: (nullable): some parameter which affects something\n"
" *\n"
" * Body of the function documentation.\n"
" */"
msgstr ""
"/**\n"
" * my_function:\n"
" * @parameter: (nullable): some parameter which affects something\n"
" *\n"
" * Body of the function documentation.\n"
" */"
#. (itstool) path: section/p
#: C/documentation.page:271
msgid "Instead of:"
msgstr "Použijte namísto:"
#. (itstool) path: section/code
#: C/documentation.page:274
#, no-wrap
msgid ""
"/**\n"
" * my_bad_function:\n"
" * @parameter: some parameter which affects something, or %NULL to ignore\n"
" *\n"
" * Bad body of the function documentation.\n"
" */"
msgstr ""
"/**\n"
" * my_bad_function:\n"
" * @parameter: some parameter which affects something, or %NULL to ignore\n"
" *\n"
" * Bad body of the function documentation.\n"
" */"
#. (itstool) path: section/p
#: C/documentation.page:281
msgid ""
"For more information on introspection, see the <link xref=\"introspection"
"\">introspection guidelines</link>."
msgstr ""
"Více informací k introspekci najdete v <link xref=\"introspection\">pokynech "
"k introspekci</link>."
#. (itstool) path: section/title
#: C/documentation.page:288
msgid "Symbol Versioning"
msgstr "Číslování verzí symbolů"
#. (itstool) path: section/p
#: C/documentation.page:290
msgid ""
"Whenever a symbol is added to the public API, it should have a documentation "
"comment added. This comment should always contain a <code>Since</code> line "
"with the package version number of the release which will first contain the "
"new API. This should be the number currently in <file>configure.ac</file> if "
"<link xref=\"versioning#release-process\">post-release version incrementing</"
"link> is being used."
msgstr ""
"Kdykoliv je do veřejného API přidán nějaký symbol, měl by pro něj být přidán "
"i dokumentační komentář. Ten by měl vždy obsahovat řádek <code>Since</code> "
"s číslem verze vydání balíčku, který poprvé obsahuje nové API. Mělo by se "
"jednat o číslo verze, které se právě nachází v <file>configure.ac</file>, za "
"předpokladu, že používáte <link xref=\"versioning#release-process"
"\">zvyšování čísla verze po vydání</link>."
#. (itstool) path: section/p
#. (itstool) path: example/p
#: C/documentation.page:300 C/memory-management.page:494 C/threading.page:79
msgid "For example:"
msgstr "Například:"
#. (itstool) path: section/code
#: C/documentation.page:303
#, no-wrap
msgid ""
"/**\n"
" * my_function:\n"
" * @param: some parameter\n"
" *\n"
" * Body of the function documentation.\n"
" *\n"
" * Since: 0.5.0\n"
" */"
msgstr ""
"/**\n"
" * my_function:\n"
" * @param: some parameter\n"
" *\n"
" * Body of the function documentation.\n"
" *\n"
" * Since: 0.5.0\n"
" */"
#. (itstool) path: section/p
#: C/documentation.page:312
msgid ""
"gtk-doc uses this information to generate indexes of the APIs added in each "
"release. These should be added to the main <file>*-docs.xml</file> as an "
"appendix:"
msgstr ""
"gtk-doc používá tyto informace k vygenerování rejstříku API přidaných v "
"jednotlivých vydáních. Do <file>*-docs.xml</file> by jako dodatek mělo být "
"přidáno následující:"
#. (itstool) path: section/code
#: C/documentation.page:317
#, no-wrap
msgid ""
"<part>\n"
"\t<title>Appendices</title>\n"
"\t<index id=\"api-index-full\">\n"
"\t\t<title>API Index</title>\n"
"\t\t<xi:include href=\"xml/api-index-full.xml\"><xi:fallback/></xi:include>\n"
"\t</index>\n"
"\t<index id=\"api-index-deprecated\">\n"
"\t\t<title>Index of deprecated symbols</title>\n"
"\t\t<xi:include href=\"xml/api-index-deprecated.xml\"><xi:fallback/></xi:include>\n"
"\t</index>\n"
"\t<index role=\"0.1.0\">\n"
"\t\t<title>Index of new symbols in 0.1.0</title>\n"
"\t\t<xi:include href=\"xml/api-index-0.1.0.xml\"><xi:fallback/></xi:include>\n"
"\t</index>\n"
"\t<!-- More versions here. -->\n"
"\t<xi:include href=\"xml/annotation-glossary.xml\"><xi:fallback /></xi:include>\n"
"</part>"
msgstr ""
"<part>\n"
"\t<title>Appendices</title>\n"
"\t<index id=\"api-index-full\">\n"
"\t\t<title>API Index</title>\n"
"\t\t<xi:include href=\"xml/api-index-full.xml\"><xi:fallback/></xi:include>\n"
"\t</index>\n"
"\t<index id=\"api-index-deprecated\">\n"
"\t\t<title>Index of deprecated symbols</title>\n"
"\t\t<xi:include href=\"xml/api-index-deprecated.xml\"><xi:fallback/></xi:include>\n"
"\t</index>\n"
"\t<index role=\"0.1.0\">\n"
"\t\t<title>Index of new symbols in 0.1.0</title>\n"
"\t\t<xi:include href=\"xml/api-index-0.1.0.xml\"><xi:fallback/></xi:include>\n"
"\t</index>\n"
"\t<!-- More versions here. -->\n"
"\t<xi:include href=\"xml/annotation-glossary.xml\"><xi:fallback /></xi:include>\n"
"</part>"
#. (itstool) path: section/title
#: C/documentation.page:337
msgid "D-Bus APIs"
msgstr "API pro D-Bus"
#. (itstool) path: section/p
#: C/documentation.page:339
msgid ""
"D-Bus interface descriptions contain documentation comments, and these can "
"be extracted from the XML using <cmd>gdbus-codegen</cmd>, and turned into "
"DocBook files to be included by gtk-doc."
msgstr ""
"Popisy rozhraní D-Bus obsahují dokumentační komentáře a ty je možné získat z "
"XML pomocí <cmd>gdbus-codegen</cmd> a nasměrovat do souborů DocBook, aby "
"byly začleněny pomocí gtk-doc."
#. (itstool) path: section/p
#: C/documentation.page:352
msgid ""
"The DocBook files can be included in the main <file>*-docs.xml</file> file "
"using:"
msgstr ""
"Soubory DocBook mohou být vloženy do souboru <file>*-docs.xml</file> pomocí:"
#. (itstool) path: section/code
#: C/documentation.page:356
#, no-wrap
msgid ""
"<chapter>\n"
" <title>C Interfaces</title>\n"
" <partintro>\n"
" <para>C wrappers for the D-Bus interfaces.</para>\n"
" </partintro>\n"
"\n"
" <xi:include href=\"xml/SomeDBusService.xml\"/>\n"
" <xi:include href=\"xml/SomeOtherService.xml\"/>\n"
"</chapter>"
msgstr ""
"<chapter>\n"
" <title>C Interfaces</title>\n"
" <partintro>\n"
" <para>C wrappers for the D-Bus interfaces.</para>\n"
" </partintro>\n"
"\n"
" <xi:include href=\"xml/SomeDBusService.xml\"/>\n"
" <xi:include href=\"xml/SomeOtherService.xml\"/>\n"
"</chapter>"
#. (itstool) path: section/p
#: C/documentation.page:366
msgid ""
"The generated XML files must be included in the <code>content_files</code> "
"variable in your gtk-doc <file>Makefile.am</file>, otherwise the build will "
"fail. (This is to fix situations where the <code>builddir</code> does not "
"equal the <code>srcdir</code>.)"
msgstr ""
"Vygenerované soubory XML musí být zahrnuté v proměnné <code>content_files</"
"code> ve vašem <file>Makefile.am</file> pro gtk-doc, jinak sestavení selže. "
"(Je to kvůli nápravě situací, kdy složka <code>builddir</code> není shodná "
"se <code>srcdir</code>.)"
#. (itstool) path: section/title
#: C/documentation.page:375
msgid "Keeping Documentation Up to Date"
msgstr "Udržování dokumentace v aktuálním stavu"
#. (itstool) path: section/p
#: C/documentation.page:377
msgid ""
"gtk-doc comes with support for checking the documentation with some basic "
"tests. These check that all version indexes are included in the main <file>*-"
"docs.xml</file> file and that all symbols are documented, among other things."
msgstr ""
"gtk-doc obsahuje podporu pro kontrolu dokumentace pomocí pár základních "
"testů. Mimo jiných věcí se zkontroluje, jestli jsou všechny verze indexů "
"vložené v hlavním souboru <file>*-docs.xml</file> a jestli jsou "
"zdokumentované všechny symboly."
#. (itstool) path: section/p
#: C/documentation.page:384
msgid ""
"These tests should always be enabled, by adding the following to your gtk-"
"doc <file>Makefile.am</file>:"
msgstr ""
"Tyto testy by měly být vždy povolené přidáním následujícího do "
"<file>Makefile.am</file> pro váš gtk-doc:"
#. (itstool) path: section/code
#: C/documentation.page:388
#, no-wrap
msgid "TESTS = $(GTKDOC_CHECK)"
msgstr "TESTS = $(GTKDOC_CHECK)"
#. (itstool) path: section/p
#: C/documentation.page:390
msgid "They will then be run as part of <cmd>make check</cmd>."
msgstr "Budou pak spouštěny jako součást <cmd>make check</cmd>."
#. (itstool) path: info/desc
#: C/file-system.page:18
msgid "Accessing the file system"
msgstr "Jak přistupovat k souborovému systému"
#. (itstool) path: page/title
#: C/file-system.page:21
msgid "File System Access"
msgstr "Přístup k souborovému systému"
#. (itstool) path: synopsis/p
#: C/file-system.page:26
msgid ""
"There are a few anti-patterns to consider when accessing the file system. "
"This article assumes knowledge of the standard <link href=\"https://"
"developer.gnome.org/gio/stable/GFile.html\"><code>GFile</code></link>, <link "
"href=\"https://developer.gnome.org/gio/stable/GInputStream.html"
"\"><code>GInputStream</code></link> and <link href=\"https://developer.gnome."
"org/gio/stable/GOutputStream.html\"><code>GOutputStream</code></link> APIs."
msgstr ""
"Při přístupu k souborovému systému byste měli mít na paměti několik "
"negativních návrhových vzorů. Tento článek předpokládá znalost standardních "
"API <link href=\"https://developer.gnome.org/gio/stable/GFile.html"
"\"><code>GFile</code></link>, <link href=\"https://developer.gnome.org/gio/"
"stable/GInputStream.html\"><code>GInputStream</code></link> a <link href="
"\"https://developer.gnome.org/gio/stable/GOutputStream.html"
"\"><code>GOutputStream</code></link>."
#. (itstool) path: item/p
#: C/file-system.page:37
msgid ""
"Use asynchronous I/O for file access. (<link xref=\"#asynchronous-io\"/>)"
msgstr ""
"Pro přístup k souborům používejte asynchronní V/V. (<link xref="
"\"#asynchronous-io\"/>)"
#. (itstool) path: item/p
#: C/file-system.page:41
msgid ""
"Always use appropriate functions to construct file names and paths. (<link "
"xref=\"#file-path-construction\"/>)"
msgstr ""
"Vždy používejte vhodné funkce k vytvoření názvů souborů a cest. (<link xref="
"\"#file-path-construction\"/>)"
#. (itstool) path: item/p
#: C/file-system.page:45
msgid ""
"Validate file paths are in the expected directories before using them. "
"(<link xref=\"#path-validation-and-sandboxing\"/>)"
msgstr ""
"Než použijete cestu k souboru, ověřte, že se nachází v očekávané složce. "
"(<link xref=\"#path-validation-and-sandboxing\"/>)"
#. (itstool) path: item/p
#: C/file-system.page:49
msgid ""
"Use mandatory access control profiles to enforce constraints on file access. "
"(<link xref=\"#path-validation-and-sandboxing\"/>)"
msgstr ""
"Používejte povinné profily pro řízení přístupu, aby se zaručily omezení v "
"přístupu k souborům. (<link xref=\"#path-validation-and-sandboxing\"/>)"
#. (itstool) path: section/title
#: C/file-system.page:58
msgid "Asynchronous I/O"
msgstr "Asynchronní V/V"
#. (itstool) path: section/p
#: C/file-system.page:60
msgid ""
"Almost all I/O should be performed asynchronously. That is, without blocking "
"the <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html\">GLib main context</link>. This can be achieved by always using "
"the <code>*_async()</code> and <code>*_finish()</code> variants of each I/O "
"function."
msgstr ""
"Většina V/V operací by měla být prováděna asynchronně. Což znamená bez "
"blokování <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-"
"Event-Loop.html\">hlavního kontextu GLib</link>. Toho lze dosáhnout "
"důsledným používáním variant <code>*_async()</code> a <code>*_finish()</"
"code> jednotlivých V/V funkcí."
#. (itstool) path: example/p
#: C/file-system.page:70
msgid ""
"For example, <link href=\"https://developer.gnome.org/gio/stable/"
"GInputStream.html#g-input-stream-read-async"
"\"><code>g_input_stream_read_async()</code></link> rather than <link href="
"\"https://developer.gnome.org/gio/stable/GInputStream.html#g-input-stream-"
"read\"><code>g_input_stream_read()</code></link>."
msgstr ""
"Například použijte <link href=\"https://developer.gnome.org/gio/stable/"
"GInputStream.html#g-input-stream-read-async"
"\"><code>g_input_stream_read_async()</code></link> a ne <link href=\"https://"
"developer.gnome.org/gio/stable/GInputStream.html#g-input-stream-read"
"\"><code>g_input_stream_read()</code></link>."
#. (itstool) path: section/p
#: C/file-system.page:78
msgid ""
"Synchronous I/O blocks the main loop, which means that other events, such as "
"user input, incoming networking packets, timeouts and idle callbacks, are "
"not handled until the blocking function returns."
msgstr ""
"Synchronní V/V operace blokují hlavní smyčku, což znamená, že ostatní "
"události, jako je vstup od uživatele, příchozí síťový paket, vypršení "
"časového limitu a zpětné volání při nečinnosti, nejsou obsluhovány, dokud "
"nedojde k návratu z blokující funkce."
#. (itstool) path: section/p
#: C/file-system.page:84
msgid ""
"Synchronous I/O is acceptable in certain circumstances where the overheads "
"of scheduling an asynchronous operation exceed the costs of local "
"synchronous I/O on Linux. For example, making a small read from a local "
"file, or from a virtual file system such as <file>/proc</file>. For such "
"reads, the low level functions <code>g_open()</code>, <code>read()</code> "
"and <code>g_close()</code> should be used rather than GIO."
msgstr ""
"Synchronní V/V je přijatelný za určitých okolností, kdy náklady na plánování "
"asynchronní operace převýší cenu místního synchronního V/V v Linuxu. "
"Například provedení drobného čtení z místního souborového systému nebo z "
"virtuálního souborového systému, jako je <file>/proc</file>. Při takovém "
"čtení by měly být použity raději nízkoúrovňové funkce <code>g_open()</code>, "
"<code>read()</code> a <code>g_close()</code> místo GIO."
#. (itstool) path: section/p
#: C/file-system.page:93
msgid ""
"Files in the user’s home directory do <em>not</em> count as local, as they "
"could be on a networked file system."
msgstr ""
"Soubory v uživatelově domovské složce se <em>nepočítají</em> jako místní, "
"protože mohou být na síťovém souborovém systému."
#. (itstool) path: section/p
#: C/file-system.page:98
msgid ""
"Note that the alternative – running synchronous I/O in a separate thread – "
"is highly discouraged; see the <link xref=\"threading#when-to-use-threading"
"\">threading guidelines</link> for more information."
msgstr ""
"Upozorňujeme, že alternativa – běh synchronního V/V v odděleném vlákně – je "
"silně nedoporučován. Více informací viz <link xref=\"threading#when-to-use-"
"threading\">pokyny k vláknům</link>."
#. (itstool) path: section/title
#: C/file-system.page:107
msgid "File Path Construction"
msgstr "Sestavení cesty k souboru"
#. (itstool) path: section/p
#: C/file-system.page:109
msgid ""
"File names and paths are not normal strings: on some systems, they can use a "
"character encoding other than UTF-8, while normal strings in GLib are "
"guaranteed to always use UTF-8. For this reason, special functions should be "
"used to build and handle file names and paths. (Modern Linux systems almost "
"universally use UTF-8 for filename encoding, so this is not an issue in "
"practice, but the file path functions should still be used for compatibility "
"with systems such as Windows, which use UTF-16 filenames.)"
msgstr ""
"Názvy souborů a cesty nejsou běžné řetězce: na některých systémech mohou "
"používat jiné kódování znaků, než UTF-8, zatímco u normálních řetězců je v "
"GLib vždy zaručeno použití UTF-8. Z tohoto důvodu by pro sestavení a "
"zpracování názvů souborů a cest měly používat speciální funkce. (Moderní "
"linuxové systémy povětšinou pro kódování názvů souborů jednotně používají "
"UTF-8, takže to v praxi není problém, ale tyto funkce by měly být přesto "
"používány kvůli kompatibilitě s jinými systéme, jako jsou Windows "
"používající v názvech souborů UTF-16.)"
#. (itstool) path: example/p
#: C/file-system.page:120
msgid ""
"For example, file paths should be built using <link href=\"https://developer."
"gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-build-"
"filename\"><code>g_build_filename()</code></link> rather than <link href="
"\"https://developer.gnome.org/glib/stable/glib-String-Utility-Functions."
"html#g-strconcat\"><code>g_strconcat()</code></link>."
msgstr ""
"Například cesta k souboru by se měla sestavit pomocí <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-"
"build-filename\"><code>g_build_filename()</code></link> namísto běžného "
"<link href=\"https://developer.gnome.org/glib/stable/glib-String-Utility-"
"Functions.html#g-strconcat\"><code>g_strconcat()</code></link>."
#. (itstool) path: section/p
#: C/file-system.page:128
msgid ""
"Doing so makes it clearer what the code is meant to do, and also eliminates "
"duplicate directory separators, so the returned path is canonical (though "
"not necessarily absolute)."
msgstr ""
"Když se to dělá takto, je v kódu jasnější, co se tím míní a také se tím "
"zamezí zdvojení oddělovačů cest a vrácená cesta je kanonická (i když ne "
"nutně absolutně)."
#. (itstool) path: example/p
#: C/file-system.page:135
msgid ""
"As another example, paths should be disassembled using <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-"
"path-get-basename\"><code>g_path_get_basename()</code></link> and <link href="
"\"https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-"
"Functions.html#g-path-get-dirname\"><code>g_path_get_dirname()</code></link> "
"rather than <link href=\"https://developer.gnome.org/glib/stable/glib-String-"
"Utility-Functions.html#g-strrstr\"><code>g_strrstr()</code></link> and other "
"manual searching functions."
msgstr ""
"Jiným příkladem by mohlo být rozložení cesty pomocí <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-"
"path-get-basename\"><code>g_path_get_basename()</code></link> a <link href="
"\"https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-"
"Functions.html#g-path-get-dirname\"><code>g_path_get_dirname()</code></link> "
"namísto běžného <link href=\"https://developer.gnome.org/glib/stable/glib-"
"String-Utility-Functions.html#g-strrstr\"><code>g_strrstr()</code></link> "
"nebo jiných ručních vyhledávacích funkcí."
#. (itstool) path: section/title
#: C/file-system.page:148
msgid "Path Validation and Sandboxing"
msgstr "Ověřování cest a pískoviště"
#. (itstool) path: section/p
#: C/file-system.page:150
msgid ""
"If a filename or path comes from external input, such as a web page or user "
"input, it should be validated to ensure that putting it into a file path "
"will not produce an arbitrary path. For example if a filename is constructed "
"from the constant string <file>~/</file> plus some user input, if the user "
"inputs <file>../../etc/passwd</file>, they can (potentially) gain access to "
"sensitive account information, depending on which user the program is "
"running as, and what it does with data loaded from the constructed path."
msgstr ""
"Když název souboru nebo cesta pochází z externího vstupu, jako je webová "
"stránka nebo uživatelský vstup, měly by být ověřeny, aby se zajistilo, že "
"jejich vložení do cesty nevytvoří jen tak nějakou cestu. Například, když je "
"název souboru sestavován z řetězce <file>~/</file> plus uživatelského vstupu "
"a uživatel zadá <file>../../etc/passwd</file>, mohl by (potenciálně) získat "
"přístup k citlivým informacím o účtech, v závislosti na tom, pod jakým účtem "
"program běží a co dělá s daty načtenými ze sestavené cesty."
#. (itstool) path: section/p
#: C/file-system.page:161
msgid ""
"This can be avoided by validating constructed paths before using them, using "
"<link href=\"https://developer.gnome.org/gio/stable/GFile.html#g-file-"
"resolve-relative-path\"><code>g_file_resolve_relative_path()</code></link> "
"to convert any relative paths to absolute ones, and then validating that the "
"path is beneath a given root sandboxing directory appropriate for the "
"operation. For example, if code downloads a file, it could validate that all "
"paths are beneath <file>~/Downloads</file>, using <link href=\"https://"
"developer.gnome.org/gio/stable/GFile.html#g-file-has-parent"
"\"><code>g_file_has_parent()</code></link>."
msgstr ""
"Tomu se dá předejít ověřováním sestavené cesty před tím, než ji použijete, "
"pomocí funkce <link href=\"https://developer.gnome.org/gio/stable/GFile."
"html#g-file-resolve-relative-path\"><code>g_file_resolve_relative_path()</"
"code></link>, která převede relativní cesty na absolutní a následně ověří, "
"že cesta je pod danou kořenovou složku pískoviště příslušejícího operaci. "
"Například, když kód stahuje soubor, mohl by pomocí <link href=\"https://"
"developer.gnome.org/gio/stable/GFile.html#g-file-has-parent"
"\"><code>g_file_has_parent()</code></link> ověřovat, že jsou všechny cesty "
"pod <file>~/Downloads</file>."
#. (itstool) path: section/p
#: C/file-system.page:172
msgid ""
"As a second line of defense, all projects which access the file system "
"should consider providing a mandatory access control profile, using a system "
"such as <link href=\"http://apparmor.net/\">AppArmor</link> or <link href="
"\"http://selinuxproject.org/\">SELinux</link>, which limits the directories "
"and files they can read from and write to."
msgstr ""
"Jako druhou linii obrany by všechny projekty, které přistupují k souborovému "
"systému, měly zvážit poskytnutí povinného profilu pro řízení přístupu za "
"použití systému jako jsou <link href=\"http://apparmor.net/\">AppArmor</"
"link> nebo <link href=\"http://selinuxproject.org/\">SELinux</link>, čímž se "
"omezí složky a soubory, které lze číst a zapisovat do nich."
#. (itstool) path: info/desc
#: C/gerror.page:18
msgid "Runtime error handling and reporting"
msgstr "Obsluha a hlášení běhových chyb"
#. (itstool) path: page/title
#: C/gerror.page:21
msgid "GError"
msgstr "GError"
#. (itstool) path: section/title
#: C/gerror.page:24
msgid "GError Usage"
msgstr "Použití GError"
#. (itstool) path: section/p
#: C/gerror.page:26
msgid ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-Error-Reporting."
"html\"><code>GError</code></link> is the standard error reporting mechanism "
"for GLib-using code, and can be thought of as a C implementation of an <link "
"href=\"https://en.wikipedia.org/wiki/Exception_handling\">exception</link>."
msgstr ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-Error-Reporting."
"html\"><code>GError</code></link> je standardní mechanizmus hlášení chyb pro "
"kód používající GLib a může na něj být pohlíženo jako na implementaci <link "
"href=\"https://cs.wikipedia.org/wiki/V%C3%BDjimka_(programov%C3%A1n"
"%C3%AD)\">výjimek</link> v jazyce C."
#. (itstool) path: section/p
#: C/gerror.page:33
msgid ""
"Any kind of runtime failure (anything which is not a <link xref="
"\"preconditions\">programmer error</link>) must be handled by including a "
"<code>GError**</code> parameter in the function, and setting a useful and "
"relevant GError describing the failure, before returning from the function. "
"Programmer errors must not be handled using GError: use assertions, pre-"
"conditions or post-conditions instead."
msgstr ""
"Libovolný druh selhání za běhu (cokoliv, co není <link xref=\"preconditions"
"\">programová chyba</link>) musí být obslouženo vložením parametru "
"<code>GError**</code> do funkce a před návratem z funkce nastavením vhodného "
"a smysluplného popisu selhání v GError. Programové chyby se naopak pomocí "
"GError obsluhovat nesmí: místo toho použijte assertion a podmíněné testy "
"před a po."
#. (itstool) path: section/p
#: C/gerror.page:42
msgid ""
"GError should be used in preference to a simple return code, as it can "
"convey more information, and is also supported by all GLib tools. For "
"example, <link xref=\"introspection\">introspecting an API</link> will "
"automatically detect all GError parameters so that they can be converted to "
"exceptions in other languages."
msgstr ""
"Použití GError byste měli dávat přednost před prostým návratem kódu, protože "
"poskytuje více informací a navíc je podporován všemi nástroji GLib. "
"Například <link xref=\"introspection\">introspekce API</link> bude "
"automaticky detekovat všechny parametry GError, protože je pak umí převést "
"na výjimky v jiných jazycích."
#. (itstool) path: section/p
#: C/gerror.page:50
msgid ""
"Printing warnings to the console must not be done in library code: use a "
"GError, and the calling code can propagate it further upwards, decide to "
"handle it, or decide to print it to the console. Ideally, the only code "
"which prints to the console will be top-level application code, and not "
"library code."
msgstr ""
"Výpis varování do konzole se nesmí provádět v programovém kódu knihovny. "
"Použijte GError a volající kód jej může propagovat dále, rozhodnout se jej "
"zpracovat nebo se rozhodnout jej vypsat do konzole. V ideálním případě je "
"jediným kódem, který vypisuje do konzole, programový kód nejvyšší úrovně "
"aplikace a ne kód knihovny."
#. (itstool) path: section/p
#: C/gerror.page:58
msgid ""
"Any function call which can take a <code>GError**</code>, <em>should</em> "
"take such a parameter, and the returned GError should be handled "
"appropriately. There are very few situations where ignoring a potential "
"error by passing <code>NULL</code> to a <code>GError**</code> parameter is "
"acceptable."
msgstr ""
"Volání kterékoliv funkce, které přebírá <code>GError**</code>, <em>by mělo</"
"em> takovýto parametr poskytnout a pak příslušně obsloužit vrácený GError. "
"Je jen velmi málo situací, kdy je přijatelné potenciální chybu ignorovat "
"předáním <code>NULL</code> do parametru <code>GError**</code>."
#. (itstool) path: section/p
#: C/gerror.page:66
msgid ""
"The GLib API documentation contains a <link href=\"https://developer.gnome."
"org/glib/stable/glib-Error-Reporting.html#glib-Error-Reporting.description"
"\">full tutorial for using GError</link>."
msgstr ""
"Dokumentace k API knihovny GLib obsahuje <link href=\"https://developer."
"gnome.org/glib/stable/glib-Error-Reporting.html#glib-Error-Reporting."
"description\">uceleného průvodce použitím GError</link>."
#. (itstool) path: info/desc
#: C/glist.page:18
msgid "Linked lists and container types"
msgstr "Propojené seznamy a kontejnerové typy"
#. (itstool) path: page/title
#: C/glist.page:21
msgid "GList"
msgstr "GList"
#. (itstool) path: section/title
#: C/glist.page:24
msgid "GList Usage"
msgstr "Použití GList"
#. (itstool) path: section/p
#: C/glist.page:26
msgid ""
"GLib provides several container types for sets of data: <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Doubly-Linked-Lists.html\"><code>GList</"
"code></link>, <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Singly-Linked-Lists.html\"><code>GSList</code></link>, <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Pointer-Arrays.html\"><code>GPtrArray</"
"code></link> and <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Arrays.html\"><code>GArray</code></link>."
msgstr ""
"GLib poskytuje někoklik kontejnerových typů pro množiny dat: <link href="
"\"https://developer.gnome.org/glib/stable/glib-Doubly-Linked-Lists.html"
"\"><code>GList</code></link>, <link href=\"https://developer.gnome.org/glib/"
"stable/glib-Singly-Linked-Lists.html\"><code>GSList</code></link>, <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Pointer-Arrays.html"
"\"><code>GPtrArray</code></link> a <link href=\"https://developer.gnome.org/"
"glib/stable/glib-Arrays.html\"><code>GArray</code></link>."
#. (itstool) path: section/p
#: C/glist.page:34
msgid ""
"It has been common practice in the past to use GList in all situations where "
"a sequence or set of data needs to be stored. This is inadvisable — in most "
"situations, a GPtrArray should be used instead. It has lower memory overhead "
"(a third to a half of an equivalent list), better cache locality, and the "
"same or lower algorithmic complexity for all common operations. The only "
"typical situation where a GList may be more appropriate is when dealing with "
"ordered data, which requires expensive insertions at arbitrary indexes in "
"the array."
msgstr ""
"Dříve bylo běžnou praxí používat GList ve všech situacích, kdy bylo "
"zapotřebí uchovat řadu nebo množinu dat. To ale není rozumné — ve většině "
"situací by místo něj měl být použit GPtrArray. Má menší paměťové nároky "
"(třetinové až poloviční oproti obdobnému seznamu), lepší dostupnost z "
"mezipaměti a stejnou nebo menší algoritmickou složitost pro všechny běžné "
"operace. Jedinou typickou situací, kdy může být GList vhodnější, je při "
"práci se uspořádanými daty ve kterých je požadováno masivní vkládání na "
"libovolné místo v poli."
#. (itstool) path: section/p
#: C/glist.page:45
msgid ""
"If linked lists are used, be careful to keep the complexity of operations on "
"them low, using standard CS complexity analysis. Any operation which uses "
"<link href=\"https://developer.gnome.org/glib/2.30/glib-Doubly-Linked-Lists."
"html#g-list-nth\"><code>g_list_nth()</code></link> or <link href=\"https://"
"developer.gnome.org/glib/2.30/glib-Doubly-Linked-Lists.html#g-list-nth-data"
"\"><code>g_list_nth_data()</code></link> is almost certainly wrong. For "
"example, iteration over a GList should be implemented using the linking "
"pointers, rather than a incrementing index:"
msgstr ""
"Když jsou použité zřetězené seznamy, dávejte pozor, aby složitost operací "
"zůstala na rozumné úrovni podle standardní analýzy složitosti v matematické "
"informatice. Kterákoliv operace, která používá <link href=\"https://"
"developer.gnome.org/glib/2.30/glib-Doubly-Linked-Lists.html#g-list-nth"
"\"><code>g_list_nth()</code></link> nebo <link href=\"https://developer."
"gnome.org/glib/2.30/glib-Doubly-Linked-Lists.html#g-list-nth-data"
"\"><code>g_list_nth_data()</code></link>, je povětšinou úplně špatně. "
"Například iterace přes GList by měla být implementována pomocí zřetězujících "
"ukazatelů a ne postupným zvyšováním indexu."
#. (itstool) path: section/code
#: C/glist.page:54
#, no-wrap
msgid ""
"GList *some_list, *l;\n"
"\n"
"for (l = some_list; l != NULL; l = l->next)\n"
" {\n"
" gpointer element_data = l->data;\n"
"\n"
" /* Do something with @element_data. */\n"
" }"
msgstr ""
"GList *some_list, *l;\n"
"\n"
"for (l = some_list; l != NULL; l = l->next)\n"
" {\n"
" gpointer element_data = l->data;\n"
"\n"
" /* Provedení něčeho s @element_data. */\n"
" }"
#. (itstool) path: section/p
#: C/glist.page:63
msgid ""
"Using an incrementing index instead results in a quadratic decrease in "
"performance (<em>O(N^2)</em> rather than <em>O(N)</em>):"
msgstr ""
"Když se místo toho použije postupné zvyšování indexu, je výsledkem "
"kvadratické snížení výkonu (<em>O(N^2)</em> namísto <em>O(N)</em>):"
#. (itstool) path: section/code
#: C/glist.page:67
#, no-wrap
msgid ""
"GList *some_list;\n"
"guint i;\n"
"\n"
"/* This code is inefficient and should not be used in production. */\n"
"for (i = 0; i < g_list_length (some_list); i++)\n"
" {\n"
" gpointer element_data = g_list_nth_data (some_list, i);\n"
"\n"
" /* Do something with @element_data. */\n"
" }"
msgstr ""
"GList *some_list;\n"
"guint i;\n"
"\n"
"/* Tento algoritmus je neefektivní a neměl by být použit v produkčním kódu. */\n"
"for (i = 0; i < g_list_length (some_list); i++)\n"
" {\n"
" gpointer element_data = g_list_nth_data (some_list, i);\n"
"\n"
" /* Provedení něčeho s @element_data. */\n"
" }"
#. (itstool) path: section/p
#: C/glist.page:78
msgid ""
"The performance penalty comes from <code>g_list_length()</code> and "
"<code>g_list_nth_data()</code> which both traverse the list (<em>O(N)</em>) "
"to perform their operations."
msgstr ""
"Snížení výkonu nastává ve funkcích <code>g_list_length()</code> a "
"<code>g_list_nth_data()</code>, které obě kvůli provedení své operace pole "
"procházejí (<em>O(N)</em>)."
#. (itstool) path: section/p
#: C/glist.page:84
msgid ""
"Implementing the above with a GPtrArray has the same complexity as the first "
"(correct) GList implementation, but better cache locality and lower memory "
"consumption, so will perform better for large numbers of elements:"
msgstr ""
"Implementace kódu uvedeného výše pomocí GPtrArray má stejnou složitost pro "
"první (správnou) implementaci GList, ale lepší dostupnost z mezipaměti a "
"nižší spotřebu paměti, takže bude mít lepší výkon pro velké množství prvků:"
#. (itstool) path: section/code
#: C/glist.page:89
#, no-wrap
msgid ""
"GPtrArray *some_array;\n"
"guint i;\n"
"\n"
"for (i = 0; i < some_array->len; i++)\n"
" {\n"
" gpointer element_data = some_array->pdata[i];\n"
"\n"
" /* Do something with @element_data. */\n"
" }"
msgstr ""
"GPtrArray *some_array;\n"
"guint i;\n"
"\n"
"for (i = 0; i < some_array->len; i++)\n"
" {\n"
" gpointer element_data = some_array->pdata[i];\n"
"\n"
" /* Provedení něčeho s @element_data. */\n"
" }"
#. (itstool) path: credit/name
#: C/index.page:13 C/writing-good-code.page:15
msgid "Miguel de Icaza"
msgstr "Miguel de Icaza"
#. (itstool) path: credit/name
#: C/index.page:17 C/writing-good-code.page:19
msgid "Morten Welinder"
msgstr "Morten Welinder"
#. (itstool) path: credit/name
#: C/index.page:26
msgid "GNOME Foundation"
msgstr "Nadace GNOME"
#. (itstool) path: credit/page
#: C/index.page:27
msgid "http://foundation.gnome.org/"
msgstr "http://foundation.gnome.org/"
#. (itstool) path: info/desc
#. (itstool) path: page/title
#: C/index.page:32 C/index.page:37
msgid "GNOME Programming Guidelines"
msgstr "Pokyny k programování GNOME"
#. (itstool) path: info/title
#: C/index.page:34
msgctxt "link:trail"
msgid "Programming Guidelines"
msgstr "Pokyny k programování"
#. (itstool) path: page/p
#: C/index.page:39
msgid ""
"This article contains several guidelines and suggestions for programmers "
"working in and with the GNOME stack. This is intended for programmers to "
"know about the development processes, conventions and philosophies behind "
"GNOME applications and the stack of libraries supporting them. By knowing "
"“the way things are done” in the GNOME ecosystem, it is hoped that "
"programmers will find use of GNOME APIs and development of new applications "
"easier and more natural, and will produce code which is legible and "
"maintainable over a long period of time by a diverse team of programmers."
msgstr ""
"Tato příručka obsahuje několik pokynů a doporučení pro programátory "
"pracující s GNOME. Je zaměřena na programátory, kteří mají povědomí o "
"procesu vývoje, zvyklostech a filozofii stojící za aplikacemi GNOME a "
"hromadou knihoven, které jim poskytují podporu. Doufáme, že díky znalosti "
"„jak se to dělá“ v ekosystému GNOME, shledají programátoři použití různých "
"API v GNOME a vývoj nových aplikací jednodušším a přirozenějším a budou "
"vytvářet kód, který je čitelný a udržovatelný po dlouhou dobu různorodým "
"týmem programátorů."
#. (itstool) path: page/p
#: C/index.page:50
msgid "This guide has a two-fold purpose:"
msgstr "Tato příručka má dvojí účel:"
#. (itstool) path: item/p
#: C/index.page:56
msgid ""
"To give you good suggestions on how to write code for GNOME or using GNOME "
"technologies. This will help you write code that is consistent with best "
"practices, and that will be accepted by the community. This will also lead "
"to code that is a pleasure to work on."
msgstr ""
"Poskytnout vám dobrá doporučení, jak psát kód pro GNOME a s použitím "
"technologií GNOME. Pomůže vám to psát kód, který je v souladu s nejlepšími "
"zvyklostmi a který bude přijat komunitou. Zavede vás to do světa kódu, na "
"kterém je potěšením pracovat."
#. (itstool) path: item/p
#: C/index.page:65
msgid ""
"To transmit the knowledge we have gotten over the years on how to keep the "
"GNOME project sustainable, even when people’s contributions increase or "
"decrease."
msgstr ""
"Přinést znalosti, které jsme nasbírali v průběhu let, kdy jsem se snažili "
"udržet projekt GNOME dlouhodobě fungující, i když se počet přispívajících "
"lidí zvyšoval nebo snižoval."
#. (itstool) path: info/title
#: C/index.page:75
msgctxt "link:trail"
msgid "General Guidelines"
msgstr "Obecné pokyny"
#. (itstool) path: section/title
#: C/index.page:77
msgid "General Guidelines"
msgstr "Obecné pokyny"
#. (itstool) path: info/title
#: C/index.page:83
msgctxt "link:trail"
msgid "Maintainer Guidelines"
msgstr "Pokyny pro správce"
#. (itstool) path: section/title
#: C/index.page:85
msgid "Maintainer Guidelines"
msgstr "Pokyny pro správce"
#. (itstool) path: info/title
#: C/index.page:91
msgctxt "link:trail"
msgid "Specific How-Tos"
msgstr "Jak na to konkrétněji"
#. (itstool) path: section/title
#: C/index.page:93
msgid "Specific How-Tos"
msgstr "Jak na to konkrétněji"
#. (itstool) path: info/title
#: C/index.page:99
msgctxt "link:trail"
msgid "References"
msgstr "Odkazy"
#. (itstool) path: section/title
#: C/index.page:101
msgid "References"
msgstr "Odkazy"
#. (itstool) path: info/desc
#: C/introspection.page:17
msgid "GObject Introspection support in library code"
msgstr "Podpora introspekce pro GObject v kódu knihovny"
#. (itstool) path: page/title
#: C/introspection.page:20
msgid "Introspection"
msgstr "Introspekce"
#. (itstool) path: synopsis/p
#: C/introspection.page:25
msgid ""
"<link href=\"https://wiki.gnome.org/Projects/GObjectIntrospection\"> GObject "
"introspection</link> (abbreviated ‘GIR’) is a system which extracts APIs "
"from C code and produces binary type libraries which can be used by non-C "
"language bindings, and other tools, to <link href=\"https://en.wikipedia.org/"
"wiki/Type_introspection\">introspect</link> or <link href=\"https://en."
"wikipedia.org/wiki/Language_binding\">wrap</link> the original C libraries. "
"It uses a system of annotations in documentation comments in the C code to "
"expose extra information about the APIs which is not machine readable from "
"the code itself."
msgstr ""
"<link href=\"https://wiki.gnome.org/Projects/GObjectIntrospection\">GObject "
"introspection</link> (zkráceně „GIR“) je systém, který získává API z kódu v "
"jazyce C a na jejich základě vytváří binární knihovny, které můžete použít k "
"navázání jiných programovacích jazyků a v nástrojích pro <link href="
"\"https://en.wikipedia.org/wiki/Type_introspection\">introspekci</link> nebo "
"<link href=\"https://cs.wikipedia.org/wiki/Language_Binding\">navázání</"
"link> originálních knihoven v C. Používá se k tomu systém anotací v "
"dokumentačních komentářích ve zdrojových kódech, pomocí kterých se zveřejní "
"doplňující informace o API, které jsou přímo z kódu strojově čitelné."
#. (itstool) path: synopsis/p
#: C/introspection.page:37
msgid ""
"It should be enabled for all public APIs: so all libraries. It cannot be "
"enabled for programs, since they expose no APIs. However, it is still "
"recommended to <link xref=\"documentation#introspection-annotations\">add "
"introspection annotations to documentation comments</link> in program code, "
"as they clarify the documentation."
msgstr ""
"Mělo by to být zapnuto pro všechna veřejná API, tzn. pro všechny knihovny. "
"Zapnuto by to nemělo být pro programy, protože ty nevystavují žádná API. I "
"tak je ale doporučeno <link xref=\"documentation#introspection-annotations"
"\">přidat anotace k introspekci do dokumentačních komentářů</link> v "
"programovém kódu, aby dokumentace byla jasnější."
#. (itstool) path: item/p
#: C/introspection.page:46
msgid ""
"Enable introspection for all libraries. (<link xref=\"#using-introspection\"/"
">)"
msgstr ""
"Povolte introspekci pro všechny knihovny. (<link xref=\"#using-introspection"
"\"/>)"
#. (itstool) path: item/p
#: C/introspection.page:50
msgid ""
"Pay attention to warnings from <cmd>g-ir-scanner</cmd> and "
"<code>introspectable=\"0\"</code> attributes in GIR files. (<link xref="
"\"#using-introspection\"/>)"
msgstr ""
"Dávejte pozor na varování od <cmd>g-ir-scanner</cmd> a atribut "
"<code>introspectable=\"0\"</code> v souborech GIR. (<link xref=\"#using-"
"introspection\"/>)"
#. (itstool) path: item/p
#: C/introspection.page:55
msgid ""
"Add introspection annotations to all documentation comments. (<link xref="
"\"#using-introspection\"/>)"
msgstr ""
"Přidávejte anotace k introspekci do všech dokumentačních komentářů. (<link "
"xref=\"#using-introspection\"/>)"
#. (itstool) path: item/p
#: C/introspection.page:59
msgid ""
"Design APIs to be introspectable from the start. (<link xref=\"#api-design\"/"
">)"
msgstr ""
"Navrhujte API už od začátku tak, aby v nich šla použít introspekce. (<link "
"xref=\"#api-design\"/>)"
#. (itstool) path: section/title
#: C/introspection.page:67
msgid "Using Introspection"
msgstr "Použití introspekce"
#. (itstool) path: section/p
#: C/introspection.page:69
msgid ""
"The first step for using introspection is to add it to the build system, "
"following the instructions <link href=\"https://wiki.gnome.org/Projects/"
"GObjectIntrospection/AutotoolsIntegration#Method_1_-_Recommended_-"
"_most_portable\">here</link>, following method 1. This should be done early "
"in the life of a project, as introspectability affects <link xref=\"#api-"
"design\">API design</link>."
msgstr ""
"Prvním korkem k použití introspekce je její přidání do sestavovacího systému "
"podle instrukcí uvedených <link href=\"https://wiki.gnome.org/Projects/"
"GObjectIntrospection/AutotoolsIntegration#Method_1_-_Recommended_-"
"_most_portable\">zde</link> v metodě 1. Mělo by se tak stát v rané fázi "
"projektu, protože schopnost introspekce ovlivňuje <link xref=\"#api-design"
"\">návrh API</link>."
#. (itstool) path: section/p
#: C/introspection.page:77
msgid ""
"This should result in a <file>.gir</file> and <file>.typelib</file> file "
"being generated for the project. The <file>.gir</file> file is human "
"readable, and can be inspected manually to see if the API has been "
"introspected correctly (although the GIR compilation process will print "
"error messages and warnings for any missing annotations or other problems). "
"APIs with <code>introspectable=\"0\"</code> will not be exposed to language "
"bindings as they are missing annotations or are otherwise not representable "
"in the GIR file."
msgstr ""
"To by se mělo odrazit v souborech <file>.gir</file> a <file>.typelib</file>, "
"které se pro projekt vygenerují. Soubor <file>.gir</file> je člověkem "
"čitelný a můžete jej ručně zkoumat, jestli má API správnou introspekci "
"(ačkoliv proces kompilace GIR vypíše chybové zprávy a varování pro chybějící "
"anotace nebo jiné problémy). API s <code>introspectable=\"0\"</code> nebude "
"zpřístupněno pro vazbu na jazyk, protože mu schází anotace nebo není z "
"jiných důvodů přítomno v souboru GIR."
#. (itstool) path: section/p
#: C/introspection.page:88
msgid ""
"The next step is to <link xref=\"documentation#introspection-annotations"
"\">add annotations to the documentation comments for every piece of public "
"API</link>. If a particular piece of API should not be exposed in the GIR "
"file, use the <code>(skip)</code> annotation. Documentation on the available "
"annotations is <link href=\"https://wiki.gnome.org/Projects/"
"GObjectIntrospection/Annotations\">here</link>."
msgstr ""
"Dalším krokem je <link xref=\"documentation#introspection-annotations"
"\">přidat anotace do dokumentačních komentářů pro každou část veřejného API</"
"link>. Pokud některá konkrétní část nemá být v souboru GIR zpřístupněna, "
"použijte anotaci <code>(skip)</code>. Dokumentaci se seznamem dostupných "
"anotací najdete <link href=\"https://wiki.gnome.org/Projects/"
"GObjectIntrospection/Annotations\">zde</link>."
#. (itstool) path: section/p
#: C/introspection.page:98
msgid ""
"If annotating the code for a program, a good approach is to split the bulk "
"of the code out into an internal, private convenience library. An internal "
"API reference manual can be built from its documentation comments (see <link "
"xref=\"documentation\"/>). The library is then not installed, but is linked "
"in to the program which is itself installed. This approach for generating "
"internal API documentation is especially useful for large projects where the "
"internal code may be large and hard to navigate."
msgstr ""
"Když vytváříte anotace kódu pro program, je dobrým zvykem rozdělik hromadu "
"kódu do vhodných interních privátních knihoven. Z dokumentačních komentářů "
"pak můžete sestavit referenční příručku k API (viz <link xref=\"documentation"
"\"/>). Takovéto knihovny se pak neinstalují, ale přímo slinkují s vlastním "
"programem. Přínos vygenerované interní dokumentace oceníte především u "
"velkých projektů, kde interní kód může být opravdu rozsáhlý a těžko se v něm "
"orientuje."
#. (itstool) path: section/p
#: C/introspection.page:108
msgid ""
"Annotations do not have to be added exhaustively: GIR has a set of default "
"annotations which it applies based on various conventions (see <link xref="
"\"#api-design\"/>). For example, a <code>const gchar*</code> parameter does "
"not need an explicit <code>(transfer none)</code> annotation, because the "
"<code>const</code> modifier implies this already. Learning the defaults for "
"annotations is a matter of practice."
msgstr ""
"Anotace by ale neměly být přidávány bezúčelně: GIR má sadu výchozích "
"anotací, které se použijí na základě různých pravidel (viz <link xref=\"#api-"
"design\"/>). Například parametr <code>const gchar*</code> nepotřebuje "
"výslovně uvádět anotaci <code>(transfer none)</code>, protože to dává najevo "
"již modifikátor <code>const</code>. Když se tyto výchozí anotace naučíte, "
"jen to prospěje věci."
#. (itstool) path: section/title
#: C/introspection.page:119
msgid "API Design"
msgstr "Návrh API"
#. (itstool) path: section/p
#: C/introspection.page:121
msgid ""
"In order to be introspectable without too many annotations, APIs must follow "
"certain conventions, such as the <link href=\"https://developer.gnome.org/"
"gobject/stable/gtype-conventions.html\">standard GObject naming conventions</"
"link>, and the <link href=\"https://wiki.gnome.org/Projects/"
"GObjectIntrospection/WritingBindingableAPIs\">conventions for bindable APIs</"
"link>. This is necessary because of the flexibility of C: code can be "
"written to behave in any way imaginable, but higher level languages don’t "
"allow this kind of freedom. So in order for a C API to be representable in a "
"higher level language, it has to conform to the behaviors supported by that "
"language."
msgstr ""
"Aby API podporovalo introspekci bez přílišného množství anotací, musí "
"dodržovat jisté zvyklosti, jako třeba <link href=\"https://developer.gnome."
"org/gobject/stable/gtype-conventions.html\">standardní konvenci názvů "
"GObject</link> a <link href=\"https://wiki.gnome.org/Projects/"
"GObjectIntrospection/WritingBindingableAPIs\">konvenci pro API podporující "
"vazby na jiné jazyky</link>. To je nutné kvůli flexibilitě C: programový "
"kód, který se chová slušně, může být napsán všemožnými způsoby, ale "
"vysokoúrovňové jazyky tento druh volnosti nedovolují. Takže aby API v jazyce "
"C mohlo být zpřístupněno ve vysokoúrovňovém jazyce, musí se podřídit chování "
"podporovanému tímto jazykem."
#. (itstool) path: section/p
#: C/introspection.page:134
msgid ""
"For example, GIR expects that if a function can fail, it will have a "
"<code>GError**</code> parameter, which will always be its final parameter. "
"The GIR scanner detects this and automatically converts that parameter to an "
"exception attribute on the method in the GIR file. It cannot do this if the "
"<code>GError*</code> is returned directly, or is not the final function "
"parameter, for example."
msgstr ""
"Například GIR očekává, že jestliže funkce může selhat, tak vrací parametr "
"<code>GError**</code>, který je vždy posledním parametrem. Analyzátor GIR "
"takovýto parametr odhalí a automaticky převede atribut výjimky u metody v "
"souboru GIR. Nemůže to ale udělat, pokud je například <code>GError**</code> "
"vracen přímo nebo není posledním parametrem."
#. (itstool) path: section/p
#: C/introspection.page:143
msgid ""
"Therefore, APIs must be designed to be introspectable, and the GIR file "
"should be checked as the APIs are being written. If the GIR doesn’t match "
"what you expect for a new API, the API may need extra annotations, or even "
"for its C declaration to be changed (as in the case of <link href=\"https://"
"wiki.gnome.org/Projects/GObjectIntrospection/WritingBindingableAPIs#va_list"
"\"><code>va_list</code></link>)."
msgstr ""
"Proto musí být API navržena pro introspekci a při jejich psaní by měl být "
"překontrolováván soubor GIR. Když GIR neodpovídá tomu, co pro nové API "
"očekáváte, potřebuje API dodatečné anotace nebo i změnu v deklaraci C (jako "
"v případě <link href=\"https://wiki.gnome.org/Projects/GObjectIntrospection/"
"WritingBindingableAPIs#va_list\"><code>va_list</code></link>)."
#. (itstool) path: section/p
#: C/introspection.page:151
msgid ""
"<cmd>g-ir-scanner</cmd> emits warnings when it encounters code it does not "
"understand. By passing <cmd>--warn-error</cmd> as well as <cmd>--warn-all</"
"cmd> in <code>INTROSPECTION_SCANNER_ARGS</code> in <file>Makefile.am</file>, "
"compilation will fail when unintrospectable APIs are encountered. This will "
"ensure all new APIs are introspectable, and is highly recommended."
msgstr ""
"<cmd>g-ir-scanner</cmd> vyšle varování, když narazí na kód, kterému "
"nerozumí. Předání <cmd>--warn-error</cmd> nebo také <cmd>--warn-all</cmd> v "
"<code>INTROSPECTION_SCANNER_ARGS</code> v <file>Makefile.am</file> způsobí, "
"že kompilace selže, když se narazí na API nepodporující introspekci. Tím se "
"zajistí, že nová API budou vždy podporovat introspekci, což je silně "
"doporučováno."
#. (itstool) path: info/desc
#: C/logging.page:18
msgid "Logging debug and information output from libraries and programs"
msgstr "Ladicí záznamy a informační výstup z knihoven a programů"
#. (itstool) path: page/title
#: C/logging.page:23
msgid "Logging"
msgstr "Záznamy (log)"
#. (itstool) path: synopsis/p
#: C/logging.page:28
msgid ""
"Logging debug and informational output from libraries and programs is an "
"open problem, and there are various methods for converting multiple streams "
"of log output into the customary stdout and stderr streams. Below are some "
"suggestions for how to implement logging. However, the most important thing "
"is to ensure that logging is consistent, so that log data can be accessed "
"and searched with a minimum of effort, since that’s what it’s used for. "
"Using different logging mechanisms and formats in different projects is not "
"the right approach."
msgstr ""
"Záznam ladicího a informačního výstupu z knihoven a programů je stále "
"otevřený problém a existuje řada metod pro převod více datových proudů s "
"výstupními záznamy do vlastních datových proudů stdout a stderr. Níže jsou "
"uvedena některá doporučení, jak zaznamenávání implementovat. Nejdůležitější "
"věcí ale je zajistit, aby záznamy byly konzistentní, takže k nim bude "
"jednoduchý přístup a půjde v nich snadno vyhledávat, protože to je přesně "
"to, k čemu slouží. Používat odlišné mechanizmy záznamu a odlišné formáty u "
"různých projektů není ten pravý přístup."
#. (itstool) path: item/p
#: C/logging.page:40
msgid ""
"Use the GLib logging framework instead of logging directly to stderr and "
"stdout. (<link xref=\"#glib-logging-framework\"/>)"
msgstr ""
"Místo záznamů přímo do stderr a stdout používejte framework GLib pro "
"záznamy. (<link xref=\"#glib-logging-framework\"/>)"
#. (itstool) path: item/p
#: C/logging.page:44
msgid ""
"If systemd can be a dependency of the project, consider logging directly to "
"the journal. (<link xref=\"#journald-integration\"/>)"
msgstr ""
"Když může být projekt závislý na systemd, zvažte přímé použití záznamů v "
"žurnálu. (<link xref=\"#journald-integration\"/>)"
#. (itstool) path: item/p
#: C/logging.page:48
msgid ""
"Do not implement log rotation and deletion; leave that to system services. "
"(<link xref=\"#log-rotation\"/>)"
msgstr ""
"Neimplementujte rotaci a mazání záznamů. Ponechte to na systémových "
"službách. (<link xref=\"#log-rotation\"/>)"
#. (itstool) path: section/title
#: C/logging.page:56
msgid "GLib Logging Framework"
msgstr "Framework GLib pro záznamy"
#. (itstool) path: section/p
#: C/logging.page:58
msgid ""
"GLib provides <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Message-Logging.html\">a logging framework</link> based around the <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-"
"log\"><code>g_log()</code></link> function, with convenience wrappers <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-"
"debug\"><code>g_debug()</code></link>, <link href=\"https://developer.gnome."
"org/glib/stable/glib-Message-Logging.html#g-message\"><code>g_message()</"
"code></link>, <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Message-Logging.html#g-warning\"><code>g_warning()</code></link> and <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-"
"error\"><code>g_error()</code></link>. The GLib logging framework has a few "
"useful features:"
msgstr ""
"GLib poskytuje <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Message-Logging.html\">framework pro zaznamenávání</link>, který je "
"postavený na funkci <link href=\"https://developer.gnome.org/glib/stable/"
"glib-Message-Logging.html#g-log\"><code>g_log()</code></link> spolu s "
"obalujícími funkcemi <link href=\"https://developer.gnome.org/glib/stable/"
"glib-Message-Logging.html#g-debug\"><code>g_debug()</code></link>, <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-"
"message\"><code>g_message()</code></link>, <link href=\"https://developer."
"gnome.org/glib/stable/glib-Message-Logging.html#g-warning"
"\"><code>g_warning()</code></link> a <link href=\"https://developer.gnome."
"org/glib/stable/glib-Message-Logging.html#g-error\"><code>g_error()</code></"
"link> pro větší pohodlí. Tento framework má pár užitečných vlastností:"
#. (itstool) path: item/p
#: C/logging.page:72
msgid ""
"Programmatic redirection of log messages using <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Message-Logging.html#g-log-set-handler"
"\"><code>g_log_set_handler()</code></link>."
msgstr ""
"Programové přesměrování záznamu zpráv pomocí <link href=\"https://developer."
"gnome.org/glib/stable/glib-Message-Logging.html#g-log-set-handler"
"\"><code>g_log_set_handler()</code></link>."
#. (itstool) path: item/p
#: C/logging.page:76
msgid "Multiple logging domains, which can be processed separately."
msgstr "Více domén záznamů, které mohou být zpracovány odděleně."
#. (itstool) path: item/p
#: C/logging.page:79
msgid ""
"Multiple log levels, which can be processed separately. For example, this "
"allows debug messages to be turned on and off at runtime."
msgstr ""
"Více úrovní záznamů, které mohou být zpracovány odděleně. Například to "
"umožňuje za běhu zapnout a vypnout ladicí zprávy."
#. (itstool) path: item/p
#: C/logging.page:83
msgid "Support for automatically aborting a program on ‘fatal’ messages."
msgstr "Podpora pro automatické přerušení programu u „kritických“ zpráv."
#. (itstool) path: section/p
#: C/logging.page:88
msgid ""
"These should be used in preference to functions like <code>printf()</code>, "
"<link href=\"https://developer.gnome.org/glib/stable/glib-Warnings-and-"
"Assertions.html#g-print\"><code>g_print()</code></link> and <link href="
"\"https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions."
"html#g-printerr\"><code>g_printerr()</code></link>, due to their enhanced "
"flexibility. The logging functions allow log processing to be done in code, "
"rather than by external shell scripting, which simplifies everything."
msgstr ""
"Uvedeným postupům byste měli dát přednost před funkcemi jako jsou "
"<code>printf()</code>, <link href=\"https://developer.gnome.org/glib/stable/"
"glib-Warnings-and-Assertions.html#g-print\"><code>g_print()</code></link> a "
"<link href=\"https://developer.gnome.org/glib/stable/glib-Warnings-and-"
"Assertions.html#g-printerr\"><code>g_printerr()</code></link>, protože je to "
"daleko flexibilnější. Funkce pro zaznamenávání umožňují provádět "
"zaznamenávání přímo z kódu, namísto pomocí externích shellových skriptů, "
"čímž se vše zjednoduší."
#. (itstool) path: section/p
#: C/logging.page:99
msgid ""
"A key reason to use the logging framework is that it is used in GLib and "
"other related libraries already; by using it, all log messages are then "
"going through the same system and can be processed similarly."
msgstr ""
"Klíčovým důvodem pro používání frameworku pro záznamy je, že jej používá "
"GLib a ostatní související knihovny. Když jej budete používat i vy, půjdou "
"všechny zprávy skrz ten samý systém a mohou být zpracovány podobně."
#. (itstool) path: section/p
#: C/logging.page:105
msgid ""
"To use the GLib logging framework, define <link href=\"https://developer."
"gnome.org/glib/stable/glib-Message-Logging.html#G-LOG-DOMAIN:CAPS"
"\"><code>G_LOG_DOMAIN</code></link> for the project so it’s unique from all "
"other projects. Call <code>g_debug(\"Message\")</code> to log a debug "
"message."
msgstr ""
"Když chcete používat framework GLib pro záznamy, definujte pro projekt "
"jedinečnou <link href=\"https://developer.gnome.org/glib/stable/glib-Message-"
"Logging.html#G-LOG-DOMAIN:CAPS\"><code>G_LOG_DOMAIN</code></link>, lišící se "
"od ostatních projektů. Ladicí zprávu zaznamenáte zavoláním "
"<code>g_debug(\"Zpráva\")</code>."
#. (itstool) path: section/p
#: C/logging.page:112
msgid ""
"If the default GLib log handlers are not sufficient, for example if log "
"messages need to be in a custom format or <link xref=\"#journald-integration"
"\">journald integration</link> is needed, set up a log handler with the "
"following code:"
msgstr ""
"V případě, že výchozí obsluha záznamů v GLib není dostačující, například "
"když potřebujete zaznamenávané zprávy ve vlastním formátu nebo potřebujete "
"<link xref=\"#journald-integration\">integraci s journald</link>, nastavte "
"obsluhu záznamů pomocí následujícího kódu:"
#. (itstool) path: section/code
#: C/logging.page:118
#, no-wrap
msgid ""
"\n"
"static const gchar *\n"
"log_level_to_string (GLogLevelFlags level)\n"
"{\n"
" switch (level)\n"
" {\n"
" case G_LOG_LEVEL_ERROR: return \"ERROR\";\n"
" case G_LOG_LEVEL_CRITICAL: return \"CRITICAL\";\n"
" case G_LOG_LEVEL_WARNING: return \"WARNING\";\n"
" case G_LOG_LEVEL_MESSAGE: return \"MESSAGE\";\n"
" case G_LOG_LEVEL_INFO: return \"INFO\";\n"
" case G_LOG_LEVEL_DEBUG: return \"DEBUG\";\n"
" default: return \"UNKNOWN\";\n"
" }\n"
"}\n"
"\n"
"static void\n"
"log_handler_cb (const gchar *log_domain,\n"
" GLogLevelFlags log_level,\n"
" const gchar *message,\n"
" gpointer user_data)\n"
"{\n"
" const gchar *log_level_str;\n"
"\n"
" /* Ignore debug messages if disabled. */\n"
" if (!debug_enabled && (log_level & G_LOG_LEVEL_DEBUG))\n"
" {\n"
" return;\n"
" }\n"
"\n"
" log_level_str = log_level_to_string (log_level & G_LOG_LEVEL_MASK);\n"
"\n"
" /* Use g_printerr() for warnings and g_print() otherwise. */\n"
" if (flags <= G_LOG_LEVEL_WARNING)\n"
" {\n"
" g_printerr (\"%s: %s: %s\\n\", log_domain, log_level_str, message);\n"
" }\n"
" else\n"
" {\n"
" g_print (\"%s: %s: %s\\n\", log_domain, log_level_str, message);\n"
" }\n"
"}\n"
"\n"
"g_log_set_handler (\"log-domain\",\n"
" G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,\n"
" log_handler_cb, NULL);"
msgstr ""
"\n"
"static const gchar *\n"
"log_level_to_string (GLogLevelFlags level)\n"
"{\n"
" switch (level)\n"
" {\n"
" case G_LOG_LEVEL_ERROR: return \"ERROR\";\n"
" case G_LOG_LEVEL_CRITICAL: return \"CRITICAL\";\n"
" case G_LOG_LEVEL_WARNING: return \"WARNING\";\n"
" case G_LOG_LEVEL_MESSAGE: return \"MESSAGE\";\n"
" case G_LOG_LEVEL_INFO: return \"INFO\";\n"
" case G_LOG_LEVEL_DEBUG: return \"DEBUG\";\n"
" default: return \"UNKNOWN\";\n"
" }\n"
"}\n"
"\n"
"static void\n"
"log_handler_cb (const gchar *log_domain,\n"
" GLogLevelFlags log_level,\n"
" const gchar *message,\n"
" gpointer user_data)\n"
"{\n"
" const gchar *log_level_str;\n"
"\n"
" /* Když je vypnuto ladění, ignorovat ladicí zprávy. */\n"
" if (!debug_enabled && (log_level & G_LOG_LEVEL_DEBUG))\n"
" {\n"
" return;\n"
" }\n"
"\n"
" log_level_str = log_level_to_string (log_level & G_LOG_LEVEL_MASK);\n"
"\n"
" /* Použít g_printerr() pro varování a g_print() v ostatních případech. */\n"
" if (flags <= G_LOG_LEVEL_WARNING)\n"
" {\n"
" g_printerr (\"%s: %s: %s\\n\", log_domain, log_level_str, message);\n"
" }\n"
" else\n"
" {\n"
" g_print (\"%s: %s: %s\\n\", log_domain, log_level_str, message);\n"
" }\n"
"}\n"
"\n"
"g_log_set_handler (\"log-domain\",\n"
" G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,\n"
" log_handler_cb, NULL);"
#. (itstool) path: section/title
#: C/logging.page:166
msgid "Exceptions"
msgstr "Výjimky"
#. (itstool) path: item/p
#: C/logging.page:169
msgid ""
"Do not use <code>g_message()</code> in normal code to print output. Printing "
"output should be done at the top level of an application, using "
"<code>g_print()</code>, and should be quite rare; i.e. only done in command "
"line applications."
msgstr ""
"Nepoužívejte <code>g_message()</code> v normálním kódu k výpisům. Výpisy by "
"se měly dělat jen v nejvyšší úrovni aplikace pomocí <code>g_print()</code> a "
"měly by být jen zřídkavé, tj. prováděné jen v aplikacích pro příkazový řádek."
#. (itstool) path: item/p
#: C/logging.page:175
msgid ""
"Do not use <code>g_warning()</code> in library code. Use <link xref=\"gerror"
"\"><code>GError</code>s</link> instead."
msgstr ""
"Nepoužívejte <code>g_warning()</code> v programovém kódu knihoven. Místo "
"toho použijte <link xref=\"gerror\"><code>GError</code></link>."
#. (itstool) path: item/p
#: C/logging.page:179
msgid ""
"Similarly, do not set up log handlers in library code. Log messages should "
"propagate through library code and be handled in a log handler at the top "
"level of an application."
msgstr ""
"Obdobně, nenastavujte obsluhu záznamů v kódu knihovny. Zprávy do záznamu by "
"měly být propagovány z kódu knihovny ven a obslouženy v obsluze záznamu v "
"nejvyšší úrovni aplikace."
#. (itstool) path: section/title
#: C/logging.page:189
msgid "journald Integration"
msgstr "Integrace journald"
#. (itstool) path: section/p
#: C/logging.page:191
msgid ""
"Compared to conventional syslog-style logs, journald supports storage of "
"structured logging data, which can make post-hoc analysis of logs much "
"easier. If it’s possible to add <code>systemd-journal</code> as a dependency "
"to a project, the project’s log handling function could be extended to use "
"<link href=\"http://0pointer.de/public/systemd-man/sd_journal_send.html"
"\"><code>sd_journal_print()</code> and <code>sd_journal_send()</code></link> "
"instead of <code>g_print()</code> and <code>g_printerr()</code>."
msgstr ""
"Ve srovnání s tradičními záznamy ve stylu syslog, journald podporuje "
"ukládání záznamů ve strukturované podobě, co usnadňuje následnou analýzu "
"záznamů. Můžete přidat <code>systemd-journal</code> jako závislost do svého "
"projektu a jako funkce pro obsluhu záznamů pak můžete použít <link href="
"\"http://0pointer.de/public/systemd-man/sd_journal_send.html"
"\"><code>sd_journal_print()</code> a <code>sd_journal_send()</code></link>, "
"na místo <code>g_print()</code> a <code>g_printerr()</code>."
#. (itstool) path: section/p
#: C/logging.page:202
msgid ""
"For more information, see this <link href=\"http://0pointer.de/blog/projects/"
"journal-submit.html\">article on logging to the journal</link>."
msgstr ""
"Další informace najdete v tomto <link href=\"http://0pointer.de/blog/"
"projects/journal-submit.html\">článku o záznamu do žurnálu</link>."
#. (itstool) path: section/title
#: C/logging.page:210
msgid "Log Rotation"
msgstr "Rotování záznamů"
#. (itstool) path: section/p
#: C/logging.page:212
msgid ""
"Log file rotation is one feature which is out of scope of the GLib logging "
"system. It should be handled by the normal system logging mechanisms, such "
"as <cmd>logrotate</cmd> or <cmd>systemd-journald</cmd>."
msgstr ""
"Rotování záznamů je jedna z funkcí, která jde mimo rozsah systému záznamů v "
"GLib. Mělo by být obsluhováno normálním mechanizmem systému záznamů, jako je "
"<cmd>logrotate</cmd> nebo <cmd>systemd-journald</cmd>."
#. (itstool) path: credit/years
#: C/main-contexts.page:13
msgid "2014–2015"
msgstr "2014 – 2015"
#. (itstool) path: info/desc
#: C/main-contexts.page:18
msgid ""
"GLib main contexts, invoking functions in other threads, and the event loop"
msgstr ""
"Hlavní kontext GLib, vyvolání funkcí v jiných vláknech a smyčka událostí"
#. (itstool) path: page/title
#: C/main-contexts.page:24
msgid "GLib Main Contexts"
msgstr "Hlavní kontexty GLib"
#. (itstool) path: item/p
#: C/main-contexts.page:30
msgid ""
"Use <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#g-main-context-invoke-full\"><code>g_main_context_invoke_full()</"
"code></link> to invoke functions in other threads, assuming every thread has "
"a thread default main context which runs throughout the lifetime of that "
"thread (<link xref=\"#g-main-context-invoke-full\"/>)"
msgstr ""
"K vyvolání funkcí z jiných vláknech použijte funkci <link href=\"https://"
"developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-main-context-"
"invoke-full\"><code>g_main_context_invoke_full()</code></link>, která "
"předpokládá, že každé vlákno má výchozí hlavní kontext, který běží po celou "
"dobu existence vlákna (<link xref=\"#g-main-context-invoke-full\"/>)"
#. (itstool) path: item/p
#: C/main-contexts.page:37
msgid ""
"Use <link href=\"https://developer.gnome.org/gio/stable/GTask.html"
"\"><code>GTask</code></link> to run a function in the background without "
"caring about the specific thread used (<link xref=\"#gtask\"/>)"
msgstr ""
"Ke spuštění funkce na pozadí bez starostí o použití konkrétního vlákna "
"použijte <link href=\"https://developer.gnome.org/gio/stable/GTask.html"
"\"><code>GTask</code></link> (<link xref=\"#gtask\"/>)"
#. (itstool) path: item/p
#: C/main-contexts.page:43
msgid ""
"Liberally use assertions to check which context executes each function, and "
"add these assertions when first writing the code (<link xref=\"#checking-"
"threading\"/>)"
msgstr ""
"Nešetřete používáním asercí ke kontrole, který kontext spouští kterou "
"funkci, a přidávejte tyto aserce hned při prvním psaní kódu. (<link xref="
"\"#checking-threading\"/>)"
#. (itstool) path: item/p
#: C/main-contexts.page:48
msgid ""
"Explicitly document contexts a function is expected to be called in, a "
"callback will be invoked in, or a signal will be emitted in (<link xref="
"\"#using-gmaincontext-in-a-library\"/>)"
msgstr ""
"Výslovně zdokumentujte, ve kterém kontextu funkce očekává, že bude volána, "
"zpětné volání vyvoláno a signál vyslán (<link xref=\"#using-gmaincontext-in-"
"a-library\"/>)"
#. (itstool) path: item/p
#: C/main-contexts.page:53
msgid ""
"Beware of <code>g_idle_add()</code> and similar functions which implicitly "
"use the global-default main context (<link xref=\"#implicit-use-of-the-"
"global-default-main-context\"/>)"
msgstr ""
"Dávejte si pozor na <code>g_idle_add()</code> a podobné funkce, které "
"implicitně používají globální výchozí hlavní kontext (<link xref=\"#implicit-"
"use-of-the-global-default-main-context\"/>)"
#. (itstool) path: section/title
#: C/main-contexts.page:62
msgid "What is <code>GMainContext</code>?"
msgstr "Co je to <code>GMainContext</code>?"
#. (itstool) path: section/p
#: C/main-contexts.page:64
msgid ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#GMainContext\"><code>GMainContext</code></link> is a generalized "
"implementation of an <link href=\"https://en.wikipedia.org/wiki/Event_loop"
"\">event loop</link>, useful for implementing polled file I/O or event-based "
"widget systems (such as GTK+). It is at the core of almost every GLib "
"application. To understand <code>GMainContext</code> requires understanding "
"<link href=\"man:poll(2)\">poll()</link> and polled I/O."
msgstr ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#GMainContext\"><code>GMainContext</code></link> je zobecněná "
"implementace <link href=\"https://en.wikipedia.org/wiki/Event_loop\">smyčky "
"událostí</link>, která je vhodná pro implementaci skupinových V/V "
"souborových operací nebo systému widgetů založeného na událostech (jako je "
"GTK+). Je jádrem většiny aplikací GLib. Pochopení <code>GMainContext</code> "
"vyžaduje pochopení <link href=\"man:poll(2)\">poll()</link> a skupinových V/"
"V."
#. (itstool) path: section/p
#: C/main-contexts.page:74
msgid ""
"A <code>GMainContext</code> has a set of <link href=\"https://developer."
"gnome.org/glib/stable/glib-The-Main-Event-Loop.html#GSource\"><code>GSource</"
"code></link>s which are ‘attached’ to it, each of which can be thought of as "
"an expected event with an associated callback function which will be invoked "
"when that event is received; or equivalently as a set of file descriptors "
"(FDs) to check. An event could be a timeout or data being received on a "
"socket, for example. One iteration of the event loop will:"
msgstr ""
"<code>GMainContext</code> má sadu objektů <link href=\"https://developer."
"gnome.org/glib/stable/glib-The-Main-Event-Loop.html#GSource\"><code>GSource</"
"code></link>, které jsou k němu „připojené“. O každém z nich můžeme "
"přemýšlet jako o očekávané události s přiřazenou funkcí zpětného volání, "
"která bude vyvolána, když je událost přijata, nebo obdobně, jako o sadě "
"popisovačů souborů, které se mají kontrolovat. Událostí může být například "
"doběhnutí časovače nebo přijetí dat na soketu. Každá jednotlivá iterace "
"smyčky události:"
#. (itstool) path: item/p
#: C/main-contexts.page:84
msgid ""
"Prepare sources, determining if any of them are ready to dispatch "
"immediately."
msgstr ""
"Připraví zdroje, přičemž určí, jestli je některý z nich připraven okamžitě "
"vysílat."
#. (itstool) path: item/p
#: C/main-contexts.page:88
msgid ""
"Poll the sources, blocking the current thread until an event is received for "
"one of the sources."
msgstr ""
"Seskupí zdroje a zablokuje aktuální vlákno, dokud není přijata událost pro "
"jeden ze zdrojů."
#. (itstool) path: item/p
#: C/main-contexts.page:92
msgid "Check which of the sources received an event (several could have)."
msgstr "Zkontroluje, který ze zdrojů přijal událost (může jich být několik)."
#. (itstool) path: item/p
#: C/main-contexts.page:95
msgid "Dispatch callbacks from those sources."
msgstr "Vyšle zpětná volání z těchto zdrojů."
#. (itstool) path: section/p
#: C/main-contexts.page:100
msgid ""
"This is <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-"
"Event-Loop.html#mainloop-states\">explained very well</link> in the <link "
"href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop."
"html#GSourceFuncs\">GLib documentation</link>."
msgstr ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#mainloop-states\">Velmi dobře je to vysvětlené</link> v <link href="
"\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop."
"html#GSourceFuncs\">dokumentaci k GLib</link>."
#. (itstool) path: section/p
#: C/main-contexts.page:108
msgid ""
"At its core, <code>GMainContext</code> is just a <code>poll()</code> loop, "
"with the preparation, check and dispatch stages of the loop corresponding to "
"the normal preamble and postamble in a typical <code>poll()</code> loop "
"implementation, such as listing 1 from <link href=\"http://www.linux-mag.com/"
"id/357/\">this article</link>. Typically, some complexity is needed in non-"
"trivial <code>poll()</code>-using applications to track the lists of FDs "
"which are being polled. Additionally, <code>GMainContext</code> adds a lot "
"of useful functionality which vanilla <code>poll()</code> doesn’t support. "
"Most importantly, it adds thread safety."
msgstr ""
"V jádru je <code>GMainContext</code> vlastně jen smyčka <code>poll()</code> "
"s přípravnou, kontrolní a vysílací fází smyčky odpovídající běžnému úvodu a "
"závěru v typické implementaci smyčky <code>poll()</code>, jako je například "
"naslouchání 1 v <link href=\"http://www.linux-mag.com/id/357/\">tomto "
"článku</link>. Typicky je zapotřebí jistá míra složitosti v aplikacích s "
"netriviálním využitím <code>poll()</code> ke sledování seznamů popisovačů "
"souborů, které nás zajímají. <code>GMainContext</code> navíc přidává spoustu "
"užitečné funkcionality, kterou varianta <code>poll()</code> nepodporuje. Z "
"toho nejdůležitější je bezpečné použití ve více vláknech."
#. (itstool) path: section/p
#: C/main-contexts.page:121
msgid ""
"<code>GMainContext</code> is completely thread safe, meaning that a "
"<code>GSource</code> can be created in one thread and attached to a "
"<code>GMainContext</code> running in another thread. (See also: <link xref="
"\"threading\"/>.) A typical use for this might be to allow worker threads to "
"control which sockets are being listened to by a <code>GMainContext</code> "
"in a central I/O thread. Each <code>GMainContext</code> is ‘acquired’ by a "
"thread for each iteration it’s put through. Other threads cannot iterate a "
"<code>GMainContext</code> without acquiring it, which guarantees that a "
"<code>GSource</code> and its FDs will only be polled by one thread at once "
"(since each <code>GSource</code> is attached to at most one "
"<code>GMainContext</code>). A <code>GMainContext</code> can be swapped "
"between threads across iterations, but this is expensive."
msgstr ""
"<code>GMainContext</code> je z hlediska vláken zcela bezpečný, což znamená, "
"že <code>GSource</code> může být vytvořen v jednom vlákně a napojen na "
"<code>GMainContext</code> běžící v jiném vlákně. (Viz také <link xref="
"\"threading\"/>). Typickým využitím je umožnit pracovnímu vláknu řídit, "
"kterým soketům <code>GMainContext</code> naslouchá v centrálním V/V vlákně. "
"Každý <code>GMainContext</code> je „získán“ vláknem pro každou iteraci, "
"kterou prochází. Ostatní vlákna nemohou přes <code>GMainContext</code> "
"iterovat bez jeho získání, což zajistí, že <code>GSource</code> a jeho "
"popisovače souborů budou seskupeny jen jedním vláknem v každý okamžik "
"(protože každý <code>GSource</code> je napojen nejvýše na jeden kontext "
"<code>GMainContext</code>). <code>GMAinContext</code> může být během iterací "
"napříč vlákny přehazován, ale je to nákladná operace."
#. (itstool) path: section/p
#: C/main-contexts.page:137
msgid ""
"<code>GMainContext</code> is used instead of <code>poll()</code> mostly for "
"convenience, as it transparently handles dynamically managing the array of "
"FDs to pass to <code>poll()</code>, especially when operating over multiple "
"threads. This is done by encapsulating FDs in <code>GSource</code>s, which "
"decide whether those FDs should be passed to the <code>poll()</code> call on "
"each ‘prepare’ stage of the main context iteration."
msgstr ""
"<code>GMainContext</code> se používá místo <code>poll()</code> hlavně kvůli "
"pohodlí, protože transparentně obsluhuje dynamickou správu polí s popisovači "
"souborů předávanými do <code>poll()</code>, hlavně když se pracuje napříč "
"více vlákny. Provádí se to zapouzdřením popisovačů polí do objektů "
"<code>GSource</code>, které rozhodují, jestli mají být tyto popisovače "
"souborů předány do volání <code>poll()</code> v každé „přípravné“ fázi "
"iterace hlavního kontextu."
#. (itstool) path: section/title
#: C/main-contexts.page:149
msgid "What is <code>GMainLoop</code>?"
msgstr "Co je to <code>GMainLoop</code>?"
#. (itstool) path: section/p
#: C/main-contexts.page:151
msgid ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#GMainLoop\"><code>GMainLoop</code></link> is essentially the "
"following few lines of code, once reference counting and locking have been "
"removed (from <link href=\"https://developer.gnome.org/glib/stable/glib-The-"
"Main-Event-Loop.html#g-main-loop-run\"><code>g_main_loop_run()</code></"
"link>):"
msgstr ""
"Když si odmyslíme počítání referencí a zamykání, je <link href=\"https://"
"developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#GMainLoop"
"\"><code>GMainLoop</code></link> v podstatě jen pár následujících řádků kódu "
"(z <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#g-main-loop-run\"><code>g_main_loop_run()</code></link>):"
#. (itstool) path: section/code
#: C/main-contexts.page:157
#, no-wrap
msgid ""
"loop->is_running = TRUE;\n"
"while (loop->is_running)\n"
" {\n"
" g_main_context_iteration (context, TRUE);\n"
" }"
msgstr ""
"loop->is_running = TRUE;\n"
"while (loop->is_running)\n"
" {\n"
" g_main_context_iteration (context, TRUE);\n"
" }"
#. (itstool) path: section/p
#: C/main-contexts.page:163
msgid ""
"Plus a fourth line in <link href=\"https://developer.gnome.org/glib/stable/"
"glib-The-Main-Event-Loop.html#g-main-loop-quit\"><code>g_main_loop_quit()</"
"code></link> which sets <code>loop->is_running = FALSE</code> and which "
"will cause the loop to terminate once the current main context iteration "
"ends."
msgstr ""
"Plus čtyři řádky v <link href=\"https://developer.gnome.org/glib/stable/glib-"
"The-Main-Event-Loop.html#g-main-loop-quit\"><code>g_main_loop_quit()</code></"
"link>, které nastaví <code>loop->is_running = FALSE</code> a které "
"způsobí, že se smyčka ukončí, jakmile doběhne aktuální iterace hlavního "
"kontextu."
#. (itstool) path: section/p
#: C/main-contexts.page:170
msgid ""
"Hence, <code>GMainLoop</code> is a convenient, thread-safe way of running a "
"<code>GMainContext</code> to process events until a desired exit condition "
"is met, at which point <code>g_main_loop_quit()</code> should be called. "
"Typically, in a UI program, this will be the user clicking ‘exit’. In a "
"socket handling program, this might be the final socket closing."
msgstr ""
"Proto je <code>GMainLoop</code> vhodným, a z hlediska vláken bezpečným, "
"způsobem, jak spustit <code>GMainContext</code>, aby zpracovával události, "
"dokud není dosažena požadovaná výstupní podmínka. V tu chvíli by měla být "
"zavolána funkce <code>g_main_loop_quit()</code>. V programech s uživatelským "
"rozhraním je to typicky uživatelovo kliknutí na „Ukončit“. V programech "
"obsluhujících sokety do může být závěrečné zavření soketu."
#. (itstool) path: section/p
#: C/main-contexts.page:178
msgid ""
"It is important not to confuse main contexts with main loops. Main contexts "
"do the bulk of the work: preparing source lists, waiting for events, and "
"dispatching callbacks. A main loop simply iterates a context."
msgstr ""
"Je důležité neplést si hlavní kontext s hlavní smyčkou. Hlavní kontext dělá "
"většinu práce: připravuje seznam zdrojů, čeká na události a obesílá zpětná "
"volání. Hlavní smyčka prostě jen opakovaně cykluje kontextem."
#. (itstool) path: section/title
#: C/main-contexts.page:186
msgid "Default Contexts"
msgstr "Výchozí kontexty"
#. (itstool) path: section/p
#: C/main-contexts.page:188
msgid ""
"One of the important features of <code>GMainContext</code> is its support "
"for ‘default’ contexts. There are two levels of default context: the thread-"
"default, and the global-default. The global-default (accessed using "
"<code>g_main_context_default()</code>) is run by GTK+ when <code>gtk_main()</"
"code> is called. It’s also used for timeouts (<code>g_timeout_add()</code>) "
"and idle callbacks (<code>g_idle_add()</code>) — these won’t be dispatched "
"unless the default context is running! (See: <link xref=\"#implicit-use-of-"
"the-global-default-main-context\"/>.)"
msgstr ""
"Jednou z důležitých vlastností <code>GMainContext</code> je, že podporuje "
"„výchozí“ kontext. Existují dvě úrovně výchozího kontextu: výchozí pro "
"vlákno a výchozí globální. Globální (přístupný přes "
"<code>g_main_context_default()</code>) je spuštěn GTK+ ve chvíli, kdy je "
"zavoláno <code>gtk_main()</code>. Používá se také pro časovače "
"(<code>g_timeout_add()</code>) a zpětná volání při nečinnosti "
"(<code>g_idle_add()</code>) — ty nechceme obesílat, když neběží výchozí "
"kontext! (Viz <link xref=\"#implicit-use-of-the-global-default-main-context"
"\"/>.)"
#. (itstool) path: section/p
#: C/main-contexts.page:200
msgid ""
"Thread-default contexts are a later addition to GLib (since version 2.22), "
"and are generally used for I/O operations which need to run and dispatch "
"callbacks in a thread. By calling "
"<code>g_main_context_push_thread_default()</code> before starting an I/O "
"operation, the thread-default context is set and the I/O operation can add "
"its sources to that context. The context can then be run in a new main loop "
"in an I/O thread, causing the callbacks to be dispatched on that thread’s "
"stack rather than on the stack of the thread running the global-default main "
"context. This allows I/O operations to be run entirely in a separate thread "
"without explicitly passing a specific <code>GMainContext</code> pointer "
"around everywhere."
msgstr ""
"Výchozí kontexty vláken byly do GLib přidány později (od verze 2.22) a "
"obecně se používají pro V/V operace, které potřebují spouštět a obesílat "
"zpětná volání ve vlákně. Zavoláním "
"<code>g_main_context_push_thread_default()</code> před spuštěním V/V operace "
"se nastaví výchozí kontext vlákna a V/V operace může přidat své zdroje do "
"tohoto kontextu. Kontext pak může být spuštěn v nové hlavní smyčce ve V/V "
"vlákně, což způsobí, že zpětná volání budou obesílána v zásobníku tohoto "
"vlákna namísto v zásobníku vlákna, ve kterém běží globální výchozí kontext. "
"To umožňuje, aby V/V operace běžely celé v odděleném vlákně bez vyloženého "
"předávání konkrétního ukazatele <code>GMainContext</code> všude kolem."
#. (itstool) path: section/p
#: C/main-contexts.page:214
msgid ""
"Conversely, by starting a long-running operation with a specific thread-"
"default context set, the calling code can guarantee that the operation’s "
"callbacks will be emitted in that context, even if the operation itself runs "
"in a worker thread. This is the principle behind <link href=\"https://"
"developer.gnome.org/gio/stable/GTask.html\"><code>GTask</code></link>: when "
"a new <code>GTask</code> is created, it stores a reference to the current "
"thread-default context, and dispatches its completion callback in that "
"context, even if the task itself is run using <link href=\"https://developer."
"gnome.org/gio/stable/GTask.html#g-task-run-in-thread"
"\"><code>g_task_run_in_thread()</code></link>."
msgstr ""
"Naopak, spuštěním dlouho trvající operace s nastaveným konkrétním výchozím "
"kontextem vlákna, může volající kód zaručit, že zpětná volání operace budou "
"vyslána v tomto kontextu, i když operace samotná běží v pracovním vlákně. "
"Jde o princip stojící za <link href=\"https://developer.gnome.org/gio/stable/"
"GTask.html\"><code>GTask</code></link>: když je vytvořen nový objekt "
"<code>GTask</code>, uloží si reference na výchozí kontext aktuálního vlákna "
"a a vyšle jeho dokončovací zpětné volání v tomto kontextu, i když úloha "
"samotná běží pomocí <link href=\"https://developer.gnome.org/gio/stable/"
"GTask.html#g-task-run-in-thread\"><code>g_task_run_in_thread()</code></link>."
#. (itstool) path: example/p
#: C/main-contexts.page:227
msgid ""
"For example, the code below will run a <code>GTask</code> which performs two "
"writes in parallel from a thread. The callbacks for the writes will be "
"dispatched in the worker thread, whereas the callback from the task as a "
"whole will be dispatched in the <code>interesting_context</code>."
msgstr ""
"Například následující kód spustí <code>GTask</code>, který provede z vlákna "
"souběžně dva zápisy. Zpětná volání pro zápisy budou obeslána v pracovním "
"vlákně, zatímco zpětné volání z úlohy jako celku bude obesláno v "
"<code>interesting_context</code>."
#. (itstool) path: example/code
#: C/main-contexts.page:234
#, no-wrap
msgid ""
"\n"
"typedef struct {\n"
" GMainLoop *main_loop;\n"
" guint n_remaining;\n"
"} WriteData;\n"
"\n"
"/* This is always called in the same thread as thread_cb() because\n"
" * it’s always dispatched in the @worker_context. */\n"
"static void\n"
"write_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" WriteData *data = user_data;\n"
" GOutputStream *stream = G_OUTPUT_STREAM (source_object);\n"
" GError *error = NULL;\n"
" gssize len;\n"
"\n"
" /* Finish the write. */\n"
" len = g_output_stream_write_finish (stream, result, &error);\n"
" if (error != NULL)\n"
" {\n"
" g_error (\"Error: %s\", error->message);\n"
" g_error_free (error);\n"
" }\n"
"\n"
" /* Check whether all parallel operations have finished. */\n"
" write_data->n_remaining--;\n"
"\n"
" if (write_data->n_remaining == 0)\n"
" {\n"
" g_main_loop_quit (write_data->main_loop);\n"
" }\n"
"}\n"
"\n"
"/* This is called in a new thread. */\n"
"static void\n"
"thread_cb (GTask *task,\n"
" gpointer source_object,\n"
" gpointer task_data,\n"
" GCancellable *cancellable)\n"
"{\n"
" /* These streams come from somewhere else in the program: */\n"
" GOutputStream *output_stream1, *output_stream;\n"
" GMainContext *worker_context;\n"
" GBytes *data;\n"
" const guint8 *buf;\n"
" gsize len;\n"
"\n"
" /* Set up a worker context for the writes’ callbacks. */\n"
" worker_context = g_main_context_new ();\n"
" g_main_context_push_thread_default (worker_context);\n"
"\n"
" /* Set up the writes. */\n"
" write_data.n_remaining = 2;\n"
" write_data.main_loop = g_main_loop_new (worker_context, FALSE);\n"
"\n"
" data = g_task_get_task_data (task);\n"
" buf = g_bytes_get_data (data, &len);\n"
"\n"
" g_output_stream_write_async (output_stream1, buf, len,\n"
" G_PRIORITY_DEFAULT, NULL, write_cb,\n"
" &write_data);\n"
" g_output_stream_write_async (output_stream2, buf, len,\n"
" G_PRIORITY_DEFAULT, NULL, write_cb,\n"
" &write_data);\n"
"\n"
" /* Run the main loop until both writes have finished. */\n"
" g_main_loop_run (write_data.main_loop);\n"
" g_task_return_boolean (task, TRUE); /* ignore errors */\n"
"\n"
" g_main_loop_unref (write_data.main_loop);\n"
"\n"
" g_main_context_pop_thread_default (worker_context);\n"
" g_main_context_unref (worker_context);\n"
"}\n"
"\n"
"/* This can be called from any thread. Its @callback will always be\n"
" * dispatched in the thread which currently owns\n"
" * @interesting_context. */\n"
"void\n"
"parallel_writes_async (GBytes *data,\n"
" GMainContext *interesting_context,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" GTask *task;\n"
"\n"
" g_main_context_push_thread_default (interesting_context);\n"
"\n"
" task = g_task_new (NULL, cancellable, callback, user_data);\n"
" g_task_set_task_data (task, data,\n"
" (GDestroyNotify) g_bytes_unref);\n"
" g_task_run_in_thread (task, thread_cb);\n"
" g_object_unref (task);\n"
"\n"
" g_main_context_pop_thread_default (interesting_context);\n"
"}"
msgstr ""
"\n"
"typedef struct {\n"
" GMainLoop *main_loop;\n"
" guint n_remaining;\n"
"} WriteData;\n"
"\n"
"/* Toto je voláno vždy ve stejném vlákně jako thread_cb(), protože je to\n"
" * vždy vysláno v kontextu @worker_context. */\n"
"static void\n"
"write_cb (GObject *source_object,\n"
" GAsyncResult *result,\n"
" gpointer user_data)\n"
"{\n"
" WriteData *data = user_data;\n"
" GOutputStream *stream = G_OUTPUT_STREAM (source_object);\n"
" GError *error = NULL;\n"
" gssize len;\n"
"\n"
" /* Dokončí zápis */\n"
" len = g_output_stream_write_finish (stream, result, &error);\n"
" if (error != NULL)\n"
" {\n"
" g_error (\"Error: %s\", error->message);\n"
" g_error_free (error);\n"
" }\n"
"\n"
" /* Zkontroluje, jestli byly dokončeny všechny paralelní operace */\n"
" write_data->n_remaining--;\n"
"\n"
" if (write_data->n_remaining == 0)\n"
" {\n"
" g_main_loop_quit (write_data->main_loop);\n"
" }\n"
"}\n"
"\n"
"/* Toto je voláno v novém vlákně */\n"
"static void\n"
"thread_cb (GTask *task,\n"
" gpointer source_object,\n"
" gpointer task_data,\n"
" GCancellable *cancellable)\n"
"{\n"
" /* Tento datový proud přichází z jiného místa v programu: */\n"
" GOutputStream *output_stream1, *output_stream;\n"
" GMainContext *worker_context;\n"
" GBytes *data;\n"
" const guint8 *buf;\n"
" gsize len;\n"
"\n"
" /* Nastaví pracovní kontext pro zpětná volání zápisu */\n"
" worker_context = g_main_context_new ();\n"
" g_main_context_push_thread_default (worker_context);\n"
"\n"
" /* Nastaví zápis */\n"
" write_data.n_remaining = 2;\n"
" write_data.main_loop = g_main_loop_new (worker_context, FALSE);\n"
"\n"
" data = g_task_get_task_data (task);\n"
" buf = g_bytes_get_data (data, &len);\n"
"\n"
" g_output_stream_write_async (output_stream1, buf, len,\n"
" G_PRIORITY_DEFAULT, NULL, write_cb,\n"
" &write_data);\n"
" g_output_stream_write_async (output_stream2, buf, len,\n"
" G_PRIORITY_DEFAULT, NULL, write_cb,\n"
" &write_data);\n"
"\n"
" /* Spustí hlavní smyčku, dokud nejsou dokončeny oba zápisy */\n"
" g_main_loop_run (write_data.main_loop);\n"
" g_task_return_boolean (task, TRUE); /* ignore errors */\n"
"\n"
" g_main_loop_unref (write_data.main_loop);\n"
"\n"
" g_main_context_pop_thread_default (worker_context);\n"
" g_main_context_unref (worker_context);\n"
"}\n"
"\n"
"/* Toto může být voláno z kteréhokoliv vlákna. Jeho funkce @callback bude\n"
" * vždy vyslána ve vlákně, které aktuálně vlastní @interesting_context */\n"
"void\n"
"parallel_writes_async (GBytes *data,\n"
" GMainContext *interesting_context,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" GTask *task;\n"
"\n"
" g_main_context_push_thread_default (interesting_context);\n"
"\n"
" task = g_task_new (NULL, cancellable, callback, user_data);\n"
" g_task_set_task_data (task, data,\n"
" (GDestroyNotify) g_bytes_unref);\n"
" g_task_run_in_thread (task, thread_cb);\n"
" g_object_unref (task);\n"
"\n"
" g_main_context_pop_thread_default (interesting_context);\n"
"}"
#. (itstool) path: section/title
#: C/main-contexts.page:336
msgid "Implicit Use of the Global-Default Main Context"
msgstr "Výchozí použití globálního výchozího hlavního kontextu"
#. (itstool) path: section/p
#: C/main-contexts.page:338
msgid ""
"Several functions implicitly add sources to the global-default main context. "
"They should <em>not</em> be used in threaded code. Instead, use "
"<code>g_source_attach()</code> with the <code>GSource</code> created by the "
"replacement function from the table below."
msgstr ""
"Několik funkcí přidává zdroje do globálního výchozího hlavního kontextu "
"implicitně. Ty <em>nesmí</em> být použity v kódu vláken. Místo toho použijte "
"<code>g_source_attach()</code> s <code>GSource</code> vytvořeným nahrazením "
"funkce z tabulky níže."
#. (itstool) path: section/p
#: C/main-contexts.page:345
msgid ""
"Implicit use of the global-default main context means the callback functions "
"are invoked in the main thread, typically resulting in work being brought "
"back from a worker thread into the main thread."
msgstr ""
"Implicitní použití globálního výchozího hlavního kontextu znamená, že jsou "
"funkce zpětného volání vyvolány v hlavním vlákně, typicky jako výsledek "
"práce práce přenesené zpět z pracovního vlákna do hlavního vlákna."
#. (itstool) path: td/p
#: C/main-contexts.page:356
msgid "Do not use"
msgstr "Nepoužívat"
#. (itstool) path: td/p
#: C/main-contexts.page:357
msgid "Use instead"
msgstr "Místo toho použít"
#. (itstool) path: td/p
#: C/main-contexts.page:362
msgid "<code>g_timeout_add()</code>"
msgstr "<code>g_timeout_add()</code>"
#. (itstool) path: td/p
#: C/main-contexts.page:363
msgid "<code>g_timeout_source_new()</code>"
msgstr "<code>g_timeout_source_new()</code>"
#. (itstool) path: td/p
#: C/main-contexts.page:366
msgid "<code>g_idle_add()</code>"
msgstr "<code>g_idle_add()</code>"
#. (itstool) path: td/p
#: C/main-contexts.page:367
msgid "<code>g_idle_source_new()</code>"
msgstr "<code>g_idle_source_new()</code>"
#. (itstool) path: td/p
#: C/main-contexts.page:370
msgid "<code>g_child_watch_add()</code>"
msgstr "<code>g_child_watch_add()</code>"
#. (itstool) path: td/p
#: C/main-contexts.page:371
msgid "<code>g_child_watch_source_new()</code>"
msgstr "<code>g_child_watch_source_new()</code>"
#. (itstool) path: example/p
#: C/main-contexts.page:377
msgid ""
"So to delay some computation in a worker thread, use the following code:"
msgstr ""
"Takže prodlevu v nějakém výpočtu v pracovním vlákně uděláte pomocí "
"následujícího kódu:"
#. (itstool) path: example/code
#: C/main-contexts.page:381
#, no-wrap
msgid ""
"\n"
"static guint\n"
"schedule_computation (guint delay_seconds)\n"
"{\n"
" GSource *source = NULL;\n"
" GMainContext *context;\n"
" guint id;\n"
"\n"
" /* Get the calling context. */\n"
" context = g_main_context_get_thread_default ();\n"
"\n"
" source = g_timeout_source_new_seconds (delay_seconds);\n"
" g_source_set_callback (source, do_computation, NULL, NULL);\n"
" id = g_source_attach (source, context);\n"
" g_source_unref (source);\n"
"\n"
" /* The ID can be used with the same @context to\n"
" * cancel the scheduled computation if needed. */\n"
" return id;\n"
"}\n"
"\n"
"static void\n"
"do_computation (gpointer user_data)\n"
"{\n"
" /* … */\n"
"}"
msgstr ""
"\n"
"static guint\n"
"schedule_computation (guint delay_seconds)\n"
"{\n"
" GSource *source = NULL;\n"
" GMainContext *context;\n"
" guint id;\n"
"\n"
" /* Získat kontext volání. */\n"
" context = g_main_context_get_thread_default ();\n"
"\n"
" source = g_timeout_source_new_seconds (delay_seconds);\n"
" g_source_set_callback (source, do_computation, NULL, NULL);\n"
" id = g_source_attach (source, context);\n"
" g_source_unref (source);\n"
"\n"
" /* Když je potřeba, může být ID použito se stejným \n"
" * @context ke zrušení naplánovaného výpočtu. */\n"
" return id;\n"
"}\n"
"\n"
"static void\n"
"do_computation (gpointer user_data)\n"
"{\n"
" /* … */\n"
"}"
#. (itstool) path: section/title
#: C/main-contexts.page:412
msgid "Using <code>GMainContext</code> in a Library"
msgstr "Použití <code>GMainContext</code> v knihovně"
#. (itstool) path: section/p
#: C/main-contexts.page:414
msgid ""
"At a high level, library code must not make changes to main contexts which "
"could affect the execution of an application using the library, for example "
"by changing when the application’s <code>GSource</code>s are dispatched. "
"There are various best practices which can be followed to aid this."
msgstr ""
"Na nejvyšší úrovni kód knihovny nesmí provádět změny v hlavním kontextu, "
"který by mohly ovlivnit provádění aplikace, která používá knihovnu. "
"Například změnou, když je vyslán <code>GSource</code> patřící aplikaci. "
"Existuje řada správných zvyklostí, kterých je dobré se držet, aby tomu tak "
"bylo."
#. (itstool) path: section/p
#: C/main-contexts.page:422
msgid ""
"Never iterate a context created outside the library, including the global-"
"default or thread-default contexts. Otherwise, <code>GSource</code>s created "
"in the application may be dispatched when the application is not expecting "
"it, causing <link href=\"https://en.wikipedia.org/wiki/Reentrancy_"
"%28computing%29\">re-entrancy problems</link> for the application code."
msgstr ""
"Nikdy neprovádějte iteraci kontextu vytvořeného mimo knihovnu. Týká se to i "
"výchozího globálního kontextu a výchozího kontextu vlákna. V opačném případě "
"může být <code>GSource</code> vytvořený v aplikaci vyslán, když to aplikace "
"neočekává, což způsobí <link href=\"https://en.wikipedia.org/wiki/Reentrancy_"
"%28computing%29\">problém s opětovným vstupem (reentrance)</link> v kódu "
"aplikace."
#. (itstool) path: section/p
#: C/main-contexts.page:431
msgid ""
"Always remove <code>GSource</code>s from a main context before dropping the "
"library’s last reference to the context, especially if it may have been "
"exposed to the application (for example, as a thread-default). Otherwise the "
"application may keep a reference to the main context and continue iterating "
"it after the library has returned, potentially causing unexpected source "
"dispatches in the library. This is equivalent to not assuming that dropping "
"the library’s last reference to a main context will finalize that context."
msgstr ""
"Před zahozením poslední reference z knihovny na kontext vždy odstraňte z "
"hlavního kontextu zdroje <code>GSource</code>, především když mohou být "
"vystaveny aplikaci (například jako výchozí vlákno). V opačném případě může "
"aplikace zachovat referenci na hlavní kontext a pokračovat s jeho iteracemi "
"po návratu z knihovny, což případně může způsobit nechtěné vysílání zdroje v "
"knihovně. Je to to stejné, jako když nepředpokládáte, že zahození poslední "
"reference z knihovny na hlavní kontext tento kontext finalizuje."
#. (itstool) path: section/p
#: C/main-contexts.page:442
msgid ""
"If the library is designed to be used from multiple threads, or in a context-"
"aware fashion, always document which context each callback will be "
"dispatched in. For example, “callbacks will always be dispatched in the "
"context which is the thread-default at the time of the object’s "
"construction”. Developers using the library’s API need to know this "
"information."
msgstr ""
"Pokud je knihovna navržena pro použití z více vláken nebo ve stylu kontextů, "
"zdokumentujte vždy, ve kterém kontextu budou jednotlivá zpětná volání "
"vysílána. Například „callbacks will always be dispatched in the context "
"which is the thread-default at the time of the object’s "
"construction“ (zpětná volání budou v době vytváření objektu vždy vyslána v "
"kontextu, který je pro vlákno výchozí). Vývojáři používající API knihovny "
"tuto informaci potřebují."
#. (itstool) path: section/p
#: C/main-contexts.page:451
msgid ""
"Use <code>g_main_context_invoke()</code> to ensure callbacks are dispatched "
"in the right context. It’s much easier than manually using "
"<code>g_idle_source_new()</code> to transfer work between contexts. (See: "
"<link xref=\"#ensuring-functions-are-called-in-the-right-context\"/>.)"
msgstr ""
"Používejte <code>g_main_context_invoke()</code>, abyste zajistili, že zpětné "
"volání bude vysláno ve správném kontextu. Je to mnohem jednodušší, než ruční "
"použití <code>g_idle_source_new()</code> k přenosu práce mezi kontexty. (Viz "
"<link xref=\"#ensuring-functions-are-called-in-the-right-context\"/>.)"
#. (itstool) path: section/p
#: C/main-contexts.page:458
msgid ""
"Libraries should never use <code>g_main_context_default()</code> (or, "
"equivalently, pass <code>NULL</code> to a <code>GMainContext</code>-typed "
"parameter). Always store and explicitly use a specific <code>GMainContext</"
"code>, even if it often points to some default context. This makes the code "
"easier to split out into threads in future, if needed, without causing hard-"
"to-debug problems caused by callbacks being invoked in the wrong context."
msgstr ""
"Knihovny by nikdy neměly použít <code>g_main_context_default()</code> (nebo "
"udělat to stejné předáním <code>NULL</code> do parametru typu "
"<code>GMainContext</code>). Vždy uložte a výslovně použijte konkrétní "
"<code>GMainContext</code>, i když často ukazuje na nějaký výchozí kontext. V "
"případě potřeby to v budoucnu usnadní rozdělení kódu do vláken, aniž by to "
"způsobilo těžko laditelné probléme vznikající zpětnými voláními vyvolanými v "
"nesprávném kontextu."
#. (itstool) path: section/p
#: C/main-contexts.page:468
msgid ""
"<link xref=\"async-programming\">Write things asynchronously</link> "
"internally (using <link xref=\"#gtask\"><code>GTask</code></link> where "
"appropriate), and keep synchronous wrappers at the very top level of an API, "
"where they can be implemented by calling <code>g_main_context_iteration()</"
"code> on a specific <code>GMainContext</code>. Again, this makes future "
"refactoring easier. This is demonstrated in the above example: the thread "
"uses <code>g_output_stream_write_async()</code> rather than "
"<code>g_output_stream_write()</code>. A worker thread may be used instead, "
"and this can simplify the callback chain for long series of asynchronous "
"calls; but at the cost of increased complexity in verifying the code is race-"
"free."
msgstr ""
"Věci interně <link xref=\"async-programming\">pište jako asynchronní</link> "
"(kde je to vhodné, tak pomocí <link xref=\"#gtask\"><code>GTask</code></"
"link>) a na nejvyšší úrovni API pak udržujte synchronní obalující funkci, "
"kterou můžete implementovat pomocí volání <code>g_main_context_iteration()</"
"code> na příslušný <code>GMainContext</code>. Pro zopakování: umožní to v "
"budoucnu snadnější přepracování kódu. Ukázáno je to na příkladu výše: vlákno "
"používá raději <code>g_output_stream_write_async()</code> namísto "
"<code>g_output_stream_write()</code>. Místo toho může být použito pracovní "
"vlákno a tím se může zjednodušit řetěz zpětných volání pro dlouhé "
"posloupnosti asynchronních volání, ale za cenu nárustu složitosti ověřování "
"kódu vůči souběhu podmínek."
#. (itstool) path: section/p
#: C/main-contexts.page:483
msgid ""
"Always match pushes and pops of the thread-default main context: "
"<code>g_main_context_push_thread_default()</code> and "
"<code>g_main_context_pop_thread_default()</code>."
msgstr ""
"Vždy si musí odpovídat počet vložení a vyjmutí výchozího hlavního kontextu "
"vlákna: <code>g_main_context_push_thread_default()</code> a "
"<code>g_main_context_pop_thread_default()</code>."
#. (itstool) path: section/title
#: C/main-contexts.page:491
msgid "Ensuring Functions are Called in the Right Context"
msgstr "Zajištění, aby funkce byly volány ve správném kontextu"
#. (itstool) path: section/p
#: C/main-contexts.page:493
msgid ""
"The ‘right context’ is the thread-default main context of the <em>thread the "
"function should be executing in</em>. This assumes the typical case that "
"every thread has a <em>single</em> main context running in a main loop. A "
"main context effectively provides a work or <link href=\"https://en."
"wikipedia.org/wiki/Message_queue\">message queue</link> for the thread — "
"something which the thread can periodically check to determine if there is "
"work pending from another thread. Putting a message on this queue – invoking "
"a function in another main context – will result in it eventually being "
"dispatched in that thread."
msgstr ""
"„Ten pravý kontext“ je výchozí hlavní kontext vlákna pro <em>vlákno, ve "
"kterém má být funkce spuštěna</em>. Předpokládá to typický případ, kdy každé "
"vlákno má <em>jeden</em> hlavní kontext, ve kterém běží hlavní smyčka. "
"Hlavní kontext v podstatě poskytuje práci nebo <link href=\"https://en."
"wikipedia.org/wiki/Message_queue\">frontu zpráv</link> pro vlákno – něco, v "
"čem vlákno může pravidelně kontrolovat, jestli byla dokončena práce v jiném "
"vlákně. Vložením zprávy do fronty – vyvoláním funkce v jiném hlavním "
"kontextu – způsobí její případné vyslání v onom vlákně."
#. (itstool) path: example/p
#: C/main-contexts.page:507
msgid ""
"For example, if an application does a long and CPU-intensive computation it "
"should schedule this in a background thread so that UI updates in the main "
"thread are not blocked. The results of the computation, however, might need "
"to be displayed in the UI, so some UI update function must be called in the "
"main thread once the computation’s complete."
msgstr ""
"Například, když aplikace provádí nějaké dlouhé a na výkon procesoru náročné "
"výpočty, měla by je naplánovat ve vlákně na pozadí, aby se neblokovaly "
"aktualizace uživatelského rozhraní v hlavním vlákně. Může ale být zapotřebí "
"výsledky výpočtu zobrazit v uživatelském rozhraní, takže funkce, která to "
"bude mít na starosti, musí být po dokončení výpočtu zavolána v hlavním "
"vlákně."
#. (itstool) path: example/p
#: C/main-contexts.page:515
msgid ""
"Furthermore, if the computation function can be limited to a single thread, "
"it becomes easy to eliminate the need for locking a lot of the data it "
"accesses. This assumes that other threads are implemented similarly and "
"hence most data is only accessed by a single thread, with threads "
"communicating by <link href=\"https://en.wikipedia.org/wiki/Message_passing"
"\">message passing</link>. This allows each thread to update its data at its "
"leisure, which significantly simplifies locking."
msgstr ""
"Mimo to může být výpočetní funkce omezena jen na jedno vlákno, aby se "
"usnadnilo zamezení potřeby zamykat příliš dat při přístupu k nim. To "
"předpokládá, že ostatní vlákna jsou implementována podobně a tudíž je k "
"většině dat přistupováno jen z jediného vlákna a mezi vlákny se komunikuje "
"pomocí <link href=\"https://cs.wikipedia.org/wiki/Zas%C3%ADl%C3%A1n%C3%AD_zpr"
"%C3%A1v\">předávání zpráv</link>. Umožní to jednotlivým vláknům aktualizovat "
"svá data, kdy se jim to hodí, což významně zjednodušuje zamykání."
#. (itstool) path: section/p
#: C/main-contexts.page:527
msgid ""
"For some functions, there might be no reason to care which context they’re "
"executed in, perhaps because they’re asynchronous and hence do not block the "
"context. However, it is still advisable to be explicit about which context "
"is used, since those functions may emit signals or invoke callbacks, and for "
"reasons of thread safety it’s necessary to know which threads those signal "
"handlers or callbacks are going to be invoked in."
msgstr ""
"U některých funkcí nemusí být žádný důvod se starat o to, ve kterém kontextu "
"jsou spuštěné, protože jsou asynchronní a tudíž kontext neblokují. I přesto "
"je rozumné vědět o tom, který kontext je použit, protože tyto funkce mohou "
"vysílat signály nebo vyvolávat zpětná volání a z důvodu bezpečnosti vlákna "
"je nutné vědět, která vlákna hodlají tyto obsluhy signálů nebo zpětná volání "
"vyvolat."
#. (itstool) path: example/p
#: C/main-contexts.page:537
msgid ""
"For example, the progress callback in <link href=\"https://developer.gnome."
"org/gio/stable/GFile.html#g-file-copy-async\"><code>g_file_copy_async()</"
"code></link> is documented as being called in the thread-default main "
"context at the time of the initial call."
msgstr ""
"Například pro průběh volání v <link href=\"https://developer.gnome.org/gio/"
"stable/GFile.html#g-file-copy-async\"><code>g_file_copy_async()</code></"
"link> je zdokumentováno, že se volá ve výchozím vlákně hlavního kontextu v "
"době volání inicializace."
#. (itstool) path: section/title
#: C/main-contexts.page:546
msgid "Principles of Invocation"
msgstr "Principy vyvolání"
#. (itstool) path: section/p
#: C/main-contexts.page:548
msgid ""
"The core principle of invoking a function in a specific context is simple, "
"and is walked through below to explain the concepts. In practice the <link "
"xref=\"#g-main-context-invoke-full\">convenience method, "
"<code>g_main_context_invoke_full()</code></link> should be used instead."
msgstr ""
"Klíčový princip vyvolání funkce v konkrétním kontextu je jednoduchý a je "
"probrán níže ve vysvětlení konceptu. V praxi by se místo toho měla použít "
"<link xref=\"#g-main-context-invoke-full\">vhodná metoda "
"<code>g_main_context_invoke_full()</code></link>."
#. (itstool) path: section/p
#: C/main-contexts.page:555
msgid ""
"A <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-"
"Loop.html#GSource\"><code>GSource</code></link> has to be added to the "
"target <code>GMainContext</code>, which will invoke the function when it’s "
"dispatched. This <code>GSource</code> should almost always be an idle source "
"created with <link href=\"https://developer.gnome.org/glib/stable/glib-The-"
"Main-Event-Loop.html#g-idle-source-new\"><code>g_idle_source_new()</code></"
"link>, but this doesn’t have to be the case. It could be a timeout source so "
"that the function is executed after a delay, for example."
msgstr ""
"Do cílového <code>GMainContext</code>, který vyvolá funkci, když je obeslán, "
"musí být přidán <link href=\"https://developer.gnome.org/glib/stable/glib-"
"The-Main-Event-Loop.html#GSource\"><code>GSource</code></link>. Tento "
"<code>GSource</code> by většinou měl být zdroj pro nečinnost vytvořený "
"pomocí <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-"
"Event-Loop.html#g-idle-source-new\"><code>g_idle_source_new()</code></link>, "
"ale nemusí tomu tak být nutně. Může jít například i o zdroj časovače, takže "
"ona funkce bude spuštěna po nějaké prodlevě."
#. (itstool) path: section/p
#: C/main-contexts.page:566
msgid ""
"The <code>GSource</code> will be <link xref=\"#what-is-gmaincontext"
"\">dispatched as soon as it’s ready</link>, calling the function on the "
"thread’s stack. In the case of an idle source, this will be as soon as all "
"sources at a higher priority have been dispatched — this can be tweaked "
"using the idle source’s priority parameter with <link href=\"https://"
"developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-source-set-"
"priority\"><code>g_source_set_priority()</code></link>. The source will "
"typically then be destroyed so the function is only executed once (though "
"again, this doesn’t have to be the case)."
msgstr ""
"<code>GSource</code> bude <link xref=\"#what-is-gmaincontext\">vyslán hned, "
"jak bude připraven</link>, zavoláním funkce na zásobníku vlákna. V případě "
"nečinnosti zdroje to bude hned, jak budou vyslány zdroje s vyšší prioritou – "
"to lze vyladit pomocí parametru s prioritou zdroje v <link href=\"https://"
"developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-source-set-"
"priority\"><code>g_source_set_priority()</code></link>. Typicky je zdroj "
"následně zlikvidován, takže funkce se spustí jen jednou (a když znovu, tak "
"to nemusí být ta samá situace)."
#. (itstool) path: section/p
#: C/main-contexts.page:578
msgid ""
"Data can be passed between threads as the <code>user_data</code> passed to "
"the <code>GSource</code>’s callback. This is set on the source using <link "
"href=\"https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop."
"html#g-source-set-callback\"><code>g_source_set_callback()</code></link>, "
"along with the callback function to invoke. Only a single pointer is "
"provided, so if multiple data fields need passing, they must be wrapped in "
"an allocated structure."
msgstr ""
"Data mezi vlákny mohou být předávána jako <code>user_data</code> předaná do "
"zpětného volání patřícího <code>GSource</code>. Nastaví se to na zdroji "
"pomocí <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-"
"Event-Loop.html#g-source-set-callback\"><code>g_source_set_callback()</"
"code></link> společně s funkcí zpětného volání, která má být vyvolána. K "
"dispozici je jen jeden ukazatel, takže když potřebujete předat více polí, "
"musíte je zabalit do nějaké struktury, kterou si naalokujete."
#. (itstool) path: example/p
#: C/main-contexts.page:588
msgid ""
"The example below demonstrates the underlying principles, but there are "
"convenience methods explained below which simplify things."
msgstr ""
"Následující příklad demonstruje základní principy, ale existují vhodné "
"metody probrané dále, které vše zjednodušují."
#. (itstool) path: example/code
#: C/main-contexts.page:593
#, no-wrap
msgid ""
"\n"
"/* Main function for the background thread, thread1. */\n"
"static gpointer\n"
"thread1_main (gpointer user_data)\n"
"{\n"
" GMainContext *thread1_main_context = user_data;\n"
" GMainLoop *main_loop;\n"
"\n"
" /* Set up the thread’s context and run it forever. */\n"
" g_main_context_push_thread_default (thread1_main_context);\n"
"\n"
" main_loop = g_main_loop_new (thread1_main_context, FALSE);\n"
" g_main_loop_run (main_loop);\n"
" g_main_loop_unref (main_loop);\n"
"\n"
" g_main_context_pop_thread_default (thread1_main_context);\n"
" g_main_context_unref (thread1_main_context);\n"
"\n"
" return NULL;\n"
"}\n"
"\n"
"/* A data closure structure to carry multiple variables between\n"
" * threads. */\n"
"typedef struct {\n"
" gchar *some_string; /* owned */\n"
" guint some_int;\n"
" GObject *some_object; /* owned */\n"
"} MyFuncData;\n"
"\n"
"static void\n"
"my_func_data_free (MyFuncData *data)\n"
"{\n"
" g_free (data->some_string);\n"
" g_clear_object (&data->some_object);\n"
" g_free (data);\n"
"}\n"
"\n"
"static void\n"
"my_func (const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object)\n"
"{\n"
" /* Do something long and CPU intensive! */\n"
"}\n"
"\n"
"/* Convert an idle callback into a call to my_func(). */\n"
"static gboolean\n"
"my_func_idle (gpointer user_data)\n"
"{\n"
" MyFuncData *data = user_data;\n"
"\n"
" my_func (data->some_string, data->some_int, data->some_object);\n"
"\n"
" return G_SOURCE_REMOVE;\n"
"}\n"
"\n"
"/* Function to be called in the main thread to schedule a call to\n"
" * my_func() in thread1, passing the given parameters along. */\n"
"static void\n"
"invoke_my_func (GMainContext *thread1_main_context,\n"
" const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object)\n"
"{\n"
" GSource *idle_source;\n"
" MyFuncData *data;\n"
"\n"
" /* Create a data closure to pass all the desired variables\n"
" * between threads. */\n"
" data = g_new0 (MyFuncData, 1);\n"
" data->some_string = g_strdup (some_string);\n"
" data->some_int = some_int;\n"
" data->some_object = g_object_ref (some_object);\n"
"\n"
" /* Create a new idle source, set my_func() as the callback with\n"
" * some data to be passed between threads, bump up the priority\n"
" * and schedule it by attaching it to thread1’s context. */\n"
" idle_source = g_idle_source_new ();\n"
" g_source_set_callback (idle_source, my_func_idle, data,\n"
" (GDestroyNotify) my_func_data_free);\n"
" g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);\n"
" g_source_attach (idle_source, thread1_main_context);\n"
" g_source_unref (idle_source);\n"
"}\n"
"\n"
"/* Main function for the main thread. */\n"
"static void\n"
"main (void)\n"
"{\n"
" GThread *thread1;\n"
" GMainContext *thread1_main_context;\n"
"\n"
" /* Spawn a background thread and pass it a reference to its\n"
" * GMainContext. Retain a reference for use in this thread\n"
" * too. */\n"
" thread1_main_context = g_main_context_new ();\n"
" g_thread_new (\"thread1\", thread1_main,\n"
" g_main_context_ref (thread1_main_context));\n"
"\n"
" /* Maybe set up your UI here, for example. */\n"
"\n"
" /* Invoke my_func() in the other thread. */\n"
" invoke_my_func (thread1_main_context,\n"
" \"some data which needs passing between threads\",\n"
" 123456, some_object);\n"
"\n"
" /* Continue doing other work. */\n"
"}"
msgstr ""
"\n"
"/* Hlavní funkce pro vlákno na pozadí thread1 */\n"
"static gpointer\n"
"thread1_main (gpointer user_data)\n"
"{\n"
" GMainContext *thread1_main_context = user_data;\n"
" GMainLoop *main_loop;\n"
"\n"
" /* Nastaví kontext vlákna a navždy jej spustí */\n"
" g_main_context_push_thread_default (thread1_main_context);\n"
"\n"
" main_loop = g_main_loop_new (thread1_main_context, FALSE);\n"
" g_main_loop_run (main_loop);\n"
" g_main_loop_unref (main_loop);\n"
"\n"
" g_main_context_pop_thread_default (thread1_main_context);\n"
" g_main_context_unref (thread1_main_context);\n"
"\n"
" return NULL;\n"
"}\n"
"\n"
"/* Zapouzdření dat pro obsluhu více proměnných mezi vlákny */\n"
"typedef struct {\n"
" gchar *some_string; /* owned */\n"
" guint some_int;\n"
" GObject *some_object; /* owned */\n"
"} MyFuncData;\n"
"\n"
"static void\n"
"my_func_data_free (MyFuncData *data)\n"
"{\n"
" g_free (data->some_string);\n"
" g_clear_object (&data->some_object);\n"
" g_free (data);\n"
"}\n"
"\n"
"static void\n"
"my_func (const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object)\n"
"{\n"
" /* Zde se dělá něco náročného na čas a procesor! */\n"
"}\n"
"\n"
"/* Převede zpětné volání nečinnosti na volání my_func() */\n"
"static gboolean\n"
"my_func_idle (gpointer user_data)\n"
"{\n"
" MyFuncData *data = user_data;\n"
"\n"
" my_func (data->some_string, data->some_int, data->some_object);\n"
"\n"
" return G_SOURCE_REMOVE;\n"
"}\n"
"\n"
"/* Funkce, která má být volána v hlavním vlákně, aby plánovala volání\n"
" * my_func() ve vlákně thread1 a přitom předala zadané parametry */\n"
"static void\n"
"invoke_my_func (GMainContext *thread1_main_context,\n"
" const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object)\n"
"{\n"
" GSource *idle_source;\n"
" MyFuncData *data;\n"
"\n"
" /* Vytvoří zapouzdření dat pro předání všech požadovaných proměnných\n"
" * mezi vlákny */\n"
" data = g_new0 (MyFuncData, 1);\n"
" data->some_string = g_strdup (some_string);\n"
" data->some_int = some_int;\n"
" data->some_object = g_object_ref (some_object);\n"
"\n"
" /* Vytvoří nový zdroj nečinnosti, nastaví my_func() jako zpětné volání\n"
" * s nějakými daty, která budou předána mezi vlákny, zvýší prioritu a\n"
" * a naplánuje ji napojením na kontext vlákna thread1 */\n"
" idle_source = g_idle_source_new ();\n"
" g_source_set_callback (idle_source, my_func_idle, data,\n"
" (GDestroyNotify) my_func_data_free);\n"
" g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);\n"
" g_source_attach (idle_source, thread1_main_context);\n"
" g_source_unref (idle_source);\n"
"}\n"
"\n"
"/* Hlavní funkce pro hlavní vlákno */\n"
"static void\n"
"main (void)\n"
"{\n"
" GThread *thread1;\n"
" GMainContext *thread1_main_context;\n"
"\n"
" /* Spawn a background thread and pass it a reference to its\n"
" * GMainContext. Retain a reference for use in this thread\n"
" * too. */\n"
" thread1_main_context = g_main_context_new ();\n"
" g_thread_new (\"thread1\", thread1_main,\n"
" g_main_context_ref (thread1_main_context));\n"
"\n"
" /* Zde je možné například nastavit uživatelské rozhraní */\n"
"\n"
" /* Vyvolá my_func() v jiném vlákně */\n"
" invoke_my_func (thread1_main_context,\n"
" \"some data which needs passing between threads\",\n"
" 123456, some_object);\n"
"\n"
" /* Zde se pokračuje v jiné práci */\n"
"}"
#. (itstool) path: example/p
#: C/main-contexts.page:702
msgid ""
"This invocation is <em style=\"strong\">uni-directional</em>: it calls "
"<code>my_func()</code> in <code>thread1</code>, but there’s no way to return "
"a value to the main thread. To do that, the same principle needs to be used "
"again, invoking a callback function in the main thread. It’s a "
"straightforward extension which isn’t covered here."
msgstr ""
"Toto vyvolání je <em style=\"strong\">jednosměrné</em>: zavolá se "
"<code>my_func()</code> v <code>thread1</code>, ale neexistuje žádný způsob, "
"jak vrátit hodnotu do hlavního vlákna. Když to potřebujete udělat, je "
"potřeba znovu použít ten samý princip, tj. vyvolat funkci zpětného volání v "
"hlavním vlákně. Jedná se o přímočaré rozšíření, které zde není potřeba "
"rozebírat."
#. (itstool) path: example/p
#: C/main-contexts.page:710
msgid ""
"To maintain thread safety, data which is potentially accessed by multiple "
"threads must make those accesses mutually exclusive using a <link href="
"\"https://en.wikipedia.org/wiki/Mutual_exclusion\">mutex</link>. Data "
"potentially accessed by multiple threads: <code>thread1_main_context</code>, "
"passed in the fork call to <code>thread1_main</code>; and <code>some_object</"
"code>, a reference to which is passed in the data closure. Critically, GLib "
"guarantees that <code>GMainContext</code> is thread safe, so sharing "
"<code>thread1_main_context</code> between threads is safe. The example "
"assumes that other code accessing <code>some_object</code> is thread safe."
msgstr ""
"Aby byla zachována bezpečnost vlákna, musí být přístup k datům, ke kterým je "
"potenciálně možné přistupovat z více vláken, vzájemně vyloučen pomocí <link "
"href=\"https://cs.wikipedia.org/wiki/Vz%C3%A1jemn%C3%A9_vylou%C4%8Den%C3%AD"
"\">mutexu</link>. Data s potenciálním přístupem z více vláken: "
"<code>thread1_main_context</code>, předaný při rozvětvení do "
"<code>thread1_main</code>, a <code>some_object</code>, reference, do které "
"jsou předána zapouzdřená data. Podstatné je, že GLib zaručuje, že "
"<code>GMainContext</code> je z hlediska vláken bezpečný, takže sdílení "
"<code>thread1_main_context</code> mezi vlákny je bezpečné. Příklad "
"předpokládá, že ostatní kód přistupující k <code>some_object</code> je z "
"hlediska vláken bezpečný."
#. (itstool) path: example/p
#: C/main-contexts.page:724
msgid ""
"Note that <code>some_string</code> and <code>some_int</code> cannot be "
"accessed from both threads, because <em>copies</em> of them are passed to "
"<code>thread1</code>, rather than the originals. This is a standard "
"technique for making cross-thread calls thread safe without requiring "
"locking. It also avoids the problem of synchronizing freeing "
"<code>some_string</code>."
msgstr ""
"Všimněte si, že k proměnným <code>some_string</code> a <code>some_int</code> "
"nelze přistupovat z obou vláken, protože do vlákna <code>thread1</code> jsou "
"místo originálů předávány jejich <code>kopie</code>. Jedná se o standardní "
"techniku používanou z důvodu, aby křížové volání vláken bylo z hlediska "
"vícevláknového zpracování bezpečné, aniž by bylo nutné zamykání. Také se tím "
"předejte problémům se synchronizací při uvolňování <code>some_string</code>."
#. (itstool) path: example/p
#: C/main-contexts.page:733
msgid ""
"Similarly, a reference to <code>some_object</code> is transferred to "
"<code>thread1</code>, which works around the issue of synchronizing "
"destruction of the object (see <link xref=\"memory-management\"/>)."
msgstr ""
"A obdobně, reference na <code>some_object</code> je přenášena do vlákna "
"<code>thread1</code>, které řeší problém se synchronizací při likvidaci "
"objektu (viz <link xref=\"memory-management\"/>)."
#. (itstool) path: example/p
#: C/main-contexts.page:739
msgid ""
"<code>g_idle_source_new()</code> is used rather than the simpler "
"<code>g_idle_add()</code> so the <code>GMainContext</code> to attach to can "
"be specified."
msgstr ""
"Namísto jednodušší <code>g_idle_add()</code> je požita raději funkce "
"<code>g_idle_source_new()</code>, takže lze určit připojený "
"<code>GMainContext</code>."
#. (itstool) path: section/title
#: C/main-contexts.page:748
msgid "Convenience Method: <code>g_main_context_invoke_full()</code>"
msgstr "Užitečná metoda: <code>g_main_context_invoke_full()</code>"
#. (itstool) path: section/p
#: C/main-contexts.page:752
msgid ""
"This is simplified greatly by the convenience method, <link href=\"https://"
"developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-main-context-"
"invoke-full\"><code>g_main_context_invoke_full()</code></link>. It invokes a "
"callback so that the specified <code>GMainContext</code> is owned during the "
"invocation. Owning a main context is almost always equivalent to running it, "
"and hence the function is invoked in the thread for which the specified "
"context is the thread-default."
msgstr ""
"To vše se dá úžasně zjednodušit správnou metodou <link href=\"https://"
"developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-main-context-"
"invoke-full\"><code>g_main_context_invoke_full()</code></link>. Ta vyvolá "
"zpětné volání tak, že <code>GMainContext</code> je během něj vlastněn. "
"Vlastnění hlavního kontextu je téměř vždy to stejné, jako jej spustit, a tím "
"pádem je funkce vyvolána ve vlákně, pro které je určený kontext výchozí. "
#. (itstool) path: section/p
#: C/main-contexts.page:761
msgid ""
"<code>g_main_context_invoke()</code> can be used instead if the user data "
"does not need to be freed by a <code>GDestroyNotify</code> callback after "
"the invocation returns."
msgstr ""
"V případě, že uživatelská data není nutné po návratu z volání uvolňovat "
"pomocí zpětného volání <code>GDestroyNotify</code>, dá se místo toho použít "
"funkce <code>g_main_context_invoke()</code>."
#. (itstool) path: example/p
#: C/main-contexts.page:768
msgid ""
"Modifying the earlier example, the <code>invoke_my_func()</code> function "
"can be replaced by the following:"
msgstr ""
"Upravený předchozí příklad – funkce <code>invoke_my_func()</code> může být "
"nahrazena následovně:"
#. (itstool) path: example/code
#: C/main-contexts.page:773
#, no-wrap
msgid ""
"\n"
"static void\n"
"invoke_my_func (GMainContext *thread1_main_context,\n"
" const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object)\n"
"{\n"
" MyFuncData *data;\n"
"\n"
" /* Create a data closure to pass all the desired variables\n"
" * between threads. */\n"
" data = g_new0 (MyFuncData, 1);\n"
" data->some_string = g_strdup (some_string);\n"
" data->some_int = some_int;\n"
" data->some_object = g_object_ref (some_object);\n"
"\n"
" /* Invoke the function. */\n"
" g_main_context_invoke_full (thread1_main_context,\n"
" G_PRIORITY_DEFAULT, my_func_idle,\n"
" data,\n"
" (GDestroyNotify) my_func_data_free);\n"
"}"
msgstr ""
"\n"
"static void\n"
"invoke_my_func (GMainContext *thread1_main_context,\n"
" const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object)\n"
"{\n"
" MyFuncData *data;\n"
"\n"
" /* Vytvoří zapouzdření dat pro předávání všech požadovaných proměnných\n"
" * mezi vlákny */\n"
" data = g_new0 (MyFuncData, 1);\n"
" data->some_string = g_strdup (some_string);\n"
" data->some_int = some_int;\n"
" data->some_object = g_object_ref (some_object);\n"
"\n"
" /* Vyvolá funkci */\n"
" g_main_context_invoke_full (thread1_main_context,\n"
" G_PRIORITY_DEFAULT, my_func_idle,\n"
" data,\n"
" (GDestroyNotify) my_func_data_free);\n"
"}"
#. (itstool) path: example/p
#: C/main-contexts.page:796
msgid ""
"Consider what happens if <code>invoke_my_func()</code> were called from "
"<code>thread1</code>, rather than from the main thread. With the original "
"implementation, the idle source would be added to <code>thread1</code>’s "
"context and dispatched on the context’s next iteration (assuming no pending "
"dispatches with higher priorities). With the improved implementation, "
"<code>g_main_context_invoke_full()</code> will notice that the specified "
"context is already owned by the thread (or ownership can be acquired by it), "
"and will call <code>my_func_idle()</code> directly, rather than attaching a "
"source to the context and delaying the invocation to the next context "
"iteration."
msgstr ""
"Zamysleme se, co se stane, kdy je <code>invoke_my_func()</code> zavolána z "
"<code>thread1</code>, místo z hlavního vlákna. V původní implementaci by byl "
"nečinný zdroj přidán do kontextu vlákna <code>thread1</code> a vyslán v "
"následující iteraci kontextu (předpokládáme, že nečeká vyslání s vyšší "
"prioritou). Ve vylepšené implementaci si <code>g_main_context_invoke_full()</"
"code> všimne, že uvedený kontext je již vlastněn vláknem (nebo jeho "
"vlastnictví může získat), a zavolá přímo <code>my_func_idle()</code>, "
"namísto aby zdroj připojovala ke kontextu a čekala na vyvolání následující "
"iterace."
#. (itstool) path: example/p
#: C/main-contexts.page:810
msgid ""
"This subtle behavior difference doesn’t matter in most cases, but is worth "
"bearing in mind since it can affect blocking behavior "
"(<code>invoke_my_func()</code> would go from taking negligible time, to "
"taking the same amount of time as <code>my_func()</code> before returning)."
msgstr ""
"Na tomto jemném rozdílu v chování většinou nesejde, ale je dobré na něj "
"pamatovat, protože může ovlivnit chování při blokování "
"(<code>invoke_my_func()</code> by zabrala nezanedbatelné množství času, "
"které by odpovídalo stejnému množství času jako u <code>my_func()</code> "
"před návratem)."
#. (itstool) path: section/title
#: C/main-contexts.page:822
msgid "Checking Threading"
msgstr "Kontrola vláken"
#. (itstool) path: section/p
#: C/main-contexts.page:824
msgid ""
"It is useful to document which thread each function should be called in, in "
"the form of an assertion:"
msgstr ""
"Je vhodné zdokumentovat, která funkce je volána ve kterém vlákně, a to "
"formou aserce:"
#. (itstool) path: section/code
#: C/main-contexts.page:828
#, no-wrap
msgid ""
"\n"
"g_assert (g_main_context_is_owner (expected_main_context));"
msgstr ""
"\n"
"g_assert (g_main_context_is_owner (expected_main_context));"
#. (itstool) path: section/p
#: C/main-contexts.page:831
msgid ""
"If that’s put at the top of each function, any assertion failure will "
"highlight a case where a function has been called from the wrong thread. It "
"is much easier to write these assertions when initially developing code, "
"rather than debugging race conditions which can easily result from a "
"function being called in the wrong thread."
msgstr ""
"Když tohle vložíte na začátek každé funkce, selhání aserce zviditelní ty "
"případy, kdy je funkce volána z nesprávného vlákna. Je mnohem jednodušší "
"napsat tyto aserce v rané fázi vývoje kódu, než pak ladit souběh podmínek, "
"který může při volání funkce z nesprávného vlákna snadno nastat."
#. (itstool) path: section/p
#: C/main-contexts.page:839
msgid ""
"This technique can also be applied to signal emissions and callbacks, "
"improving type safety as well as asserting the right context is used. Note "
"that signal emission via <link href=\"https://developer.gnome.org/gobject/"
"stable/gobject-Signals.html#g-signal-emit\"><code>g_signal_emit()</code></"
"link> is synchronous, and doesn’t involve a main context at all."
msgstr ""
"Tuto techniku lze použít i u vysílání signálů a zpětných volání, díky čemuž "
"se zvýší typová bezpečnost i kontrola, jestli je použit správný kontext. "
"Upozorňujeme, že vyslání signálu přes <link href=\"https://developer.gnome."
"org/gobject/stable/gobject-Signals.html#g-signal-emit"
"\"><code>g_signal_emit()</code></link> je asynchronní a vůbec se netýká "
"hlavního kontextu."
#. (itstool) path: example/p
#: C/main-contexts.page:848
msgid "For example, instead of using the following when emitting a signal:"
msgstr "Například místo použití následujícího kódu při vyslání signálu:"
#. (itstool) path: example/code
#: C/main-contexts.page:851
#, no-wrap
msgid ""
"\n"
"guint param1; /* arbitrary example parameters */\n"
"gchar *param2;\n"
"guint retval = 0;\n"
"\n"
"g_signal_emit_by_name (my_object, \"some-signal\",\n"
" param1, param2, &retval);"
msgstr ""
"\n"
"guint param1; /* příklad libovolného parametru */\n"
"gchar *param2;\n"
"guint retval = 0;\n"
"\n"
"g_signal_emit_by_name (my_object, \"some-signal\",\n"
" param1, param2, &retval);"
#. (itstool) path: example/p
#: C/main-contexts.page:859
msgid "The following can be used:"
msgstr "Může být použito následující:"
#. (itstool) path: example/code
#: C/main-contexts.page:862
#, no-wrap
msgid ""
"\n"
"static guint\n"
"emit_some_signal (GObject *my_object,\n"
" guint param1,\n"
" const gchar *param2)\n"
"{\n"
" guint retval = 0;\n"
"\n"
" g_assert (g_main_context_is_owner (expected_main_context));\n"
"\n"
" g_signal_emit_by_name (my_object, \"some-signal\",\n"
" param1, param2, &retval);\n"
"\n"
" return retval;\n"
"}"
msgstr ""
"\n"
"static guint\n"
"emit_some_signal (GObject *my_object,\n"
" guint param1,\n"
" const gchar *param2)\n"
"{\n"
" guint retval = 0;\n"
"\n"
" g_assert (g_main_context_is_owner (expected_main_context));\n"
"\n"
" g_signal_emit_by_name (my_object, \"some-signal\",\n"
" param1, param2, &retval);\n"
"\n"
" return retval;\n"
"}"
#. (itstool) path: section/title
#: C/main-contexts.page:881
msgid "<code>GTask</code>"
msgstr "<code>GTask</code>"
#. (itstool) path: section/p
#: C/main-contexts.page:883
msgid ""
"<link href=\"https://developer.gnome.org/gio/stable/GTask.html"
"\"><code>GTask</code></link> provides a slightly different approach to "
"invoking functions in other threads, which is more suited to the case where "
"a function should be executed in <em>some</em> background thread, but not a "
"specific one."
msgstr ""
"<link href=\"https://developer.gnome.org/gio/stable/GTask.html"
"\"><code>GTask</code></link> poskytuje k vyvolání funkcí v jiných vláknech "
"trochu odlišný přístup, který je zaměřen více na případy, kdy by funkce měla "
"být spuštěna v <em>nějakém</em> vlákně na pozadí, ale není určeno, v kterém "
"konkrétním."
#. (itstool) path: section/p
#: C/main-contexts.page:890
msgid ""
"<code>GTask</code> takes a data closure and a function to execute, and "
"provides ways to return the result from this function. It handles everything "
"necessary to run that function in an arbitrary thread belonging to some "
"thread pool internal to GLib."
msgstr ""
"<code>GTask</code> přebírá zapouzdřená data a funkci ke spuštění a poskytuje "
"způsob, jak vrátit výsledky z této funkce. Postará se o vše potřebné ke "
"spuštění funkce v libovolném vlákně náležejícímu do stejného svazku vláken "
"sdílených interně v GLib."
#. (itstool) path: example/p
#: C/main-contexts.page:898
msgid ""
"By combining <link xref=\"#g-main-context-invoke-full"
"\"><code>g_main_context_invoke_full()</code></link> and <code>GTask</code>, "
"it is possible to run a task in a specific context and effortlessly return "
"its result to the current context:"
msgstr ""
"Zkombinováním <link xref=\"#g-main-context-invoke-full"
"\"><code>g_main_context_invoke_full()</code></link> a <code>GTask</code> je "
"možné spustit úlohu v konkrétním kontextu a bez většího úsilí vrátit její "
"výsledek do aktuálního kontextu:"
#. (itstool) path: example/code
#: C/main-contexts.page:904
#, no-wrap
msgid ""
"\n"
"/* This will be invoked in thread1. */\n"
"static gboolean\n"
"my_func_idle (gpointer user_data)\n"
"{\n"
" GTask *task = G_TASK (user_data);\n"
" MyFuncData *data;\n"
" gboolean retval;\n"
"\n"
" /* Call my_func() and propagate its returned boolean to\n"
" * the main thread. */\n"
" data = g_task_get_task_data (task);\n"
" retval = my_func (data->some_string, data->some_int,\n"
" data->some_object);\n"
" g_task_return_boolean (task, retval);\n"
"\n"
" return G_SOURCE_REMOVE;\n"
"}\n"
"\n"
"/* Whichever thread this is invoked in, the @callback will be\n"
" * invoked in, once my_func() has finished and returned a result. */\n"
"static void\n"
"invoke_my_func_with_result (GMainContext *thread1_main_context,\n"
" const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" MyFuncData *data;\n"
"\n"
" /* Create a data closure to pass all the desired variables\n"
" * between threads. */\n"
" data = g_new0 (MyFuncData, 1);\n"
" data->some_string = g_strdup (some_string);\n"
" data->some_int = some_int;\n"
" data->some_object = g_object_ref (some_object);\n"
"\n"
" /* Create a GTask to handle returning the result to the current\n"
" * thread-default main context. */\n"
" task = g_task_new (NULL, NULL, callback, user_data);\n"
" g_task_set_task_data (task, data,\n"
" (GDestroyNotify) my_func_data_free);\n"
"\n"
" /* Invoke the function. */\n"
" g_main_context_invoke_full (thread1_main_context,\n"
" G_PRIORITY_DEFAULT, my_func_idle,\n"
" task,\n"
" (GDestroyNotify) g_object_unref);\n"
"}"
msgstr ""
"\n"
"/* Toto bude vyvoláno ve vlákně thread1 */\n"
"static gboolean\n"
"my_func_idle (gpointer user_data)\n"
"{\n"
" GTask *task = G_TASK (user_data);\n"
" MyFuncData *data;\n"
" gboolean retval;\n"
"\n"
" /* Zavolá my_func() a vrácenou pravdivostní hodnotu propaguje\n"
" * do hlavního vlákna */\n"
" data = g_task_get_task_data (task);\n"
" retval = my_func (data->some_string, data->some_int,\n"
" data->some_object);\n"
" g_task_return_boolean (task, retval);\n"
"\n"
" return G_SOURCE_REMOVE;\n"
"}\n"
"\n"
"/* Ať je toto vyvoláno z kteréhokoliv vlákna, vyvolá se funkce\n"
" * @callback, jakmile je dokončena my_func() a vrátí výsledek */\n"
"static void\n"
"invoke_my_func_with_result (GMainContext *thread1_main_context,\n"
" const gchar *some_string,\n"
" guint some_int,\n"
" GObject *some_object,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" MyFuncData *data;\n"
"\n"
" /* Vytvoří zapouzdření dat pro předání všech požadovaných proměnných\n"
" * mezi vlákny */\n"
" data = g_new0 (MyFuncData, 1);\n"
" data->some_string = g_strdup (some_string);\n"
" data->some_int = some_int;\n"
" data->some_object = g_object_ref (some_object);\n"
"\n"
" /* Vytvoří GTask pro obsluhu vráceného výsledku do hlavního výchozího\n"
" * kontextu aktuálního vlákna */\n"
" task = g_task_new (NULL, NULL, callback, user_data);\n"
" g_task_set_task_data (task, data,\n"
" (GDestroyNotify) my_func_data_free);\n"
"\n"
" /* Vyvolá funkci */\n"
" g_main_context_invoke_full (thread1_main_context,\n"
" G_PRIORITY_DEFAULT, my_func_idle,\n"
" task,\n"
" (GDestroyNotify) g_object_unref);\n"
"}"
#. (itstool) path: info/desc
#: C/memory-management.page:17
msgid "Managing memory allocation and deallocation in C"
msgstr "Správa přidělování a uvolňování paměti v C"
#. (itstool) path: page/title
#: C/memory-management.page:20
msgid "Memory Management"
msgstr "Správa paměti"
#. (itstool) path: page/p
#: C/memory-management.page:50
msgid ""
"The GNOME stack is predominantly written in C, so dynamically allocated "
"memory has to be managed manually. Through use of GLib convenience APIs, "
"memory management can be trivial, but programmers always need to keep memory "
"in mind when writing code."
msgstr ""
"Zásobník GNOME je napsán převážně v jazyce C, takže dynamicky alokovaná "
"paměť musí být spravována ručně. S použitím usnadňujícího API z GLib je však "
"správa triviální, přesto by měli programátoři při psaní kódu na paměť vždy "
"myslet."
#. (itstool) path: page/p
#: C/memory-management.page:57
msgid ""
"It is assumed that the reader is familiar with the idea of heap allocation "
"of memory using <code>malloc()</code> and <code>free()</code>, and knows of "
"the paired GLib equivalents, <code>g_malloc()</code> and <code>g_free()</"
"code>."
msgstr ""
"Předpokládá se, že čtenář je dobře seznámen s principem alokace paměti na "
"haldě s pomocí <code>malloc()</code> a <code>free()</code> a zná příslušnou "
"dvojici obdobných funkcí z GLib <code>g_malloc()</code> a <code>g_free()</"
"code>."
#. (itstool) path: synopsis/p
#: C/memory-management.page:67
msgid "There are three situations to avoid, in order of descending importance:"
msgstr ""
"Existují tři situace, kterým byste se měli vyhnout a které zde uvádíme podle "
"důležitosti:"
#. (itstool) path: item/p
#: C/memory-management.page:72
msgid "Using memory after freeing it (use-after-free)."
msgstr "Použití paměti po jejím uvolnění."
#. (itstool) path: item/p
#: C/memory-management.page:73
msgid "Using memory before allocating it."
msgstr "Požití paměti před jejím přidělením."
#. (itstool) path: item/p
#: C/memory-management.page:74
msgid "Not freeing memory after allocating it (leaking)."
msgstr "Neuvolnění paměti, která byla přidělena (tzv. únik)."
#. (itstool) path: synopsis/p
#: C/memory-management.page:77
msgid "Key principles, in no particular order:"
msgstr "Klíčové principy (bez ohledu na pořadí důležitosti):"
#. (itstool) path: item/p
#: C/memory-management.page:82
msgid ""
"Determine and document whether each variable is owned or unowned. They must "
"never change from one to the other at runtime. (<link xref=\"#principles\"/>)"
msgstr ""
"U každé proměnné určete a zdokumentujte, zda je či není vlastněna. Za běhu "
"se to pak nikdy nesmí měnit. (<link xref=\"#principles\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:87
msgid ""
"Determine and document the ownership transfers at function boundaries. "
"(<link xref=\"#principles\"/>)"
msgstr ""
"Určete a zdokumentujte přenosy vlastnictví na hranicích funkcí. (<link xref="
"\"#principles\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:91
msgid ""
"Ensure that each assignment, function call and function return respects the "
"relevant ownership transfers. (<link xref=\"#assignments\"/>, <link xref="
"\"#function-calls\"/>, <link xref=\"#function-returns\"/>)"
msgstr ""
"Zajistěte, aby každé přiřazení, volání funkce a návrat z funkce respektovali "
"příslušné přenosy vlastnictví. (<link xref=\"#assignments\"/>, <link xref="
"\"#function-calls\"/>, <link xref=\"#function-returns\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:96
msgid ""
"Use reference counting rather than explicit finalization where possible. "
"(<link xref=\"#reference-counting\"/>)"
msgstr ""
"Kde je to možné, používejte raději počítání odkazů, než explicitní "
"finalizaci. (<link xref=\"#reference-counting\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:100
msgid ""
"Use GLib convenience functions like <link xref=\"#g-clear-object"
"\"><code>g_clear_object()</code></link> where possible. (<link xref="
"\"#convenience-functions\"/>)"
msgstr ""
"Kde je to možné, používejte vhodné funkce z GLib, jako třeba <link xref=\"#g-"
"clear-object\"><code>g_clear_object()</code></link>. (<link xref="
"\"#convenience-functions\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:105
msgid ""
"Do not split memory management across code paths. (<link xref=\"#principles"
"\"/>)"
msgstr ""
"Nerozdělujte správu paměti do více cest průchodu programem. (<link xref="
"\"#principles\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:109
msgid ""
"Use the single-path cleanup pattern for large or complex functions. (<link "
"xref=\"#single-path-cleanup\"/>)"
msgstr ""
"Používejte návrhový vzor pro jednocestné čištění pro rozsáhlé a složité "
"funkce. (<link xref=\"#single-path-cleanup\"/>)"
#. (itstool) path: item/p
#: C/memory-management.page:113
msgid ""
"Leaks should be checked for using Valgrind or the address sanitizer. (<link "
"xref=\"#verification\"/>)"
msgstr ""
"Uniky by měly být kontrolovány pomocí nástroje Valgrind nebo sanitizérem "
"adres. (<link xref=\"#verification\"/>)"
#. (itstool) path: section/title
#: C/memory-management.page:121
msgid "Principles of Memory Management"
msgstr "Principy správy paměti"
#. (itstool) path: section/p
#: C/memory-management.page:123
msgid ""
"The normal approach to memory management is for the programmer to keep track "
"of which variables point to allocated memory, and to manually free them when "
"they are no longer needed. This is correct, but can be clarified by "
"introducing the concept of <em>ownership</em>, which is the piece of code "
"(such as a function, struct or object) which is responsible for freeing a "
"piece of allocated memory (an <em>allocation</em>). Each allocation has "
"exactly one owner; this owner may change as the program runs, by "
"<em>transferring</em> ownership to another piece of code. Each variable is "
"<em>owned</em> or <em>unowned</em>, according to whether the scope "
"containing it is always its owner. Each function parameter and return type "
"either transfers ownership of the values passed to it, or it doesn’t. If "
"code which owns some memory doesn’t deallocate that memory, that’s a memory "
"leak. If code which doesn’t own some memory frees it, that’s a double-free. "
"Both are bad."
msgstr ""
"Normální přístup ke správě paměti spočívá pro programátora v tom, mít "
"přehled, které proměnné ukazují na alokovanou paměť a ručně ji uvolnit v "
"situaci, kdy již není nadále potřeba. Tak je to v pořádku, ale dá se to "
"zpřehlednit zavedením konceptu <em>vlastnictví</em>, což je kus kódu "
"(například funkce, struktura nebo objekt), který je zodpovědný za uvolnění "
"kusu alokované paměti (<em>alokace</em>). Každá alokace má právě jednoho "
"vlastníka, který se ale za dobu běhu programu může měnit tzv. <em>přenosem</"
"em> vlastnictví na jiný kus kódu. Každá proměnná je buď <em>vlastněna</em> "
"nebo <em>nevlastněna</em>, podle toho, jestli je rozsah působnosti, jehož je "
"součástí, vždy jejím vlastníkem. Každý parametr funkce a návratový typ buď "
"přenáší vlastnictví předávané hodnoty nebo nepřenáší. V případě, že kód "
"vlastnící nějakou paměti tuto paměť nedealokuje, dojde k úniku paměti. V "
"případě, že kód, který nevlastní určitou paměť, tuto paměť uvolní, jedná se "
"o dvojité uvolnění. Obojí je špatně."
#. (itstool) path: section/p
#: C/memory-management.page:140
msgid ""
"By statically calculating which variables are owned, memory management "
"becomes a simple task of unconditionally freeing the owned variables before "
"they leave their scope, and <em>not</em> freeing the unowned variables (see "
"<link xref=\"#single-path-cleanup\"/>). The key question to answer for all "
"memory is: which code has ownership of this memory?"
msgstr ""
"Tím, že stačí napevno určit, které proměnné jsou vlastněné, se ze správy "
"paměti stává jednoduchý úkol spočívající v nepodmíněném uvolňování "
"proměnných před tím, než se opustí jejich rozsah působnosti, a v <em>ne</"
"em>uvolnění nevlastněných proměnných (viz <link xref=\"#single-path-cleanup"
"\"/>). Klíčovou otázkou pro kterýkoliv kus paměti tak je: která část kódu "
"jej vlastní."
#. (itstool) path: section/p
#: C/memory-management.page:149
msgid ""
"There is an important restriction here: variables must <em style=\"strong"
"\">never</em> change from owned to unowned (or vice-versa) at runtime. This "
"restriction is key to simplifying memory management."
msgstr ""
"Je zde jedno důležité omezení: proměnné se za běhu <em style=\"strong"
"\">nikdy</em> nesmí změnit z vlastněných na nevlastněné (nebo naopak). Toto "
"omezení je klíčové kvůli zjednodušení správy paměti."
#. (itstool) path: section/p
#: C/memory-management.page:155
msgid "For example, consider the functions:"
msgstr "Například mějme funkci:"
#. (itstool) path: section/code
#: C/memory-management.page:159
#, no-wrap
msgid ""
"gchar *generate_string (const gchar *template);\n"
"void print_string (const gchar *str);"
msgstr ""
"gchar *generate_string (const gchar *template);\n"
"void print_string (const gchar *str);"
#. (itstool) path: section/p
#: C/memory-management.page:162
msgid ""
"The following code has been annotated to note where the ownership transfers "
"happen:"
msgstr ""
"Následující kód byl opatřen anotacemi a komentáři, abyste se všimli, kde "
"dochází k přenosu vlastnictví:"
#. (itstool) path: section/code
#: C/memory-management.page:167
#, no-wrap
msgid ""
"gchar *my_str = NULL; /* owned */\n"
"const gchar *template; /* unowned */\n"
"GValue value = G_VALUE_INIT; /* owned */\n"
"g_value_init (&value, G_TYPE_STRING);\n"
"\n"
"/* Transfers ownership of a string from the function to the variable. */\n"
"template = \"XXXXXX\";\n"
"my_str = generate_string (template);\n"
"\n"
"/* No ownership transfer. */\n"
"print_string (my_str);\n"
"\n"
"/* Transfer ownership. We no longer have to free @my_str. */\n"
"g_value_take_string (&value, my_str);\n"
"\n"
"/* We still have ownership of @value, so free it before it goes out of scope. */\n"
"g_value_unset (&value);"
msgstr ""
"gchar *my_str = NULL; /* owned */\n"
"const gchar *template; /* unowned */\n"
"GValue value = G_VALUE_INIT; /* owned */\n"
"g_value_init (&value, G_TYPE_STRING);\n"
"\n"
"/* Přenese vlastnictví řetězce z funkce do proměnné */\n"
"template = \"XXXXXX\";\n"
"my_str = generate_string (template);\n"
"\n"
"/* Bez přenosu vlastnictví */\n"
"print_string (my_str);\n"
"\n"
"/* Přenos vlastnictví. Nadále se již nemusíme starat o uvolnění @my_str. */\n"
"g_value_take_string (&value, my_str);\n"
"\n"
"/* Stále vlastníme @value, takže před opuštěním této oblasti působnosti ji musíme uvolnit */\n"
"g_value_unset (&value);"
#. (itstool) path: section/p
#: C/memory-management.page:185
msgid ""
"There are a few points here: Firstly, the ‘owned’ comments by the variable "
"declarations denote that those variables are owned by the local scope, and "
"hence need to be freed before they go out of scope. The alternative is "
"‘unowned’, which means the local scope does <em>not</em> have ownership, and "
"<em>must not</em> free the variables before going out of scope. Similarly, "
"ownership <em>must not</em> be transferred to them on assignment."
msgstr ""
"Zastavme se u několika věcí: Za prvé, komentáře „vlastněno“ u deklarací "
"proměnných naznačují, že tyto proměnné jsou vlastněné místním rozsahem "
"působnosti, a proto potřebují být uvolněné před opuštěním tohoto rozsahu "
"působnosti. Alternativou je „nevlastněno“, což znamená, že místní rozsah "
"působnosti <em>nemá</em> vlastnictví a <em>nemusí</em> proměnnou uvolnit "
"před opuštěním rozsahu působnosti. Obdobně, při přiřazení na něj vlastnictví "
"<em>nemusí</em> být přeneseno."
#. (itstool) path: section/p
#: C/memory-management.page:195
msgid ""
"Secondly, the variable type modifiers reflect whether they transfer "
"ownership: because <code>my_str</code> is owned by the local scope, it has "
"type <code>gchar</code>, whereas <code>template</code> is <code>const</code> "
"to denote it is unowned. Similarly, the <code>template</code> parameter of "
"<code>generate_string()</code> and the <code>str</code> parameter of "
"<code>print_string()</code> are <code>const</code> because no ownership is "
"transferred when those functions are called. As ownership <em>is</em> "
"transferred for the string parameter of <code>g_value_take_string()</code>, "
"we can expect its type to be <code>gchar</code>."
msgstr ""
"Za druhé, modifikatory u proměnných odrážejí, jestli dochází k přenosu "
"vlastnictví: protože <code>my_str</code> je vlastněna místním rozsahem "
"působnosti, je typu <code>gchar</code>, zatímco <code>template</code> je "
"<code>const</code>, což říká, že není vlastněna. Obdobně, parametr "
"<code>template</code> funkce <code>generate_string()</code> a parametr "
"<code>str</code> funkce <code>print_string()</code> jsou <code>const</code>, "
"protože není přenášeno vlastnictví při volání těchto funkcí. Protože pro "
"řetězcový parametr funkce <code>g_value_take_string()</code> <em>je</em> "
"přenášeno vlastnictví, očekáváme, že její typ je <code>gchar</code>."
#. (itstool) path: section/p
#: C/memory-management.page:208
msgid ""
"(Note that this is not the case for <link href=\"https://developer.gnome.org/"
"gobject/stable/gobject-The-Base-Object-Type.html\"> <code>GObject</code></"
"link>s and subclasses, which can never be <code>const</code>. It is only the "
"case for strings and simple <code>struct</code>s.)"
msgstr ""
"(Upozorňujeme, že toto se netýká objektu <link href=\"https://developer."
"gnome.org/gobject/stable/gobject-The-Base-Object-Type.html\"><code>GObject</"
"code></link> a podtříd, které nemohou být nikdy <code>const</code>. Týká se "
"to jen řetězců a jednoduchých struktur <code>struct</code>.)"
#. (itstool) path: section/p
#: C/memory-management.page:216
msgid ""
"Finally, a few libraries use a function naming convention to indicate "
"ownership transfer, for example using ‘take’ in a function name to indicate "
"full transfer of parameters, as with <code>g_value_take_string()</code>. "
"Note that different libraries use different conventions, as shown below:"
msgstr ""
"A na konec, pár knihoven používá zvyklosti v názvech funkcí k indikaci "
"přenosu vlastnictví, například pomocí „take“ v názvu funkce, čímž oznamují "
"úplný přenos parametru, jako třeba u <code>g_value_take_string()</code>. "
"Dávajte ale pozor na to, že různé knihovny používají různé konvence, jak je "
"ukázáno níže:"
#. (itstool) path: td/p
#: C/memory-management.page:229
msgid "Function name"
msgstr "Název funkce"
#. (itstool) path: td/p
#: C/memory-management.page:230
msgid "Convention 1 (standard)"
msgstr "Konvence 1 (standardní)"
#. (itstool) path: td/p
#: C/memory-management.page:231
msgid "Convention 2 (alternate)"
msgstr "Konvence 2 (alternativní)"
#. (itstool) path: td/p
#: C/memory-management.page:232
msgid "Convention 3 (<cmd>gdbus-codegen</cmd>)"
msgstr "Konvence 3 (<cmd>gdbus-codegen</cmd>)"
#. (itstool) path: td/p
#: C/memory-management.page:237
msgid "get"
msgstr "get"
#. (itstool) path: td/p
#: C/memory-management.page:238 C/memory-management.page:254
#: C/memory-management.page:259 C/memory-management.page:260
#: C/memory-management.page:261
msgid "No transfer"
msgstr "Bez přenosu"
#. (itstool) path: td/p
#: C/memory-management.page:239
msgid "Any transfer"
msgstr "Libovolný přenos"
#. (itstool) path: td/p
#: C/memory-management.page:240 C/memory-management.page:245
#: C/memory-management.page:266 C/memory-management.page:273
#: C/memory-management.page:274 C/memory-management.page:275
msgid "Full transfer"
msgstr "Úplný přenos"
#. (itstool) path: td/p
#: C/memory-management.page:244
msgid "dup"
msgstr "dup"
#. (itstool) path: td/p
#: C/memory-management.page:246 C/memory-management.page:247
#: C/memory-management.page:252 C/memory-management.page:253
#: C/memory-management.page:267 C/memory-management.page:268
msgid "Unused"
msgstr "Nepoužito"
#. (itstool) path: td/p
#: C/memory-management.page:251
msgid "peek"
msgstr "peek"
#. (itstool) path: td/p
#: C/memory-management.page:258
msgid "set"
msgstr "set"
#. (itstool) path: td/p
#: C/memory-management.page:265
msgid "take"
msgstr "take"
#. (itstool) path: td/p
#: C/memory-management.page:272
msgid "steal"
msgstr "steal"
#. (itstool) path: section/p
#: C/memory-management.page:280
msgid ""
"Ideally, all functions have a <code>(transfer)</code> <link xref="
"\"introspection\">introspection annotation</link> for all relevant "
"parameters and the return value. Failing that, here is a set of guidelines "
"to use to determine whether ownership of a return value is transferred:"
msgstr ""
"V ideálním případě mají všechny funkce <link xref=\"introspection\">anotaci "
"k introspekci</link> ve formě <code>(transfer)</code> pro všechny příslušné "
"parametry a návratovou hodnotu. Pokud tomu tak není, uvádíme zde sadu "
"pravidel, které můžete použít k určení toho, jestli je vlastnictví návratové "
"hodnoty přenášeno:"
#. (itstool) path: item/p
#: C/memory-management.page:288
msgid ""
"If the type has an introspection <code>(transfer)</code> annotation, look at "
"that."
msgstr ""
"Jestliže má typ uvedenou anotaci <code>(transfer)</code> k introspekci, "
"podívejte se na ni."
#. (itstool) path: item/p
#: C/memory-management.page:292
msgid "Otherwise, if the type is <code>const</code>, there is no transfer."
msgstr ""
"V ostatních případech, když je typ konstantní (<code>const</code>), "
"nedochází k přenosu."
#. (itstool) path: item/p
#: C/memory-management.page:295
msgid ""
"Otherwise, if the function documentation explicitly specifies the return "
"value must be freed, there is full or container transfer."
msgstr ""
"Jinak, jestliže dokumentace k funkci výslovně uvádí, že návratová hodnota "
"musí být uvolněna, jedná se o úplný nebo kontejnerový přenos."
#. (itstool) path: item/p
#: C/memory-management.page:299
msgid ""
"Otherwise, if the function is named ‘dup’, ‘take’ or ‘steal’, there is full "
"or container transfer."
msgstr ""
"V ostatních případech, když se funkce nazývá „dup“, „take“ nebo „steal“, "
"dochází k úplnému nebo kontejnerovému přenosu."
#. (itstool) path: item/p
#: C/memory-management.page:303
msgid "Otherwise, if the function is named ‘peek’, there is no transfer."
msgstr ""
"V ostatních případech, když se funkce nazývá „peek“, nedochází k přenosu."
#. (itstool) path: item/p
#: C/memory-management.page:306
msgid ""
"Otherwise, you need to look at the function’s code to determine whether it "
"intends ownership to be transferred. Then file a bug against the "
"documentation for that function, and ask for an introspection annotation to "
"be added."
msgstr ""
"Jinak se musíte podívat do kódu funkce, abyste určili, jestli zamýšlí "
"vlastnictví přenášet. Nahlaste také chybu vůči dokumentaci této funkce a v "
"hlášení požádejte o přidání anotace k introspekci."
#. (itstool) path: section/p
#: C/memory-management.page:314
msgid ""
"Given this ownership and transfer infrastructure, the correct approach to "
"memory allocation can be mechanically determined for each situation. In each "
"case, the <code>copy()</code> function must be appropriate to the data type, "
"for example <code>g_strdup()</code> for strings, or <code>g_object_ref()</"
"code> for GObjects."
msgstr ""
"Když máme vlastnictví a přenos takhle jasně dány, je správný přístup k "
"alokaci paměti v kterékoliv situaci otázkou mechanického rozhodnutí. V "
"každém případě, funkce <code>copy()</code> musí odpovídat datovému typu, "
"například <code>g_strdup()</code> pro řetězec nebo <code>g_object_ref()</"
"code> pro GObject."
#. (itstool) path: section/p
#: C/memory-management.page:322
msgid ""
"When thinking about ownership transfer, <code>malloc()</code>/<code>free()</"
"code> and reference counting are equivalent: in the former case, a newly "
"allocated piece of heap memory is transferred; in the latter, a newly "
"incremented reference. See <link xref=\"#reference-counting\"/>."
msgstr ""
"Když se nad přenosem vlastnictví zamyslíte, jsou <code>malloc()</code>/"
"<code>free()</code> a počítání referencí to stejné: v prvním případě je "
"naalokování nového kusu paměti z haldy přenosem vlastnictví, ve druhém "
"případě nové zvýšení referencí. Viz <link xref=\"#reference-counting\"/>."
#. (itstool) path: section/title
#: C/memory-management.page:331
msgid "Assignments"
msgstr "Přiřazení"
#. (itstool) path: td/p
#: C/memory-management.page:338
msgid "Assignment from/to"
msgstr "Přiřazení z/do"
#. (itstool) path: td/p
#: C/memory-management.page:339
msgid "Owned destination"
msgstr "Vlastněný cíl"
#. (itstool) path: td/p
#: C/memory-management.page:340
msgid "Unowned destination"
msgstr "Nevlastněný cíl"
#. (itstool) path: td/p
#: C/memory-management.page:346 C/memory-management.page:394
#: C/memory-management.page:441
msgid "Owned source"
msgstr "Vlastněný zdroj"
#. (itstool) path: td/p
#: C/memory-management.page:348
msgid "Copy or move the source to the destination."
msgstr "Kopírování nebo přesun zdroje do cíle."
#. (itstool) path: td/code
#: C/memory-management.page:351
#, no-wrap
msgid "owned_dest = copy (owned_src)"
msgstr "owned_dest = copy (owned_src)"
#. (itstool) path: td/code
#: C/memory-management.page:352
#, no-wrap
msgid "owned_dest = owned_src; owned_src = NULL"
msgstr "owned_dest = owned_src; owned_src = NULL"
#. (itstool) path: td/p
#: C/memory-management.page:355
msgid ""
"Pure assignment, assuming the unowned variable is not used after the owned "
"one is freed."
msgstr ""
"Prosté přiřazení, předpokládá se, že nevlastněná proměnná se nepoužije po "
"té, co je vlastněná uvolněna."
#. (itstool) path: td/code
#: C/memory-management.page:359
#, no-wrap
msgid "unowned_dest = owned_src"
msgstr "unowned_dest = owned_src"
#. (itstool) path: td/p
#: C/memory-management.page:364 C/memory-management.page:411
#: C/memory-management.page:457
msgid "Unowned source"
msgstr "Nevlastněný zdroj"
#. (itstool) path: td/p
#: C/memory-management.page:366
msgid "Copy the source to the destination."
msgstr "Kopírování zdroje do cíle."
#. (itstool) path: td/code
#: C/memory-management.page:367
#, no-wrap
msgid "owned_dest = copy (unowned_src)"
msgstr "owned_dest = copy (unowned_src)"
#. (itstool) path: td/p
#: C/memory-management.page:370
msgid "Pure assignment."
msgstr "Prosté přiřazení."
#. (itstool) path: td/code
#: C/memory-management.page:371
#, no-wrap
msgid "unowned_dest = unowned_src"
msgstr "unowned_dest = unowned_src"
#. (itstool) path: section/title
#: C/memory-management.page:379
msgid "Function Calls"
msgstr "Volání funkcí"
#. (itstool) path: td/p
#: C/memory-management.page:386
msgid "Call from/to"
msgstr "Volání z/do"
#. (itstool) path: td/p
#: C/memory-management.page:387
msgid "Transfer full parameter"
msgstr "Přenos úplného parametru"
#. (itstool) path: td/p
#: C/memory-management.page:388
msgid "Transfer none parameter"
msgstr "Žádný přenos parametru"
#. (itstool) path: td/p
#: C/memory-management.page:396
msgid "Copy or move the source for the parameter."
msgstr "Kopírování nebo přesun zdroje pro parametr."
#. (itstool) path: td/code
#: C/memory-management.page:399
#, no-wrap
msgid "function_call (copy (owned_src))"
msgstr "function_call (copy (owned_src))"
#. (itstool) path: td/code
#: C/memory-management.page:400
#, no-wrap
msgid "function_call (owned_src); owned_src = NULL"
msgstr "function_call (owned_src); owned_src = NULL"
#. (itstool) path: td/p
#: C/memory-management.page:403 C/memory-management.page:417
msgid "Pure parameter passing."
msgstr "Prosté předání parametru."
#. (itstool) path: td/code
#: C/memory-management.page:406
#, no-wrap
msgid "function_call (owned_src)"
msgstr "function_call (owned_src)"
#. (itstool) path: td/p
#: C/memory-management.page:413
msgid "Copy the source for the parameter."
msgstr "Kopírování zdroje pro parametr."
#. (itstool) path: td/code
#: C/memory-management.page:414
#, no-wrap
msgid "function_call (copy (unowned_src))"
msgstr "function_call (copy (unowned_src))"
#. (itstool) path: td/code
#: C/memory-management.page:418
#, no-wrap
msgid "function_call (unowned_src)"
msgstr "function_call (unowned_src)"
#. (itstool) path: section/title
#: C/memory-management.page:426
msgid "Function Returns"
msgstr "Návrat z funkcí"
#. (itstool) path: td/p
#: C/memory-management.page:433
msgid "Return from/to"
msgstr "Návrat z/do"
#. (itstool) path: td/p
#: C/memory-management.page:434
msgid "Transfer full return"
msgstr "Přenos úplné návratové hodnoty"
#. (itstool) path: td/p
#: C/memory-management.page:435
msgid "Transfer none return"
msgstr "Žádný přenos návratové hodnoty"
#. (itstool) path: td/p
#: C/memory-management.page:443
msgid "Pure variable return."
msgstr "Prostý návrat proměnné."
#. (itstool) path: td/code
#: C/memory-management.page:446
#, no-wrap
msgid "return owned_src"
msgstr "return owned_src"
#. (itstool) path: td/p
#: C/memory-management.page:449
msgid ""
"Invalid. The source needs to be freed, so the return value would use freed "
"memory — a use-after-free error."
msgstr ""
"Neplatné. Zdroj potřebuje být uvolněn, takže vrácená hodnota by používala "
"volnou paměť — chyba „použití po uvolnění“."
#. (itstool) path: td/p
#: C/memory-management.page:459
msgid "Copy the source for the return."
msgstr "Kopírování zdroje pro návratovou hodnotu."
#. (itstool) path: td/code
#: C/memory-management.page:460
#, no-wrap
msgid "return copy (unowned_src)"
msgstr "return copy (unowned_src)"
#. (itstool) path: td/p
#: C/memory-management.page:463
msgid "Pure variable passing."
msgstr "Prosté předání proměnné."
#. (itstool) path: td/code
#: C/memory-management.page:464
#, no-wrap
msgid "return unowned_src"
msgstr "return unowned_src"
#. (itstool) path: section/p
#: C/memory-management.page:475
msgid ""
"Documenting the ownership transfer for each function parameter and return, "
"and the ownership for each variable, is important. While they may be clear "
"when writing the code, they are not clear a few months later; and may never "
"be clear to users of an API. They should always be documented."
msgstr ""
"Zdokumentování přenosu vlastnictví u každého parametru funkce a návratové "
"hodnoty a vlastnictví u každé proměnné je velmi důležité. Zatím co při psaní "
"kódu to může být zcela jasné, o pár měsíců později to již tak jasné být "
"nemusí. A už vůbec to nemusí být jasné uživatelům API. Proto by to mělo být "
"vždy zdokumentováno."
#. (itstool) path: section/p
#: C/memory-management.page:482
msgid ""
"The best way to document ownership transfer is to use the <link href="
"\"https://wiki.gnome.org/Projects/GObjectIntrospection/"
"Annotations#Memory_and_lifecycle_management\"> <code>(transfer)</code></"
"link> annotation introduced by <link xref=\"introspection\">gobject-"
"introspection</link>. Include this in the API documentation comment for each "
"function parameter and return type. If a function is not public API, write a "
"documentation comment for it anyway and include the <code>(transfer)</code> "
"annotations. By doing so, the introspection tools can also read the "
"annotations and use them to correctly introspect the API."
msgstr ""
"Nejlepším způsobem zdokumentování přenosu vlastnictví je použít anotaci "
"<link href=\"https://wiki.gnome.org/Projects/GObjectIntrospection/"
"Annotations#Memory_and_lifecycle_management\"><code>(transfer)</code></"
"link>, která byla zavedena spolu s <link xref=\"introspection\">introspekcí "
"pro GObject</link>. Uveďte ji do dokumentačních komentářů k API pro všechny "
"parametry a návratové typy funkcí. I když funkce není veřejným API, napište "
"k ní dokumentační komentář a do něj zahrňte anotaci <code>(transfer)</code>. "
"Díky tomu budo moci nástroje pro introspekci číst potřebné anotace a správně "
"prozkoumávat API."
#. (itstool) path: section/code
#: C/memory-management.page:497
#, no-wrap
msgid ""
"/**\n"
" * g_value_take_string:\n"
" * @value: (transfer none): an initialized #GValue\n"
" * @str: (transfer full): string to set it to\n"
" *\n"
" * Function documentation goes here.\n"
" */\n"
"\n"
"/**\n"
" * generate_string:\n"
" * @template: (transfer none): a template to follow when generating the string\n"
" *\n"
" * Function documentation goes here.\n"
" *\n"
" * Returns: (transfer full): a newly generated string\n"
" */"
msgstr ""
"/**\n"
" * g_value_take_string:\n"
" * @value: (transfer none): an initialized #GValue\n"
" * @str: (transfer full): string to set it to\n"
" *\n"
" * Function documentation goes here.\n"
" */\n"
"\n"
"/**\n"
" * generate_string:\n"
" * @template: (transfer none): a template to follow when generating the string\n"
" *\n"
" * Function documentation goes here.\n"
" *\n"
" * Returns: (transfer full): a newly generated string\n"
" */"
#. (itstool) path: section/p
#: C/memory-management.page:514
msgid ""
"Ownership for variables can be documented using inline comments. These are "
"non-standard, and not read by any tools, but can form a convention if used "
"consistently."
msgstr ""
"Vlastnictví proměnných lze dokumentovat pomocí vložených komentářů. Není to "
"standardem a nečtou to všechny nástroje, ale může se to stát zvyklostí, "
"pokud to bude jednotně dodržováno."
#. (itstool) path: section/code
#: C/memory-management.page:519
#, no-wrap
msgid ""
"GObject *some_owned_object = NULL; /* owned */\n"
"GObject *some_unowned_object; /* unowned */"
msgstr ""
"GObject *some_owned_object = NULL; /* owned */\n"
"GObject *some_unowned_object; /* unowned */"
#. (itstool) path: section/p
#: C/memory-management.page:522
msgid ""
"The documentation for <link xref=\"#container-types\"/> is similarly only a "
"convention; it includes the type of the contained elements too:"
msgstr ""
"Obdobně i dokumentování pro <link xref=\"#container-types\"/> je čistě jen "
"zvyklost. Součástí je také typ obsaženého prvku:"
#. (itstool) path: section/code
#: C/memory-management.page:526
#, no-wrap
msgid ""
"GPtrArray/*<owned gchar*>*/ *some_unowned_string_array; /* unowned */\n"
"GPtrArray/*<owned gchar*>*/ *some_owned_string_array = NULL; /* owned */\n"
"GPtrArray/*<unowned GObject*>*/ *some_owned_object_array = NULL; /* owned */"
msgstr ""
"GPtrArray/*<owned gchar*>*/ *some_unowned_string_array; /* unowned */\n"
"GPtrArray/*<owned gchar*>*/ *some_owned_string_array = NULL; /* owned */\n"
"GPtrArray/*<unowned GObject*>*/ *some_owned_object_array = NULL; /* owned */"
#. (itstool) path: section/p
#: C/memory-management.page:530
msgid ""
"Note also that owned variables should always be initialized so that freeing "
"them is more convenient. See <link xref=\"#convenience-functions\"/>."
msgstr ""
"Pamatujte také, že vlastněné proměnné by měly být vždy inicializovány, takže "
"jejich uvolnění je pak mnohem pohodlnější. Viz <link xref=\"#convenience-"
"functions\"/>."
#. (itstool) path: section/p
#: C/memory-management.page:536
msgid ""
"Also note that some types, for example basic C types like strings, can have "
"the <code>const</code> modifier added if they are unowned, to take advantage "
"of compiler warnings resulting from assigning those variables to owned "
"variables (which must <em>not</em> use the <code>const</code> modifier). If "
"so, the <code>/* unowned */</code> comment may be omitted."
msgstr ""
"Poznamenejme také, že některé typy, například základní typy v C, jako je "
"řetězec, mohou mít v případě, že nejsou vlastněny, přidán modifikátor "
"<code>const</code>, což má výhodu, že kompilátor zobrazí varování, když se "
"pokusíte takovouto proměnnou přiřadit do vlastněné proměnné (která "
"modifikátor <code>const</code> použít <em>nesmí</em>). V případě použití "
"modifikátoru je možné vynechat komentář <code>/* unowned */</code>."
#. (itstool) path: section/title
#: C/memory-management.page:546
msgid "Reference Counting"
msgstr "Počítání odkazů"
#. (itstool) path: section/p
#: C/memory-management.page:548
msgid ""
"As well as conventional <code>malloc()</code>/<code>free()</code>-style "
"types, GLib has various reference counted types — <link href=\"https://"
"developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html\"> "
"<code>GObject</code></link> being a prime example."
msgstr ""
"Mimo tradičních typů ve stylu <code>malloc()</code>/<code>free()</code> máte "
"v GLib k dispozici i různé typy počítání referencí — základním příkladem je "
"<link href=\"https://developer.gnome.org/gobject/stable/gobject-The-Base-"
"Object-Type.html\"> <code>GObject</code></link>."
#. (itstool) path: section/p
#: C/memory-management.page:555
msgid ""
"The concepts of ownership and transfer apply just as well to reference "
"counted types as they do to allocated types. A scope <em>owns</em> a "
"reference counted type if it holds a strong reference to the instance (for "
"example by calling <link href=\"https://developer.gnome.org/gobject/stable/"
"gobject-The-Base-Object-Type.html#g-object-ref\"> <code>g_object_ref()</"
"code></link>). An instance can be ‘copied’ by calling <code>g_object_ref()</"
"code> again. Ownership can be freed with <link href=\"https://developer."
"gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-unref\"> "
"<code>g_object_unref()</code></link> — even though this may not actually "
"finalize the instance, it frees the current scope’s ownership of that "
"instance."
msgstr ""
"Koncept vlastnictví a jeho přenosu se používá stejně jako počítání "
"referencí, které dělají alokované typy. Rozsah působnosti <em>vlastní</em> "
"typy s počítáním referencí, pokud drží silnou referenci na instanci "
"(například zavoláním <link href=\"https://developer.gnome.org/gobject/stable/"
"gobject-The-Base-Object-Type.html#g-object-ref\"><code>g_object_ref()</"
"code></link>. Instance se dá „zkopírovat“ opětovným zavoláním "
"<code>g_object_ref()</code>. Vlastnictví se dá uvolnit pomocí <link href="
"\"https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type."
"html#g-object-unref\"><code>g_object_unref()</code></link> — i když se tím "
"nemusí ve skutečnosti ukončit instance, uvolní se tím vlastnictví instance v "
"aktuálním rozsahu působnosti."
#. (itstool) path: section/p
#: C/memory-management.page:569
msgid ""
"See <link xref=\"#g-clear-object\"/> for a convenient way of handling "
"GObject references."
msgstr ""
"Viz <link xref=\"#g-clear-object\"/> ohledně vhodného způsobu zacházení s "
"referencemi GObject."
#. (itstool) path: section/p
#: C/memory-management.page:574
msgid ""
"There are other reference counted types in GLib, such as <link href="
"\"https://developer.gnome.org/glib/stable/glib-Hash-Tables.html\"> "
"<code>GHashTable</code></link> (using <link href=\"https://developer.gnome."
"org/glib/stable/glib-Hash-Tables.html#g-hash-table-ref\"> "
"<code>g_hash_table_ref()</code></link> and <link href=\"https://developer."
"gnome.org/glib/stable/glib-Hash-Tables.html#g-hash-table-unref\"> "
"<code>g_hash_table_unref()</code></link>), or <link href=\"https://developer."
"gnome.org/glib/stable/glib-GVariant.html\"> <code>GVariant</code></link> "
"(<link href=\"https://developer.gnome.org/glib/stable/glib-GVariant.html#g-"
"variant-ref\"> <code>g_variant_ref()</code></link>, <link href=\"https://"
"developer.gnome.org/glib/stable/glib-GVariant.html#g-variant-unref\"> "
"<code>g_variant_unref()</code></link>). Some types, like <code>GHashTable</"
"code>, support both reference counting and explicit finalization. Reference "
"counting should always be used in preference, because it allows instances to "
"be easily shared between multiple scopes (each holding their own reference) "
"without having to allocate multiple copies of the instance. This saves "
"memory."
msgstr ""
"V GLib existují další typy s počítáním referencí, jako je <link href="
"\"https://developer.gnome.org/glib/stable/glib-Hash-Tables.html\"> "
"<code>GHashTable</code></link> (používá <link href=\"https://developer.gnome."
"org/glib/stable/glib-Hash-Tables.html#g-hash-table-ref\"> "
"<code>g_hash_table_ref()</code></link> a <link href=\"https://developer."
"gnome.org/glib/stable/glib-Hash-Tables.html#g-hash-table-unref\"> "
"<code>g_hash_table_unref()</code></link>), nebo <link href=\"https://"
"developer.gnome.org/glib/stable/glib-GVariant.html\"> <code>GVariant</code></"
"link> (<link href=\"https://developer.gnome.org/glib/stable/glib-GVariant."
"html#g-variant-ref\"> <code>g_variant_ref()</code></link>, <link href="
"\"https://developer.gnome.org/glib/stable/glib-GVariant.html#g-variant-unref"
"\"> <code>g_variant_unref()</code></link>). Některé typy, jako "
"<code>GHashTable</code> podporují jak počítání referencí, tak vynucenou "
"finalizaci. Použití počítání referencí by se měla vždy dávat přednost, "
"protože umožňuje instancím se jednoduše sdílet mezi více rozsahy působnosti "
"(každá se drží svoji vlastní referenci), bez nutnosti alokovat více kopií "
"instance. Šetří se tím paměť."
#. (itstool) path: section/title
#: C/memory-management.page:596
msgid "Floating References"
msgstr "Plovoucí reference"
#. (itstool) path: section/p
#: C/memory-management.page:598
msgid ""
"Classes which are derived from <link href=\"https://developer.gnome.org/"
"gobject/stable/gobject-The-Base-Object-Type.html#GInitiallyUnowned"
"\"><code>GInitiallyUnowned</code></link>, as opposed to <link href=\"https://"
"developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-"
"struct\"><code>GObject</code></link> have an initial reference which is "
"<em>floating</em>, meaning that no code owns the reference. As soon as <link "
"href=\"https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-"
"Type.html#g-object-ref-sink\"><code>g_object_ref_sink()</code></link> is "
"called on the object, the floating reference is converted to a strong "
"reference, and the calling code assumes ownership of the object."
msgstr ""
"Třídy odvozené z <link href=\"https://developer.gnome.org/gobject/stable/"
"gobject-The-Base-Object-Type.html#GInitiallyUnowned"
"\"><code>GInitiallyUnowned</code></link> mají, oproti <link href=\"https://"
"developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-"
"struct\"><code>GObject</code></link>, počáteční referenci, která je "
"<em>plovoucí</em>, což znamená, že ji nevlastní žádný kód. Jakmile je "
"zavolána funkce <link href=\"https://developer.gnome.org/gobject/stable/"
"gobject-The-Base-Object-Type.html#g-object-ref-sink"
"\"><code>g_object_ref_sink()</code></link>, změní se plovoucí reference na "
"silnou referenci a volající kód je pokládán za vlastníka objektu."
#. (itstool) path: section/p
#: C/memory-management.page:610
msgid ""
"Floating references are a convenience for use in C in APIs, such as GTK+, "
"where large numbers of objects must be created and organized into a "
"hierarchy. In these cases, calling <code>g_object_unref()</code> to drop all "
"the strong references would result in a lot of code."
msgstr ""
"Plovoucí reference jsou vhodné pro použití v jazyce C v takových API, jako "
"je GTK+, kde je zapotřebí vytvářet a organizovat do hierarchie velké "
"množství objektů. V takových případech by zavolání <code>g_object_unref()</"
"code> kvůli zachození všech silných referencí vedlo na velké množství kódu."
#. (itstool) path: example/p
#: C/memory-management.page:618
msgid "Floating references allow the following code to be simplified:"
msgstr "Plovoucí reference umožňují následující kód zjednodušit:"
#. (itstool) path: example/code
#: C/memory-management.page:621
#, no-wrap
msgid ""
"GtkWidget *new_widget;\n"
"\n"
"new_widget = gtk_some_widget_new ();\n"
"gtk_container_add (some_container, new_widget);\n"
"g_object_unref (new_widget);"
msgstr ""
"GtkWidget *new_widget;\n"
"\n"
"new_widget = gtk_some_widget_new ();\n"
"gtk_container_add (some_container, new_widget);\n"
"g_object_unref (new_widget);"
#. (itstool) path: example/p
#: C/memory-management.page:627
msgid ""
"Instead, the following code can be used, with the <code>GtkContainer</code> "
"assuming ownership of the floating reference:"
msgstr ""
"Místo toho můžete použít následující kód s <code>GtkContainer</code> "
"předpokládajícím vlastnictví plovoucí reference:"
#. (itstool) path: example/code
#: C/memory-management.page:632
#, no-wrap
msgid ""
"\n"
"gtk_container_add (some_container, gtk_some_widget_new ());"
msgstr ""
"\n"
"gtk_container_add (some_container, gtk_some_widget_new ());"
#. (itstool) path: section/p
#: C/memory-management.page:636
msgid ""
"Floating references are only used by a few APIs — in particular, "
"<code>GtkWidget</code> and all its subclasses. You must learn which APIs "
"support it, and which APIs consume floating references, and only use them "
"together."
msgstr ""
"Plovoucí reference používá jen pár API, zejména to je <code>GtkWidget</code> "
"a všechny jeho podtřídy. Musíte si zjistit, která API je podporují a která "
"API je umějí přijímat a používat je jen dohromady."
#. (itstool) path: section/p
#: C/memory-management.page:643
msgid ""
"Note that <code>g_object_ref_sink()</code> is equivalent to "
"<code>g_object_ref()</code> when called on a non-floating reference, making "
"<code>gtk_container_add()</code> no different from any other function in "
"such cases."
msgstr ""
"Všimněte si, že <code>g_object_ref_sink()</code> se chová stejně jako "
"<code>g_object_ref()</code>, když je zavolána na neplovoucí referenci, díky "
"čemuž se <code>gtk_container_add()</code> neliší v takovýchto případech od "
"jiných funkcí."
#. (itstool) path: section/p
#: C/memory-management.page:650
msgid ""
"See the <link href=\"https://developer.gnome.org/gobject/stable/gobject-The-"
"Base-Object-Type.html#floating-ref\">GObject manual</link> for more "
"information on floating references."
msgstr ""
"Více informací o plovoucích referencích najdete v <link href=\"https://"
"developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type."
"html#floating-ref\">příručce k GObject</link>."
#. (itstool) path: section/title
#: C/memory-management.page:658
msgid "Convenience Functions"
msgstr "Vhodné funkce"
#. (itstool) path: section/p
#: C/memory-management.page:660
msgid ""
"GLib provides various convenience functions for memory management, "
"especially for GObjects. Three will be covered here, but others exist — "
"check the GLib API documentation for more. They typically follow similar "
"naming schemas to these three (using ‘_full’ suffixes, or the verb ‘clear’ "
"in the function name)."
msgstr ""
"GLib poskytuje řadu funkcí usnadňujících správu paměti, hlavně pro GObject. "
"Tři z nich jsou zde rozebrány, ale existují i další — podívejte se na ně do "
"dokumentace k API GLib. Typicky dodržují podobné schéma pojmenování, jako "
"zmíněné tři (používají sufix „_full“ nebo sloveso „clear“ v názvu)."
#. (itstool) path: section/title
#: C/memory-management.page:669
msgid "<code>g_clear_object()</code>"
msgstr "<code>g_clear_object()</code>"
#. (itstool) path: section/p
#: C/memory-management.page:671
msgid ""
"<link href=\"https://developer.gnome.org/gobject/stable/gobject-The-Base-"
"Object-Type.html#g-clear-object\"> <code>g_clear_object()</code></link> is a "
"version of <link href=\"https://developer.gnome.org/gobject/stable/gobject-"
"The-Base-Object-Type.html#g-object-unref\"> <code>g_object_unref()</code></"
"link> which unrefs a GObject and then clears the pointer to it to "
"<code>NULL</code>."
msgstr ""
"<link href=\"https://developer.gnome.org/gobject/stable/gobject-The-Base-"
"Object-Type.html#g-clear-object\"><code>g_clear_object()</code></link> je "
"verzí funkce <link href=\"https://developer.gnome.org/gobject/stable/gobject-"
"The-Base-Object-Type.html#g-object-unref\"><code>g_object_unref()</code></"
"link>, která zruší referenci na GObject a vymaže ukazatel nastavením na "
"<code>NULL</code>."
#. (itstool) path: section/p
#: C/memory-management.page:679
msgid ""
"This makes it easier to implement code that guarantees a GObject pointer is "
"always either <code>NULL</code>, or has ownership of a GObject (but which "
"never points to a GObject it no longer owns)."
msgstr ""
"Díky tomu je snazší napsat programový kód, který zaručuje, že ukazatel na "
"GObject je vždy buď <code>NULL</code> nebo je vlastněn objektem GObject (ale "
"nikdy neukazuje na GObject, který již není vlastněn)."
#. (itstool) path: section/p
#: C/memory-management.page:685
msgid ""
"By initialising all owned GObject pointers to <code>NULL</code>, freeing "
"them at the end of the scope is as simple as calling <code>g_clear_object()</"
"code> without any checks, as discussed in <link xref=\"#single-path-cleanup"
"\"/>:"
msgstr ""
"Tím, že inicializujete všechny vlastněné ukazatel na GObject na <code>NULL</"
"code>, je jejich uvolnění na konci oblasti působnosti možné pouhým zavoláním "
"<code>g_clear_object()</code> bez jakýchkoliv kontrol, tak jak je to "
"probráno v <link xref=\"#single-path-cleanup\"/>:"
#. (itstool) path: section/code
#: C/memory-management.page:691
#, no-wrap
msgid ""
"void\n"
"my_function (void)\n"
"{\n"
" GObject *some_object = NULL; /* owned */\n"
"\n"
" if (rand ())\n"
" {\n"
" some_object = create_new_object ();\n"
" /* do something with the object */\n"
" }\n"
"\n"
" g_clear_object (&some_object);\n"
"}"
msgstr ""
"void\n"
"my_function (void)\n"
"{\n"
" GObject *some_object = NULL; /* owned */\n"
"\n"
" if (rand ())\n"
" {\n"
" some_object = create_new_object ();\n"
" /* zde se s objektem něco udělá */\n"
" }\n"
"\n"
" g_clear_object (&some_object);\n"
"}"
#. (itstool) path: section/title
#: C/memory-management.page:707
msgid "<code>g_list_free_full()</code>"
msgstr "<code>g_list_free_full()</code>"
#. (itstool) path: section/p
#: C/memory-management.page:709
msgid ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-Doubly-Linked-"
"Lists.html#g-list-free-full\"> <code>g_list_free_full()</code></link> frees "
"all the elements in a linked list, <em>and all their data</em>. It is much "
"more convenient than iterating through the list to free all the elements’ "
"data, then calling <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Doubly-Linked-Lists.html#g-list-free\"> <code>g_list_free()</code></link> to "
"free the <code>GList</code> elements themselves."
msgstr ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-Doubly-Linked-"
"Lists.html#g-list-free-full\"> <code>g_list_free_full()</code></link> uvolní "
"všechny prvky v zřetězeném seznamu <em>a všechna jejich data</em>. To je "
"mnohem pohodlnější, než procházet celý seznam, abyste uvolnily data "
"jednotlivých prvků a následně zavolat <link href=\"https://developer.gnome."
"org/glib/stable/glib-Doubly-Linked-Lists.html#g-list-free\"> "
"<code>g_list_free()</code></link>, aby se uvolnily vlastní prvky seznamu "
"<code>GList</code>."
#. (itstool) path: section/title
#: C/memory-management.page:721
msgid "<code>g_hash_table_new_full()</code>"
msgstr "<code>g_hash_table_new_full()</code>"
#. (itstool) path: section/p
#: C/memory-management.page:723
msgid ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-Hash-Tables.html#g-"
"hash-table-new-full\"> <code>g_hash_table_new_full()</code></link> is a "
"newer version of <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Hash-Tables.html#g-hash-table-new\"> <code>g_hash_table_new()</code></link> "
"which allows setting functions to destroy each key and value in the hash "
"table when they are removed. These functions are then automatically called "
"for all keys and values when the hash table is destroyed, or when an entry "
"is removed using <code>g_hash_table_remove()</code>."
msgstr ""
"<link href=\"https://developer.gnome.org/glib/stable/glib-Hash-Tables.html#g-"
"hash-table-new-full\"> <code>g_hash_table_new_full()</code></link> je novou "
"verzí funkce <link href=\"https://developer.gnome.org/glib/stable/glib-Hash-"
"Tables.html#g-hash-table-new\"><code>g_hash_table_new()</code></link>, která "
"umožňuje nastavit funkce pro likvidaci jednotlivých klíčů a hodnot hašovací "
"tabulky při jejím odstranění. Tyto funkce jsou pak automaticky volány pro "
"všechny klíče a hodnoty, když je hašovací tabulka likvidována nebo když je "
"odstraněna položka pomocí <code>g_hash_table_remove()</code>."
#. (itstool) path: section/p
#: C/memory-management.page:734
msgid ""
"Essentially, it simplifies memory management of keys and values to the "
"question of whether they are present in the hash table. See <link xref="
"\"#container-types\"/> for a discussion on ownership of elements within "
"container types."
msgstr ""
"V podstatě to zjednodušuje správu paměti s klíči a hodnotami na otázku, "
"jestli se nacházejí v hašovací tabulce. Vlastnictví prvku v kontejnerových "
"typech je rozebráno v <link xref=\"#container-types\"/>."
#. (itstool) path: section/p
#: C/memory-management.page:741
msgid ""
"A similar function exists for <code>GPtrArray</code>: <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Pointer-Arrays.html#g-ptr-array-new-"
"with-free-func\"> <code>g_ptr_array_new_with_free_func()</code></link>."
msgstr ""
"Obdobná funkce existuje pro <code>GPtrArray</code>: <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Pointer-Arrays.html#g-ptr-array-new-"
"with-free-func\"><code>g_ptr_array_new_with_free_func()</code></link>."
#. (itstool) path: section/title
#: C/memory-management.page:750
msgid "Container Types"
msgstr "Typy kontejnerů"
#. (itstool) path: section/p
#: C/memory-management.page:752
msgid ""
"When using container types, such as <code>GPtrArray</code> or <code>GList</"
"code>, an additional level of ownership is introduced: as well as the "
"ownership of the container instance, each element in the container is either "
"owned or unowned too. By nesting containers, multiple levels of ownership "
"must be tracked. Ownership of owned elements belongs to the container; "
"ownership of the container belongs to the scope it’s in (which may be "
"another container)."
msgstr ""
"Při používání kontejnerových typů, jako je <code>GPtrArray</code> nebo "
"<code>GList</code>, vzniká další úroveň vlastnictví: kromě vlastnictví "
"instance kontejneru je také vlasněn nebo nevlastněn každý z prvků v "
"kontejneru. Při vnoření kontejnerů pak musí být sledováno více úrovní "
"vlastnictví. Vlastnictví vlastněných prvků náleží kontejneru a vlastnictví "
"kontejneru náleží rozsahu působnosti kódu, ve kterém se nachází (což může "
"být i další kontejner)."
#. (itstool) path: section/p
#: C/memory-management.page:762
msgid ""
"A key principle for simplifying this is to ensure that all elements in a "
"container have the same ownership: they are either all owned, or all "
"unowned. This happens automatically if the normal <link xref=\"#convenience-"
"functions\"/> are used for types like <code>GPtrArray</code> and "
"<code>GHashTable</code>."
msgstr ""
"Klíčovým principem pro zjednodušení toho celého je, zajistit, aby všechny "
"prvky v kontejneru měly stejného vlastníka: buď jsou všechny vlastněny nebo "
"nejsou. To se děje automaticky, když jsou použity normální <link xref="
"\"#convenience-functions\"/> pro typy, jako jsou <code>GPtrArray</code> a "
"<code>GHashTable</code>."
#. (itstool) path: section/p
#: C/memory-management.page:770
msgid ""
"If elements in a container are <em>owned</em>, adding them to the container "
"is essentially an ownership transfer. For example, for an array of strings, "
"if the elements are owned, the definition of <code>g_ptr_array_add()</code> "
"is effectively:"
msgstr ""
"Když kontejner prvky <em>vlastní</em>, pak je jejich přidání do kontejneru v "
"podstatě přenosem vlastnictví. Například, pro pole řetězců, pokud jsou prvky "
"vlastněny, je definice <code>g_ptr_array_add()</code> ve skutečnosti:"
#. (itstool) path: section/code
#: C/memory-management.page:776
#, no-wrap
msgid ""
"/**\n"
" * g_ptr_array_add:\n"
" * @array: a #GPtrArray\n"
" * @str: (transfer full): string to add\n"
" */\n"
"void\n"
"g_ptr_array_add (GPtrArray *array,\n"
" gchar *str);"
msgstr ""
"/**\n"
" * g_ptr_array_add:\n"
" * @array: a #GPtrArray\n"
" * @str: (transfer full): string to add\n"
" */\n"
"void\n"
"g_ptr_array_add (GPtrArray *array,\n"
" gchar *str);"
#. (itstool) path: section/p
#: C/memory-management.page:785
msgid ""
"So, for example, constant (unowned) strings must be added to the array using "
"<code>g_ptr_array_add (array, g_strdup (\"constant string\"))</code>."
msgstr ""
"Takže například konstantní (nevlastněný) řetězec musí být přidán do pole "
"pomocí <code>g_ptr_array_add (array, g_strdup (\"constant string\"))</code>."
#. (itstool) path: section/p
#: C/memory-management.page:790
msgid "Whereas if the elements are unowned, the definition is effectively:"
msgstr "Zatímco, když prvek není vlastněn, je definice ve skutečnosti:"
#. (itstool) path: section/code
#: C/memory-management.page:793
#, no-wrap
msgid ""
"/**\n"
" * g_ptr_array_add:\n"
" * @array: a #GPtrArray\n"
" * @str: (transfer none): string to add\n"
" */\n"
"void\n"
"g_ptr_array_add (GPtrArray *array,\n"
" const gchar *str);"
msgstr ""
"/**\n"
" * g_ptr_array_add:\n"
" * @array: a #GPtrArray\n"
" * @str: (transfer none): string to add\n"
" */\n"
"void\n"
"g_ptr_array_add (GPtrArray *array,\n"
" const gchar *str);"
#. (itstool) path: section/p
#: C/memory-management.page:802
msgid ""
"Here, constant strings can be added without copying them: "
"<code>g_ptr_array_add (array, \"constant string\")</code>."
msgstr ""
"Zde může být konstantní řetězec přidán bez jeho kopírování: "
"<code>g_ptr_array_add (array, \"constant string\")</code>."
#. (itstool) path: section/p
#: C/memory-management.page:807
msgid ""
"See <link xref=\"#documentation\"/> for examples of comments to add to "
"variable definitions to annotate them with the element type and ownership."
msgstr ""
"Příklady komentářů, které se přidávají ke definicím proměnných kvůli "
"anotacím k typu a vlastnictví, viz <link xref=\"#documentation\"/>."
#. (itstool) path: section/title
#: C/memory-management.page:814
msgid "Single-Path Cleanup"
msgstr "Jednocestné čištění"
#. (itstool) path: section/p
#: C/memory-management.page:816
msgid ""
"A useful design pattern for more complex functions is to have a single "
"control path which cleans up (frees) allocations and returns to the caller. "
"This vastly simplifies tracking of allocations, as it’s no longer necessary "
"to mentally work out which allocations have been freed on each code path — "
"all code paths end at the same point, so perform all the frees then. The "
"benefits of this approach rapidly become greater for larger functions with "
"more owned local variables; it may not make sense to apply the pattern to "
"smaller functions."
msgstr ""
"Vhodným návrhovým vzorem pro složitější funkce je mít v jediné cestě "
"průchodu vyčištění (uvolnění) alokací a návrat k volajícímu. Tím se nesmírně "
"zjednoduší sledování alokací, protože není nadále nutné přemýšlet na tím, "
"které alokace již byly v jednotlivých cestách průchodu uvolněny – všechny "
"cesty průchodu končí ve stejném bodě, za kterým teprve provádíte uvolnění. "
"Výhody tohoto přístupu se rychle projeví u rozsáhlých funkcí s více "
"vlastněnými lokálními proměnnými. Pro menší funkce tento návrhový vzor "
"smysluplný být nemusí."
#. (itstool) path: section/p
#: C/memory-management.page:827
msgid "This approach has two requirements:"
msgstr "Tento přístup má dva předpoklady:"
#. (itstool) path: item/p
#: C/memory-management.page:831
msgid ""
"The function returns from a single point, and uses <code>goto</code> to "
"reach that point from other paths."
msgstr ""
"Návrat z funkce je v jediném bodě a pro dosažení tohoto bodu z jiných míst "
"se používá <code>goto</code>."
#. (itstool) path: item/p
#: C/memory-management.page:835
msgid ""
"All owned variables are set to <code>NULL</code> when initialized or when "
"ownership is transferred away from them."
msgstr ""
"Všechny vlastněné proměnné jsou při inicializaci nebo při přenosu "
"vlastnictví pryč nastaveny na <code>NULL</code>."
#. (itstool) path: section/p
#: C/memory-management.page:841
msgid ""
"The example below is for a small function (for brevity), but should "
"illustrate the principles for application of the pattern to larger functions:"
msgstr ""
"Příklad níže je pro malou funkci (kvůli stručnosti), ale měl by ukázat "
"principy i pro aplikaci, které chce tento vzor použít pro rozsáhlé funkce:"
#. (itstool) path: listing/title
#: C/memory-management.page:848
msgid "Single-Path Cleanup Example"
msgstr "Příklad jednocestného číštění"
#. (itstool) path: listing/desc
#: C/memory-management.page:849
msgid "Example of implementing single-path cleanup for a simple function"
msgstr "Příklad implementace jednocestného čištění pro jednoduchou funkci"
#. (itstool) path: listing/code
#: C/memory-management.page:852
#, no-wrap
msgid ""
"GObject *\n"
"some_function (GError **error)\n"
"{\n"
" gchar *some_str = NULL; /* owned */\n"
" GObject *temp_object = NULL; /* owned */\n"
" const gchar *temp_str;\n"
" GObject *my_object = NULL; /* owned */\n"
" GError *child_error = NULL; /* owned */\n"
"\n"
" temp_object = generate_object ();\n"
" temp_str = \"example string\";\n"
"\n"
" if (rand ())\n"
" {\n"
" some_str = g_strconcat (temp_str, temp_str, NULL);\n"
" }\n"
" else\n"
" {\n"
" some_operation_which_might_fail (&child_error);\n"
"\n"
" if (child_error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" my_object = generate_wrapped_object (temp_object);\n"
" }\n"
"\n"
"done:\n"
" /* Here, @some_str is either NULL or a string to be freed, so can be passed to\n"
" * g_free() unconditionally.\n"
" *\n"
" * Similarly, @temp_object is either NULL or an object to be unreffed, so can\n"
" * be passed to g_clear_object() unconditionally. */\n"
" g_free (some_str);\n"
" g_clear_object (&temp_object);\n"
"\n"
" /* The pattern can also be used to ensure that the function always returns\n"
" * either an error or a return value (but never both). */\n"
" if (child_error != NULL)\n"
" {\n"
" g_propagate_error (error, child_error);\n"
" g_clear_object (&my_object);\n"
" }\n"
"\n"
" return my_object;\n"
"}"
msgstr ""
"GObject *\n"
"some_function (GError **error)\n"
"{\n"
" gchar *some_str = NULL; /* owned */\n"
" GObject *temp_object = NULL; /* owned */\n"
" const gchar *temp_str;\n"
" GObject *my_object = NULL; /* owned */\n"
" GError *child_error = NULL; /* owned */\n"
"\n"
" temp_object = generate_object ();\n"
" temp_str = \"example string\";\n"
"\n"
" if (rand ())\n"
" {\n"
" some_str = g_strconcat (temp_str, temp_str, NULL);\n"
" }\n"
" else\n"
" {\n"
" some_operation_which_might_fail (&child_error);\n"
"\n"
" if (child_error != NULL)\n"
" {\n"
" goto done;\n"
" }\n"
"\n"
" my_object = generate_wrapped_object (temp_object);\n"
" }\n"
"\n"
"done:\n"
" /* Zde je proměnná @some_str buď NULL nebo řetězec, který má být uvolněn, takže\n"
" * může být předána do g_free() nepodmíněně.\n"
" *\n"
" * Obdobně, @temp_object je buď NULL nebo objekt, na nějž má být zrušena reference,\n"
" * takže může být předána do g_clear_object() nepodmíněně. */\n"
" g_free (some_str);\n"
" g_clear_object (&temp_object);\n"
"\n"
" /* Tento vzor může být použit také zajištění, že funcke vždy vrátí\n"
" * buď nějakou chybu nebo návratovou hodnotu (ale nikdy obojí). */\n"
" if (child_error != NULL)\n"
" {\n"
" g_propagate_error (error, child_error);\n"
" g_clear_object (&my_object);\n"
" }\n"
"\n"
" return my_object;\n"
"}"
#. (itstool) path: section/title
#: C/memory-management.page:903
msgid "Verification"
msgstr "Ověření"
#. (itstool) path: section/p
#: C/memory-management.page:905
msgid ""
"Memory leaks can be checked for in two ways: static analysis, and runtime "
"leak checking."
msgstr ""
"Úniky paměti mohou být kontrolovány dvěma způsoby: statickou analýzou a "
"kontrolou úniků za běhu."
#. (itstool) path: section/p
#: C/memory-management.page:910
msgid ""
"Static analysis with tools like <link xref=\"tooling#coverity\">Coverity</"
"link>, the <link xref=\"tooling#clang-static-analyzer\">Clang static "
"analyzer</link> or <link xref=\"tooling#tartan\">Tartan</link> can catch "
"some leaks, but require knowledge of the ownership transfer of every "
"function called in the code. Domain-specific static analyzers like Tartan "
"(which knows about GLib memory allocation and transfer) can perform better "
"here, but Tartan is quite a young project and still misses things (a low "
"true positive rate). It is recommended that code be put through a static "
"analyzer, but the primary tool for detecting leaks should be runtime leak "
"checking."
msgstr ""
"Statická analýza pomocí nástrojů, jako je <link xref=\"tooling#coverity"
"\">Coverity</link>, <link xref=\"tooling#clang-static-analyzer\">statický "
"analyzátor Clang</link> nebo <link xref=\"tooling#tartan\">Tartan</link>, "
"může zachytit některé úniky, ale potřebuje k tomu znalost přenosu "
"vlastnictví u všech funkcí volaných v kódu. Statické analyzátory zaměřené na "
"určitou oblast, jako Tartan (který zná alokaci paměti a přenosy knihovny "
"GLib) si mohou vést lépe. Ale zrovna Tartan je poněkud mladý projekt a stále "
"postrádá některé věci (nízkou četnost pravdivých hlášení). Ze zmíněných "
"důvodů je doporučováno projít kód statickým analyzátorem, ale jako hlavní "
"nástroj pro zjišťování úniků by měla být kontrola za běhu."
#. (itstool) path: section/p
#: C/memory-management.page:924
msgid ""
"Runtime leak checking is done using <link xref=\"tooling#valgrind"
"\">Valgrind</link>, using its <link xref=\"tooling#memcheck\">memcheck</"
"link> tool. Any leak it detects as ‘definitely losing memory’ should be "
"fixed. Many of the leaks which ‘potentially’ lose memory are not real leaks, "
"and should be added to the suppression file."
msgstr ""
"Kontrola úniků za běhu se provádí pomocí <link xref=\"tooling#valgrind"
"\">Valgrind</link>, konkrétně nástrojem <link xref=\"tooling#memcheck"
"\">memcheck</link>. Kterýkoliv únik, který je detekován jako „trvalá ztráta "
"paměti“, by měl být opraven. Řada úniků, které jsou „potenciální ztráta "
"paměti“ ve skutečnosti žádné uniky nejsou a měly by být přidány do souboru "
"pro potlačení."
#. (itstool) path: section/p
#: C/memory-management.page:933
msgid ""
"If compiling with a recent version of Clang or GCC, the <link xref="
"\"tooling#address-sanitizer\">address sanitizer</link> can be enabled "
"instead, and it will detect memory leaks and overflow problems at runtime, "
"but without the difficulty of running Valgrind in the right environment. "
"Note, however, that it is still a young tool, so may fail in some cases."
msgstr ""
"Pokud kompilujete pomocí nejnovějších verzí Clang nebo GCC, můžete místo "
"toho zapnout <link xref=\"tooling#address-sanitizer\">sanitizér adres</"
"link>, který bude za běhu detekovat problémy s úniky paměti a přetečením, "
"ale bez složitosti běhu nástrojů Valgrind ve správném prostředí. "
"Upozorňujeme ale, že se jedná stále o nevyzrálý nástroj, takže v některých "
"případech může selhat."
#. (itstool) path: section/p
#: C/memory-management.page:942
msgid ""
"See <link xref=\"tooling#valgrind\"/> for more information on using Valgrind."
msgstr ""
"Další informace ohledně použití aplikace Valgrind viz <link xref="
"\"tooling#valgrind\"/>."
#. (itstool) path: credit/years
#: C/namespacing.page:12
msgid "2015, 2016"
msgstr "2015, 2016"
#. (itstool) path: info/desc
#: C/namespacing.page:17
msgid "Avoiding symbol conflicts between libraries by namespacing all APIs"
msgstr ""
"Jak předejít konfliktům v symbolech mezi knihovnami pomocí jmenných prostorů "
"ve všech API"
#. (itstool) path: page/title
#: C/namespacing.page:22
msgid "Namespacing"
msgstr "Jmenné prostory"
#. (itstool) path: synopsis/p
#: C/namespacing.page:27
msgid ""
"If a library is namespaced correctly, it can define types and methods in its "
"API which have the same names as those in another library, and a program can "
"use both without conflicts. This is achieved by prefixing all types and "
"method names with a namespace unique to the library."
msgstr ""
"Když má knihovna přidělený správný jmenný prostor, může ve svém API "
"definovat typy a metody, které mají stejné názvy jako v jiných knihovnách a "
"program ji s nimi může použít souběžně, aniž by došlo ke konfliktům. Je toho "
"dosaženo díky předřazení prefixu v podobě jedinečného jmenného prostoru "
"knihovny před názvy všech typů a metod."
#. (itstool) path: section/title
#: C/namespacing.page:36
msgid "GObject APIs"
msgstr "API pro GObject"
#. (itstool) path: section/p
#: C/namespacing.page:38
msgid ""
"Consistent and complete namespacing of symbols (functions and types) and "
"files is important for two key reasons:"
msgstr ""
"Jednotné a úplné jmenné prostory symbolů (funkcí a typů) a souborů jsou "
"důležité ze dvou hlavních důvodů:"
#. (itstool) path: item/p
#: C/namespacing.page:43
msgid ""
"Establishing a convention which means developers have to learn fewer symbol "
"names to use the library — they can guess them reliably instead."
msgstr ""
"Zavedení zvyklostí, které pro vývojáře znamenají, že si stačí zapamatovat "
"pár názvů symbolů, aby mohli knihovnu používat – zbytek si mohou snadno "
"domyslet."
#. (itstool) path: item/p
#: C/namespacing.page:47
msgid ""
"Ensuring symbols from two projects do not conflict if included in the same "
"file."
msgstr ""
"Zajištění, že symboly ze dvou projektů nebudou ve vzájemném konfliktu, když "
"jsou vložené do stejného souboru."
#. (itstool) path: section/p
#: C/namespacing.page:53
msgid ""
"The second point is important — imagine what would happen if every project "
"exported a function called <code>create_object()</code>. The headers "
"defining them could not be included in the same file, and even if that were "
"overcome, the programmer would not know which project each function comes "
"from. Namespacing eliminates these problems by using a unique, consistent "
"prefix for every symbol and filename in a project, grouping symbols into "
"their projects and separating them from others."
msgstr ""
"Druhý bod je velmi důležitý — představte si, co by se stalo, když by každý "
"projekt exportoval funkci nazvanou <code>create_object()</code>. Hlavičkové "
"soubory, které by ji definovaly, by pak nemohly být vložené naráz ve stejném "
"souboru. A i kdyby mohly, programátor by pak stejně nevěděl, ze kterého "
"projektu je která. Jmenné prostory tento problém řeší pomocí použití "
"jedinečného a jednotného prefixu pro všechny symboly a názvy souborů v "
"projektu, čímž se symboly seskupí ve svém projektu a oddělí od ostatních "
"projektů."
#. (itstool) path: section/p
#: C/namespacing.page:63
msgid ""
"The conventions below should be used for namespacing all symbols. They are "
"<link href=\"https://developer.gnome.org/gobject/stable/gtype-conventions."
"html\"> used in all GLib-based projects</link>, so should be familiar to a "
"lot of developers:"
msgstr ""
"Konvence uvedené níže by se měly používat pro jmenné prostory všech symbolů. "
"Jsou <link href=\"https://developer.gnome.org/gobject/stable/gtype-"
"conventions.html\">použity ve všech projektech založených na GLib</link>, a "
"měly by tak být dobře známy velkému množství vývojářů:"
#. (itstool) path: item/p
#: C/namespacing.page:70
msgid "Functions should use <code>lower_case_with_underscores</code>."
msgstr "Funkce by měly používat <code>mala_pismena_s_podtrzitky</code>."
#. (itstool) path: item/p
#: C/namespacing.page:73
msgid ""
"Structures, types and objects should use <code>CamelCaseWithoutUnderscores</"
"code>."
msgstr ""
"Struktury, typy a objekty by měly používat "
"<code>VelkaPismenaNaZacatkuSlovBezPodtrzitek</code>."
#. (itstool) path: item/p
#: C/namespacing.page:77
msgid ""
"Macros and constants should use <code>UPPER_CASE_WITH_UNDERSCORES</code>."
msgstr ""
"Makra a konstanty by měly používat <code>VELKA_PISMENA_S_PODTRZITKY</code>."
#. (itstool) path: item/p
#: C/namespacing.page:81
msgid ""
"All symbols should be prefixed with a short (2–4 characters) version of the "
"namespace. This is shortened purely for ease of typing, but should still be "
"unique."
msgstr ""
"Všechny symboly by měly mít prefix s krátkou (2 až 4 písmennou) verzí "
"jmenného prostoru. To je dostatečně krátké pro snadné psaní, ale stále by to "
"mělo být jedinečné."
#. (itstool) path: item/p
#: C/namespacing.page:86
msgid "All methods of a class should also be prefixed with the class name."
msgstr ""
"Také názvy všech metody třídy by měly mít na začátku připojen název třídy."
#. (itstool) path: section/p
#: C/namespacing.page:91
msgid ""
"Additionally, public headers should be included from a subdirectory, "
"effectively namespacing the header files. For example, instead of "
"<code>#include <abc.h></code>, a project should allow its users to use "
"<code>#include <namespace/abc.h></code>."
msgstr ""
"Navíc by veřejné hlavičkové soubory měly být vkládány z podsložky, které pro "
"ně fakticky vytvoří jmenný prostor. Například místo <code>#include <abc."
"h></code> by měl projekt svým uživatelům umožnit použít <code>#include "
"<namespace/abc.h></code>."
#. (itstool) path: section/p
#: C/namespacing.page:98
msgid ""
"Some projects namespace their headers within this subdirectory — for "
"example, <code>#include <namespace/ns-abc.h></code> instead of "
"<code>#include <namespace/abc.h></code>. This is redundant, but "
"harmless."
msgstr ""
"Některé projekty připojují jmenný prostor k hlavičkovým souborům v rámci "
"podsložky, například <code>#include <namespace/ns-abc.h></code> "
"namísto <code>#include <namespace/abc.h></code>. Dochází tak ke "
"zdvojení, ale ničemu to nevadí."
#. (itstool) path: section/p
#: C/namespacing.page:105
msgid ""
"For example, for a project called ‘Walbottle’, the short namespace ‘Wbl’ "
"would be chosen. If it has a ‘schema’ class and a ‘writer’ class, it would "
"install headers:"
msgstr ""
"Například pro projekt s názvem „Walbottle“ by šel zvolit zkrácený název pro "
"jmenný prostor „Wbl“. Když bude mít třídu „schema“ a třídu „writer“, "
"instalovaly by se hlavičkové soubory:"
#. (itstool) path: item/p
#: C/namespacing.page:111
msgid ""
"<file><var>$(includedir)</var>/walbottle-<var>$API_MAJOR</var>/walbottle/"
"schema.h</file>"
msgstr ""
"<file><var>$(includedir)</var>/walbottle-<var>$API_MAJOR</var>/walbottle/"
"schema.h</file>"
#. (itstool) path: item/p
#: C/namespacing.page:114
msgid ""
"<file><var>$(includedir)</var>/walbottle-<var>$API_MAJOR</var>/walbottle/"
"writer.h</file>"
msgstr ""
"<file><var>$(includedir)</var>/walbottle-<var>$API_MAJOR</var>/walbottle/"
"writer.h</file>"
#. (itstool) path: section/p
#: C/namespacing.page:119
msgid ""
"(The use of <var>$API_MAJOR</var> above is for <link xref=\"parallel-"
"installability\">parallel installability</link>.)"
msgstr ""
"(Použití <var>$API_MAJOR</var> výše je z důvodu <link xref=\"parallel-"
"installability\">možnosti souběžné instalace</link>.)"
#. (itstool) path: section/p
#: C/namespacing.page:124
msgid ""
"For the schema class, the following symbols would be exported (amongst "
"others), following GObject conventions:"
msgstr ""
"Pro třídu schématu by měly být exportovány následující symboly (mimo jiné) a "
"dodržet při tom zvyklosti pro GObject:"
#. (itstool) path: item/p
#: C/namespacing.page:129
msgid "<code>WblSchema</code> structure"
msgstr "Struktura <code>WblSchema</code>"
#. (itstool) path: item/p
#: C/namespacing.page:130
msgid "<code>WblSchemaClass</code> structure"
msgstr "Struktura <code>WblSchemaClass</code>"
#. (itstool) path: item/p
#: C/namespacing.page:131
msgid "<code>WBL_TYPE_SCHEMA</code> macro"
msgstr "Makro <code>WBL_TYPE_SCHEMA</code>"
#. (itstool) path: item/p
#: C/namespacing.page:132
msgid "<code>WBL_IS_SCHEMA</code> macro"
msgstr "Makro <code>WBL_IS_SCHEMA</code>"
#. (itstool) path: item/p
#: C/namespacing.page:133
msgid "<code>wbl_schema_get_type</code> function"
msgstr "Funkce <code>wbl_schema_get_type</code>"
#. (itstool) path: item/p
#: C/namespacing.page:134
msgid "<code>wbl_schema_new</code> function"
msgstr "Funkce <code>wbl_schema_new</code>"
#. (itstool) path: item/p
#: C/namespacing.page:135
msgid "<code>wbl_schema_load_from_data</code> function"
msgstr "Funkce <code>wbl_schema_load_from_data</code>"
#. (itstool) path: credit/name
#: C/parallel-installability.page:10
msgid "Havoc Pennington"
msgstr "Havoc Pennington"
#. (itstool) path: credit/years
#: C/parallel-installability.page:12
msgid "2002"
msgstr "2002"
#. (itstool) path: info/desc
#: C/parallel-installability.page:25
msgid "Writing libraries to be future proof through parallel installation"
msgstr "Jak psát knihovny, aby v budoucnu šly instalovat souběžně různé verze"
#. (itstool) path: page/title
#: C/parallel-installability.page:30
msgid "Parallel Installability"
msgstr "Souběžná instalace"
#. (itstool) path: synopsis/p
#: C/parallel-installability.page:35
msgid ""
"If two packages can be parallel installed, then they have no filenames in "
"common, and people developing against the package always compile against the "
"version they expected. This applies to daemons, utility programs and "
"configuration files as it does to header files and library binaries."
msgstr ""
"Pokud mohou být dva balíčky nainstalovány souběžně, nesmí mít společné názvy "
"souborů a lidé provádějící vývoj vůči balíčku vždy kompilují vůči očekávané "
"verzi. Pro démony, pomocné programy a konfigurační soubory to platí úplně "
"stejně, jako pro hlavičkové soubory a binární knihovny."
#. (itstool) path: item/p
#: C/parallel-installability.page:43
msgid ""
"Ensure all versions of a library are parallel installable. (<link xref="
"\"#justification\"/>)"
msgstr ""
"Zajistěte, aby všechny verze knihoven šly nainstalovat vedle sebe. (<link "
"xref=\"#justification\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:47
msgid "Version all files installed by a library. (<link xref=\"#solution\"/>)"
msgstr ""
"Všem souborům instalovaným knihovnou přidělte číslo verze. (<link xref="
"\"#solution\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:51
msgid ""
"Keep package version numbers separate from soname or libtool version "
"numbers. Be clear which part of the package version number changes with the "
"API. (<link xref=\"#version-numbers\"/>)"
msgstr ""
"Udržujte číslo verze balíčku oddělené od názvu souboru s knihovnou nebo "
"čísla verze libtool. Je pak jasnější, která část čísla verze balíčku se mění "
"s API. (<link xref=\"#version-numbers\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:57
msgid ""
"Install C header files to <file><var>$(includedir)</var>/lib<var>library</"
"var>-<var>version</var>/<var>library</var>/</file>. (<link xref=\"#header-"
"files\"/>)"
msgstr ""
"Nainstalujte hlavičkové soubory C do <file><var>$(includedir)</var>/"
"lib<var>library</var>-<var>version</var>/<var>library</var>/</file>. (<link "
"xref=\"#header-files\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:62
msgid ""
"Install library binaries to <file><var>$(libdir)</var>/lib<var>library</var>-"
"<var>version</var>.so.<var>soname</var></file>. (<link xref=\"#libraries\"/>)"
msgstr ""
"Nainstalujte spustitelné soubory knihovny do <file><var>$(libdir)</var>/"
"lib<var>library</var>-<var>version</var>.so.<var>soname</var></file>. (<link "
"xref=\"#libraries\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:67
msgid ""
"Install pkg-config files to <file><var>$(libdir)</var>/pkgconfig/"
"<var>library</var>-<var>version</var>.pc</file>. (<link xref=\"#pkg-config\"/"
">)"
msgstr ""
"Nainstalujte soubory pkg-config do <file><var>$(libdir)</var>/pkgconfig/"
"<var>library</var>-<var>version</var>.pc</file>. (<link xref=\"#pkg-config\"/"
">)"
#. (itstool) path: item/p
#: C/parallel-installability.page:72
msgid ""
"Make configuration files forwards and backwards compatible, or install them "
"to <file><var>$(sysconfdir)</var>/<var>library</var>-<var>version</var>/</"
"file>. (<link xref=\"#configuration-files\"/>)"
msgstr ""
"U souborů s nastavením zajistěte zpětnou a dopřednou kompatibilitu nebo je "
"instalujte do <file><var>$(sysconfdir)</var>/<var>knihovna</var>-<var>verze</"
"var>/</file>. (<link xref=\"#configuration-files\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:78
msgid ""
"Set <code>GETTEXT_PACKAGE</code> to <code><var>library</var>-<var>version</"
"var></code>. (<link xref=\"#gettext\"/>)"
msgstr ""
"Nastavte <code>GETTEXT_PACKAGE</code> na <code><var>library</var>-"
"<var>version</var></code>. (<link xref=\"#gettext\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:83
msgid ""
"Include a version number in all D-Bus interface names, service names and "
"object paths. For example: <code>org.domain.<var>Library</var><var>Version</"
"var>.<var>Interface</var></code>, <code>org.domain.<var>Library</"
"var><var>Version</var></code> and <code>/org/domain/<var>Library</"
"var><var>Version</var>/</code>. (<link xref=\"#dbus\"/>)"
msgstr ""
"Do všech názvů rozhraní D-Bus, názvů služeb a cest k objektům zahrňte číslo "
"verze. Například: <code>org.domain.<var>Knihovna</var><var>Verze</var>."
"<var>Rozhraní</var></code>, <code>org.domain.<var>Knihovna</var><var>Verze</"
"var></code> a <code>/org/domain/<var>Knihovna</var><var>Verze</var>/</code>. "
"(<link xref=\"#dbus\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:91
msgid ""
"Install daemon binaries to <file><var>$(libexecdir)</var>/<var>library</var>-"
"daemon-<var>version</var></file>. (<link xref=\"#programs\"/>)"
msgstr ""
"Nainstalujte spustitelné soubory démonů do <file><var>$(libexecdir)</var>/"
"<var>library</var>-daemon-<var>version</var></file>. (<link xref=\"#programs"
"\"/>)"
#. (itstool) path: item/p
#: C/parallel-installability.page:96
msgid ""
"Install utility binaries to <file><var>$(bindir)</var>/<var>library</var>-"
"utility-<var>version</var></file> and install symbolic links to <file><var>"
"$(bindir)</var>/<var>library</var>-utility</file>. (<link xref=\"#programs\"/"
">)"
msgstr ""
"Spustitelné soubory pomůcek instalujte do <file><var>$(bindir)</var>/"
"<var>knihovna</var>-utility-<var>verze</var></file> a symbolické odkazy do "
"<file><var>$(bindir)</var>/<var>knihovna</var>-utility</file>. (<link xref="
"\"#programs\"/>)"
#. (itstool) path: section/title
#: C/parallel-installability.page:106
msgid "Justification"
msgstr "Odůvodnění"
#. (itstool) path: section/p
#: C/parallel-installability.page:108
msgid ""
"All public libraries should be designed to be parallel installed to ease API "
"breaks later in the life of the library. If a library is used by multiple "
"projects, and wants to break API, either all of the projects must be ported "
"to the new API in parallel, or some of them will no longer be installable at "
"the same time as the others, due to depending on conflicting versions of "
"this library."
msgstr ""
"Všechny veřejné knihovny by měly být navržené tak, aby je šlo instalovat "
"souběžně ve více verzích, kvůli jednoduššímu pozdějšímu porušení API po dobu "
"existence knihovny. Pokud je knihovna používána více projekty a chcete "
"porušit API, buď musí projekty naráz přejít na nové API, nebo některé z nich "
"již nebude nadále možné nainstalovat souběžně s ostatními, protože závisí na "
"konfliktní verzi této knihovny."
#. (itstool) path: section/p
#: C/parallel-installability.page:117
msgid ""
"This is unmaintainable, and asking all the projects to port to a new API at "
"the same time is hard to organize and demoralizing, as most API breaks do "
"not bring large new features which would motivate porting."
msgstr ""
"To komplikuje správu a žádat pro všech projektech, aby naráz přesly na novou "
"verzi API je organizačně náročné a demoralizující, protože většina porušení "
"API nepřinese mnoho nových funkcí, které by motivovaly k přechodu."
#. (itstool) path: section/p
#: C/parallel-installability.page:123
msgid ""
"The solution is to ensure that all libraries are parallel installable, "
"allowing the old and new versions of the API to be installed and compiled "
"against at the same time, without conflicts. Building in support for this "
"kind of parallel installation is much easier to do at the start of a project "
"than it is to do retroactively."
msgstr ""
"Řešením je zajistit, aby šly všechny verze knihoven nainstalovat naráz, "
"takže staré i nové verze API budou nainstalované a aplikace zkompilované "
"vůči nim souběžně, bez konfliktů. Vestavění podpory pro tento druh souběžné "
"instalace je mnohem jednodušší udělat na začátku projektu, než to dělat "
"zpětně."
#. (itstool) path: section/p
#: C/parallel-installability.page:131
msgid ""
"This eliminates the ‘chicken and egg’ problem of porting a collection of "
"applications from one version of a library to the next, and makes breaking "
"API a lot simpler for library maintainers, which can allow for more rapid "
"iteration and development of new features if they desire."
msgstr ""
"Tím se odstraní problém „slepice nebo vejce“ při přechodu celé sady aplikací "
"z jedné verze knihovny na novější a pro správce knihovny si tím velmi "
"zjednoduší porušení API, takže mohou při vývoji mnohem rychleji reagovat na "
"přání nových funkcí."
#. (itstool) path: section/p
#: C/parallel-installability.page:138
msgid ""
"The alternative, and equally valid, solution is for the library to never "
"break API — the approach taken by <code>libc</code>."
msgstr ""
"Jiným a rovněž platným řešením pro knihovny je, nikdy nenarušovat API — "
"tímto se řídí <code>libc</code>."
#. (itstool) path: section/title
#: C/parallel-installability.page:145
msgid "Solution"
msgstr "Řešení"
#. (itstool) path: section/p
#: C/parallel-installability.page:147
msgid ""
"The solution to the problem is essentially to rename the library, and in "
"most cases the nicest way to do so is to include the version number in the "
"path of every file it installs. This means multiple versions of the library "
"can be installed at the same time."
msgstr ""
"Řešením problému v podstatě je přejmenovat knihovnu a ve většině případů je "
"nejhezčím způsobem, jak to udělat, vložit do cesty ke každému instalovanému "
"souboru číslo verze. Díky tomu může být naráz nainstalováno více verzí "
"knihovny."
#. (itstool) path: section/p
#: C/parallel-installability.page:154
msgid ""
"For example, say that library <code>Foo</code> traditionally installs these "
"files:"
msgstr ""
"Kupříkladu řekněme, že knihovna <code>Foo</code> tradičně instaluje tyto "
"soubory:"
#. (itstool) path: item/p
#: C/parallel-installability.page:159 C/parallel-installability.page:284
msgid "<file>/usr/include/foo.h</file>"
msgstr "<file>/usr/include/foo.h</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:160
msgid "<file>/usr/include/foo-utils.h</file>"
msgstr "<file>/usr/include/foo-utils.h</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:161
msgid "<file>/usr/lib/libfoo.so</file>"
msgstr "<file>/usr/lib/libfoo.so</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:162
msgid "<file>/usr/lib/pkgconfig/foo.pc</file>"
msgstr "<file>/usr/lib/pkgconfig/foo.pc</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:163
msgid "<file>/usr/share/doc/foo/foo-manual.txt</file>"
msgstr "<file>/usr/share/doc/foo/foo-manual.txt</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:164
msgid "<file>/usr/bin/foo-utility</file>"
msgstr "<file>/usr/bin/foo-utility</file>"
#. (itstool) path: section/p
#: C/parallel-installability.page:167
msgid ""
"You might modify <code>Foo</code> version 4 to install these files instead:"
msgstr ""
"Můžete změnit verzi 4 knihovny <code>Foo</code>, aby místo toho instalovala "
"tyto soubory:"
#. (itstool) path: item/p
#: C/parallel-installability.page:172 C/parallel-installability.page:261
msgid "<file>/usr/include/foo-4/foo/foo.h</file>"
msgstr "<file>/usr/include/foo-4/foo/foo.h</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:173
msgid "<file>/usr/include/foo-4/foo/utils.h</file>"
msgstr "<file>/usr/include/foo-4/foo/utils.h</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:174 C/parallel-installability.page:338
msgid "<file>/usr/lib/libfoo-4.so</file>"
msgstr "<file>/usr/lib/libfoo-4.so</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:175 C/parallel-installability.page:397
msgid "<file>/usr/lib/pkgconfig/foo-4.pc</file>"
msgstr "<file>/usr/lib/pkgconfig/foo-4.pc</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:176
msgid "<file>/usr/share/doc/foo-4/foo-manual.txt</file>"
msgstr "<file>/usr/share/doc/foo-4/foo-manual.txt</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:177
msgid "<file>/usr/bin/foo-utility-4</file>"
msgstr "<file>/usr/bin/foo-utility-4</file>"
#. (itstool) path: section/p
#: C/parallel-installability.page:180
msgid "It could then be parallel installed with version 5:"
msgstr "Pak by mohly být nainstalovány souběžně s verzí 5:"
#. (itstool) path: item/p
#: C/parallel-installability.page:184 C/parallel-installability.page:262
msgid "<file>/usr/include/foo-5/foo/foo.h</file>"
msgstr "<file>/usr/include/foo-5/foo/foo.h</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:185
msgid "<file>/usr/include/foo-5/foo/utils.h</file>"
msgstr "<file>/usr/include/foo-5/foo/utils.h</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:186 C/parallel-installability.page:339
msgid "<file>/usr/lib/libfoo-5.so</file>"
msgstr "<file>/usr/lib/libfoo-5.so</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:187 C/parallel-installability.page:398
msgid "<file>/usr/lib/pkgconfig/foo-5.pc</file>"
msgstr "<file>/usr/lib/pkgconfig/foo-5.pc</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:188
msgid "<file>/usr/share/doc/foo-5/foo-manual.txt</file>"
msgstr "<file>/usr/share/doc/foo-5/foo-manual.txt</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:189
msgid "<file>/usr/bin/foo-utility-5</file>"
msgstr "<file>/usr/bin/foo-utility-5</file>"
#. (itstool) path: section/p
#: C/parallel-installability.page:192
msgid ""
"This is easily supported using <link href=\"http://www.freedesktop.org/wiki/"
"Software/pkg-config/\"> <cmd>pkg-config</cmd></link>: <file>foo-4.pc</file> "
"would add <file>/usr/include/foo-4</file> to the include path and "
"<file>libfoo-4.so</file> to the list of libraries to link; <file>foo-5.pc</"
"file> would add <file>/usr/include/foo-5</file> and <file>libfoo-5.so</file>."
msgstr ""
"To je jednoduše podporováno pomocí <link href=\"http://www.freedesktop.org/"
"wiki/Software/pkg-config/\"><cmd>pkg-config</cmd></link>: <file>foo-4.pc</"
"file> by přidal do cesty <file>/usr/include/foo-4</file> a do seznamu "
"knihoven odkaz <file>libfoo-4.so</file>; <file>foo-5.pc</file> by přidal "
"<file>/usr/include/foo-5</file> a <file>libfoo-5.so</file>."
#. (itstool) path: section/title
#: C/parallel-installability.page:204
msgid "Version Numbers"
msgstr "Čísla verzí"
#. (itstool) path: section/p
#: C/parallel-installability.page:206
msgid ""
"The version number that goes in filenames is an <em>ABI/API</em> version. It "
"should not be the full version number of your package — just the part which "
"signifies an API break. If using the standard <code><var>major</var>."
"<var>minor</var>.<var>micro</var></code> scheme for project versioning, the "
"API version is typically the major version number."
msgstr ""
"Číslo verze které se zahrne do názvu souboru je veze <em>ABI/API</em>. "
"Nemělo by jít o celé číslo verze balíčku, jen o část, která významěmně "
"porušuje API. Pokud používáte pro číslování verzí projektu standartní schéma "
"<code><var>hlavní</var>.<var>vedlejší</var>.<var>setinkové</var></code>, je "
"verzí API typicky hlavní číslo verze."
#. (itstool) path: section/p
#: C/parallel-installability.page:214
msgid ""
"Minor releases (typically where API is added but <em>not</em> changed or "
"removed) and micro releases (typically bug fixes) do not affect <link xref="
"\"api-stability\">API backwards compatibility</link> so do not require "
"moving all the files."
msgstr ""
"Vedlejší vydání (typicky, když je přidáno API, ale <em>není</em> změněno "
"nebo odebráno) a setinková vydání (typicky opravy chyb) neovlivňují <link "
"xref=\"api-stability\">zpětnou kompatibilitu API</link>, takže nevyžadují "
"přesun všech souborů."
#. (itstool) path: section/p
#: C/parallel-installability.page:221
msgid ""
"The examples in the following sections assume that the API version and "
"soname are exported from <file>configure.ac</file> using the following code:"
msgstr ""
"Příklady v následujícím oddíle předpokládají, že verze API a název souboru s "
"knihovnou jsou exportovány z <file>configure.ac</file> pomocí následujícího "
"kódu:"
#. (itstool) path: listing/title
#: C/parallel-installability.page:227
msgid "API Versioning in Autoconf"
msgstr "Číslování verzí API v Autoconf"
#. (itstool) path: listing/desc
#: C/parallel-installability.page:228
msgid ""
"Code to export the API version and soname from <file>configure.ac</file>"
msgstr ""
"Kód pro export verze API a názvu souboru s knihovnou z <file>configure.ac</"
"file>"
#. (itstool) path: listing/code
#: C/parallel-installability.page:231
#, no-wrap
msgid ""
"# Before making a release, the <var>LIBRARY</var>_LT_VERSION string should be modified.\n"
"# The string is of the form c:r:a. Follow these instructions sequentially:\n"
"#\n"
"# 1. If the library source code has changed at all since the last update,\n"
"# then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).\n"
"# 2. If any interfaces have been added, removed, or changed since the last update,\n"
"# increment current, and set revision to 0.\n"
"# 3. If any interfaces have been added since the last public release,\n"
"# then increment age.\n"
"# 4. If any interfaces have been removed or changed since the last public release,\n"
"# then set age to 0.\n"
"AC_SUBST([<var>LIBRARY</var>_LT_VERSION],[1:0:0])\n"
"\n"
"AC_SUBST([<var>LIBRARY</var>_API_VERSION],[4])"
msgstr ""
"# Před vydáním by se měl upravit řetězec <var>KNIHOVNA</var>_LT_VERSION, který\n"
"# je ve formě a:r:v (aktuální:revize:věk). Postupujte podle následujících bodů:\n"
"#\n"
"# 1. Když od poslední aktualizace došlo ke změně zdrojového kódu knihovny\n"
"# jako celku, zvyšte revizi („a:r:v“ se změní na „a:r+1:v“).\n"
"# 2. Když bylo od poslední aktualizace přidáno, odebráno nebo změněno\n"
"# rozhraní, zvyšte aktuální a revizi nastavte na 0.\n"
"# 3. Když bylo od posledního veřejného vydání přidáno rozhraní, zvyšte věk.\n"
"# 4. Když bylo od posledního veřejného vydání odebráno nebo změněno \n"
"# rozhraní, nastavte věk na 0.\n"
"AC_SUBST([<var>KNIHOVNA</var>_LT_VERSION],[1:0:0])\n"
"\n"
"AC_SUBST([<var>KNIHOVNA</var>_API_VERSION],[4])"
#. (itstool) path: section/title
#: C/parallel-installability.page:249
msgid "C Header Files"
msgstr "Hlavičkové soubory C"
#. (itstool) path: section/p
#: C/parallel-installability.page:251
msgid ""
"Header files should always be installed in a versioned subdirectory that "
"requires an <cmd>-I</cmd> flag to the C compiler. For example, if my header "
"is <file>foo.h</file>, and applications do this:"
msgstr ""
"Hlavičkové soubory by vždy měly být nainstalovány v podsložce s číslem "
"verze, kterou požaduje přepínač <cmd>-I</cmd> pro kompilátor jazyka C. "
"Například, když je hlavičkový soubor <file>foo.h</file> a aplikace udělá "
"následující:"
#. (itstool) path: section/code
#: C/parallel-installability.page:256
#, no-wrap
msgid "#include <foo/foo.h>"
msgstr "#include <foo/foo.h>"
#. (itstool) path: section/p
#: C/parallel-installability.page:257
msgid "then I should install these files:"
msgstr "pak by měly být nainstalovány tyto soubory:"
#. (itstool) path: section/p
#: C/parallel-installability.page:265
msgid ""
"Applications should pass the flag <cmd>-I/usr/include/foo-4</cmd> or <cmd>-I/"
"usr/include/foo-5</cmd> to the C compiler. Again, this is facilitated by "
"using <cmd>pkg-config</cmd>."
msgstr ""
"Aplikace by měla kompilátoru jazyka C předat přepínač <cmd>-I/usr/include/"
"foo-4</cmd> nebo <cmd>-I/usr/include/foo-5</cmd>. Jak již bylo několikrát "
"řečeno, to vše vám může usnadnit <cmd>pkg-config</cmd>."
#. (itstool) path: section/p
#: C/parallel-installability.page:271
msgid ""
"Note the extra <file>foo/</file> subdirectory. This namespaces the <code "
"mime=\"text/x-csrc\">#include</code> to avoid file naming collisions with "
"other libraries. For example, if two different libraries install headers "
"called <file>utils.h</file>, which one gets included when you use <code mime="
"\"text/x-csrc\">#include <utils.h></code>?"
msgstr ""
"Všimněte si zvláštní podsložky <file>foo/</file>. Funguje jako jmenný "
"prostor pro <code mime=\"text/x-csrc\">#include</code>, aby se předešlo "
"kolizi názvů s jinými knihovnami. Když například dvě různé knihovny "
"nainstalují každá hlavičkový soubor s názvem <file>utils.h</file>, který se "
"ve skutečnosti vloží, když použijete kód <code mime=\"text/x-csrc\">#include "
"<utils.h></code>?"
#. (itstool) path: section/p
#: C/parallel-installability.page:279
msgid ""
"There’s some temptation to keep one of the header files outside of any "
"subdirectory:"
msgstr ""
"Existuje pokušení ponechat jeden z hlavičkových souborů mimo kteroukoliv "
"podsložku:"
#. (itstool) path: item/p
#: C/parallel-installability.page:285
msgid "<file>/usr/include/foo-5/foo.h</file>"
msgstr "<file>/usr/include/foo-5/foo.h</file>"
#. (itstool) path: section/p
#: C/parallel-installability.page:288
msgid ""
"The problem there is that users are always accidentally getting the wrong "
"header, since <cmd>-I/usr/include</cmd> seems to find its way onto compile "
"command lines with some regularity. If you must do this, at least add a "
"check to the library that detects applications using the wrong header file "
"when the library is initialized."
msgstr ""
"Problém je v tom, že uživatel určitě vždycky omylem použije nesprávnou "
"hlavičku, protože <cmd>-I/usr/include</cmd> si při kompilaci vždy najde "
"nějakou cestičku do příkazového řádku. Pokud to musíte udělat, minimálně do "
"knihovny přidejte kontrolu, která při inicializaci knihovny objeví aplikaci "
"používající nesprávný hlavičkový soubor."
#. (itstool) path: section/p
#: C/parallel-installability.page:296
msgid ""
"Versioned header files can be installed from automake using the following "
"code:"
msgstr ""
"Hlavičkové soubory s číslem verze mohou být instalovány z automake pomocí "
"následujícího kódu:"
#. (itstool) path: listing/title
#: C/parallel-installability.page:301
msgid "Header Files in Automake"
msgstr "Hlavičkové soubory v Automake"
#. (itstool) path: listing/desc
#: C/parallel-installability.page:302
msgid "Code to install versioned header files from <file>Makefile.am</file>"
msgstr ""
"Kód pro instalaci hlavičkových souborů s číslem verze z <file>Makefile.am</"
"file>"
#. (itstool) path: listing/code
#: C/parallel-installability.page:305
#, no-wrap
msgid ""
"<var>library</var>includedir = $(includedir)/lib<var>library</var>-@<var>LIBRARY</var>_API_VERSION@/<var>library</var>\n"
"<var>library</var>_headers = \\\n"
"\tlib<var>library</var>/example1.h \\\n"
"\tlib<var>library</var>/example2.h \\\n"
"\t$(NULL)\n"
"\n"
"# The following headers are private, and shouldn't be installed:\n"
"private_headers = \\\n"
"\tlib<var>library</var>/example-private.h \\\n"
"\t$(NULL)\n"
"# The main header simply #includes all other public headers:\n"
"main_header = lib<var>library</var>/<var>library</var>.h\n"
"public_headers = \\\n"
"\t$(main_header) \\\n"
"\t$(<var>library</var>_headers) \\\n"
"\t$(NULL)\n"
"\n"
"<var>library</var>include_HEADERS = $(public_headers)"
msgstr ""
"<var>library</var>includedir = $(includedir)/lib<var>library</var>-@<var>LIBRARY</var>_API_VERSION@/<var>library</var>\n"
"<var>library</var>_headers = \\\n"
"\tlib<var>library</var>/example1.h \\\n"
"\tlib<var>library</var>/example2.h \\\n"
"\t$(NULL)\n"
"\n"
"# The following headers are private, and shouldn't be installed:\n"
"private_headers = \\\n"
"\tlib<var>library</var>/example-private.h \\\n"
"\t$(NULL)\n"
"# The main header simply #includes all other public headers:\n"
"main_header = lib<var>library</var>/<var>library</var>.h\n"
"public_headers = \\\n"
"\t$(main_header) \\\n"
"\t$(<var>library</var>_headers) \\\n"
"\t$(NULL)\n"
"\n"
"<var>library</var>include_HEADERS = $(public_headers)"
#. (itstool) path: section/p
#: C/parallel-installability.page:325
msgid ""
"As well as correct versioning, all APIs in installed headers should be <link "
"xref=\"namespacing\">namespaced correctly</link>."
msgstr ""
"Kromě správného číslování verzí by měla mít všechna API v instalovaných "
"hlavičkových souborech <link xref=\"namespacing\">správný jmenný prostor</"
"link>."
#. (itstool) path: section/title
#: C/parallel-installability.page:332
msgid "Libraries"
msgstr "Knihovny"
#. (itstool) path: section/p
#: C/parallel-installability.page:334
msgid "Library object files should have a versioned name. For example:"
msgstr ""
"Objektové soubory knihovny by měly mít názvy s číslem verze. Například:"
#. (itstool) path: section/p
#: C/parallel-installability.page:342
msgid ""
"This allows applications to get exactly the one they want at compile time, "
"and ensures that versions 4 and 5 have no files in common."
msgstr ""
"To umožňuje aplikacím získat při kompilaci právě tu, kterou chtějí a zajistí "
"to, že verze 4 a 5 nemají žádné soubory společné."
#. (itstool) path: section/p
#: C/parallel-installability.page:347
msgid ""
"Versioned libraries can be built and installed from automake using the "
"following code:"
msgstr ""
"Knihovny s číslem verze mohou být sestaveny a nainstalovány z automake "
"pomocí následujícího kódu:"
#. (itstool) path: listing/title
#: C/parallel-installability.page:352
msgid "Libraries in Automake"
msgstr "Knihovny v Automake"
#. (itstool) path: listing/desc
#: C/parallel-installability.page:353
msgid ""
"Code to build and install versioned libraries from <file>Makefile.am</file>"
msgstr ""
"Kód pro sestavení a instalaci knihoven s číslem verze z <file>Makefile.am</"
"file>"
#. (itstool) path: listing/code
#: C/parallel-installability.page:357
#, no-wrap
msgid ""
"lib_LTLIBRARIES = lib<var>library</var>/lib<var>library</var>-@<var>LIBRARY</var>_API_VERSION@.la\n"
"\n"
"lib<var>library</var>_lib<var>library</var>_@<var>LIBRARY</var>_API_VERSION@_la_SOURCES = \\\n"
"\t$(private_headers) \\\n"
"\t$(<var>library</var>_sources) \\\n"
"\t$(NULL)\n"
"lib<var>library</var>_lib<var>library</var>_@<var>LIBRARY</var>_API_VERSION@_la_CPPFLAGS = …\n"
"lib<var>library</var>_lib<var>library</var>_@<var>LIBRARY</var>_API_VERSION@_la_CFLAGS = …\n"
"lib<var>library</var>_lib<var>library</var>_@<var>LIBRARY</var>_API_VERSION@_la_LIBADD = …\n"
"lib<var>library</var>_lib<var>library</var>_@<var>LIBRARY</var>_API_VERSION@_la_LDFLAGS = \\\n"
"\t-version-info $(<var>LIBRARY</var>_LT_VERSION) \\\n"
"\t$(AM_LDFLAGS) \\\n"
"\t$(NULL)"
msgstr ""
"lib_LTLIBRARIES = lib<var>knihovna</var>/lib<var>knihovna</var>-@<var>KNIHOVNA</var>_API_VERSION@.la\n"
"\n"
"lib<var>knihovna</var>_lib<var>knihovna</var>_@<var>KNIHOVNA</var>_API_VERSION@_la_SOURCES = \\\n"
"\t$(private_headers) \\\n"
"\t$(<var>knihovna</var>_sources) \\\n"
"\t$(NULL)\n"
"lib<var>knihovna</var>_lib<var>knihovna</var>_@<var>KNIHOVNA</var>_API_VERSION@_la_CPPFLAGS = …\n"
"lib<var>knihovna</var>_lib<var>knihovna</var>_@<var>KNIHOVNA</var>_API_VERSION@_la_CFLAGS = …\n"
"lib<var>knihovna</var>_lib<var>knihovna</var>_@<var>KNIHOVNA</var>_API_VERSION@_la_LIBADD = …\n"
"lib<var>knihovna</var>_lib<var>knihovna</var>_@<var>KNIHOVNA</var>_API_VERSION@_la_LDFLAGS = \\\n"
"\t-version-info $(<var>KNIHOVNA</var>_LT_VERSION) \\\n"
"\t$(AM_LDFLAGS) \\\n"
"\t$(NULL)"
#. (itstool) path: section/title
#: C/parallel-installability.page:373
msgid "Library sonames"
msgstr "Názvy souborů s knihovnami"
#. (itstool) path: section/p
#: C/parallel-installability.page:375
msgid ""
"Library sonames (also known as libtool version numbers) only address the "
"problem of runtime linking previously-compiled applications. They don’t "
"address the issue of compiling applications that require a previous version, "
"and they don’t address anything other than libraries."
msgstr ""
"Názvy souborů s knihovnami (známé též jako soname nebo číslování verzí "
"libtool) se zaměřují jen na problém linkování dříve přeložených aplikací za "
"běhu. Neřeší záležitosti okolo kompilace aplikací, které požadují dřívější "
"verzi, a ani nic jiného okolo knihoven."
#. (itstool) path: section/p
#: C/parallel-installability.page:382
msgid ""
"For this reason, sonames should be used, but <em>in addition</em> to "
"versioned names for libraries. The two solutions address different problems."
msgstr ""
"Z toho důvodu byste ještě <em>navíc</em> měli používat pro knihovny názvy s "
"číslováním verzi. Každá z těchto věcí cílí na jiný problém."
#. (itstool) path: section/title
#: C/parallel-installability.page:391
msgid "pkg-config Files"
msgstr "Soubory pkg-config"
#. (itstool) path: section/p
#: C/parallel-installability.page:393
msgid "pkg-config files should have a versioned name. For example:"
msgstr "Soubory pkg-config by měly mít názvy s číslem verze. Například:"
#. (itstool) path: section/p
#: C/parallel-installability.page:401
msgid ""
"Since each pkg-config file contains versioned information about the library "
"name and include paths, any project which depends on the library should be "
"able to switch from one version to another simply by changing their pkg-"
"config check from <file>foo-4</file> to <file>foo-5</file> (and doing any "
"necessary API porting)."
msgstr ""
"Protože každý soubor pkg-config obsahuje informace o verzi názvu knihovny "
"včetně cesty, měl by být kterýkoliv projekt, který závisí na knihovně, "
"schopen se přepnout z jedné verze na jinou prostou změnou kontroly ve svém "
"pkg-config z <file>neco-4</file> na <file>neco-5</file> (a provedením "
"příslušného přechodu v API)."
#. (itstool) path: section/p
#: C/parallel-installability.page:409
msgid ""
"Versioned pkg-config files can be installed from autoconf and automake using "
"the following code:"
msgstr ""
"Soubory pkg-config s rozlišením verze mohou být instalovány z autoconf a "
"automake pomocí následujícího kódu:"
#. (itstool) path: listing/title
#: C/parallel-installability.page:414
msgid "pkg-config Files in Autoconf and Automake"
msgstr "Soubory pkg-config v Autoconf a Automake"
#. (itstool) path: listing/desc
#: C/parallel-installability.page:415
msgid ""
"Code to install versioned pkg-config files from <file>configure.ac</file> "
"and <file>Makefile.am</file>"
msgstr ""
"Kód pro instalaci souborů pkg-config s rozlišením verze z <file>configure."
"ac</file> a <file>Makefile.am</file>"
#. (itstool) path: listing/code
#: C/parallel-installability.page:420
#, no-wrap
msgid ""
"AC_CONFIG_FILES([\n"
"lib<var>library</var>/<var>library</var>-$<var>LIBRARY</var>_API_VERSION.pc:lib<var>library</var>/<var>library</var>.pc.in\n"
"],[],\n"
"[<var>LIBRARY</var>_API_VERSION='$<var>LIBRARY</var>_API_VERSION'])"
msgstr ""
"AC_CONFIG_FILES([\n"
"lib<var>knihovna</var>/<var>knihovna</var>-$<var>KNIHOVNA</var>_API_VERSION.pc:lib<var>knihovna</var>/<var>knihovna</var>.pc.in\n"
"],[],\n"
"[<var>KNIHOVNA</var>_API_VERSION='$<var>KNIHOVNA</var>_API_VERSION'])"
#. (itstool) path: listing/code
#: C/parallel-installability.page:425
#, no-wrap
msgid ""
"# Note that the template file is called <var>library</var>.pc.in, but generates a\n"
"# versioned .pc file using some magic in AC_CONFIG_FILES.\n"
"pkgconfigdir = $(libdir)/pkgconfig\n"
"pkgconfig_DATA = lib<var>library</var>/<var>library</var>-$(<var>LIBRARY</var>_API_VERSION).pc\n"
"\n"
"DISTCLEANFILES += $(pkgconfig_DATA)\n"
"EXTRA_DIST += lib<var>library</var>/<var>library</var>.pc.in"
msgstr ""
"# Všimněte si, že soubor s šablonou se nazývá <var>library</var>.pc.in, ale generuje se\n"
"# soubor .pc s číslem verze pomocí stejné magie, jako v AC_CONFIG_FILES.\n"
"pkgconfigdir = $(libdir)/pkgconfig\n"
"pkgconfig_DATA = lib<var>knihovna</var>/<var>knihovna</var>-$(<var>KNIHOVNA</var>_API_VERSION).pc\n"
"\n"
"DISTCLEANFILES += $(pkgconfig_DATA)\n"
"EXTRA_DIST += lib<var>knihovna</var>/<var>knihovna</var>.pc.in"
#. (itstool) path: section/title
#: C/parallel-installability.page:436
msgid "Configuration Files"
msgstr "Soubory s nastavením"
#. (itstool) path: section/p
#: C/parallel-installability.page:438
msgid ""
"From a user standpoint, the best approach to configuration files is to keep "
"the format both <link xref=\"api-stability\">forward and backward "
"compatible</link> (both library versions understand exactly the same "
"configuration file syntax and semantics). Then the same configuration file "
"can be used for all versions of the library, and no versioning is needed on "
"the configuration file itself."
msgstr ""
"Z hlediska uživatele je nejlepším přístupem k souborům s nastavením udržovat "
"formát <link xref=\"api-stability\">dopředně i zpětně kompatibilní</link> "
"(obě verze knihovny rozumí právě té stejné syntaxi a sémantice souboru s "
"nastavením). Pak lze použít ten samý soubor s nastavením pro všechny verze "
"knihovny a není potřeba žádné číslování verzí u souborů s nastavením."
#. (itstool) path: section/p
#: C/parallel-installability.page:448
msgid ""
"If you can’t do that, the configuration files should simply be renamed, and "
"users will have to configure each version of the library separately."
msgstr ""
"Pokud to ale dodržet nejde, měly by být soubory s nastavením jednoduše "
"přejmenovány a uživatel musí nastavit každou verzi knihovny zvlášť."
#. (itstool) path: section/title
#: C/parallel-installability.page:455
msgid "Gettext Translations"
msgstr "Překlady pomocí Gettext"
#. (itstool) path: section/p
#: C/parallel-installability.page:457
msgid ""
"If you use gettext for translations in combination with autoconf and "
"automake, normally things are set up to install the translations to <file>/"
"usr/share/locale/<var>lang</var>/LC_MESSAGES/<var>package</var></file>. "
"You’ll need to change <var>package</var>. The convention used in GNOME is to "
"put this in <file>configure.ac</file>:"
msgstr ""
"Jestli používáte pro překlady gettext v kombinaci s autoconf a automake, je "
"normální postup nainstalovat překlady do <file>/usr/share/locale/<var>jazyk</"
"var>/LC_MESSAGES/<var>balíček</var></file>. Údaj <var>baliček</var> musíte "
"změnit na správný název. Podle zvyklostí používaných v GNOME se to celé "
"vloží do <file>configure.ac</file>:"
#. (itstool) path: section/code
#: C/parallel-installability.page:465
#, no-wrap
msgid ""
"GETTEXT_PACKAGE=foo-4\n"
"AC_SUBST([GETTEXT_PACKAGE])\n"
"AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],[\"$GETTEXT_PACKAGE\"])"
msgstr ""
"GETTEXT_PACKAGE=foo-4\n"
"AC_SUBST([GETTEXT_PACKAGE])\n"
"AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],[\"$GETTEXT_PACKAGE\"])"
#. (itstool) path: section/p
#: C/parallel-installability.page:469
msgid ""
"Then use <code>GETTEXT_PACKAGE</code> as the package name to pass to <code "
"mime=\"text/x-csrc\">bindtextdomain()</code>, <code mime=\"text/x-csrc"
"\">textdomain()</code>, and <code mime=\"text/x-csrc\">dgettext()</code>."
msgstr ""
"Pak použijte <code>GETTEXT_PACKAGE</code> jako název balíčku předaný do "
"<code mime=\"text/x-csrc\">bindtextdomain()</code>, <code mime=\"text/x-csrc"
"\">textdomain()</code> a <code mime=\"text/x-csrc\">dgettext()</code>."
#. (itstool) path: section/title
#: C/parallel-installability.page:482
msgid "D-Bus Interfaces"
msgstr "Rozhraní D-Bus"
#. (itstool) path: section/p
#: C/parallel-installability.page:484
msgid ""
"A D-Bus interface is another form of API, similar to a C API except that "
"resolution of the version is done at runtime rather than compile time. "
"Versioning D-Bus interfaces is otherwise no different to C APIs: version "
"numbers must be included in interface names, service names and object paths."
msgstr ""
"Rozhraní D-Bus je další formou API a podobá se API v C s tím rozdílem, že "
"rozlišení verze se neprovádí při kompilaci, ale za běhu. Číslování verzí "
"rozhraní D-Bus se jinak od API v C nijak neliší: čísla verzí musí být "
"zahrnuta v názvech rozhraní, názvech služeb a v cestách k objektům."
#. (itstool) path: section/p
#: C/parallel-installability.page:492
msgid ""
"For example, for a service <code>org.example.Foo</code> exposing interfaces "
"<code>A</code> and <code>B</code> on objects <code>Controller</code> and "
"<code>Client</code>, versions 4 and 5 of the D-Bus API would look like this:"
msgstr ""
"Například pro službu <code>org.example.Foo</code> vystavující rozhraní "
"<code>A</code> a <code>B</code> na objektech <code>Controller</code> a "
"<code>Client</code>, by verze 4 a 5 API pro D-Bus vypadala nějak takto:"
#. (itstool) path: list/title
#: C/parallel-installability.page:499
msgid "Service Names"
msgstr "Názvy služeb"
#. (itstool) path: item/p
#: C/parallel-installability.page:500
msgid "<code>org.example.Foo4</code>"
msgstr "<code>org.example.Foo4</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:501
msgid "<code>org.example.Foo5</code>"
msgstr "<code>org.example.Foo5</code>"
#. (itstool) path: list/title
#: C/parallel-installability.page:504
msgid "Interface Names"
msgstr "Názvy rozhraní"
#. (itstool) path: item/p
#: C/parallel-installability.page:505
msgid "<code>org.example.Foo4.InterfaceA</code>"
msgstr "<code>org.example.Foo4.InterfaceA</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:506
msgid "<code>org.example.Foo4.InterfaceB</code>"
msgstr "<code>org.example.Foo4.InterfaceB</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:507
msgid "<code>org.example.Foo5.InterfaceA</code>"
msgstr "<code>org.example.Foo5.InterfaceA</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:508
msgid "<code>org.example.Foo5.InterfaceB</code>"
msgstr "<code>org.example.Foo5.InterfaceB</code>"
#. (itstool) path: list/title
#: C/parallel-installability.page:511
msgid "Object Paths"
msgstr "Cesty k objektům"
#. (itstool) path: item/p
#: C/parallel-installability.page:512
msgid "<code>/org/example/Foo4/Controller</code>"
msgstr "<code>/org/example/Foo4/Controller</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:513
msgid "<code>/org/example/Foo4/Client</code>"
msgstr "<code>/org/example/Foo4/Client</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:514
msgid "<code>/org/example/Foo5/Controller</code>"
msgstr "<code>/org/example/Foo5/Controller</code>"
#. (itstool) path: item/p
#: C/parallel-installability.page:515
msgid "<code>/org/example/Foo5/Client</code>"
msgstr "<code>/org/example/Foo5/Client</code>"
#. (itstool) path: section/title
#: C/parallel-installability.page:527
msgid "Programs, Daemons and Utilities"
msgstr "Programy, démoni a pomůcky"
#. (itstool) path: section/p
#: C/parallel-installability.page:529
msgid ""
"Desktop applications generally do not need to be versioned, as they are not "
"depended on by any other modules. Daemons and utility programs, however, "
"interact with other parts of the system and hence need versioning."
msgstr ""
"Grafické aplikace obecně nepotřebují být nainstalované ve více verzích, "
"protože na nich nezávisí další moduly. Démoni a pomocné programy ale "
"spolupracují s dalšími částmi systému, a tak číslování verzí v názvech "
"potřebují."
#. (itstool) path: section/p
#: C/parallel-installability.page:536
msgid "Given a daemon and utility program:"
msgstr "Mějme démona a pomocný program:"
#. (itstool) path: item/p
#: C/parallel-installability.page:540
msgid "<file>/usr/libexec/foo-daemon</file>"
msgstr "<file>/usr/libexec/foo-daemon</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:541
msgid "<file>/usr/bin/foo-lookup-utility</file>"
msgstr "<file>/usr/bin/foo-lookup-utility</file>"
#. (itstool) path: section/p
#: C/parallel-installability.page:543
msgid "these should be versioned as:"
msgstr "Číslo verze pak mohou mít přidělené jako:"
#. (itstool) path: item/p
#: C/parallel-installability.page:547
msgid "<file>/usr/libexec/foo-daemon-4</file>"
msgstr "<file>/usr/libexec/foo-daemon-4</file>"
#. (itstool) path: item/p
#: C/parallel-installability.page:548
msgid "<file>/usr/bin/foo-lookup-utility-4</file>"
msgstr "<file>/usr/bin/foo-lookup-utility-4</file>"
#. (itstool) path: section/p
#: C/parallel-installability.page:551
msgid ""
"You may want to install a symbolic link from <file>/usr/bin/foo-lookup-"
"utility</file> to the recommended versioned copy of the utility, to make it "
"more convenient for users to use."
msgstr ""
"Můžete nainstalovat symbolický odkaz z <file>/usr/bin/foo-lookup-utility</"
"file> na doporučovanou verzi kopie pomocného programu, aby se pohodlněji "
"používal uživatelům. "
#. (itstool) path: info/desc
#: C/preconditions.page:18
msgid "Contract programming with checks on function input and output"
msgstr "Kontraktové programování s kontrolami na vstupu a výstupu funkcí"
#. (itstool) path: page/title
#. (itstool) path: section/title
#: C/preconditions.page:21 C/preconditions.page:24
msgid "Pre- and Post-Conditions"
msgstr "Úvodní a závěrečné podmínky"
#. (itstool) path: section/p
#: C/preconditions.page:26
msgid ""
"An important part of secure coding is ensuring that incorrect data does not "
"propagate far through code — the further some malicious input can propagate, "
"the more code it sees, and the greater potential there is for an exploit to "
"be possible."
msgstr ""
"Důležitou zásadou bezpečného kódu je, že se nesprávná data nebudou programem "
"dále šířit – čím dále se vadný vstup může dostat, tím větší částí kódu "
"projde a potenciálně se zvyšuje možnost využít je k útoku."
#. (itstool) path: section/p
#: C/preconditions.page:33
msgid ""
"A standard way of preventing the propagation of invalid data is to check all "
"inputs to, and outputs from, all publicly visible functions in a library or "
"module. There are two levels of checking:"
msgstr ""
"Standardním způsobem předcházení šíření neplatných dat je kontrolovat "
"všechny vstupy do a výstupy ze všech veřejně viditelných funkcí v knihovně "
"nebo modulu. Existují dvě úrovně kontroly:"
#. (itstool) path: item/title
#: C/preconditions.page:40
msgid "Assertions"
msgstr "Aserce"
#. (itstool) path: item/p
#: C/preconditions.page:41
msgid "Check for programmer errors and abort the program on failure."
msgstr "Kontrolují programové chyby a při selhání program přeruší."
#. (itstool) path: item/title
#: C/preconditions.page:46
msgid "Validation"
msgstr "Validace"
#. (itstool) path: item/p
#: C/preconditions.page:47
msgid "Check for invalid input and return an error gracefully on failure."
msgstr "Kontrolují neplatný vstup a při selhání vhodně vracejí chybu."
#. (itstool) path: section/p
#: C/preconditions.page:53
msgid ""
"Validation is a complex topic, and is handled using <link xref=\"gerror"
"\">GErrors</link>. The remainder of this section discusses pre- and post-"
"condition assertions, which are purely for catching programmer errors. A "
"programmer error is where a function is called in a way which is documented "
"as disallowed. For example, if <code>NULL</code> is passed to a parameter "
"which is documented as requiring a non-<code>NULL</code> value to be passed; "
"or if a negative value is passed to a function which requires a positive "
"value. Programmer errors can happen on output too — for example, returning "
"<code>NULL</code> when it is not documented to, or not setting a GError "
"output when it fails."
msgstr ""
"Validace je náročná záležitost, která se řeší pomocí <link xref=\"gerror"
"\">GErrors</link>. Zbývající část tohoto oddílu rozebírá úvodní a koncové "
"podmínky asercí, které jsou určené čistě pro odhalování chyb programátora. "
"Programátorskou chybou je, když je funkce zavolána způsobem, který je v "
"dokumentaci uvedený jako zakázaný. Například když je předána hodnota "
"<code>NULL</code> v parametru, pro který je uvedeno, že vyžaduje hodnotu, "
"která není <code>NULL</code>, nebo když je předána záporná hodnota v "
"parametru, který vyžaduje kladnou hodnotu. Programátorské chyby mohou nastat "
"i na výstupu, například návratová hodnota <code>NULL</code>, když není "
"uvedená v dokumentaci, nebo když není nastaven výstup GError při selhání."
#. (itstool) path: section/p
#: C/preconditions.page:67
msgid ""
"Adding pre- and post-condition assertions to code is as much about ensuring "
"the behavior of each function is correctly and completely documented as it "
"is about adding the assertions themselves. All assertions should be "
"documented, preferably by using the relevant <link xref=\"introspection"
"\">introspection annotations</link>, such as <code>(nullable)</code>."
msgstr ""
"Přidání úvodních a koncových podmínek asercí do kódu je hlavně o zajištění "
"správného chování a jeho podrobného uvedení v dokumentaci, než o vlastním "
"přidání asercí. Všechny aserce by měly být zdokumentované, nejlépe pomocí "
"příslušné <link xref=\"introspection\">anotace k introspekci</link>, jako je "
"<code>(nullable)</code>."
#. (itstool) path: section/p
#: C/preconditions.page:76
msgid ""
"Pre- and post-condition assertions are implemented using <link href="
"\"https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions."
"html#g-return-if-fail\"><code>g_return_if_fail()</code></link> and <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions."
"html#g-return-val-if-fail\"><code>g_return_val_if_fail()</code></link>."
msgstr ""
"Úvodní a závěrečné podmínky asercí jsou implementovány pomocí <link href="
"\"https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions."
"html#g-return-if-fail\"><code>g_return_if_fail()</code></link> a <link href="
"\"https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions."
"html#g-return-val-if-fail\"><code>g_return_val_if_fail()</code></link>."
#. (itstool) path: section/p
#: C/preconditions.page:83
msgid ""
"The pre-conditions should check each parameter at the start of the function, "
"before any other code is executed (even retrieving the private data "
"structure from a GObject, for example, since the GObject pointer could be "
"<code>NULL</code>). The post-conditions should check the return value and "
"any output parameters at the end of the function — this requires a single "
"<code>return</code> statement and use of <code>goto</code> to merge other "
"control paths into it. See <link xref=\"memory-management#single-path-cleanup"
"\"/> for an example."
msgstr ""
"Úvodní podmínky by měly kontrolovat jednotlivé parametry hned na začátku "
"funkce, dříve než je proveden jakýkoliv další kód (i třeba načtení privátní "
"datové struktury z GObject, protože by například mohl mít ukazatel na "
"GObject hodnotu <code>NULL</code>). Koncové podmínky by měly kontrolovat "
"návratovou hodnotu a případné výstupní parametry na konci funkce, což "
"vyžaduje jediný výraz <code>return</code> a použití příkazu <code>goto</"
"code> pro sloučení ostatních průchodových cest do něj. Příklad viz <link "
"xref=\"memory-management#single-path-cleanup\"/>."
#. (itstool) path: info/desc
#: C/threading.page:18
msgid "Moving computation out of the main thread into worker threads"
msgstr "Přesun výpočtů mimo hlavní vlákno do pracovních vláken"
#. (itstool) path: page/title
#: C/threading.page:21
msgid "Threading"
msgstr "Vlákna"
#. (itstool) path: item/p
#: C/threading.page:27
msgid ""
"Do not use threads if at all possible. (<link xref=\"#when-to-use-threading"
"\"/>)"
msgstr ""
"Pokud je to možné, vlákna nepoužívejte (<link xref=\"#when-to-use-threading"
"\"/>)"
#. (itstool) path: item/p
#: C/threading.page:31
msgid ""
"If threads have to be used, use <code>GTask</code> or <code>GThreadPool</"
"code> and isolate the threaded code as much as possible. (<link xref="
"\"#using-threading\"/>)"
msgstr ""
"Pokud vlákna použít musíte, použijte <code>GTask</code> nebo "
"<code>GThreadPool</code> a kód vlákna izolujte co nejvíce je možné. (<link "
"xref=\"#using-threading\"/>)"
#. (itstool) path: item/p
#: C/threading.page:37
msgid ""
"Use <code>g_thread_join()</code> to avoid leaking thread resources if using "
"<code>GThread</code> manually. (<link xref=\"#using-threading\"/>)"
msgstr ""
"Při ručním požití <code>GThread</code> používejte <code>g_thread_join()</"
"code>, abyste předešli únikům prostředků vlákna. (<link xref=\"#using-"
"threading\"/>)"
#. (itstool) path: item/p
#: C/threading.page:42
msgid ""
"Be careful about the <code>GMainContext</code> which code is executed in if "
"using threads. Executing code in the wrong context can cause race "
"conditions, or block the main loop. (<link xref=\"#using-threading\"/>)"
msgstr ""
"Při použití vláken dávejte pozor, jaký kód spouštíte v <code>GMainContext</"
"code>. Spuštění kódu v nesprávném kontextu může způsobit souběh podmínek "
"nebo blokování hlavní smyčky. (<link xref=\"#using-threading\"/>)"
#. (itstool) path: section/title
#: C/threading.page:52
msgid "When to Use Threading"
msgstr "Kdy použít vlákna"
#. (itstool) path: section/p
#: C/threading.page:54
msgid ""
"When writing projects using GLib, the default approach should be to <em "
"style=\"strong\">never use threads</em>. Instead, make proper use of the "
"<link xref=\"main-contexts\">GLib main context</link> which, through the use "
"of <link xref=\"async-programming\">asynchronous operations</link>, allows "
"most blocking I/O operations to continue in the background while the main "
"context continues to process other events. Analysis, review and debugging of "
"threaded code becomes very hard, very quickly."
msgstr ""
"Když píšete projekty s pomocí GLib, mělo by být výchozím přístupem pravidlo "
"<em style=\"strong\">nikdy nepoužívat vlákna</em>. Místo toho správně "
"používejte <link xref=\"main-contexts\">hlavní kontext GLib</link>, který, "
"skrz použití <link xref=\"async-programming\">asynchronních operací</link>, "
"umožňuje většině blokujících V/V operací pokračovat na pozadí, zatímco "
"hlavní kontext pokračuje ve zpracování dalších událostí. Analýza, kontrola a "
"ladění programového kódu vláken se velmi rychle dokáže zvrhnout ve velmi "
"složitou věc."
#. (itstool) path: section/p
#: C/threading.page:64
msgid ""
"Threading should only be necessary when using an external library which has "
"blocking functions which need to be called from GLib code. If the library "
"provides a non-blocking alternative, or one which integrates with a <link "
"href=\"http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html"
"\"><code>poll()</code></link> loop, that should be used in preference. If "
"the blocking function really must be used, a thin wrapper should be written "
"for it to convert it to the normal <link href=\"https://developer.gnome.org/"
"gio/stable/GAsyncResult.html\"><code>GAsyncResult</code> style</link> of "
"GLib asynchronous function, running the blocking operation in a worker "
"thread."
msgstr ""
"Vlákna by se měla používat jen, když je to nutné kvůli externí knihovně, "
"která má blokující funkce, které potřebujete volat z kódu GLib. Jestliže "
"knihovna poskytuje neblokující variantu, nebo nějakou integrovanou se "
"smyčkou <link href=\"http://pubs.opengroup.org/onlinepubs/009695399/"
"functions/poll.html\"><code>poll()</code></link>, měli byste takové variantě "
"dát přednost. Pokud musíte opravdu použít blokující funkci, měli byste k ní "
"napsat tenký obalující kód, který ji převede na běžnou asynchronní funkci ve "
"<link href=\"https://developer.gnome.org/gio/stable/GAsyncResult.html"
"\">stylu <code>GAsyncResult</code></link> z GLib, a který spustí blokující "
"operaci v pracovním vlákně."
#. (itstool) path: example/code
#: C/threading.page:82
#, no-wrap
msgid ""
"\n"
"int\n"
"some_blocking_function (void *param1,\n"
" void *param2);\n"
msgstr ""
"\n"
"int\n"
"some_blocking_function (void *param1,\n"
" void *param2);\n"
#. (itstool) path: example/p
#: C/threading.page:87
msgid "Should be wrapped as:"
msgstr "By měla být obalena jako:"
#. (itstool) path: example/code
#: C/threading.page:90
#, no-wrap
msgid ""
"\n"
"void\n"
"some_blocking_function_async (void *param1,\n"
" void *param2,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n"
"int\n"
"some_blocking_function_finish (GAsyncResult *result,\n"
" GError **error);\n"
msgstr ""
"\n"
"void\n"
"some_blocking_function_async (void *param1,\n"
" void *param2,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data);\n"
"int\n"
"some_blocking_function_finish (GAsyncResult *result,\n"
" GError **error);\n"
#. (itstool) path: example/p
#: C/threading.page:102
msgid "With an implementation something like:"
msgstr "S nějakou takovouto implementací:"
#. (itstool) path: example/code
#: C/threading.page:105
#, no-wrap
msgid ""
"/* Closure for the call’s parameters. */\n"
"typedef struct {\n"
" void *param1;\n"
" void *param2;\n"
"} SomeBlockingFunctionData;\n"
"\n"
"static void\n"
"some_blocking_function_data_free (SomeBlockingFunctionData *data)\n"
"{\n"
" free_param (data->param1);\n"
" free_param (data->param2);\n"
"\n"
" g_free (data);\n"
"}\n"
"\n"
"static void\n"
"some_blocking_function_thread_cb (GTask *task,\n"
" gpointer source_object,\n"
" gpointer task_data,\n"
" GCancellable *cancellable)\n"
"{\n"
" SomeBlockingFunctionData *data = task_data;\n"
" int retval;\n"
"\n"
" /* Handle cancellation. */\n"
" if (g_task_return_error_if_cancelled (task))\n"
" {\n"
" return;\n"
" }\n"
"\n"
" /* Run the blocking function. */\n"
" retval = some_blocking_function (data->param1, data->param2);\n"
" g_task_return_int (task, retval);\n"
"}\n"
"\n"
"void\n"
"some_blocking_function_async (void *param1,\n"
" void *param2,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" GTask *task = NULL; /* owned */\n"
" SomeBlockingFunctionData *data = NULL; /* owned */\n"
"\n"
" g_return_if_fail (validate_param (param1));\n"
" g_return_if_fail (validate_param (param2));\n"
" g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));\n"
"\n"
" task = g_task_new (NULL, cancellable, callback, user_data);\n"
" g_task_set_source_tag (task, some_blocking_function_async);\n"
"\n"
" /* Cancellation should be handled manually using mechanisms specific to\n"
" * some_blocking_function(). */\n"
" g_task_set_return_on_cancel (task, FALSE);\n"
"\n"
" /* Set up a closure containing the call’s parameters. Copy them to avoid\n"
" * locking issues between the calling thread and the worker thread. */\n"
" data = g_new0 (SomeBlockingFunctionData, 1);\n"
" data->param1 = copy_param (param1);\n"
" data->param2 = copy_param (param2);\n"
"\n"
" g_task_set_task_data (task, data, some_blocking_function_data_free);\n"
"\n"
" /* Run the task in a worker thread and return immediately while that continues\n"
" * in the background. When it’s done it will call @callback in the current\n"
" * thread default main context. */\n"
" g_task_run_in_thread (task, some_blocking_function_thread_cb);\n"
"\n"
" g_object_unref (task);\n"
"}\n"
"\n"
"int\n"
"some_blocking_function_finish (GAsyncResult *result,\n"
" GError **error)\n"
"{\n"
" g_return_val_if_fail (g_task_is_valid (result,\n"
" some_blocking_function_async), -1);\n"
" g_return_val_if_fail (error == NULL || *error == NULL, -1);\n"
"\n"
" return g_task_propagate_int (G_TASK (result), error);\n"
"}"
msgstr ""
"/* Zapouzdření pro parametry volání */\n"
"typedef struct {\n"
" void *param1;\n"
" void *param2;\n"
"} SomeBlockingFunctionData;\n"
"\n"
"static void\n"
"some_blocking_function_data_free (SomeBlockingFunctionData *data)\n"
"{\n"
" free_param (data->param1);\n"
" free_param (data->param2);\n"
"\n"
" g_free (data);\n"
"}\n"
"\n"
"static void\n"
"some_blocking_function_thread_cb (GTask *task,\n"
" gpointer source_object,\n"
" gpointer task_data,\n"
" GCancellable *cancellable)\n"
"{\n"
" SomeBlockingFunctionData *data = task_data;\n"
" int retval;\n"
"\n"
" /* Obsluha zrušení */\n"
" if (g_task_return_error_if_cancelled (task))\n"
" {\n"
" return;\n"
" }\n"
"\n"
" /* Spuštění blokující funkce */\n"
" retval = some_blocking_function (data->param1, data->param2);\n"
" g_task_return_int (task, retval);\n"
"}\n"
"\n"
"void\n"
"some_blocking_function_async (void *param1,\n"
" void *param2,\n"
" GCancellable *cancellable,\n"
" GAsyncReadyCallback callback,\n"
" gpointer user_data)\n"
"{\n"
" GTask *task = NULL; /* vlastněno */\n"
" SomeBlockingFunctionData *data = NULL; /* vlastněno */\n"
"\n"
" g_return_if_fail (validate_param (param1));\n"
" g_return_if_fail (validate_param (param2));\n"
" g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));\n"
"\n"
" task = g_task_new (NULL, cancellable, callback, user_data);\n"
" g_task_set_source_tag (task, some_blocking_function_async);\n"
"\n"
" /* Zrušení by mělo být obslouženo ručně pomocí mechanizmu určeného\n"
" * konkrétně pro some_blocking_function(). */\n"
" g_task_set_return_on_cancel (task, FALSE);\n"
"\n"
" /* Nastaví zapouzdření obsahující parametry volání. Zkopíruje je, aby se\n"
" * předešlo problémům se zamykáním mezi volajícím vláknem a pracovním vláknem */\n"
" data = g_new0 (SomeBlockingFunctionData, 1);\n"
" data->param1 = copy_param (param1);\n"
" data->param2 = copy_param (param2);\n"
"\n"
" g_task_set_task_data (task, data, some_blocking_function_data_free);\n"
"\n"
" /* Spustí úlohu v pracovním vlákně a ihned se vrátí, zatímco zpracování\n"
" * pokračuje na pozadí. Když je dokončeno, je zavolána funkce @callback\n"
" * ve výchozím hlavním kontextu aktuálního vlákna */\n"
" g_task_run_in_thread (task, some_blocking_function_thread_cb);\n"
"\n"
" g_object_unref (task);\n"
"}\n"
"\n"
"int\n"
"some_blocking_function_finish (GAsyncResult *result,\n"
" GError **error)\n"
"{\n"
" g_return_val_if_fail (g_task_is_valid (result,\n"
" some_blocking_function_async), -1);\n"
" g_return_val_if_fail (error == NULL || *error == NULL, -1);\n"
"\n"
" return g_task_propagate_int (G_TASK (result), error);\n"
"}"
#. (itstool) path: example/p
#: C/threading.page:187
msgid ""
"See the <link href=\"https://developer.gnome.org/gio/stable/GAsyncResult.html"
"\"><code>GAsyncResult</code> documentation</link> for more details. A simple "
"way to implement the worker thread is to use <link href=\"https://developer."
"gnome.org/gio/stable/GTask.html\"><code>GTask</code></link> and <link href="
"\"https://developer.gnome.org/gio/stable/GTask.html#g-task-run-in-thread"
"\"><code>g_task_run_in_thread()</code></link>. (See also: <link xref=\"main-"
"contexts#gtask\"/>.)"
msgstr ""
"Další podrobnosti viz <link href=\"https://developer.gnome.org/gio/stable/"
"GAsyncResult.html\">dokumentace k <code>GAsyncResult</code></link>. "
"Jednoduchým způsobem, jak implementovat pracovní vlákno, je <link href="
"\"https://developer.gnome.org/gio/stable/GTask.html\"><code>GTask</code></"
"link> a <link href=\"https://developer.gnome.org/gio/stable/GTask.html#g-"
"task-run-in-thread\"><code>g_task_run_in_thread()</code></link>. (Viz také "
"<link xref=\"main-contexts#gtask\"/>.)"
#. (itstool) path: section/title
#: C/threading.page:200
msgid "Using Threading"
msgstr "Používání vláken"
#. (itstool) path: section/p
#: C/threading.page:202
msgid ""
"If <code>GTask</code> is not suitable for writing the worker thread, a more "
"low-level approach must be used. This should be considered very carefully, "
"as it is very easy to get threading code wrong in ways which will "
"unpredictably cause bugs at runtime, cause deadlocks, or consume too many "
"resources and terminate the program."
msgstr ""
"Pokud není pro napsání pracovního vlákna použitelný <code>GTask</code>, musí "
"být použit přístup na nižší úrovni. To ale hodně dobře zvažte, protože je "
"velmi snadné napsat kód vlákna nesprávným způsobem, který způsobí za běhu "
"nepředvidatelné chyby, nekonečné zámky nebo spotřebu přílišného množství "
"prostředků a ukončení programu."
#. (itstool) path: section/p
#: C/threading.page:210
msgid ""
"A full manual on writing threaded code is beyond the scope of this document, "
"but here are a number of guidelines to follow which should reduce the "
"potential for bugs in threading code. The overriding principle is to reduce "
"the amount of code and data which can be affected by threading — for "
"example, reducing the number of threads, the complexity of worker thread "
"implementation, and the amount of data shared between threads."
msgstr ""
"Kompletní návod pro psaní vláken je mimo rozsah tohoto dokumentu, ale "
"existuje řada dalších příruček, podle kterých se můžete řídit, abyste "
"omezili vznik potenciálních chyb v kódu vlákna. Obecným principem je omezit "
"množství kódu a dat, které budou vláknem ovlivněny. Například omezením počtu "
"vláken, složitosti implementace pracovního vlákna a množství dat sdílených "
"mezi vlákny."
#. (itstool) path: item/p
#: C/threading.page:222
msgid ""
"Use <link href=\"https://developer.gnome.org/glib/stable/glib-Thread-Pools."
"html\"><code>GThreadPool</code></link> instead of manually creating <link "
"href=\"https://developer.gnome.org/glib/stable/glib-Threads.html"
"\"><code>GThread</code>s</link> if possible. <code>GThreadPool</code> "
"supports a work queue, limits on the number of spawned threads, and "
"automatically joins finished threads so they are not leaked."
msgstr ""
"Pokud je to možné, použijte místo ručního vytváření svých <link href="
"\"https://developer.gnome.org/glib/stable/glib-Threads.html\"><code>GThread</"
"code></link> třídu <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Thread-Pools.html\"><code>GThreadPool</code></link>. <code>GThreadPool</"
"code> podporuje pracovní fronty, omezení počtu spuštěných vláken a "
"automatické sloučení dokončených vláken, takže nedochází k jejich úniku."
#. (itstool) path: item/p
#: C/threading.page:232
msgid ""
"If it is not possible to use a <code>GThreadPool</code> (which is rarely the "
"case):"
msgstr ""
"Kdy není možné použít <code>GThreadPool</code> (což je zřídkavý případ):"
#. (itstool) path: item/p
#: C/threading.page:239
msgid ""
"Use <link href=\"https://developer.gnome.org/glib/stable/glib-Threads.html#g-"
"thread-try-new\"><code>g_thread_try_new()</code></link> to spawn threads, "
"instead of <link href=\"https://developer.gnome.org/glib/stable/glib-Threads."
"html#g-thread-new\"><code>g_thread_new()</code></link>, so errors due to the "
"system running out of threads can be handled gracefully rather than "
"unconditionally aborting the program."
msgstr ""
"Použijte ke spuštění vlákna <link href=\"https://developer.gnome.org/glib/"
"stable/glib-Threads.html#g-thread-try-new\"><code>g_thread_try_new()</code></"
"link> namísto <link href=\"https://developer.gnome.org/glib/stable/glib-"
"Threads.html#g-thread-new\"><code>g_thread_new()</code></link>, a chyby "
"způsobené vybočením z vlákna pak můžete skvěle ošetřit, místo aby došlo k "
"nepodmíněnému přerušení programu."
#. (itstool) path: item/p
#: C/threading.page:248
msgid ""
"Explicitly join threads using <link href=\"https://developer.gnome.org/glib/"
"stable/glib-Threads.html#g-thread-join\"><code>g_thread_join()</code></link> "
"to avoid leaking the thread resources."
msgstr ""
"Výslovně spojte vlákna pomocí <link href=\"https://developer.gnome.org/glib/"
"stable/glib-Threads.html#g-thread-join\"><code>g_thread_join()</code></"
"link>, abyste předešli úniku prostředků vlákna."
#. (itstool) path: item/p
#: C/threading.page:257
msgid ""
"Use message passing to transfer data between threads, rather than manual "
"locking with mutexes. <code>GThreadPool</code> explicitly supports this with "
"<link href=\"https://developer.gnome.org/glib/stable/glib-Thread-Pools."
"html#g-thread-pool-push\"><code>g_thread_pool_push()</code></link>."
msgstr ""
"Místo ručního zamykání pomocí mutexů použijte raději předávání zpráv do dat "
"přenášených mezi vlákny. <code>GThreadPool</code> to vyloženě podporuje "
"pomocí <link href=\"https://developer.gnome.org/glib/stable/glib-Thread-"
"Pools.html#g-thread-pool-push\"><code>g_thread_pool_push()</code></link>."
#. (itstool) path: item/p
#: C/threading.page:265
msgid "If mutexes must be used:"
msgstr "Když se musí použít mutexy:"
#. (itstool) path: item/p
#: C/threading.page:271
msgid ""
"Isolate threading code as much as possible, keeping mutexes private within "
"classes, and tightly bound to very specific class members."
msgstr ""
"Programový kód vlákna izolujte co nejvíce to jde, mutexy udržujte v rámci "
"tříd privátní a pevně je spojte s velmi konkrétně zaměřenými členy třídy."
#. (itstool) path: item/p
#: C/threading.page:278
msgid ""
"All mutexes should be clearly commented beside their declaration, indicating "
"which other structures or variables they protect access to. Similarly, those "
"variables should be commented saying that they should <em>only</em> be "
"accessed with that mutex held."
msgstr ""
"U všech deklarací mutexů by měly být srozumitelné komentáře, ve kterých jsou "
"uvedeny struktury nebo proměnné, k nimž chrání přístup. A obdobně by u oněch "
"proměnných měl být komentář říkající, že by se k nim mělo přistupovat "
"<em>pouze</em> pomocí mutexu, který je drží."
#. (itstool) path: item/p
#: C/threading.page:288
msgid ""
"Be careful about interactions between main contexts and threads. For "
"example, <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-"
"Event-Loop.html#g-timeout-add-seconds\"><code>g_timeout_add_seconds()</"
"code></link> adds a timeout <em>to be executed in the global default main "
"context</em>, which is being run in the main thread, <em>not necessarily</"
"em> the current thread. Getting this wrong can mean that work intended for a "
"worker thread accidentally ends up being executed in the main thread anyway. "
"(See also: <link xref=\"main-contexts#default-contexts\"/>.)"
msgstr ""
"Buďte opatrní s interakcemi mezi hlavním kontextem a vlákny. Například "
"funkce <link href=\"https://developer.gnome.org/glib/stable/glib-The-Main-"
"Event-Loop.html#g-timeout-add-seconds\"><code>g_timeout_add_seconds()</"
"code></link> přidává časovač, <em>který bude spuštěn v globálním výchozím "
"hlavním kontextu</em>, který běží v hlavním vlákně, což <em>není nutně</em> "
"aktuální vlákno. Když se to udělá špatně, může to znamenat, že to co bylo "
"zamýšleno pro pracovní vlákno nešťastnou náhodou skončí spuštěné mimo v "
"hlavním vlákně. (Viz také: <link xref=\"main-contexts#default-contexts\"/>.)"
#. (itstool) path: section/title
#: C/threading.page:304
msgid "Debugging"
msgstr "Ladění"
#. (itstool) path: section/p
#: C/threading.page:306
msgid ""
"Debugging threading issues is tricky, both because they are hard to "
"reproduce, and because they are hard to reason about. This is one of the big "
"reasons for avoiding using threads in the first place."
msgstr ""
"Ladění vláken je poněkud zapeklité. Jednak protože se chyby těžko "
"reprodukují a jednak protože je těžké odhalit jejich původ. To je jeden z "
"hlavních důvodů, proč se vyhýbat vláknům a nevolit je jako první řešení."
#. (itstool) path: section/p
#: C/threading.page:312
msgid ""
"However, if a threading issue does arise, <link xref=\"tooling#helgrind-and-"
"drd\">Valgrind’s drd and helgrind tools are useful</link>."
msgstr ""
"Při výskytu takovéto chyby však mohou být <link xref=\"tooling#helgrind-and-"
"drd\">užitečné nástroje drd a helgrind z Valgrind</link>."
#. (itstool) path: info/desc
#: C/tooling.page:17
msgid "Using the right tool for various tasks"
msgstr "Použití správných nástrojů pro různé úkoly"
#. (itstool) path: page/title
#: C/tooling.page:20
msgid "Tooling"
msgstr "Nástroje"
#. (itstool) path: page/p
#: C/tooling.page:22
msgid ""
"Development tools are much more than just a text editor and a compiler. "
"Correct use of the right tools can drastically ease debugging and tracking "
"down of complex problems with memory allocation and system calls, amongst "
"other things. Some of the most commonly used tools are described below; "
"other tools exist for more specialized use cases, and should be used when "
"appropriate."
msgstr ""
"Vývojářskými nástroji nejsou jen textový editor a kompilátor. Správné "
"použití správných nástrojů může, mimo jiné, významně usnadnit ladění a "
"sledování složitých problémů s přidělováním paměti a systémovým voláním. "
"Některé z nejběžněji používaných nástrojů jsou popsány dále. Ostatní "
"existující nástroje jsou povětšinou pro specializovanější situace a měly by "
"být použity, když je to vhodné."
#. (itstool) path: page/p
#: C/tooling.page:31
msgid ""
"An overarching principle to use when developing is to always have as many "
"debugging options enabled as possible, rather than keeping them disabled "
"until near release time. By constantly testing code with all available debug "
"tooling, bugs can be caught early on, before they become ingrained in code "
"and thus harder to remove."
msgstr ""
"Obecný princip, který platí při vývoji, je mít vždy povoleno tolik ladicích "
"voleb, kolik je jen možné, a ne je mít vypnuté až do doby těsně před "
"vydáním. Tím že se kód neustále testuje všemi dostupnými ladicími nástroji, "
"zachytíte chyby již v zárodku, dřív než se zakoření hluboko do kódu a bude "
"těžší je odstranit."
#. (itstool) path: page/p
#: C/tooling.page:39
msgid ""
"Practically, this means having all compiler and other tool warnings enabled "
"and set to fail the build process with an error if they are emitted."
msgstr ""
"Prakticky to znamená, mít zapnutá varování u kompilátoru a všech dalších "
"nástrojů a zapnout selhání procesu sestavení s chybou při jejich výskytu."
#. (itstool) path: item/p
#: C/tooling.page:48
msgid ""
"Compile frequently with a second compiler. (<link xref=\"#gcc-and-clang\"/>)"
msgstr ""
"Kompilujte často pomocí druhého kompilátoru. (<link xref=\"#gcc-and-clang\"/"
">)"
#. (itstool) path: item/p
#: C/tooling.page:52
msgid ""
"Enable a large selection of compiler warnings and make them fatal. (<link "
"xref=\"#gcc-and-clang\"/>)"
msgstr ""
"Povolte co největší počet varování kompilátoru a nastavte je jako kritická. "
"(<link xref=\"#gcc-and-clang\"/>)"
#. (itstool) path: item/p
#: C/tooling.page:56
msgid "Use GDB to debug and step through code. (<link xref=\"#gdb\"/>)"
msgstr "Používejte GDB k ladění a krokování kódu. (<link xref=\"#gdb\"/>)"
#. (itstool) path: item/p
#: C/tooling.page:59
msgid ""
"Use Valgrind to analyze memory usage, memory errors, cache and CPU "
"performance and threading errors. (<link xref=\"#valgrind\"/>)"
msgstr ""
"Používejte Valgrind k analýze využití paměti, paměťových chyb, výkonu "
"mezipaměti a procesoru a chyb s vlákny. (<link xref=\"#valgrind\"/>)"
#. (itstool) path: item/p
#: C/tooling.page:63
msgid ""
"Use gcov and lcov to analyze unit test coverage. (<link xref=\"#gcov-and-lcov"
"\"/>)"
msgstr ""
"Používejte gcov a lcov k pokrytí analytickými jednotkovými testy. (<link "
"xref=\"#gcov-and-lcov\"/>)"
#. (itstool) path: item/p
#: C/tooling.page:67
msgid ""
"Use compiler sanitizers to analyze memory, thread and undefined behavior "
"problems. (<link xref=\"#sanitizers\"/>)"
msgstr ""
"Používejte sanitizéry k analýze problémů s pamětí, vlákny a nedefinovaným "
"chováním. (<link xref=\"#sanitizers\"/>)"
#. (itstool) path: item/p
#: C/tooling.page:71
msgid ""
"Submit to Coverity as a cronjob and eliminate static analysis errors as they "
"appear. (<link xref=\"#coverity\"/>)"
msgstr ""
"Kontrolu pomocí Coverity provádějte jako pravidelnou úlohu a chyby statické "
"analýzy odstraňte hned, jak se objeví. (<link xref=\"#coverity\"/>)"
#. (itstool) path: item/p
#: C/tooling.page:75
msgid ""
"Use Clang static analyzer and Tartan regularly to eliminate statically "
"analysable errors locally. (<link xref=\"#clang-static-analyzer\"/>)"
msgstr ""
"Používejte pravidelně statický analyzátor Clang a Tartan k odstranění "
"místních chyb, které lze analyzovat staticky. (<link xref=\"#clang-static-"
"analyzer\"/>)"
#. (itstool) path: section/title
#: C/tooling.page:83
msgid "GCC and Clang"
msgstr "GCC a Clang"
#. (itstool) path: section/p
#: C/tooling.page:85
msgid ""
"<link href=\"https://gcc.gnu.org/onlinedocs/gcc/\">GCC</link> is the "
"standard C compiler for Linux. An alternative exists in the form of <link "
"href=\"http://clang.llvm.org/docs/UsersManual.html\">Clang</link>, with "
"comparable functionality. Choose one (probably GCC) to use as a main "
"compiler, but occasionally use the other to compile the code, as the two "
"detect slightly different sets of errors and warnings in code. Clang also "
"comes with a static analyzer tool which can be used to detect errors in code "
"without compiling or running it; see <link xref=\"#clang-static-analyzer\"/>."
msgstr ""
"<link href=\"https://gcc.gnu.org/onlinedocs/gcc/\">GCC</link> je standardní "
"kompilátor pro Linux. Existuje i alternativa v podobě kompilátoru <link href="
"\"http://clang.llvm.org/docs/UsersManual.html\">Clang</link> s obdobnou "
"funkcionalitou. Jeden z nich (nejspíše GCC) si zvolte jako hlavní, ale "
"příležitostně provádějte kompilaci kódu i druhým, abyste objevili trochu "
"jinou skupinu chyb a varování v kódu. Clang dáva k dispozici také nástroj "
"pro statickou analýzu, který můžete použít k odhalení chyb v kódu bez jeho "
"kompilace nebo spuštění. Viz <link xref=\"#clang-static-analyzer\"/>."
#. (itstool) path: section/p
#: C/tooling.page:97
msgid ""
"Both compilers should be used with as many warning flags enabled as "
"possible. Although compiler warnings do occasionally provide false "
"positives, most warnings legitimately point to problems in the code, and "
"hence should be fixed rather than ignored. A development policy of enabling "
"all warning flags and also specifying the <code>-Werror</code> flag (which "
"makes all warnings fatal to compilation) promotes fixing warnings as soon as "
"they are introduced. This helps code quality. The alternative of ignoring "
"warnings leads to long debugging sessions to track down bugs caused by "
"issues which would have been flagged up by the warnings. Similarly, ignoring "
"warnings until the end of the development cycle, then spending a block of "
"time enabling and fixing them all wastes time."
msgstr ""
"Oba dva kompilátory by se měly používat s co nejvíce zapnutými přepínači "
"varování je možné. Přestože kompilátor může příležitostně poskytnout falešné "
"varování, většina varování oprávněně ukazuje na problém v programovém kódu a "
"proto by měla být opravena, a ne ignorována. Zásadou pro vývojáře je zapnout "
"co nejvíce přepínačů varování a rovněž zadat <code>-Werror</code> (ten "
"způsobí, že všechna varování způsobí selhání kompilace), aby byli přinuceni "
"opravit varování hned, jak se objeví. To pomáhá zvyšovat kvalitu kódu. "
"Naopak ignorování varování vede ve výsledků ke zdlouhavému ladění kvůli "
"vyhledání chyby, která je způsobená problémem, který byl již dříve označen "
"varováním. Stejně tak, když budete ignorovat varování až do konce vývojového "
"cyklu, strávíte násobně více času jejich opravami na závěr."
#. (itstool) path: section/p
#: C/tooling.page:112
msgid ""
"Both GCC and Clang support a wide range of compiler flags, only some of "
"which are related to modern, multi-purpose code (for example, others are "
"outdated or architecture-specific). Finding a reasonable set of flags to "
"enable can be tricky, and hence the <link href=\"http://www.gnu.org/software/"
"autoconf-archive/ax_compiler_flags.html\"> <code>AX_COMPILER_FLAGS</code></"
"link> macro exists."
msgstr ""
"Jak GCC, tak Clang, podporují velké množství přepínačů, ale jen některé z "
"nich se vztahují k modernímu víceúčelovému kódu (ostatní jsou například "
"zastaralé nebo závislé na architektuře). Najít vhodnou sadu přepínačů, které "
"je třeba zapnout, může být trochu magie, a proto existuje makro <link href="
"\"http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html\"> "
"<code>AX_COMPILER_FLAGS</code></link>."
#. (itstool) path: section/p
#: C/tooling.page:121
msgid ""
"<code>AX_COMPILER_FLAGS</code> enables a consistent set of compiler "
"warnings, and also tests that the compiler supports each flag before "
"enabling it. This accounts for differences in the set of flags supported by "
"GCC and Clang. To use it, add <code>AX_COMPILER_FLAGS</code> to "
"<file>configure.ac</file>. If you are using in-tree copies of autoconf-"
"archive macros, copy <link href=\"http://git.savannah.gnu.org/gitweb/?"
"p=autoconf-archive.git;a=blob_plain;f=m4/ax_compiler_flags.m4\"> "
"<file>ax_compiler_flags.m4</file></link> to the <file>m4/</file> directory "
"of your project. Note that it depends on the following autoconf-archive "
"macros which are GPL-licensed so potentially cannot be copied in-tree. They "
"may have to remain in autoconf-archive, with that as a build time dependency "
"of the project:"
msgstr ""
"<code>AX_COMPILER_FLAGS</code> zapíná jednotnou sadu varování kompilátoru a "
"také, před tím než je zapne, jednotlivě testuje, jestli je kompilátor "
"podporuje. Vyrovnává se tím s rozdíly mezi překladači GCC a Clang v sadě "
"podporovaných přepínačů. Pro použití stačí přidat <code>AX_COMPILER_FLAGS</"
"code> do <file>configure.ac</file>. Pokud používáte kopii maker autoconf-"
"archive ve stromu se zdrojovými kódy, zkopírujte <link href=\"http://git."
"savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/"
"ax_compiler_flags.m4\"><file>ax_compiler_flags.m4</file></link> do složky "
"<file>m4</file> ve svém projektu. Mějte na paměti, že závisí na "
"následujících makrech z autoconf-archive, která jsou pod licenci GPL, takže "
"existuje možnost, že z licenčních důvodů je nebudete moci nakopírovat. Pak "
"je budete muset ponechat v autoconf-archive, který pak bude závislostí pro "
"sestavovací proces projektu:"
#. (itstool) path: item/p
#: C/tooling.page:136
msgid "<code>ax_append_compile_flags.m4</code>"
msgstr "<code>ax_append_compile_flags.m4</code>"
#. (itstool) path: item/p
#: C/tooling.page:137
msgid "<code>ax_append_flag.m4</code>"
msgstr "<code>ax_append_flag.m4</code>"
#. (itstool) path: item/p
#: C/tooling.page:138
msgid "<code>ax_check_compile_flag.m4</code>"
msgstr "<code>ax_check_compile_flag.m4</code>"
#. (itstool) path: item/p
#: C/tooling.page:139
msgid "<code>ax_require_defined.m4</code>"
msgstr "<code>ax_require_defined.m4</code>"
#. (itstool) path: section/p
#: C/tooling.page:142
msgid ""
"<code>AX_COMPILER_FLAGS</code> supports disabling <code>-Werror</code> for "
"release builds, so that releases may always be built against newer compilers "
"which have introduced more warnings. Set its third parameter to ‘yes’ for "
"release builds (and only release builds) to enable this functionality. "
"Development and CI builds should always have <code>-Werror</code> enabled."
msgstr ""
"<code>AX_COMPILER_FLAGS</code> podporuje vypnutí <code>-Werror</code> u "
"sestavení pro vydání, takže tato vydání mohou být vždy sestavena oproti "
"novějšímu kompilátoru, který může mít zavedeno více varování. Pro zapnutí "
"této funkce nastavte u sestavení pro vydání (a jen u nich) jeho třetí "
"parametr na „yes“. Vývojová sestavení a sestavení průběžné integrace by měla "
"mít přepínač <code>-Werror</code> vždy zapnutý."
#. (itstool) path: section/p
#: C/tooling.page:151
msgid ""
"Release builds can be detected using the <link href=\"http://www.gnu.org/"
"software/autoconf-archive/ax_is_release.html\"><code>AX_IS_RELEASE</code></"
"link> macro, the result of which can be passed directly to "
"<code>AX_COMPILER_FLAGS</code>:"
msgstr ""
"Sestavení pro vydání lze detekovat pomocí makra <link href=\"http://www.gnu."
"org/software/autoconf-archive/ax_is_release.html\"><code>AX_IS_RELEASE</"
"code></link>, jehož výsledek můžete předat přímo do <code>AX_COMPILER_FLAGS</"
"code>:"
#. (itstool) path: section/code
#: C/tooling.page:157
#, no-wrap
msgid ""
"AX_IS_RELEASE([git])\n"
"AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS],[$ax_is_release])"
msgstr ""
"AX_IS_RELEASE([git])\n"
"AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS],[$ax_is_release])"
#. (itstool) path: section/p
#: C/tooling.page:160
msgid ""
"The choice of release stability policy (the first argument to "
"<code>AX_IS_RELEASE</code>) should be made per project, taking the project’s "
"<link xref=\"versioning\">versioning stability</link> into account."
msgstr ""
"Volba zásad pro stabilitu vydání (první argument pro <code>AX_IS_RELEASE</"
"code>) by měla být prováděna pro každý projekt zvlášť, přičemž je třeba brát "
"do úvahy <link xref=\"versioning\">číslování verzí podle stability</link>."
#. (itstool) path: section/title
#: C/tooling.page:169
msgid "GDB"
msgstr "GDB"
#. (itstool) path: section/p
#: C/tooling.page:171
msgid ""
"GDB is the standard debugger for C on Linux. Its most common uses are for "
"debugging crashes, and for stepping through code as it executes. A full "
"tutorial for using GDB is given <link href=\"https://sourceware.org/gdb/"
"current/onlinedocs/gdb/\"> here</link>."
msgstr ""
"GDB je standardní ladicí program pro C v Linuxu. Je nejběžněji používán k "
"ladění pádů a ke krokování spuštěného kódu. Ucelený průvodce použitím GDB je "
"poskytnut <link href=\"https://sourceware.org/gdb/current/onlinedocs/gdb/"
"\">zde</link>."
#. (itstool) path: section/p
#: C/tooling.page:179
msgid ""
"To run GDB on a program from within the source tree, use: <cmd>libtool exec "
"gdb --args <var>./program-name</var> <var>--some --arguments --here</var></"
"cmd>"
msgstr ""
"Ke spuštění GDB vůči programu uvnitř stromu jeho zdrojových kódů použijte: "
"<cmd>libtool exec gdb --args <var>./nazev-programu</var> <var>--nejake --"
"jeho --argumenty</var></cmd>"
#. (itstool) path: section/p
#: C/tooling.page:184
msgid ""
"This is necessary due to libtool wrapping each compiled binary in the source "
"tree in a shell script which sets up some libtool variables. It is not "
"necessary for debugging installed executables."
msgstr ""
"Takto je to nutné z důvodu, aby libtool obalila ve stromu zdrojových kódů "
"každý zkompilovaný binární soubor do shellového skriptu, který nastaví "
"některé proměnné pro libtool. Není to zapotřebí pro ladění nainstalovaných "
"spustitelných souborů."
#. (itstool) path: section/p
#: C/tooling.page:190
msgid ""
"GDB has many advanced features which can be combined to essentially create "
"small debugging scripts, triggered by different breakpoints in code. "
"Sometimes this is a useful approach (for example, for <link href=\"https://"
"tecnocode.co.uk/2010/07/12/reference-count-debugging-with-gdb/\"> reference "
"count debugging</link>), but sometimes simply using <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Message-Logging.html#g-debug\"> "
"<code>g_debug()</code></link> to output a debug message is simpler."
msgstr ""
"GDB má spoustu pokročilých funkcí, které lze kombinovat, abyste v podstatě "
"vytvořili malé ladicí skripty, které se spouští v různých bodech přerušení v "
"kódu. Někdy se to opravdu hodí (například pro <link href=\"https://tecnocode."
"co.uk/2010/07/12/reference-count-debugging-with-gdb/\">ladění počítání "
"odkazů</link>), ale jindy je jednodušší použít prostě samotné <link href="
"\"https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-debug"
"\"> <code>g_debug()</code></link> pro výpis ladicích zpráv."
#. (itstool) path: section/title
#: C/tooling.page:202
msgid "Valgrind"
msgstr "Valgrind"
#. (itstool) path: section/p
#: C/tooling.page:204
msgid ""
"Valgrind is a suite of tools for instrumenting and profiling programs. Its "
"most famous tool is <link xref=\"#memcheck\">memcheck</link>, but it has "
"several other powerful and useful tools too. They are covered separately in "
"the sections below."
msgstr ""
"Valgrind je sada nástrojů pro měření a profilování programů. Jeho "
"nejznámějším nástrojem je <link xref=\"#memcheck\">memcheck</link>, ale má i "
"několik dalších mocných a užitečných nástrojů. Jednotlivě se jim věnují "
"následující oddíly."
#. (itstool) path: section/p
#: C/tooling.page:211
msgid ""
"A useful way of running Valgrind is to run a program’s unit test suite under "
"Valgrind, setting Valgrind to return a status code indicating the number of "
"errors it encountered. When run as part of <cmd>make check</cmd>, this will "
"cause the checks to succeed if Valgrind finds no problems, and fail "
"otherwise. However, running <cmd>make check</cmd> under Valgrind is not "
"trivial to do on the command line. A macro, <link href=\"http://www.gnu.org/"
"software/autoconf-archive/ax_valgrind_check.html\"> <code>AX_VALGRIND_CHECK</"
"code></link> can be used which adds a new <cmd>make check-valgrind</cmd> "
"target to automate this. To use it:"
msgstr ""
"Vhodným způsobem, jak spustit Valgrind, je spustit pod ním sadu jednotkových "
"testů programu a nastavit jej, aby vrátil stavový kód sdělující množství "
"napočítaných chyb. Když běží jako součást <cmd>make check</cmd>, způsobí to, "
"že je kontrola úspěšná, když Valgrind nenajde žádný problém a selže v "
"opačném případě. Avšak spuštění <cmd>make check</cmd> pod Valgrind není "
"jednoduché provést v příkazové řádce. Můžete použít makro <link href="
"\"http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html"
"\"><code>AX_VALGRIND_CHECK</code></link>, které přidá nový cíl <cmd>make "
"check-valgrind</cmd> pro zautomatizování. Použijte jej následovně:"
#. (itstool) path: item/p
#: C/tooling.page:224
msgid ""
"Copy <link href=\"http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;"
"a=blob_plain;f=m4/ax_valgrind_check.m4\"> <file>ax_valgrind_check.m4</file></"
"link> to the <file>m4/</file> directory of your project."
msgstr ""
"Zkopírujte <link href=\"http://git.savannah.gnu.org/gitweb/?p=autoconf-"
"archive.git;a=blob_plain;f=m4/ax_valgrind_check.m4\"> "
"<file>ax_valgrind_check.m4</file></link> do složky <file>m4/</file> ve svém "
"projektu."
#. (itstool) path: item/p
#: C/tooling.page:230
msgid "Add <code>AX_VALGRIND_CHECK</code> to <file>configure.ac</file>."
msgstr "Přidejte <code>AX_VALGRIND_CHECK</code> do <file>configure.ac</file>."
#. (itstool) path: item/p
#: C/tooling.page:233
msgid ""
"Add <code>@VALGRIND_CHECK_RULES@</code> to the <file>Makefile.am</file> in "
"each directory which contains unit tests."
msgstr ""
"Přidejte <code>@VALGRIND_CHECK_RULES@</code> do <file>Makefile.am</file> v "
"každé složce, která obsahuje jednotkové testy."
#. (itstool) path: section/p
#: C/tooling.page:239
msgid ""
"When <cmd>make check-valgrind</cmd> is run, it will save its results in "
"<file>test-suite-*.log</file>, one log file per tool. Note that you will "
"need to run it from the directory containing the unit tests."
msgstr ""
"Když je spuštěno <cmd>make check-valgrind</cmd>, uloží se jeho výsledky do "
"<file>test-suite-*.log</file>, jeden soubor se záznamem pro každý z "
"nástrojů. Nezapomeňte, že jej musíte spustit ve složce, která obsahuje "
"jednotkové testy."
#. (itstool) path: section/p
#: C/tooling.page:251
msgid ""
"Valgrind has a way to suppress false positives, by using <link href=\"http://"
"valgrind.org/docs/manual/manual-core.html#manual-core.suppress\"> "
"suppression files</link>. These list patterns which may match error stack "
"traces. If a stack trace from an error matches part of a suppression entry, "
"it is not reported. For various reasons, GLib currently causes a number of "
"false positives in <link xref=\"#memcheck\">memcheck</link> and <link xref="
"\"#helgrind-and-drd\">helgrind and drd</link> which must be suppressed by "
"default for Valgrind to be useful. For this reason, every project should use "
"a standard GLib suppression file as well as a project specific one."
msgstr ""
"Valgrind má způsob, jak potlačit falešná hlášení pomocí <link href=\"http://"
"valgrind.org/docs/manual/manual-core.html#manual-core.suppress"
"\">potlačovacích souborů</link>. V nich jsou uvedeny vzory, které mohou "
"odpovídat výpisům chyb zásobníku. Pokud výpis zásobníku pro nějakou chybu "
"odpovídá části potlačovacího záznamu, není nahlášen. Z jistých důvodů GLib v "
"současnosti způsobuje řadu falešných hlášení v nástrojích <link xref="
"\"#memcheck\">memcheck</link> a <link xref=\"#helgrind-and-drd\">helgrind a "
"drd</link>, která je potřeba standardně potlačovat, aby byl Valgrind vůbec "
"použitelný. Proto by měl každý projekt mimo svého vlastního potlačovacího "
"souboru používat i standardní potlačovací soubor pro GLib."
#. (itstool) path: section/p
#: C/tooling.page:264
msgid ""
"Suppression files are supported by the <code>AX_VALGRIND_CHECK</code> macro:"
msgstr ""
"Potlačovací soubory jsou podporovány pomocí makra <code>AX_VALGRIND_CHECK</"
"code>:"
#. (itstool) path: section/code
#: C/tooling.page:268
#, no-wrap
msgid ""
"@VALGRIND_CHECK_RULES@\n"
"VALGRIND_SUPPRESSIONS_FILES = my-project.supp glib.supp\n"
"EXTRA_DIST = $(VALGRIND_SUPPRESSIONS_FILES)"
msgstr ""
"@VALGRIND_CHECK_RULES@\n"
"VALGRIND_SUPPRESSIONS_FILES = my-project.supp glib.supp\n"
"EXTRA_DIST = $(VALGRIND_SUPPRESSIONS_FILES)"
#. (itstool) path: section/title
#: C/tooling.page:273
msgid "memcheck"
msgstr "memcheck"
#. (itstool) path: section/p
#: C/tooling.page:275
msgid ""
"memcheck is a memory usage and allocation analyzer. It detects problems with "
"memory accesses and modifications of the heap (allocations and frees). It is "
"a highly robust and mature tool, and its output can be entirely trusted. If "
"it says there is ‘definitely’ a memory leak, there is definitely a memory "
"leak which should be fixed. If it says there is ‘potentially’ a memory leak, "
"there may be a leak to be fixed, or it may be memory allocated at "
"initialization time and used throughout the life of the program without "
"needing to be freed."
msgstr ""
"memcheck je analyzátor využití a přidělování paměti. Zjišťuje problémy s "
"přístupem k paměti a změnami v haldě (přidělování a uvolňování). Jedná se o "
"robustní a zaběhnutý nástroj a jeho výstupům se dá vcelku důvěřovat. Když "
"oznámí, že se „určitě“ jedná o únik paměti, tak se určitě jedná o únik "
"paměti, který byste měli opravit. Když řekne, že se jedná o „potenciální“ "
"únik paměti, možná jde o únik, který byste měli opravit, nebo může jít o "
"přidělení paměti při počáteční inicializaci, které je pak používána po celou "
"dobu běhu programu a není potřeba ji uvolňovat."
#. (itstool) path: section/p
#: C/tooling.page:286
msgid "To run memcheck manually on an installed program, use:"
msgstr "K ručnímu spuštění memcheck vůči nainstalovanému programu použijte:"
#. (itstool) path: section/p
#: C/tooling.page:289
msgid ""
"<cmd>valgrind --tool=memcheck --leak-check=full <var>my-program-name</var></"
"cmd>"
msgstr ""
"<cmd>valgrind --tool=memcheck --leak-check=full <var>název-vašeho-programu</"
"var></cmd>"
#. (itstool) path: section/p
#: C/tooling.page:293
msgid ""
"Or, if running your program from the source directory, use the following to "
"avoid running leak checking on the libtool helper scripts:"
msgstr ""
"Nebo, když spouštíte svůj program ze složky se zdrojovými kódy, použijte "
"následující, abyste se vyhnuli kontrole úniků v pomocných skriptech libtool:"
#. (itstool) path: section/p
#: C/tooling.page:297
msgid ""
"<cmd>libtool exec valgrind --tool=memcheck --leak-check=full <var>./my-"
"program-name</var></cmd>"
msgstr ""
"<cmd>libtool exec valgrind --tool=memcheck --leak-check=full <var>./název-"
"vašeho-programu</var></cmd>"
#. (itstool) path: section/p
#: C/tooling.page:301
msgid ""
"Valgrind lists each memory problem it detects, along with a short backtrace "
"(if you’ve compiled your program with debug symbols), allowing the cause of "
"the memory error to be pinpointed and fixed."
msgstr ""
"Valgrind vypíše všechny zjištěné problémy s pamětí, včetně krátkého výpisu "
"zásobníku volání u každého z nich (za předpokladu, že jste program "
"zkompilovali s ladicími symboly), díky čemuž lze paměťovou chybu dohledat a "
"opravit."
#. (itstool) path: section/p
#: C/tooling.page:307
msgid ""
"A full tutorial on using memcheck is <link href=\"http://valgrind.org/docs/"
"manual/mc-manual.html\">here</link>."
msgstr ""
"Ucelený průvodce použitím nástroje memcheck je <link href=\"http://valgrind."
"org/docs/manual/mc-manual.html\">zde</link>."
#. (itstool) path: section/title
#: C/tooling.page:314
msgid "cachegrind and KCacheGrind"
msgstr "cachegrind a KCacheGrind"
#. (itstool) path: section/p
#: C/tooling.page:316
msgid ""
"cachegrind is a cache performance profiler which can also measure "
"instruction execution, and hence is very useful for profiling general "
"performance of a program. <link href=\"http://kcachegrind.sourceforge.net/"
"html/Home.html\"> KCacheGrind</link> is a useful UI for it which allows "
"visualization and exploration of the profiling data, and the two tools "
"should rarely be used separately."
msgstr ""
"cachegrind je profilovací nástroj výkonu mezipaměti, který může měřit také "
"provádění instrukcí a je tak velmi užitečný i pro profilování obecného "
"výkonu programu. <link href=\"http://kcachegrind.sourceforge.net/html/Home."
"html\"> KCacheGrind</link> je pak pro něj šikovné uživatelské rozhraní, "
"které provádí grafické znázornění a můžete v něm zkoumat profilovací data. "
"Tyto dva nástroje se tak obvykle používají dohromady."
#. (itstool) path: section/p
#: C/tooling.page:326
msgid ""
"cachegrind works by simulating the processor’s memory hierarchy, so there "
"are situations where it is <link href=\"http://valgrind.org/docs/manual/cg-"
"manual.html#cg-manual.annopts.accuracy\"> not perfectly accurate</link>. "
"However, its results are always representative enough to be very useful in "
"debugging performance hotspots."
msgstr ""
"cachegrind funguje pomocí simulace hierarchie paměti procesoru, takže "
"existují situace, kdy není <link href=\"http://valgrind.org/docs/manual/cg-"
"manual.html#cg-manual.annopts.accuracy\">zcela přesný</link>. Jeho výsledky "
"jsou však vždy dostatečně reprezentativní, aby byly užitečné pro ladění "
"výkonu v dotčených místech."
#. (itstool) path: section/p
#: C/tooling.page:335
msgid ""
"A full tutorial on using cachegrind is <link href=\"http://valgrind.org/docs/"
"manual/cg-manual.html\">here</link>."
msgstr ""
"Ucelený průvodce používáním nástroje cachegrind je <link href=\"http://"
"valgrind.org/docs/manual/cg-manual.html\">zde</link>."
#. (itstool) path: section/title
#: C/tooling.page:342
msgid "helgrind and drd"
msgstr "helgrind a drd"
#. (itstool) path: section/p
#: C/tooling.page:344
msgid ""
"helgrind and drd are threading error detectors, checking for race conditions "
"in memory accesses, and abuses of the <link href=\"http://pubs.opengroup.org/"
"onlinepubs/9699919799/basedefs/pthread.h.html\"> POSIX pthreads API</link>. "
"They are similar tools, but are implemented using different techniques, so "
"both should be used."
msgstr ""
"helgrind a drd slouží ke zjišťování chyb týkajících se vláken, ke kontrole "
"souběhových chyb v přístupu k paměti a chybného používání <link href="
"\"http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html"
"\">API vláken podle standardu POSIX</link>. Jedná se o dva podobné nástroje, "
"ale používající ke své práci rozdílné techniky, takže by se měly používat "
"oba."
#. (itstool) path: section/p
#: C/tooling.page:352
msgid ""
"The kinds of errors detected by helgrind and drd are: data accessed from "
"multiple threads without consistent locking, changes in lock acquisition "
"order, freeing a mutex while it is locked, locking a locked mutex, unlocking "
"an unlocked mutex, and several other errors. Each error, when detected, is "
"printed to the console in a little report, with a separate report giving the "
"allocation or spawning details of the mutexes or threads involved so that "
"their definitions can be found."
msgstr ""
"Druhy chyb detekované nástroji helgrind a drd jsou: přístup k datům z více "
"vláken bez jednotného zamykání, změny v pořadí získávání zámků, uvolňování "
"zamknutého mutexu, zamykání zamknutého mutexu, odemykání odemčeného mutexu a "
"několik dalších chyb. Každá chyba, která je objevena, je vypsána do konzole "
"v podobě drobné výstupní sestavy s oddělenu částí poskytující podrobnosti o "
"alokaci nebo vzniku mutexů nebo vláken, se kterými to souvisí, takže pak "
"můžete snadno najít jejich definici."
#. (itstool) path: section/p
#: C/tooling.page:362
msgid ""
"helgrind and drd can produce more false positives than memcheck or "
"cachegrind, so their output should be studied a little more carefully. "
"However, threading problems are notoriously elusive even to experienced "
"programmers, so helgrind and drd errors should not be dismissed lightly."
msgstr ""
"helgrind a drd produkují více falešných hlášení, než memcheck a cachegrind, "
"takže jejich výstupy je třeba prostudovat trochu obezřetněji. Problémy s "
"vlákny jsou ale notoricky těžko polapitelné i pro zkušené programátory, "
"takže tyto nástroje by neměly být jen tak zavrhnuty."
#. (itstool) path: section/p
#: C/tooling.page:369
msgid ""
"Full tutorials on using helgrind and drd are <link href=\"http://valgrind."
"org/docs/manual/hg-manual.html\">here</link> and <link href=\"http://"
"valgrind.org/docs/manual/drd-manual.html\"> here</link>."
msgstr ""
"Ucelení průvodci používáním helgrind a drd jsou <link href=\"http://valgrind."
"org/docs/manual/hg-manual.html\">zde</link> a <link href=\"http://valgrind."
"org/docs/manual/drd-manual.html\">zde</link>."
#. (itstool) path: section/title
#: C/tooling.page:378
msgid "sgcheck"
msgstr "sgcheck"
#. (itstool) path: section/p
#: C/tooling.page:380
msgid ""
"sgcheck is an array bounds checker, which detects accesses to arrays which "
"have overstepped the length of the array. However, it is a very young tool, "
"still marked as experimental, and hence may produce more false positives "
"than other tools."
msgstr ""
"sgcheck provádí kontrolu rozsahu polí. Umí odhalit přístup do pole, při "
"kterém dojde k překročení délky pole. Jedná se ale o velmi raný nástroj, "
"zatím označený jako experimentální, a proto může produkovat více falešných "
"hlášení než jiné nástroje."
#. (itstool) path: section/p
#: C/tooling.page:387
msgid ""
"As it is experimental, sgcheck must be run by passing <cmd>--tool=exp-"
"sgcheck</cmd> to Valgrind, rather than <cmd>--tool=sgcheck</cmd>."
msgstr ""
"Protože je experimentální, musí být spuštěn s předáním <cmd>--tool=exp-"
"sgcheck</cmd> do Valgrindu, namísto <cmd>--tool=sgcheck</cmd>."
#. (itstool) path: section/p
#: C/tooling.page:393
msgid ""
"A full tutorial on using sgcheck is <link href=\"http://valgrind.org/docs/"
"manual/sg-manual.html\">here</link>."
msgstr ""
"Ucelený průvodce použitím sgcheck je <link href=\"http://valgrind.org/docs/"
"manual/sg-manual.html\">zde</link>."
#. (itstool) path: section/title
#: C/tooling.page:401
msgid "gcov and lcov"
msgstr "gcov a lcov"
#. (itstool) path: section/p
#: C/tooling.page:403
msgid ""
"<link href=\"https://gcc.gnu.org/onlinedocs/gcc/Gcov.html\">gcov</link> is a "
"profiling tool built into GCC, which instruments code by adding extra "
"instructions at compile time. When the program is run, this code generates "
"<file>.gcda</file> and <file>.gcno</file> profiling output files. These "
"files can be analyzed by the <cmd>lcov</cmd> tool, which generates visual "
"reports of code coverage at runtime, highlighting lines of code in the "
"project which are run more than others."
msgstr ""
"<link href=\"https://gcc.gnu.org/onlinedocs/gcc/Gcov.html\">gcov</link> je "
"profilovací nástroj vestavěný v GCC, který během kompilace obohatí "
"programový kód přidáním doplňujících instrukcí. Když je pak program spuštěn, "
"generuje výstupní profilovací soubory <file>.gcda</file> a <file>.gcno</"
"file>. Tyto soubory lze analyzovat pomocí nástroje <cmd>lcov</cmd>, který "
"generuje přehlednou výstupní sestavu pokrytí kódu za běhu, v níž zvýrazní "
"řádky kódu, které běží déle než ostatní."
#. (itstool) path: section/p
#: C/tooling.page:413
msgid ""
"A critical use for this code coverage data collection is when running the "
"unit tests: if the amount of code covered (for example, which particular "
"lines were run) by the unit tests is known, it can be used to guide further "
"expansion of the unit tests. By regularly checking the code coverage "
"attained by the unit tests, and expanding them towards 100%, you can be sure "
"that the entire project is being tested. Often it is the case that a unit "
"test exercises most of the code, but not a particular control flow path, "
"which then harbours residual bugs."
msgstr ""
"Kritické využití pro nasbíraná data o pokrytí kódu je při běhu jednotkových "
"testů: když je množství kódu pokrytého jednotkovými testy (např. které "
"konkrétní řádky proběhly) známé, může být použito jako vodítko pro další "
"rozšiřování jednotkových testů. Pravidelnou kontrolou pokrytí kódu získaného "
"jednotkovými testy a jeho dalším rozšířením na 100 % můžete zajistit, že "
"bude testován celý projekt. Častým případem je, že jednotkové testy zkouší "
"většinu kódu, ale ne konkrétně cestu řízeného průchodu, ve které se pak "
"ukrývá zbytek chyb."
#. (itstool) path: section/p
#: C/tooling.page:424
msgid ""
"lcov supports <link href=\"https://en.wikipedia.org/wiki/"
"Code_coverage#Basic_coverage_criteria\"> branch coverage measurement</link>, "
"so is not suitable for demonstrating coverage of safety critical code. It is "
"perfectly suitable for non-safety critical code."
msgstr ""
"lconv podporuje <link href=\"https://en.wikipedia.org/wiki/"
"Code_coverage#Basic_coverage_criteria\">měření pokrytí větve</link>, takže "
"není vhodný jako ukázkové pokrytí kritického kódu z hlediska bezpečnosti. Je "
"naopak perfektně vhodný pro kód, který není z hlediska bezpečnosti kritický."
#. (itstool) path: section/p
#: C/tooling.page:432
msgid ""
"As code coverage has to be enabled at both compile time and run time, a "
"macro is provided to make things simpler. The <link href=\"http://www.gnu."
"org/software/autoconf-archive/ax_code_coverage.html\"> "
"<code>AX_CODE_COVERAGE</code></link> macro adds a <cmd>make check-code-"
"coverage</cmd> target to the build system, which runs the unit tests with "
"code coverage enabled, and generates a report using <cmd>lcov</cmd>."
msgstr ""
"Protože pokrytí kódu musí být povoleno jak při kompilaci, tak za běhu, je "
"pro zjednodušení poskytováno makro. Makro <link href=\"http://www.gnu.org/"
"software/autoconf-archive/ax_code_coverage.html\"> <code>AX_CODE_COVERAGE</"
"code></link> přidává do sestavovacího systému cíl <cmd>make check-code-"
"coverage</cmd>, který spustí jednotkové testy s povoleným pokrytím kódu a "
"vygeneruje výstupní sestavu pomocí <cmd>lcov</cmd>."
#. (itstool) path: section/p
#: C/tooling.page:442
msgid "To add <code>AX_CODE_COVERAGE</code> support to a project:"
msgstr ""
"Když chcete do svého projektu přidat podporu pro <code>AX_CODE_COVERAGE</"
"code>:"
#. (itstool) path: item/p
#: C/tooling.page:446
msgid ""
"Copy <link href=\"http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;"
"a=blob_plain;f=m4/ax_code_coverage.m4\"> <file>ax_code_coverage.m4</file></"
"link> to the <file>m4/</file> directory of your project."
msgstr ""
"Zkopírujte <link href=\"http://git.savannah.gnu.org/gitweb/?p=autoconf-"
"archive.git;a=blob_plain;f=m4/ax_code_coverage.m4\"><file>ax_code_coverage."
"m4</file></link> do složky <file>m4/</file> svého projektu."
#. (itstool) path: item/p
#: C/tooling.page:452
msgid "Add <code>AX_CODE_COVERAGE</code> to <file>configure.ac</file>."
msgstr "Přidejte <code>AX_CODE_COVERAGE</code> do <file>configure.ac</file>."
#. (itstool) path: item/p
#: C/tooling.page:455
msgid ""
"Add <code>@CODE_COVERAGE_RULES</code> to the top-level <file>Makefile.am</"
"file>."
msgstr ""
"Přidejte <code>@CODE_COVERAGE_RULES</code> do <file>Makefile.am</file> v "
"nejvyšší úrovni."
#. (itstool) path: item/p
#: C/tooling.page:459
msgid ""
"Add <code>$(CODE_COVERAGE_CFLAGS)</code> to the automake <code><var>*</"
"var>_CFLAGS</code> variable for each target you want coverage for, for "
"example for all libraries but no unit test code. Do the same for <code>"
"$(CODE_COVERAGE_LDFLAGS)</code> and <code><var>*</var>_LDFLAGS</code>."
msgstr ""
"AdPřidejte <code>$(CODE_COVERAGE_CFLAGS)</code> do proměnné <code><var>*</"
"var>_CFLAGS</code> systému automake pro každý cíl, který chcete pokrýt, "
"například pro všechny knihovny, ale už ne tak pro jednotkové testy. To "
"stejné proveďte pro <code>$(CODE_COVERAGE_LDFLAGS)</code> a <code><var>*</"
"var>_LDFLAGS</code>."
#. (itstool) path: section/p
#: C/tooling.page:468
msgid ""
"Documentation on using gcov and lcov is <link href=\"http://ltp.sourceforge."
"net/coverage/lcov.php\">here</link>."
msgstr ""
"Dokumentace k používání gcov a lcov je <link href=\"http://ltp.sourceforge."
"net/coverage/lcov.php\">zde</link>."
#. (itstool) path: section/title
#: C/tooling.page:475
msgid "Address, Thread and Undefined Behavior Sanitizers"
msgstr "Sanitizéry adres, vláken a nedefinovaného chování"
#. (itstool) path: section/p
#: C/tooling.page:477
msgid ""
"GCC and Clang both support several sanitizers: sets of extra code and checks "
"which can be optionally compiled in to an application and used to flag "
"various incorrect behaviors at runtime. They are powerful tools, but have to "
"be enabled specially, recompiling your application to enable and disable "
"them. They cannot be enabled at the same time as each other, or used at the "
"same time as <link xref=\"#valgrind\">Valgrind</link>. They are still young, "
"so have little integration with other tooling."
msgstr ""
"Jak GCC, tak Clang, mají podporu několika sanitizérů: sadu dodatečného kódu "
"a kontrol, které mohou být volitelně zakompilovány do vaší aplikace a "
"použity k označené různorodého nesprávného chování za běhu. Jedná se o mocné "
"nástroje, ale musí být zapnuty či vypnuty tak, že překompilujete svoji "
"aplikaci. Nemohou být zapnuty zárovneň s jinými a nemohou být použity naráz "
"s nástroji <link xref=\"#valgrind\">Valgrind</link>. Jedná se stále o "
"poměrně novou funkcionalitu, takže je jen málo integrována s jinými nástroji."
#. (itstool) path: section/p
#: C/tooling.page:487
msgid ""
"All sanitizers are available for both GCC and Clang, accepting the same set "
"of compiler options."
msgstr ""
"Všechny sanitizéry jsou dostupné pro překladač GCC i Clang a přijímají "
"stejnou sadu přepínačů kompilátoru."
#. (itstool) path: section/title
#: C/tooling.page:500
msgid "Address Sanitizer"
msgstr "Sanitizér adres"
#. (itstool) path: section/p
#: C/tooling.page:502
msgid ""
"The <link href=\"https://code.google.com/p/address-sanitizer/\">address "
"sanitizer</link> (‘asan’) detects use-after-free and buffer overflow bugs in "
"C and C++ programs. A full tutorial on using asan is <link href=\"http://"
"clang.llvm.org/docs/AddressSanitizer.html#usage\">available for Clang</link> "
"— the same instructions should work for GCC."
msgstr ""
"<link href=\"https://code.google.com/p/address-sanitizer/\">Sanitizér adres</"
"link> („asan“) detekuje chyby „použití po uvolnění“ a přetečení vyrovnávací "
"paměti v programech C a C++. Vyčerpávající výklad k používání asan je <link "
"href=\"http://clang.llvm.org/docs/AddressSanitizer.html#usage\">k dispozici "
"pro Clang</link>, ale stejné postupy platí i pro GCC."
#. (itstool) path: section/title
#: C/tooling.page:512
msgid "Thread Sanitizer"
msgstr "Sanitizér vláken"
#. (itstool) path: section/p
#: C/tooling.page:514
msgid ""
"The <link href=\"https://code.google.com/p/thread-sanitizer/\">thread "
"sanitizer</link> (‘tsan’) detects data races on memory locations, plus a "
"variety of invalid uses of POSIX threading APIs. A full tutorial on using "
"tsan is <link href=\"http://clang.llvm.org/docs/ThreadSanitizer.html#usage"
"\">available for Clang</link> — the same instructions should work for GCC."
msgstr ""
"<link href=\"https://code.google.com/p/thread-sanitizer/\">Sanitizér vláken</"
"link> („tsan“ – thread sanitizer) zjišťuje souběhy v přístupu k datům v "
"paměťových místech a k tomu také různá nesprávná použití API pro práci s "
"vlákny podle standardu POSIX. Celistvý průvodce používáním nástroje tsan je "
"<link href=\"http://clang.llvm.org/docs/ThreadSanitizer.html#usage\">k "
"dispozici pro Clang</link>, ale stejné postupy by měly platit i pro GCC."
#. (itstool) path: section/title
#: C/tooling.page:525
msgid "Undefined Behavior Sanitizer"
msgstr "Sanitizér nedefinovaného chování"
#. (itstool) path: section/p
#: C/tooling.page:527
msgid ""
"The undefined behavior sanitizer (‘ubsan’) is a collection of smaller "
"instrumentations which detect various potentially undefined behaviors in C "
"programs. A set of instructions for enabling ubsan is <link href=\"http://"
"clang.llvm.org/docs/UsersManual.html#controlling-code-generation\">available "
"for Clang</link> — the same instructions should work for GCC."
msgstr ""
"Sanitizér nedefinovaného chování („ubsan“ – undefined behavior sanitizer) je "
"sbírka drobných nástrojů, které zjišťují různá potencionálně nedefinovaná "
"chování v programech napsaných v jazyce C. Sada pokynů pro zapnutí ubsanu je "
"<link href=\"http://clang.llvm.org/docs/UsersManual.html#controlling-code-"
"generation\">k dispozici pro Clang</link>, ale stejně by to mělo fungovat i "
"pro GCC."
#. (itstool) path: section/title
#: C/tooling.page:538
msgid "Coverity"
msgstr "Coverity"
#. (itstool) path: section/p
#: C/tooling.page:540
msgid ""
"<link href=\"http://scan.coverity.com/\">Coverity</link> is one of the most "
"popular and biggest commercial static analyzer tools available. However, it "
"is available to use free for Open Source projects, and any project is "
"encouraged to <link href=\"https://scan.coverity.com/users/sign_up\">sign "
"up</link>. <link href=\"https://scan.coverity.com/faq#how-get-project-"
"included-in-scan\"> Analysis is performed</link> by running some analysis "
"tools locally, then uploading the source code and results as a tarball to "
"Coverity’s site. The results are then visible online to members of the "
"project, as annotations on the project’s source code (similarly to how lcov "
"presents its results)."
msgstr ""
"<link href=\"http://scan.coverity.com/\">Coverity</link> je jeden z "
"nejpopulárenějších a největší komerční dostupný nástroj pro statickou "
"analýzu. Přestože je komerční, je volně k dispozici pro projekty Open "
"Source, akorát je projekt vyzván k <link href=\"https://scan.coverity.com/"
"users/sign_up\">přihlášení</link>. <link href=\"https://scan.coverity.com/"
"faq#how-get-project-included-in-scan\">Analýza je prováděna</link> spuštěním "
"některých analytických nástrojů lokálně a následně jsou zdrojový kód i "
"výsledky v zabalené podobě nahrány na servery Coverity. Výsledky jsou pak "
"členům projektu viditelné on-line v podobě poznámek u zdrojového kódu "
"(obdobně, jako své výsledky podává lcov)."
#. (itstool) path: section/p
#: C/tooling.page:553
msgid ""
"As Coverity cannot be run entirely locally, it cannot be integrated properly "
"into the build system. However, scripts do exist to automatically scan a "
"project and upload the tarball to Coverity regularly. The recommended "
"approach is to run these scripts regularly on a server (typically as a "
"cronjob), using a clean checkout of the project’s git repository. Coverity "
"automatically e-mails project members about new static analysis problems it "
"finds, so the same approach as for <link xref=\"#gcc-and-clang\">compiler "
"warnings</link> can be taken: eliminate all the static analysis warnings, "
"then eliminate new ones as they are detected."
msgstr ""
"Protože Coverity nelze jako celek spustit lokálně, nelze jej ani pořádně "
"zaintegrovat do systému sestavení. Existují ale skripty, které projekt "
"automaticky pravidelně proskenují a zabalená data nahrají na servery "
"Coverity. Doporučovaný přístup je spouštět tyto skripty pravidelně na "
"serveru (typicky jako cronjob) a předtím stáhnout čisté zdrojové kódy z "
"repozitáře git projektu. Coverity zašle členům projektu e-mail s nově "
"nalezenými problémy ve statické analýze, takže může být zvolen stejný "
"přístup, jako k <link xref=\"#gcc-and-clang\">varováním kompilátoru</link>: "
"řešte všechna varování statické analýzy a řešte je hned, jak jsou nalezena."
#. (itstool) path: section/p
#: C/tooling.page:566
msgid ""
"Coverity is good, but it is not perfect, and it does produce a number of "
"false positives. These should be marked as ignored in the online interface."
msgstr ""
"Coverity je dobrý, ale ne dokonalý nástroj a produkuje řadu falešných "
"hlášení. Ta lze ale v rozhraní příkazového řádku označit, aby byla "
"ignorována."
#. (itstool) path: section/title
#: C/tooling.page:574
msgid "Clang Static Analyzer"
msgstr "Statický analyzátor Clang"
#. (itstool) path: section/p
#: C/tooling.page:576
msgid ""
"One tool which can be used to perform static analysis locally is the <link "
"href=\"http://clang-analyzer.llvm.org/\">Clang static analyzer</link>, which "
"is a tool co-developed with the <link xref=\"#gcc-and-clang\">Clang "
"compiler</link>. It detects a variety of problems in C code which compilers "
"cannot, and which would otherwise only be detectable at run time (using unit "
"tests)."
msgstr ""
"Jedním z nástrojů, které můžete používat k provádění místní statické "
"analýzy, je <link href=\"http://clang-analyzer.llvm.org/\">statický "
"analyzátor Clang</link>, což je nástroj vyvíjený spolu s <link xref=\"#gcc-"
"and-clang\">kompilátorem Clang</link>. Detekuje různé problémy v kódu v "
"jazyce C, které kompilátor rozpoznat nedokáže a které by tak byly zjištěny "
"až za běhu (pomocí jednotkových testů)."
#. (itstool) path: section/p
#: C/tooling.page:585
msgid ""
"Clang produces some false positives, and there is no easy way to ignore "
"them. The recommended thing to do is to <link href=\"http://clang-analyzer."
"llvm.org/faq.html#suppress_issue\">file a bug report against the static "
"analyzer</link>, so that the false positive can be fixed in future."
msgstr ""
"Clang produkuje i pár falešných hlášení a není žádný jednoduchý způsob, jak "
"je nechat ignorovat. Proto je při jejich výskytu doporučeno <link href="
"\"http://clang-analyzer.llvm.org/faq.html#suppress_issue\">vyplnit pro "
"statický analyzátor chybové hlášení</link>, aby mohla být do budoucna "
"opravena."
#. (itstool) path: section/p
#: C/tooling.page:593
msgid ""
"A full tutorial on using Clang is <link href=\"http://clang-analyzer.llvm."
"org/scan-build.html\">here</link>."
msgstr ""
"Ucelený průvodce používáním kompilátoru Clang je <link href=\"http://clang-"
"analyzer.llvm.org/scan-build.html\">zde</link>."
#. (itstool) path: section/title
#: C/tooling.page:599
msgid "Tartan"
msgstr "Tartan"
#. (itstool) path: section/p
#: C/tooling.page:601
msgid ""
"However, for all the power of the Clang static analyzer, it cannot detect "
"problems with specific libraries, such as GLib. This is a problem if a "
"project uses GLib exclusively, and rarely uses POSIX APIs (which Clang does "
"understand). There is a plugin available for the Clang static analyzer, "
"called <link href=\"http://people.collabora.com/~pwith/tartan/\">Tartan</"
"link>, which extends Clang to support checks against some of the common GLib "
"APIs."
msgstr ""
"Přes veškeré vymoženosti, které statický analyzátor Clang poskytuje, "
"nedokáže detekovat problémy se specifickými knihovnami, jako je GLib. Což je "
"problém, když projekt používá výhradně GLib a jen zřídka API standardu POSIX "
"(kterému Clang rozumí). Proto je k dispozici zásuvný modul pro statický "
"analyzátor Clang, který se nazývá <link href=\"http://people.collabora.com/"
"~pwith/tartan/\">Tartan</link> a rozšiřuje Clang o podporu kontroly vůči "
"některým běžným API knihovny GLib."
#. (itstool) path: section/p
#: C/tooling.page:612
msgid ""
"Tartan is still young software, and will produce false positives and may "
"crash when run on some code. However, it can find legitimate bugs quite "
"quickly, and is worth running over a code base frequently to detect new "
"errors in the use of GLib in the code. Please <link href=\"http://people."
"collabora.com/~pwith/tartan/#troubleshooting\"> report any problems with "
"Tartan</link>."
msgstr ""
"Tartan je zatím velmi mladý software a může produkovat falešná hlášení a při "
"spuštění vůči některému kód se může i zhroutit. Pomůže vám ale velmi rychle "
"najít skutečné chyby a je vhodné jej vůči základnímu programovému kódu "
"spouštět často, abyste odhalili nové chyby v použití GLib v svém kódu. Pokud "
"s Tartanem narazíte na nějaké problémy, <link href=\"http://people.collabora."
"com/~pwith/tartan/#troubleshooting\">nahlaste</link> je prosím."
#. (itstool) path: section/p
#: C/tooling.page:621
msgid ""
"A full tutorial on enabling Tartan for use with the Clang static analyzer is "
"<link href=\"http://people.collabora.com/~pwith/tartan/#usage-standalone\"> "
"here</link>. If set up correctly, the output from Tartan will be mixed "
"together with the normal static analyzer output."
msgstr ""
"Ucelený návod na zprovoznění Tartanu pro použití se statickým analyzátorem "
"Clang najdete <link href=\"http://people.collabora.com/~pwith/tartan/#usage-"
"standalone\">zde</link>. Pokud je nastavení správné, je výstup z Tartanu dán "
"dohromady s výstupem z normálního statického analyzátoru."
#. (itstool) path: info/desc
#: C/unit-testing.page:17
msgid "Designing software to be tested and writing unit tests for it"
msgstr ""
"Návrh softwaru tak, aby mohl být testován, a psaní jednotkových testů pro něj"
#. (itstool) path: page/title
#: C/unit-testing.page:20
msgid "Unit Testing"
msgstr "Jednotkové testy"
#. (itstool) path: synopsis/p
#: C/unit-testing.page:25
msgid ""
"Unit testing should be the primary method of testing the bulk of code "
"written, because a unit test can be written once and run many times — manual "
"tests have to be planned once and then manually run each time."
msgstr ""
"Jednotkové testování by mělo být hlavním způsobem testování většiny "
"napsaného kódu, protože jednotkové testy stačí napsat jednou, ale spouštět "
"se mohou vícekrát — ruční testy vymyslíte jednou, ale pak je musíte pokaždé "
"ručně provést."
#. (itstool) path: synopsis/p
#: C/unit-testing.page:31
msgid ""
"Development of unit tests starts with the architecture and API design of the "
"code to be tested: code should be designed to be easily testable, or will "
"potentially be very difficult to test."
msgstr ""
"Vývoj jednotkových testů začíná návrhem architektury a API kódu, který má "
"být testován: kód by měl být navržen tak, aby byl snadno testovatelný, "
"protože jinak může být jeho testování velmi obtížné."
#. (itstool) path: item/p
#: C/unit-testing.page:38
msgid ""
"Write unit tests to be as small as possible, but no smaller. (<link xref="
"\"#writing-unit-tests\"/>)"
msgstr ""
"Pište jednotkové testy tak, aby byly co nejmenší možné, ale ne menší. (<link "
"xref=\"#writing-unit-tests\"/>)"
#. (itstool) path: item/p
#: C/unit-testing.page:42
msgid ""
"Use code coverage tools to write tests to get high code coverage. (<link "
"xref=\"#writing-unit-tests\"/>)"
msgstr ""
"Používejte k psaní testů nástroje pro pokrytí kódu, abyste kód pokryli co "
"nejvíce. (<link xref=\"#writing-unit-tests\"/>)"
#. (itstool) path: item/p
#: C/unit-testing.page:46
msgid ""
"Run all unit tests under Valgrind to check for leaks and other problems. "
"(<link xref=\"#leak-checking\"/>)"
msgstr ""
"Všechny jednotkové testy spouštějte pod Vlagrindem, aby se kontrolovaly "
"úniky a jiné problémy. (<link xref=\"#leak-checking\"/>)"
#. (itstool) path: item/p
#: C/unit-testing.page:50
msgid ""
"Use appropriate tools to automatically generate unit tests where possible. "
"(<link xref=\"#test-generation\"/>)"
msgstr ""
"Používejte příslušné nástroje pro automatické generování jednotkových testů "
"všude, kde je to možné. (<link xref=\"#test-generation\"/>)"
#. (itstool) path: item/p
#: C/unit-testing.page:54
msgid ""
"Design code to be testable from the beginning. (<link xref=\"#writing-"
"testable-code\"/>)"
msgstr ""
"Kód navrhujte už od začátku tak, aby byl testovatelný. (<link xref="
"\"#writing-testable-code\"/>)"
#. (itstool) path: section/title
#: C/unit-testing.page:62
msgid "Writing Unit Tests"
msgstr "Psaní jednotkových testů"
#. (itstool) path: section/p
#: C/unit-testing.page:64
msgid ""
"Unit tests should be written in conjunction with looking at <link xref="
"\"tooling#gcov-and-lcov\">code coverage information gained from running the "
"tests</link>. This typically means writing an initial set of unit tests, "
"running them to get coverage data, then reworking and expanding them to "
"increase the code coverage levels. Coverage should be increased first by "
"ensuring all functions are covered (at least in part), and then by ensuring "
"all lines of code are covered. By covering functions first, API problems "
"which will prevent effective testing can be found quickly. These typically "
"manifest as internal functions which cannot easily be called from unit "
"tests. Overall, coverage levels of over 90% should be aimed for; don’t just "
"test cases covered by project requirements, test everything."
msgstr ""
"Jednotkové testy by měly být psány v souladu s pohledem na <link xref="
"\"tooling#gcov-and-lcov\">informace o pokrytí kódu získané z běžících testů</"
"link>. To obvykle znamená napsaní nějaké počáteční sady jednotkových testů, "
"jejich spuštění pro získání údajů o pokrytí, následné přepracování a jejich "
"rozšíření, aby se zvýšila úroveň pokrytí. Pokrytí lze zvýšit za prvé snahou "
"o pokrytí všech funkcí (nebo aspoň částečné pokrytí) a potom také snahou o "
"pokrytí všech řádků kódu. Tím, že pokryjete nejdříve funkce, můžete rychle "
"najít problémy v API, které se brání účinnému testování. Ty mají typicky "
"podobu interních funkcí, které nelze jednoduše volat z jednotkových testů. "
"Celkově se dá říci, že byste se měli zaměřit na úroveň pokrytí nad 90 %. "
"Neomezujte testy jen na pokrytí věcí, které se vztahují k požadavkům na "
"projekt – testujte vše."
#. (itstool) path: section/p
#: C/unit-testing.page:79
msgid ""
"Like <link xref=\"version-control\">git commits</link>, each unit test "
"should be ‘as small as possible, but no smaller’, testing a single specific "
"API or behavior. Each test case must be able to be run individually, without "
"depending on state from other test cases. This is important to allow "
"debugging of a single failing test, without having to step through all the "
"other test code as well. It also means that a single test failure can easily "
"be traced back to a specific API, rather than a generic ‘unit tests failed "
"somewhere’ message."
msgstr ""
"Obdobně jako <link xref=\"version-control\">zařazení do gitu</link>, i "
"jednotkový test by měl být „co nejmenší je možné, ale ne menší“ a testovat "
"jen jedno konkrétní API nebo chování. Každý test musí být spustitelný "
"samostatně, bez závislosti na stavu od ostatních testů. To je důležité, aby "
"bylo možné ladit selhání jednotlivých testů samostatně, bez nutnosti "
"procházet celou sérii dalších testů. Díky tomu lze také snadněji vysledovat "
"selhání ke konkrétnímu API, namísto obecné hlášky „jednotkový test někde "
"selhal“."
#. (itstool) path: section/p
#: C/unit-testing.page:90
msgid ""
"GLib has support for unit testing with its <link href=\"https://developer."
"gnome.org/glib/stable/glib-Testing.html\">GTest framework</link>, allowing "
"tests to be arranged in groups and hierarchies. This means that groups of "
"related tests can be run together for enhanced debugging too, by running the "
"test binary with the <cmd>-p</cmd> argument: <cmd>./test-suite-name -p /path/"
"to/test/group</cmd>."
msgstr ""
"GLib má podporu pro jednotkové testování pomocí jejího <link href=\"https://"
"developer.gnome.org/glib/stable/glib-Testing.html\">frameworku GTest</link>, "
"který umožňuje testy uspořádat do skupin a hierarchie. To znamená, že "
"skupiny souvisejících testů se dají spouště také dohromady pro zdokonalené "
"ladění. Stačí spustit testovací spustitelný soubor s argumentem <cmd>-p</"
"cmd>: <cmd>./název-testovací-sady -p /cesta/k/testovací/skupině</cmd>."
#. (itstool) path: section/title
#: C/unit-testing.page:101
msgid "Installed Tests"
msgstr "Nainstalované testy"
#. (itstool) path: section/p
#: C/unit-testing.page:103
msgid ""
"All unit tests should be installed system-wide, following the <link href="
"\"https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests\">installed-"
"tests standard</link>."
msgstr ""
"Všechny jednotkové testy by měly být nainstalovány celosystémově s dodržením "
"<link href=\"https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests"
"\">standardů pro instalaci testů</link>."
#. (itstool) path: section/p
#: C/unit-testing.page:109
msgid ""
"By installing the unit tests, continuous integration (CI) is made easier, "
"since tests for one project can be re-run after changes to other projects in "
"the CI environment, thus testing the interfaces between modules. That is "
"useful for a highly-coupled set of projects like GNOME."
msgstr ""
"Instalací jednotkových testů se zjednoduší průběžná začleňování, protože "
"testy pro jeden projekt je možné spustit znovu po změnách v jiném projektu v "
"průběžně začleňovaném prostředí, a tím testovat rozhraní mezi moduly. To je "
"užitečné hlavně pro hodně provázané sady projektů, jako je tomu v GNOME."
#. (itstool) path: section/p
#: C/unit-testing.page:116
msgid ""
"To add support for installed-tests, add the following to <file>configure.ac</"
"file>:"
msgstr ""
"Když chcete přidat podporu pro instalované testy, přidejte do "
"<file>configure.ac</file> následující:"
#. (itstool) path: section/code
#: C/unit-testing.page:120
#, no-wrap
msgid ""
"# Installed tests\n"
"AC_ARG_ENABLE([modular_tests],\n"
" AS_HELP_STRING([--disable-modular-tests],\n"
" [Disable build of test programs (default: no)]),,\n"
" [enable_modular_tests=yes])\n"
"AC_ARG_ENABLE([installed_tests],\n"
" AS_HELP_STRING([--enable-installed-tests],\n"
" [Install test programs (default: no)]),,\n"
" [enable_installed_tests=no])\n"
"AM_CONDITIONAL([BUILD_MODULAR_TESTS],\n"
" [test \"$enable_modular_tests\" = \"yes\" ||\n"
" test \"$enable_installed_tests\" = \"yes\"])\n"
"AM_CONDITIONAL([BUILDOPT_INSTALL_TESTS],[test \"$enable_installed_tests\" = \"yes\"])"
msgstr ""
"# Installed tests\n"
"AC_ARG_ENABLE([modular_tests],\n"
" AS_HELP_STRING([--disable-modular-tests],\n"
" [Disable build of test programs (default: no)]),,\n"
" [enable_modular_tests=yes])\n"
"AC_ARG_ENABLE([installed_tests],\n"
" AS_HELP_STRING([--enable-installed-tests],\n"
" [Install test programs (default: no)]),,\n"
" [enable_installed_tests=no])\n"
"AM_CONDITIONAL([BUILD_MODULAR_TESTS],\n"
" [test \"$enable_modular_tests\" = \"yes\" ||\n"
" test \"$enable_installed_tests\" = \"yes\"])\n"
"AM_CONDITIONAL([BUILDOPT_INSTALL_TESTS],[test \"$enable_installed_tests\" = \"yes\"])"
#. (itstool) path: section/p
#: C/unit-testing.page:134
msgid "Then in <file>tests/Makefile.am</file>:"
msgstr "A potom do <file>tests/Makefile.am</file>:"
#. (itstool) path: section/code
#: C/unit-testing.page:137
#, no-wrap
msgid ""
"insttestdir = $(libexecdir)/installed-tests/[project]\n"
"\n"
"all_test_programs = \\\n"
"\ttest-program1 \\\n"
"\ttest-program2 \\\n"
"\ttest-program3 \\\n"
"\t$(NULL)\n"
"if BUILD_MODULAR_TESTS\n"
"TESTS = $(all_test_programs)\n"
"noinst_PROGRAMS = $(TESTS)\n"
"endif\n"
"\n"
"if BUILDOPT_INSTALL_TESTS\n"
"insttest_PROGRAMS = $(all_test_programs)\n"
"\n"
"testmetadir = $(datadir)/installed-tests/[project]\n"
"testmeta_DATA = $(all_test_programs:=.test)\n"
"\n"
"testdatadir = $(insttestdir)\n"
"testdata_DATA = $(test_files)\n"
"\n"
"testdata_SCRIPTS = $(test_script_files)\n"
"endif\n"
"\n"
"EXTRA_DIST = $(test_files)\n"
"\n"
"%.test: % Makefile\n"
"\t$(AM_V_GEN) (echo '[Test]' > $@.tmp; \\\n"
"\techo 'Type=session' >> $@.tmp; \\\n"
"\techo 'Exec=$(insttestdir)/$<' >> $@.tmp; \\\n"
"\tmv $@.tmp $@)"
msgstr ""
"insttestdir = $(libexecdir)/installed-tests/[project]\n"
"\n"
"all_test_programs = \\\n"
"\ttest-program1 \\\n"
"\ttest-program2 \\\n"
"\ttest-program3 \\\n"
"\t$(NULL)\n"
"if BUILD_MODULAR_TESTS\n"
"TESTS = $(all_test_programs)\n"
"noinst_PROGRAMS = $(TESTS)\n"
"endif\n"
"\n"
"if BUILDOPT_INSTALL_TESTS\n"
"insttest_PROGRAMS = $(all_test_programs)\n"
"\n"
"testmetadir = $(datadir)/installed-tests/[project]\n"
"testmeta_DATA = $(all_test_programs:=.test)\n"
"\n"
"testdatadir = $(insttestdir)\n"
"testdata_DATA = $(test_files)\n"
"\n"
"testdata_SCRIPTS = $(test_script_files)\n"
"endif\n"
"\n"
"EXTRA_DIST = $(test_files)\n"
"\n"
"%.test: % Makefile\n"
"\t$(AM_V_GEN) (echo '[Test]' > $@.tmp; \\\n"
"\techo 'Type=session' >> $@.tmp; \\\n"
"\techo 'Exec=$(insttestdir)/$<' >> $@.tmp; \\\n"
"\tmv $@.tmp $@)"
#. (itstool) path: section/title
#: C/unit-testing.page:171
msgid "Leak Checking"
msgstr "Kontrola úniků"
#. (itstool) path: section/p
#: C/unit-testing.page:173
msgid ""
"Once unit tests with high code coverage have been written, they can be run "
"under various dynamic analysis tools, such as <link xref=\"tooling#valgrind"
"\">Valgrind</link> to check for leaks, threading errors, allocation "
"problems, etc. across the entire code base. The higher the code coverage of "
"the unit tests, the more confidence the Valgrind results can be treated "
"with. See <link xref=\"tooling\"/> for more information, including build "
"system integration instructions."
msgstr ""
"Jakmile napíšete jednotkové testy pokrývající velkou část kódu, můžete je "
"spouštět pod různými dynamickými analytickými nástroji, jako je <link xref="
"\"tooling#valgrind\">Valgrind</link>, abyste zkontrolovali úniky, chyby "
"vláken, problémy s alokací apod. napříč celým zdrojovým kódem. Čím vyšší je "
"pokrytí kódu jednotkovými testy, tím je možné výsledky z Valgrindu brát jako "
"důvěryhodnější. Více informací viz <link xref=\"tooling\"/>, včetně návodu "
"na integraci do sestavovacího systému."
#. (itstool) path: section/p
#: C/unit-testing.page:183
msgid ""
"Critically, this means that unit tests should not leak memory or other "
"resources themselves, and similarly should not have any threading problems. "
"Any such problems would effectively be false positives in the analysis of "
"the actual project code. (False positives which need to be fixed by fixing "
"the unit tests.)"
msgstr ""
"Podstatné je, že jednotkové testy by neměly samy o sobě způsobovat uniky "
"paměti nebo jiných prostředků a stejně tak způsobovat problémy s vlákny. "
"Jakékoliv takové problémy by ve skutečnosti způsobovaly falešná pozitivní "
"hlášení v analýzách reálného kódu projektu. (Falešná pozitivní hlášení, "
"která musí být opravena opravou jednotkových testů.)"
#. (itstool) path: section/title
#: C/unit-testing.page:193
msgid "Test Generation"
msgstr "Generování testů"
#. (itstool) path: section/p
#: C/unit-testing.page:195
msgid ""
"Certain types of code are quite repetitive, and require a lot of unit tests "
"to gain good coverage; but are appropriate for <link href=\"https://en."
"wikipedia.org/wiki/Test_data_generation\">test data generation</link>, where "
"a tool is used to automatically generate test vectors for the code. This can "
"drastically reduce the time needed for writing unit tests, for code in these "
"specific domains."
msgstr ""
"Některé formy kódu se dost často opakují a vyžadují hodně jednotkových "
"testů, aby byly dobře pokryty. Na druhou stranu jsou ale vhodné pro <link "
"href=\"https://en.wikipedia.org/wiki/Test_data_generation\">generování "
"testovacích dat</link> a na to existují nástroje, které pro kód automaticky "
"vygenerují testovací vektory. Tím se výrazně sníží čas potřebný pro psaní "
"jednotkových testů pro kód v této konkrétní oblasti."
#. (itstool) path: section/title
#: C/unit-testing.page:205
msgid "JSON"
msgstr "JSON"
#. (itstool) path: section/p
#: C/unit-testing.page:207
msgid ""
"One example of a domain amenable to test data generation is parsing, where "
"the data to be parsed is required to follow a strict schema — this is the "
"case for XML and JSON documents. For JSON, a tool such as <link href="
"\"http://people.collabora.com/~pwith/walbottle/\">Walbottle</link> can be "
"used to generate test vectors for all types of valid and invalid input "
"according to the schema."
msgstr ""
"Jedním z příkladů domény, vůči níž se testuje generování dat, je jejich "
"zpracování v případech, kdy se očekává dodržení striktního schématu dat. To "
"je případ dokumentů XML a JSON. Pro JSON lze použít <link href=\"http://"
"people.collabora.com/~pwith/walbottle/\">Walbottle</link> pro vygenerování "
"testovacích vektorů pro všechny typy platných i neplatných vstupů "
"odpovídajících schématu."
#. (itstool) path: section/p
#: C/unit-testing.page:216
msgid ""
"Every type of JSON document should have a <link href=\"http://json-schema."
"org/\">JSON Schema</link> defined for it, which can then be passed to "
"Walbottle to generate test vectors:"
msgstr ""
"Všechny typy dokumentů JSON by k tomu měly mít definováno <link href="
"\"http://json-schema.org/\">schéma JSON</link>, které můžete předat do "
"Walbottle, aby vygeneroval testovací vektory:"
#. (itstool) path: section/code
#: C/unit-testing.page:221
#, no-wrap
msgid ""
"\n"
"json-schema-generate --valid-only schema.json\n"
"json-schema-generate --invalid-only schema.json"
msgstr ""
"\n"
"json-schema-generate --valid-only schéma.json\n"
"json-schema-generate --invalid-only schéma.json"
#. (itstool) path: section/p
#: C/unit-testing.page:225
msgid ""
"These test vectors can then be passed to the code under test in its unit "
"tests. The JSON instances generated by <cmd>--valid-only</cmd> should be "
"accepted; those from <cmd>--invalid-only</cmd> should be rejected."
msgstr ""
"Tyto testovací vektory je pak možné předat kódu právě testovanému v jeho "
"jednotkových testech. Instance JSON vygenerované pomocí <cmd>--valid-only</"
"cmd> by měly být přijaty, zatímco ty vygenerované pomocí <cmd>--invalid-"
"only</cmd> odmítnuty."
#. (itstool) path: section/title
#: C/unit-testing.page:234
msgid "Writing Testable Code"
msgstr "Psaní testovatelného kódu"
#. (itstool) path: section/p
#: C/unit-testing.page:236
msgid ""
"Code should be written with testability in mind from the design stage, as it "
"affects API design and architecture in fundamental ways. A few key "
"principles:"
msgstr ""
"Při psaní kódu by se mělo myslet na jeho testovatelnost už ve fázi návrhu, "
"protože to zásadním způsobem ovlivňuje návrh API a architekturu. Zde je "
"několik klíčových principů:"
#. (itstool) path: item/p
#: C/unit-testing.page:242
msgid ""
"Do not use global state. Singleton objects are usually a bad idea as they "
"can’t be instantiated separately or controlled in the unit tests."
msgstr ""
"Nepoužívejte globální stavy. Unikátní objekty (singletony) jsou většinou "
"špatný nápad, protože pro ně nelze vytvářet oddělené instance nebo je řídit "
"v jednotkových testech."
#. (itstool) path: item/p
#: C/unit-testing.page:246
msgid ""
"Separate out use of external state, such as databases, networking, or the "
"file system. The unit tests can then replace the accesses to external state "
"with mocked objects. A common approach to this is to use dependency "
"injection to pass a file system wrapper object to the code under test. For "
"example, a class should not load a global database (from a fixed location in "
"the file system) because the unit tests would then potentially overwrite the "
"running system’s copy of the database, and could never be executed in "
"parallel. They should be passed an object which provides an interface to the "
"database: in a production system, this would be a thin wrapper around the "
"database API; for testing, it would be a mock object which checks the "
"requests given to it and returns hard-coded responses for various tests."
msgstr ""
"Oddělte používání vnějších stavů, jako jsou databáze, sítě nebo souborové "
"systémy. Jednotkové testy je pak mohou nahradit přístupem k vnějšímu stavu s "
"falešným objektem. Společným přístupem k tomu je použít vnucování "
"závislostí, které předají objekt obalující souborový systém kódu, který je "
"právě testován. Například třída by neměla načítat globální databázi (z pevně "
"daného místa v souborovém systému), protože jednotkové testy by pak "
"potenciálně mohly přepsat běžící systémovou kopii databáze a nikdy by "
"nemohly být spuštěny souběžně. Měly by být předáván objekt, který poskytne "
"rozhraní k databázi. V produkčním systému to bude tenké obalení okolo "
"databázového API, při testování by to pak mohl být pokusný objekt, který "
"kontroluje požadavky, které mu jsou předávány a vrací pevně dané odpovědi "
"pro různorodé testy."
#. (itstool) path: item/p
#: C/unit-testing.page:260
msgid "Expose utility functions where they might be generally useful."
msgstr "Vystavte pomocné funkce, pokud mohou být obecně užitečné."
#. (itstool) path: item/p
#: C/unit-testing.page:263
msgid ""
"Split projects up into collections of small, private libraries which are "
"then linked together with a minimal amount of glue code into the overall "
"executable. Each can be tested separately."
msgstr ""
"Rozdělte projekt do sady malých privátních knihoven, které pak propojíte "
"dohromady minimálním množstvím spojovacího kódu, aby tak vznikl spustitelný "
"celek. Každou pak můžete testovat odděleně."
#. (itstool) path: section/p
#: C/unit-testing.page:274
msgid "The topic of software testability is covered in the following articles:"
msgstr "Tématem testovatelnosti softwaru se zabývají následující články:"
#. (itstool) path: item/p
#: C/unit-testing.page:278
msgid ""
"<link href=\"http://msdn.microsoft.com/en-us/magazine/dd263069.aspx\">Design "
"for testability</link>"
msgstr ""
"<link href=\"http://msdn.microsoft.com/en-us/magazine/dd263069.aspx\">Design "
"for testability</link>"
#. (itstool) path: item/p
#: C/unit-testing.page:282
msgid ""
"<link href=\"https://en.wikipedia.org/wiki/Software_testability\">Software "
"testability</link>"
msgstr ""
"<link href=\"https://en.wikipedia.org/wiki/Software_testability\">Software "
"testability</link>"
#. (itstool) path: item/p
#: C/unit-testing.page:286
msgid ""
"<link href=\"https://en.wikipedia.org/wiki/Dependency_injection\">Dependency "
"injection</link>"
msgstr ""
"<link href=\"https://cs.wikipedia.org/wiki/Vkládání_závislostí\">Vkládání "
"závislostí</link>"
#. (itstool) path: item/p
#: C/unit-testing.page:290
msgid ""
"<link href=\"http://c2.com/cgi/wiki?SoftwareDesignForTesting\">Software "
"design for testing</link>"
msgstr ""
"<link href=\"http://c2.com/cgi/wiki?SoftwareDesignForTesting\">Software "
"design for testing</link>"
#. (itstool) path: info/desc
#: C/version-control.page:17
msgid "Source code version control with git"
msgstr "Správa verzí zdrojového kódu pomocí git"
#. (itstool) path: page/title
#: C/version-control.page:20
msgid "Version Control"
msgstr "Správa verzí"
#. (itstool) path: synopsis/p
#: C/version-control.page:25
msgid ""
"git is used for version control for all GNOME projects. This page assumes "
"good working knowledge of git; some introductory material is available <link "
"href=\"https://www.atlassian.com/git/tutorials/\">here</link>, and a <link "
"href=\"https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf"
"\">git cheatsheet is here</link>."
msgstr ""
"Pro správu verzí se u všech projektů GNOME používá Git. Tato stránka "
"předpokládá dobrou znalost práce se systémem git. Materiály pro úvod do této "
"problematiky najdete <link href=\"https://www.atlassian.com/git/tutorials/"
"\">zde</link> a <link href=\"https://training.github.com/kit/downloads/"
"github-git-cheat-sheet.pdf\">přehledný tahák zde</link>. V češtině je volně "
"k dispozici <link href=\"https://knihy.nic.cz/\">překlad knihy Pro Git</"
"link>."
#. (itstool) path: item/p
#: C/version-control.page:34
msgid ""
"Make atomic, revertable commits. (<link xref=\"#guidelines-for-making-commits"
"\"/>)"
msgstr ""
"Vytvářejte atomická zařazení, která jdou vzít zpět. (<link xref="
"\"#guidelines-for-making-commits\"/>)"
#. (itstool) path: item/p
#: C/version-control.page:38
msgid ""
"Include full reasoning in commit messages, plus links to relevant bug "
"reports or specifications. (<link xref=\"#guidelines-for-making-commits\"/>)"
msgstr ""
"Do zprávy k zařazení uveďte jeho plný důvod, plus odkazy na příslušná "
"chybová hlášení nebo specifikace. (<link xref=\"#guidelines-for-making-"
"commits\"/>)"
#. (itstool) path: item/p
#: C/version-control.page:43
msgid ""
"Keep large changes, such as renames, in separate commits. (<link xref="
"\"#guidelines-for-making-commits\"/>)"
msgstr ""
"Rozsáhlé změny, jako třeba přejmenování, zařazujte zvlášť. (<link xref="
"\"#guidelines-for-making-commits\"/>)"
#. (itstool) path: item/p
#: C/version-control.page:47
msgid ""
"Merge changes from feature branches by rebasing. (<link xref=\"#use-of-git\"/"
">)"
msgstr ""
"Slučujte změny z větví pro nové funkce pomocí přeskládání. (<link xref="
"\"#use-of-git\"/>)"
#. (itstool) path: section/title
#: C/version-control.page:55
msgid "Use of Git"
msgstr "Používání správy verzí Git"
#. (itstool) path: section/p
#: C/version-control.page:57
msgid "Most GNOME repositories follow these rules:"
msgstr "Většina repozitářů GNOME dodržuje tato následující pravidla:"
#. (itstool) path: item/p
#: C/version-control.page:61
msgid ""
"No forced pushes. Except for branches with the <code>wip/</code> prefix "
"(work-in-progress), the commits’ history must not be modified, as "
"contributors rely on it."
msgstr ""
"Nepoužívejte nahrávání s parametrem „force“. Vyjma větví s prefixem "
"<code>wip/</code> (work-in-progres) pro rozpracované věci, se nesmí historie "
"zařazení měnit, protože přispěvatelé na ni spoléhají."
#. (itstool) path: item/p
#: C/version-control.page:66
msgid ""
"Rebase commits rather than merging, to have a linear history (which is "
"easier to follow)."
msgstr ""
"Používejte přeskládání (rebase) místo slučování (merge), aby historie byla "
"lineární (je to přehlednější pro sledování)."
#. (itstool) path: item/p
#: C/version-control.page:70
msgid ""
"Work on feature branches on GNOME git in <code>wip/</code> branches, then "
"rebase on master and fast-forward merge the changes. It is a good practice "
"to also add your nickname to the branch name, as <code>wip/nickname/feature</"
"code>."
msgstr ""
"Větve, ve kterých pracujete na nových funkcích GNOME, umisťujte v Gitu do "
"větve <code>wip/</code>, pak přeskládejte hlavní větev a změny slučte rychle "
"vpřed (fast-forward merge). Je také dobrým zvykem přidat do názvu větve "
"svoji přezdívku, nějak jako <code>wip/prezdivka/funkce</code>."
#. (itstool) path: item/p
#: C/version-control.page:76
msgid ""
"Hide <link href=\"https://sethrobertson.github.io/GitBestPractices/#sausage"
"\">sausage making</link> by squashing commits before merging."
msgstr ""
"Před sloučením skryjte <link href=\"https://sethrobertson.github.io/"
"GitBestPractices/#sausage\">vytvořený guláš</link> pomocí komprimace "
"(squash)."
#. (itstool) path: section/title
#: C/version-control.page:84
msgid "Guidelines for Making Commits"
msgstr "Pokyny pro vytváření zařazení"
#. (itstool) path: section/p
#: C/version-control.page:86
msgid ""
"Commits should be as small as possible, but no smaller. Each commit should "
"address a single issue, containing only changes related to that issue. The "
"message for each commit should describe the issue, explain what causes it, "
"and explain how it has been fixed if it is not obvious. If the commit is "
"associated with a bug report, the full URI for the bug report should be put "
"on a line by itself at the bottom of the commit message. Similarly, the ID "
"for the git commit (from <cmd>git log --oneline</cmd>) should be copied into "
"the bug report once the commit has been pushed, so it is easy to find one "
"from the other."
msgstr ""
"Jednotlivá zařazení by měla být co nejmenší je rozumné, ale ne menší. Každé "
"zařazení se má zabývat jediným problémem a obsahovat jen změny vztahující se "
"k tomuto problému. Zpráva u jednotlivých zařazení by pak měla obsahovat "
"popis onoho problému, vysvětlit co způsobuje a vysvětlit jak byl opraven, "
"pokud to není očividné. Pokud se k problému vztahuje chybové hlášení, měla "
"by se na konec zprávy na samostatný řádek vložit úplná adresa URI tohoto "
"hlášení. A naopak, do chybového hlášení by se mělo nakopírovat ID zařazení "
"(z <cmd>git log --oneline</cmd>), aby bylo jednoduché obě věci navzájem "
"dohledat."
#. (itstool) path: section/p
#: C/version-control.page:98
msgid ""
"The changes in each commit should be easy to read. For example, they should "
"not unnecessarily change whitespace or indentation. Large, mechanical "
"changes, such as renaming a file or function, should be put in separate "
"commits from modifications to code inside that file or function, so that the "
"latter changes do not get buried and lost in the former."
msgstr ""
"Změny v jednotlivých zařazeních by měly být snadno čitelné. Například by "
"neměly obsahovat samoúčelné změny v bílých znacích nebo odsazení. Rozsáhlé "
"mechanické změny, jako je přejmenování souborů nebo funkcí, by měly být v "
"samostatném zařazení, odděleně od změn v kódu v souboru nebo funkci, takže "
"pozdější změny někam nezapadnou a nebudou ztraceny v prvním jmenovaném "
"případě."
#. (itstool) path: section/p
#: C/version-control.page:106
msgid "The following principles give the reasoning for all the advice above:"
msgstr "Důvodem pro všechny uvedené rady jsou následující principy:"
#. (itstool) path: item/p
#: C/version-control.page:110
msgid ""
"Each commit should take the repository from one working state to another, "
"otherwise <link href=\"http://git-scm.com/book/en/v2/Git-Tools-Debugging-"
"with-Git#Binary-Search\">bisection</link> is impossible."
msgstr ""
"Každé zařazení by mělo dostat repozitář z jednoho plně funkčního stavu do "
"dalšího plně funkčního stavu, jinak znemožníte použití <link href=\"http://"
"git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git#Binary-Search"
"\">binárního vyhledávání příkazem bisect</link>."
#. (itstool) path: item/p
#: C/version-control.page:116
msgid ""
"Each commit should be individually revertable. If it later turns out that "
"the commit was a bad idea, <cmd>git revert <var>commit ID</var></cmd> should "
"take the repository from a working state to another working state."
msgstr ""
"Každé zařazení by mělo jít samostatně vzít zpět. Když se později zjistí, že "
"zařazení nebylo dobrým nápadem, měl by příkaz <cmd>git revert <var>ID "
"zařazení</var></cmd> převést repozitář z jednoho plně funkčního stavu do "
"jiného plně funkčního stavu."
#. (itstool) path: item/p
#: C/version-control.page:122
msgid ""
"The reasoning for each commit, and its relationship to external resources "
"like specifications and bug reports, should be clear, to the extent that "
"commits written by one developer a year in the past should still be "
"understandable by a second developer without having to trace through the "
"changes and work out what they do."
msgstr ""
"Důvod každého zařazení a jeho vztah k externím prostředkům, jako je zadání "
"nebo nahlášená chyba, by měly být jasné do té míry, že zařazení, které "
"napsal jeden vývojář před rokem, pochopí hned i jiný vývojář, bez "
"zdlouhavého procházení změn a studování, co dělají."
#. (itstool) path: item/p
#: C/version-control.page:129
msgid ""
"Each commit should be written once, and designed to be read many times, by "
"many reviewers and future programmers."
msgstr ""
"Každé zařazení by mělo být napsáno jednou naráz, ale navrženo s tím, že "
"čteno může být nesčetněkrát, mnoha lidmi provádějícimi kontrolu a budoucími "
"programátory."
#. (itstool) path: section/title
#: C/version-control.page:137
msgid "Merging Procedure"
msgstr "Slučovací procedura"
#. (itstool) path: section/p
#: C/version-control.page:139
msgid ""
"To merge a feature branch named <code>my-branch</code> into master, use the "
"following commands:"
msgstr ""
"Pro sloučení větve s novou funkcionalitou, pojmenované <code>my-branch</"
"code>, do hlavní větve použijte následující příkazy:"
#. (itstool) path: section/code
#: C/version-control.page:143
#, no-wrap
msgid ""
"\n"
"git checkout master\n"
"git pull\n"
"\n"
"git checkout wip/<var>my-branch</var>\n"
"git rebase --interactive master\n"
"# Ensure the rebase is successful; test the changes\n"
"\n"
"git checkout master\n"
"git merge wip/<var>my-branch</var>\n"
"git push\n"
"\n"
"# wip/<var>my-branch</var> can now be deleted\n"
"git push origin :wip/<var>my-branch</var>\n"
"git branch -D wip/<var>my-branch</var>"
msgstr ""
"\n"
"git checkout master\n"
"git pull\n"
"\n"
"git checkout wip/<var>my-branch</var>\n"
"git rebase --interactive master\n"
"# Kontrola úspěšnosti přeskládání, test změn\n"
"\n"
"git checkout master\n"
"git merge wip/<var>my-branch</var>\n"
"git push\n"
"\n"
"# wip/<var>my-branch</var> lze nyní smazat\n"
"git push origin :wip/<var>my-branch</var>\n"
"git branch -D wip/<var>my-branch</var>"
#. (itstool) path: item/p
#: C/version-control.page:164
msgid ""
"<link href=\"https://sethrobertson.github.io/GitBestPractices/\">Git best "
"practices</link>"
msgstr ""
"<link href=\"https://sethrobertson.github.io/GitBestPractices/\">Git best "
"practices</link>"
#. (itstool) path: item/p
#: C/version-control.page:167
msgid ""
"<link href=\"https://help.github.com/categories/using-git/\">Git FAQ</link>"
msgstr ""
"<link href=\"https://help.github.com/categories/using-git/\">Git FAQ</link>"
#. (itstool) path: item/p
#: C/version-control.page:170
msgid ""
"<link href=\"https://www.atlassian.com/git/tutorials/\">Atlassian git "
"tutorial</link>"
msgstr ""
"<link href=\"https://www.atlassian.com/git/tutorials/\">Atlassian git "
"tutorial</link>"
#. (itstool) path: item/p
#: C/version-control.page:173
msgid ""
"<link href=\"http://git-scm.com/docs/gittutorial\">Official git tutorial</"
"link>"
msgstr ""
"<link href=\"http://git-scm.com/docs/gittutorial\">Official git tutorial</"
"link>"
#. (itstool) path: item/p
#: C/version-control.page:176
msgid "<link href=\"https://try.github.io/\">Interactive git tutorial</link>"
msgstr "<link href=\"https://try.github.io/\">Interactive git tutorial</link>"
#. (itstool) path: item/p
#: C/version-control.page:179
msgid ""
"<link href=\"http://www.git-tower.com/learn/\">git-tower tutorial</link>"
msgstr ""
"<link href=\"http://www.git-tower.com/learn/\">git-tower tutorial</link>"
#. (itstool) path: info/desc
#: C/versioning.page:17
msgid "Versioning and releasing libraries and applications"
msgstr "Číslování verzí a vydávání knihoven a aplikací"
#. (itstool) path: synopsis/p
#: C/versioning.page:25
msgid ""
"Module versioning differs for libraries and applications: libraries need a "
"libtool version specified in addition to their package version. Applications "
"just have a package version."
msgstr ""
"Číslování verzí se liší pro knihovny a pro aplikace: knihovny potřebují mít "
"mimo čísla verze pro balíček určené i číslo verze pro libtool. Aplikace mají "
"jen číslo verze pro balíček."
#. (itstool) path: item/p
#: C/versioning.page:32
msgid ""
"Libraries and applications have a package version of the form <em>major."
"minor.micro</em>. (<link xref=\"#package-versioning\"/>)"
msgstr ""
"Knihovny a aplikace mají čísla verzí balíčků ve formě <em>hlavní.vedlejší."
"setinkové</em>. (<link xref=\"#package-versioning\"/>)"
#. (itstool) path: item/p
#: C/versioning.page:36
msgid ""
"Libraries additionally have a libtool version of the form <em>current:"
"revision:age</em>. (<link xref=\"#libtool-versioning\"/>)"
msgstr ""
"Knihovny navíc mají číslo verze pro libtool ve formě <em>aktuální:revize:"
"věk</em>. (<link xref=\"#libtool-versioning\"/>)"
#. (itstool) path: item/p
#: C/versioning.page:40
msgid ""
"Version numbers should be updated for each release (using release and post-"
"release increments). (<link xref=\"#release-process\"/>)"
msgstr ""
"Číslo verze by mělo být aktualizováno u každého vydání (použijte zvýšení "
"čísla při vydání a po vydání). (<link xref=\"#release-process\"/>)"
#. (itstool) path: item/p
#: C/versioning.page:44
msgid ""
"Package versions should be incremented for feature changes or additions. "
"(<link xref=\"#package-versioning\"/>)"
msgstr ""
"Číslo verze balíčku by mělo být zvýšeno při změně nebo přidání "
"funkcionality. (<link xref=\"#package-versioning\"/>)"
#. (itstool) path: item/p
#: C/versioning.page:48
msgid ""
"Libtool versions should be updated for API changes or additions. (<link xref="
"\"#libtool-versioning\"/>)"
msgstr ""
"Číslo verze libtool by mělo být aktualizováno při změnách nebo přidání API. "
"(<link xref=\"#libtool-versioning\"/>)"
#. (itstool) path: item/p
#: C/versioning.page:52
msgid ""
"Even/odd <em>minor</em> package versions can be used respectively for stable/"
"unstable releases. (<link xref=\"#stable-unstable-versions\"/>)"
msgstr ""
"Lichá/sudá <em>vedlejší</em> čísla verze balíčku mohou být použita k "
"rozlišení stabilních/nestabilních vydání. (<link xref=\"#stable-unstable-"
"versions\"/>)"
#. (itstool) path: section/title
#: C/versioning.page:60
msgid "Package Versioning"
msgstr "Číslování verzí balíčků"
#. (itstool) path: section/p
#: C/versioning.page:62
msgid ""
"Both libraries and applications have a package version of the form <em>major."
"minor.micro</em>."
msgstr ""
"Knihovny i aplikace mají čísla verzí balíčků ve formě <em>hlavní.vedlejší."
"setinkové</em> (<em>major.minor.micro</em>)."
#. (itstool) path: section/p
#: C/versioning.page:67
msgid ""
"The package version number is that passed to <code>AC_INIT()</code>, and the "
"one which is typically known as the project’s version number. For example, "
"the Debian package for a library will use the library’s package version "
"(though may also include the major version number in the package name to "
"allow for <link xref=\"parallel-installability\">parallel installability</"
"link>). Package versions are updated by the following rules:"
msgstr ""
"Číslo verze balíčku je to, které se předává do <code>AC_INIT()</code> a bývá "
"známé jako číslo verze projektu. Například balíček ve formátu DEB (používaný "
"distribucí Debian) pro knihovnu bude používat číslo verze balíčku s "
"knihovnou (ačkoliv může v názvu balíčku obsahovat i hlavní číslo verze, aby "
"se umožnila <link xref=\"parallel-installability\">souběžná instalace</"
"link>). Verze balíčku jsou aktualizovány podle následujících pravidel:"
#. (itstool) path: item/p
#: C/versioning.page:77
msgid ""
"If breaking <link xref=\"api-stability\">API compatibility</link> in a "
"library, or making a large change to an application which affects everything "
"(such as a UI redesign), increment major and set minor and micro to 0."
msgstr ""
"Při porušení <link xref=\"api-stability\">kompatibility API</link> v "
"knihovně nebo při provedení rozsáhlých změn v aplikaci, které ovlivní vše "
"(třeba změna návrhu uživatelského rozhraní), zvyšte hlavní číslo verze a "
"vedlejší a setinkové nastavte na 0."
#. (itstool) path: item/p
#: C/versioning.page:83
msgid ""
"Otherwise, if changing or adding a feature, or adding any API, increment "
"minor and set micro to 0."
msgstr ""
"V ostatních případech, když měníte nebo přidáváte funkce nebo přidáváte "
"nějaké API, zvyšte vedlejší číslo verze a setinkové nastavte na 0."
#. (itstool) path: item/p
#: C/versioning.page:87
msgid ""
"Otherwise (if making a release containing only bug fixes and translation "
"updates), increment micro."
msgstr ""
"V ostatních případech (když vydání obsahuje jen opravy chyb a aktualizace "
"překladů), zvyšte setinkové číslo verze."
#. (itstool) path: section/p
#: C/versioning.page:93
msgid ""
"Note that the minor version number should be updated if any API is added."
msgstr ""
"Nezapomeňte, že vedlejší číslo verze by mělo být aktualizováno, když je "
"přidáno nějaké API."
#. (itstool) path: section/title
#: C/versioning.page:99
msgid "Libtool Versioning"
msgstr "Čísla verzí pro Libtool"
#. (itstool) path: section/p
#: C/versioning.page:101
msgid ""
"Libraries have two version numbers: a libtool version which tracks ABI "
"backwards compatibility (see <link xref=\"api-stability\"/>), and a package "
"version which tracks feature changes. These are normally incremented in "
"synchronization, but should be kept separate because ABI backwards "
"compatibility is not necessarily related to feature changes or bug fixes. "
"Furthermore, the two version numbers have different semantics, and cannot be "
"automatically generated from each other."
msgstr ""
"Knihovny mají dvě čísla verze: verzi libtool, která sleduje zpětnou "
"kompatibilitu ABI (viz <link xref=\"api-stability\"/>) a číslo verze "
"balíčku, které sleduje změny vlastností. Normálně jsou zvyšovány současně, "
"ale měly by se udržovat oddělené, protože zpětná kompatibilita ABI nemusí "
"nutně souviset se změnami vlastností nebo opravami chyb. Navíc tato dvě "
"číslování mají rozdílnou sémantiku a není tak možné vygenerovat jedno na "
"základě druhého."
#. (itstool) path: section/p
#: C/versioning.page:112
msgid ""
"A good overview of libtool versioning, and the differences from package "
"versioning, is given in the <link href=\"https://autotools.io/libtool/"
"version.html\">Autotools Mythbuster</link>; another is in the <link href="
"\"http://www.gnu.org/s/libtool/manual/html_node/Updating-version-info.html"
"\">libtool manual</link>."
msgstr ""
"Dobrý přehled o číslování verzí libtool a o rozdílech oproti číslování verzí "
"balíčků najdete v článku <link href=\"https://autotools.io/libtool/version."
"html\">Autotools Mythbuster</link>, a případně také v <link href=\"http://"
"www.gnu.org/s/libtool/manual/html_node/Updating-version-info.html\">příručce "
"k libtool</link>."
#. (itstool) path: section/p
#: C/versioning.page:121
msgid ""
"To update the libtool version, follow the algorithm given in the comments "
"below. This is a typical <file>configure.ac</file> snippet for setting up "
"libtool versioning:"
msgstr ""
"Při aktualizaci verze libtool postupujte podle algoritmu uvedeném v "
"komentářích níže. Jedná se o typický úryvek z <file>configure.ac</file> pro "
"nastavení verze libtool:"
#. (itstool) path: section/code
#: C/versioning.page:127
#, no-wrap
msgid ""
"\n"
"# Before making a release, the LT_VERSION string should be modified. The\n"
"# string is of the form c:r:a. Follow these instructions sequentially:\n"
"# 1. If the library source code has changed at all since the last update, then\n"
"# increment revision (‘c:r:a’ becomes ‘c:r+1:a’).\n"
"# 2. If any interfaces have been added, removed, or changed since the last\n"
"# update, increment current, and set revision to 0.\n"
"# 3. If any interfaces have been added since the last public release, then\n"
"# increment age.\n"
"# 4. If any interfaces have been removed or changed since the last public\n"
"# release, then set age to 0.\n"
"AC_SUBST([LT_VERSION],[0:0:0])"
msgstr ""
"\n"
"# Před vydáním by se měl upravit řetězec LT_VERSION, který je ve formě a:r:v\n"
"# (aktuální:revize:věk). Postupujte podle následujících bodů:\n"
"# 1. Když od poslední aktualizace došlo ke změně zdrojového kódu knihovny\n"
"# jako celku, zvyšte revizi („a:r:v“ se změní na „a:r+1:v“).\n"
"# 2. Když bylo od poslední aktualizace přidáno, odebráno nebo změněno\n"
"# rozhraní, zvyšte aktuální a revizi nastavte na 0.\n"
"# 3. Když bylo od posledního veřejného vydání přidáno rozhraní, zvyšte věk.\n"
"# 4. Když bylo od posledního veřejného vydání odebráno nebo změněno \n"
"# rozhraní, nastavte věk na 0.\n"
"AC_SUBST([LT_VERSION],[0:0:0])"
#. (itstool) path: section/p
#: C/versioning.page:140
msgid ""
"The following snippet can be used in a <file>Makefile.am</file> to pass that "
"version info to libtool:"
msgstr ""
"Následující úryvek můžete použít v souboru <file>Makefile.am</file> k "
"předání informace o verzi do libtool:"
#. (itstool) path: section/code
#: C/versioning.page:144
#, no-wrap
msgid "my_library_la_LDFLAGS = -version-info $(LT_VERSION)"
msgstr "my_library_la_LDFLAGS = -version-info $(LT_VERSION)"
#. (itstool) path: section/title
#: C/versioning.page:148
msgid "Stable and Unstable Package Versions"
msgstr "Stabilní a nestabilní verze balíčku"
#. (itstool) path: section/p
#: C/versioning.page:150
msgid ""
"Most GNOME modules follow a convention for stable and unstable releases. The "
"minor version is even for stable releases and is odd for unstable releases. "
"For example, the 3.20.* versions are stable, but the 3.19.* versions are "
"unstable. The 3.19.* versions can be seen as alpha and beta releases of the "
"3.20 version."
msgstr ""
"Většina modulů GNOME dodržuje zvyklost stabilních a nestabilních vydání. "
"Vedlejší číslo verze je sudé pro stabilní vydání a liché pro nestabilní "
"vydání. Například verze 3.20.* jsou stabilní, ale 3.19.* nestabilní. Na "
"verze 3.19.* můžete pohlížet jako na alfa a beta vydání pro verzi 3.20."
#. (itstool) path: section/p
#: C/versioning.page:158
msgid ""
"A new micro <em>stable</em> version (e.g. 3.20.0 → 3.20.1) doesn’t add new "
"features, only translation updates and bug fixes. On the other hand, "
"<em>unstable</em> micro releases (e.g. 3.19.1 → 3.19.2) can add API, or "
"change or remove API which was added in a previous micro release in that "
"minor series."
msgstr ""
"Nové setinkové <em>stabilní</em> verze (např. 3.20.0 → 3.20.1) nepřidávají "
"nové funkce, ale jen aktualizace překladů a opravy chyb. Naproti tomu, "
"<em>nestabilní</em> setinkové verze (např. 3.19.1 → 3.19.2) mohou přidat API "
"nebo změnit nebo odstranit API, které bylo přidáno v předchozí setinkové "
"verzi stejné vedlejší série."
#. (itstool) path: section/p
#: C/versioning.page:166
msgid "The libtool version should be updated only for stable package versions."
msgstr ""
"Číslo verze pro libtool by mělo být aktualizováno jen pro stabilní verzi "
"balíčku."
#. (itstool) path: section/title
#: C/versioning.page:172
msgid "Release Process"
msgstr "Proces vydání"
#. (itstool) path: section/p
#: C/versioning.page:174
msgid ""
"The standard process for making a release of a module increments the libtool "
"version (if the module is a library) at the time of release, then increments "
"the package version number immediately afterwards (this is called a post-"
"release increment)."
msgstr ""
"Standardní proces tvorby vydání modulu zvyšuje v průběhu vydání číslo verze "
"pro libtool (pokud je modul knihovnou) a bezprostředně po té zvýší číslo "
"verze balíčku (tzv. post-release zvýšení)."
#. (itstool) path: section/p
#: C/versioning.page:181
msgid ""
"Updating the libtool versions at the time of release means that they are "
"only incremented once for all ABI changes in a release. The use of post-"
"release increment for package versions means the package version number is "
"not outdated (still equal to the previous release) during the development "
"cycle."
msgstr ""
"Aktualizace verze libtool v době vydání znamená, že je zvýšena jen jednou "
"naráz pro všechny změny ABI ve vydání. Použití zvýšení po vydání pro číslo "
"verze balíčku znamená, že číslo verze balíčku nebude zastaralé (pořád stejné "
"jako u předchozího vydání) během vývojového cyklu."
#. (itstool) path: section/p
#: C/versioning.page:189
msgid ""
"The release process (based on the <link href=\"https://wiki.gnome.org/"
"MaintainersCorner/Releasing\">GNOME release process</link>):"
msgstr ""
"Proces vydání (vycházející z <link href=\"https://wiki.gnome.org/"
"MaintainersCorner/Releasing\">procesu vydávání GNOME</link>):"
#. (itstool) path: item/p
#: C/versioning.page:195
msgid "Make sure code is up to date: <cmd>git pull</cmd>"
msgstr "Zkontrolujte, že je kód aktuální: <cmd>git pull</cmd>"
#. (itstool) path: item/p
#: C/versioning.page:199
msgid "Make sure you have no local changes: <cmd>git status</cmd>"
msgstr ""
"Zkontrolujte, že nemáte provedené žádné místní změny: <cmd>git status</cmd>"
#. (itstool) path: item/p
#: C/versioning.page:202
msgid ""
"If the release is for a stable package version, increment the libtool "
"version number in <file>configure.ac</file> (if it exists)"
msgstr ""
"V případě, že se jedná o vydání pro stabilní verzi balíčku, zvyšte číslo "
"verze pro libtool v <file>configure.ac</file> (pokud existuje)"
#. (itstool) path: item/p
#: C/versioning.page:206
msgid "Add an entry to the <file>NEWS</file> file"
msgstr "Přidejte záznam do souboru <file>NEWS</file>"
#. (itstool) path: item/p
#: C/versioning.page:210
msgid ""
"Run <cmd>./autogen.sh && make && make install && "
"make distcheck</cmd> and ensure it succeeds"
msgstr ""
"Spusťe <cmd>./autogen.sh && make && make install && "
"make distcheck</cmd> a ověřte, že vše proběhlo v pořádku"
#. (itstool) path: item/p
#: C/versioning.page:216
msgid ""
"Fix any issues which come up, commit those changes, and restart at step 3"
msgstr ""
"Opravte případné problémy, které nastaly, zařaďte je a vraťte se ke kroku 3"
#. (itstool) path: item/p
#: C/versioning.page:222
msgid ""
"If <cmd>make distcheck</cmd> finishes with “[archive] is ready for "
"distribution”, run <cmd>git commit -a -m \"Release version x.y.z\"</cmd> "
"(where ‘x.y.z’ is the package version number)"
msgstr ""
"Pokud <cmd>make distcheck</cmd> skončí s „[archive] is ready for "
"distribution“, spusťte <cmd>git commit -a -m \"Release version x.y.z\"</cmd> "
"(kde „x.y.z“ je číslo verze balíčku)"
#. (itstool) path: item/p
#: C/versioning.page:228 C/versioning.page:263
msgid "Run <cmd>git push</cmd>"
msgstr "Spusťte <cmd>git push</cmd>"
#. (itstool) path: item/p
#: C/versioning.page:232
msgid ""
"If that fails due to other commits having been pushed in the meantime, run "
"<cmd>git pull</cmd> to merge your commit on the branch followed by a second "
"<cmd>git push</cmd>. This is an exception to the GNOME guideline to have a "
"linear Git history (<link xref=\"version-control#use-of-git\"/>). If you "
"prefer to have a linear history, you need to restart at step 1."
msgstr ""
"Pokud to selže, protože během správy byly nahrány další zařazení, spusťte "
"<cmd>git pull</cmd>, aby se sloučily vaše zařazení s větví následovanou po "
"druhém <cmd>git push</cmd>. Jedná se o výjimku oproti pokynům GNOME, které "
"říkají, že máte mít v Git lineární historii (<link xref=\"version-"
"control#use-of-git\"/>). Pokud dáváte lineární historii přednost, musíte se "
"vrátit ke kroku 1."
#. (itstool) path: item/p
#: C/versioning.page:242
msgid ""
"Tag the release: <cmd>git tag -s x.y.z</cmd> (where ‘x.y.z’ is the package "
"version number)"
msgstr ""
"Přidělte vydání štítek: <cmd>git tag -s x.y.z</cmd> (kde „x.y.z“ je číslo "
"verze balíčku)"
#. (itstool) path: item/p
#: C/versioning.page:246
msgid ""
"Run <cmd>git push origin x.y.z</cmd> (where ‘x.y.z’ is the package version "
"number)"
msgstr ""
"Spusťte <cmd>git push origin x.y.z</cmd> (kde „x.y.z“ je číslo verze balíčku)"
#. (itstool) path: section/p
#: C/versioning.page:252
msgid ""
"The release is now complete, and the post-release version increment can be "
"done:"
msgstr ""
"Vydání je nyní hotové a můžete provést (post-release) zvýšení čísla verze "
"pro následující vydání:"
#. (itstool) path: item/p
#: C/versioning.page:257
msgid "Increment the package version number in <file>configure.ac</file>"
msgstr "Zvyšte číslo verze balíčku v <file>configure.ac</file>"
#. (itstool) path: item/p
#: C/versioning.page:260
msgid "Run <cmd>git commit -a -m \"Post-release version increment\"</cmd>"
msgstr "Spusťte <cmd>git commit -a -m \"Post-release version increment\"</cmd>"
#. (itstool) path: section/p
#: C/versioning.page:268
msgid ""
"The package archive generated by <cmd>make distcheck</cmd> can now be "
"uploaded to download.gnome.org or distributed in other ways."
msgstr ""
"Balíček vygenerovaný pomocí <cmd>make distcheck</cmd> může být nyní nahrán "
"na download.gnome.org nebo šířen nějakým jiným způsobem."
#. (itstool) path: info/desc
#: C/writing-good-code.page:25
msgid "Good, readable code keeps the project maintainable"
msgstr "Kvalitní a čitelný kód zajišťuje udržovatelnost projektu"
#. (itstool) path: page/title
#: C/writing-good-code.page:28
msgid "The Importance of Writing Good Code"
msgstr "Význam psaní kvalitního kódu"
#. (itstool) path: page/p
#: C/writing-good-code.page:30
msgid ""
"GNOME is a very ambitious free software project, and it is composed of many "
"software packages that are more or less independent of each other. A lot of "
"the work in GNOME is done by volunteers: although there are many people "
"working on GNOME full-time or part-time for here, volunteers still make up a "
"large percentage of our contributors. Programmers may come and go at any "
"time and they will be able to dedicate different amounts of time to the "
"GNOME project. People’s “real world” responsibilities may change, and this "
"will be reflected in the amount of time that they can devote to GNOME."
msgstr ""
"GNOME je velmi ambiciózní svobodný softwarový projekt a skládá se z velkého "
"množství softwarových balíčků, které jsou na sobě navzájem více či méně "
"závislé. Většina práce na GNOME je prováděna dobrovolníky. Ačkoliv jsou i "
"lidé, kteří na GNOME pracují placeně na plný nebo částečný úvazek, "
"dobrovolníci zatím odvádějí největší díl práce ze všech přispěvatelů. "
"Programátoři mohou přicházet a odcházet kdykoliv a věnovat projektu GNOME "
"libovolné množství času. Lidem se mohou měnit podmínky ve „skutečném světě“ "
"a to se odrazí v množství času, který mohou GNOME věnovat."
#. (itstool) path: page/p
#: C/writing-good-code.page:43
msgid ""
"Software development takes long amounts of time and painstaking effort. This "
"is why most part-time volunteers cannot start big projects by themselves; it "
"is much easier and more rewarding to contribute to existing projects, as "
"this yields results that are immediately visible and usable."
msgstr ""
"Vývoj softwaru zabírá hodně času a vyžaduje nemalé úsilí. To je důvod, proč "
"dobrovolníci na částečný úvazek nemohou začít velké projekty vlastními "
"silami. Je mnohem jednodušší, a přináší uspokojivější výsledky, přispět do "
"stávajícího projektu. Výsledky jsou navíc ihned viditelné a použitelné."
#. (itstool) path: page/p
#: C/writing-good-code.page:51
msgid ""
"Thus, we conclude that it is very important for existing projects to make it "
"as easy as possible for people to contribute to them. One way of doing this "
"is by making sure that programs are easy to read, understand, modify, and "
"maintain."
msgstr ""
"Proto je jasné, že je velmi důležité u stávajících projektů zajistit, aby do "
"nich lidé mohli přispívat jednoduše. Jedním ze způsobu, jak toho dosáhnout, "
"je zajištění snadné čitelnosti, srozumitelnosti, úprav a správy."
#. (itstool) path: page/p
#: C/writing-good-code.page:58
msgid ""
"Messy code is hard to read, and people may lose interest if they cannot "
"decipher what the code tries to do. Also, it is important that programmers "
"be able to understand the code quickly so that they can start contributing "
"with bug fixes and enhancements in a short amount of time. Source code is a "
"form of <em>communication</em>, and it is more for people than for "
"computers. Just as someone would not like to read a novel with spelling "
"errors, bad grammar, and sloppy punctuation, programmers should strive to "
"write good code that is easy to understand and modify by others."
msgstr ""
"Škaredý kód se špatně čte a lidé mohou ztratit zájem, když nemohou "
"rozluštit, o co se kód vlastně snaží. Je také důležité, aby byli "
"programátoři schopni kód pochopit rychle a začít tak přispívat opravami chyb "
"a vylepšeními ve velmi krátkém čase. Zdrojový kód je jistou formou "
"<em>komunikace</em> a slouží spíše pro lidi, než pro počítače. Stejně, jako "
"by se určitě nikomu nechtělo číst román plný překlepů, gramatických chyb a "
"špatné interpunkce, i programátoři by měli usilovat o psaní kvalitního kódu, "
"který je jednoduchý na pochopení a úpravy od ostatních."
#. (itstool) path: page/p
#: C/writing-good-code.page:71
msgid "The following are some important qualities of good code:"
msgstr "Následující věci jsou důležitými měřítky kvality dobrého kódu:"
#. (itstool) path: item/title
#: C/writing-good-code.page:77
msgid "Cleanliness"
msgstr "Čistota"
#. (itstool) path: item/p
#: C/writing-good-code.page:78
msgid ""
"Clean code is easy to read with minimum effort. This lets people start to "
"understand it easily. This includes the coding style itself (brace "
"placement, indentation, variable names), and the actual control flow of the "
"code."
msgstr ""
"Čistý kód se dobře čte, bez potřeby vynakládat na to nadměrné úsilí. Lidem "
"to pomůže jej snadno pochopit. Patří k tomu přímo styl kódování (umístění "
"závorek, odsazení, názvy proměnných) a vlatní řízení průběhu kódu."
#. (itstool) path: item/title
#: C/writing-good-code.page:87
msgid "Consistency"
msgstr "Jednotnost"
#. (itstool) path: item/p
#: C/writing-good-code.page:88
msgid ""
"Consistent code makes it easy for people to understand how a program works. "
"When reading consistent code, one subconsciously forms a number of "
"assumptions and expectations about how the code works, so it is easier and "
"safer to make modifications to it. Code that <em>looks</em> the same in two "
"places should <em>work</em> the same, too."
msgstr ""
"Jednotnost kódu usnadňuje lidem porozumět, jak program funguje. Když čtete "
"konzistentní kód, podvědomě si utváříte řadu předpokladů a očekávání o tom, "
"jak kód funguje, takže v něm jednodušeji a bezpečněji můžete provádět změny. "
"Kód, který na dvou místech <em>vypadá</em> stejně, by měl i stejně "
"<em>pracovat</em>."
#. (itstool) path: item/title
#: C/writing-good-code.page:99
msgid "Extensibility"
msgstr "Rozšiřitelnost"
#. (itstool) path: item/p
#: C/writing-good-code.page:100
msgid ""
"General-purpose code is easier to reuse and modify than very specific code "
"with lots of hardcoded assumptions. When someone wants to add a new feature "
"to a program, it will obviously be easier to do so if the code was designed "
"to be extensible from the beginning. Code that was not written this way may "
"lead people into having to implement ugly hacks to add features."
msgstr ""
"Kód s obecným účelem se snáze znovu použije a upraví, než velmi specifický "
"kód s řadou natvrdo vložených předpokladů. Když chce někdo do programu "
"přidat novou funkcionalitu, bude to mít samozřejmě jednodušší, když byl kód "
"od začátku navrhován jako rozšiřitelný. Kód, který nebyl psán tímto "
"způsobem, může vést lidi k použití různých nepěkných kliček, aby novou "
"funkcionalitu mohli přidat."
#. (itstool) path: item/title
#: C/writing-good-code.page:112
msgid "Correctness"
msgstr "Správnost"
#. (itstool) path: item/p
#: C/writing-good-code.page:113
msgid ""
"Finally, code that is designed to be correct lets people spend less time "
"worrying about bugs, and more time enhancing the features of a program. "
"Users also appreciate correct code, since nobody likes software that "
"crashes. Code that is written for correctness and safety (i.e. code that "
"explicitly tries to ensure that the program remains in a consistent state) "
"prevents many kinds of silly bugs."
msgstr ""
"No a konečně, programový kód, který je navržen tak, aby byl správný, nenutí "
"lidi trávit čas trápením s řešením chyb a mohou tak více času věnovat "
"vylepšování funkcionality programu. I uživatelé ocení správný kód, protože "
"nikdo nemá rád software, který se hroutí. Kód, který je napsán správně a "
"bezpečně (tj. kód, který se výslovně snaží zajistit, aby program setrval v "
"konzistentním stavu) zabrání mnoha druhům nepříjemných chyb."
#. (itstool) path: section/title
#: C/writing-good-code.page:126
msgid "Book References"
msgstr "Doporučené knihy"
#. (itstool) path: item/p
#: C/writing-good-code.page:129
msgid ""
"<link href=\"http://www.cc2e.com\">Code Complete</link>, by Steve McConnell."
msgstr ""
"<link href=\"http://www.cc2e.com\">Code Complete</link> od autora Steve "
"McConnell."
#. (itstool) path: item/p
#: C/writing-good-code.page:132
msgid ""
"<link href=\"http://martinfowler.com/books/refactoring.html\"> Refactoring: "
"Improving the Design of Existing Code </link>, by Martin Fowler."
msgstr ""
"<link href=\"http://martinfowler.com/books/refactoring.html\"> Refactoring: "
"Improving the Design of Existing Code </link>, Martin Fowler."
#. (itstool) path: item/p
#: C/writing-good-code.page:137
msgid ""
"<link href=\"https://en.wikipedia.org/wiki/Design_Patterns\"> Design "
"Patterns: Elements of Reusable Object-Oriented Software </link>, by Erich "
"Gamma, Richard Helm, Ralph Johnson and John Vlissides."
msgstr ""
"<link href=\"https://en.wikipedia.org/wiki/Design_Patterns\"> Design "
"Patterns: Elements of Reusable Object-Oriented Software </link>, kolektiv "
"autorů Erich Gamma, Richard Helm, Ralph Johnson a John Vlissides."
#. (itstool) path: item/p
#: C/writing-good-code.page:142
msgid ""
"<link href=\"http://astore.amazon.com/gnomestore-20/detail/020163385X\"> "
"Object-Oriented Design Heuristics </link>, by Arthur Riel."
msgstr ""
"<link href=\"http://astore.amazon.com/gnomestore-20/detail/020163385X\"> "
"Object-Oriented Design Heuristics </link>, Arthur Riel."
|