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
|
// libguestfs generated file
// WARNING: THIS FILE IS GENERATED FROM:
// generator/generator_*.ml
// ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
//
// Copyright (C) 2009-2012 Red Hat Inc.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// These C# bindings are highly experimental at present.
//
// Firstly they only work on Linux (ie. Mono). In order to get them
// to work on Windows (ie. .Net) you would need to port the library
// itself to Windows first.
//
// The second issue is that some calls are known to be incorrect and
// can cause Mono to segfault. Particularly: calls which pass or
// return string[], or return any structure value. This is because
// we haven't worked out the correct way to do this from C#. Also
// we don't handle functions that take optional arguments at all.
//
// The third issue is that when compiling you get a lot of warnings.
// We are not sure whether the warnings are important or not.
//
// Fourthly we do not routinely build or test these bindings as part
// of the make && make check cycle, which means that regressions might
// go unnoticed.
//
// Suggestions and patches are welcome.
// To compile:
//
// gmcs Libguestfs.cs
// mono Libguestfs.exe
//
// (You'll probably want to add a Test class / static main function
// otherwise this won't do anything useful).
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Collections;
namespace Guestfs
{
class Error : System.ApplicationException
{
public Error (string message) : base (message) {}
protected Error (SerializationInfo info, StreamingContext context) {}
}
class Guestfs
{
IntPtr _handle;
[DllImport ("libguestfs.so.0")]
static extern IntPtr guestfs_create ();
public Guestfs ()
{
_handle = guestfs_create ();
if (_handle == IntPtr.Zero)
throw new Error ("could not create guestfs handle");
}
[DllImport ("libguestfs.so.0")]
static extern void guestfs_close (IntPtr h);
~Guestfs ()
{
guestfs_close (_handle);
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_last_error (IntPtr h);
[StructLayout (LayoutKind.Sequential)]
public class _int_bool {
int i;
int b;
}
[StructLayout (LayoutKind.Sequential)]
public class _lvm_pv {
string pv_name;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst=16)]
string pv_uuid;
string pv_fmt;
ulong pv_size;
ulong dev_size;
ulong pv_free;
ulong pv_used;
string pv_attr;
long pv_pe_count;
long pv_pe_alloc_count;
string pv_tags;
ulong pe_start;
long pv_mda_count;
ulong pv_mda_free;
}
[StructLayout (LayoutKind.Sequential)]
public class _lvm_vg {
string vg_name;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst=16)]
string vg_uuid;
string vg_fmt;
string vg_attr;
ulong vg_size;
ulong vg_free;
string vg_sysid;
ulong vg_extent_size;
long vg_extent_count;
long vg_free_count;
long max_lv;
long max_pv;
long pv_count;
long lv_count;
long snap_count;
long vg_seqno;
string vg_tags;
long vg_mda_count;
ulong vg_mda_free;
}
[StructLayout (LayoutKind.Sequential)]
public class _lvm_lv {
string lv_name;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst=16)]
string lv_uuid;
string lv_attr;
long lv_major;
long lv_minor;
long lv_kernel_major;
long lv_kernel_minor;
ulong lv_size;
long seg_count;
string origin;
float snap_percent; /* [0..100] or -1 */
float copy_percent; /* [0..100] or -1 */
string move_pv;
string lv_tags;
string mirror_log;
string modules;
}
[StructLayout (LayoutKind.Sequential)]
public class _stat {
long dev;
long ino;
long mode;
long nlink;
long uid;
long gid;
long rdev;
long size;
long blksize;
long blocks;
long atime;
long mtime;
long ctime;
}
[StructLayout (LayoutKind.Sequential)]
public class _statvfs {
long bsize;
long frsize;
long blocks;
long bfree;
long bavail;
long files;
long ffree;
long favail;
long fsid;
long flag;
long namemax;
}
[StructLayout (LayoutKind.Sequential)]
public class _dirent {
long ino;
char ftyp;
string name;
}
[StructLayout (LayoutKind.Sequential)]
public class _version {
long major;
long minor;
long release;
string extra;
}
[StructLayout (LayoutKind.Sequential)]
public class _xattr {
string attrname;
uint attrval_len;
string attrval;
}
[StructLayout (LayoutKind.Sequential)]
public class _inotify_event {
long in_wd;
uint in_mask;
uint in_cookie;
string in_name;
}
[StructLayout (LayoutKind.Sequential)]
public class _partition {
int part_num;
ulong part_start;
ulong part_end;
ulong part_size;
}
[StructLayout (LayoutKind.Sequential)]
public class _application {
string app_name;
string app_display_name;
int app_epoch;
string app_version;
string app_release;
string app_install_path;
string app_trans_path;
string app_publisher;
string app_url;
string app_source_package;
string app_summary;
string app_description;
}
[StructLayout (LayoutKind.Sequential)]
public class _isoinfo {
string iso_system_id;
string iso_volume_id;
uint iso_volume_space_size;
uint iso_volume_set_size;
uint iso_volume_sequence_number;
uint iso_logical_block_size;
string iso_volume_set_id;
string iso_publisher_id;
string iso_data_preparer_id;
string iso_application_id;
string iso_copyright_file_id;
string iso_abstract_file_id;
string iso_bibliographic_file_id;
long iso_volume_creation_t;
long iso_volume_modification_t;
long iso_volume_expiration_t;
long iso_volume_effective_t;
}
[StructLayout (LayoutKind.Sequential)]
public class _mdstat {
string mdstat_device;
int mdstat_index;
string mdstat_flags;
}
[StructLayout (LayoutKind.Sequential)]
public class _btrfssubvolume {
ulong btrfssubvolume_id;
ulong btrfssubvolume_top_level_id;
string btrfssubvolume_path;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_cdrom (IntPtr h, [In] string filename);
/// <summary>
/// add a CD-ROM disk image to examine
/// </summary>
public void add_cdrom (string filename)
{
int r;
r = guestfs_add_cdrom (_handle, filename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_domain (IntPtr h, [In] string dom);
/// <summary>
/// add the disk(s) from a named libvirt domain
/// </summary>
public int add_domain (string dom)
{
int r;
r = guestfs_add_domain (_handle, dom);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_drive (IntPtr h, [In] string filename);
/// <summary>
/// add an image to examine or modify
/// </summary>
public void add_drive (string filename)
{
int r;
r = guestfs_add_drive (_handle, filename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_drive_opts (IntPtr h, [In] string filename);
/// <summary>
/// add an image to examine or modify
/// </summary>
public void add_drive_opts (string filename)
{
int r;
r = guestfs_add_drive_opts (_handle, filename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_drive_ro (IntPtr h, [In] string filename);
/// <summary>
/// add a drive in snapshot mode (read-only)
/// </summary>
public void add_drive_ro (string filename)
{
int r;
r = guestfs_add_drive_ro (_handle, filename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_drive_ro_with_if (IntPtr h, [In] string filename, [In] string iface);
/// <summary>
/// add a drive read-only specifying the QEMU block emulation to use
/// </summary>
public void add_drive_ro_with_if (string filename, string iface)
{
int r;
r = guestfs_add_drive_ro_with_if (_handle, filename, iface);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_add_drive_with_if (IntPtr h, [In] string filename, [In] string iface);
/// <summary>
/// add a drive specifying the QEMU block emulation to use
/// </summary>
public void add_drive_with_if (string filename, string iface)
{
int r;
r = guestfs_add_drive_with_if (_handle, filename, iface);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_clear (IntPtr h, [In] string augpath);
/// <summary>
/// clear Augeas path
/// </summary>
public void aug_clear (string augpath)
{
int r;
r = guestfs_aug_clear (_handle, augpath);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_close (IntPtr h);
/// <summary>
/// close the current Augeas handle
/// </summary>
public void aug_close ()
{
int r;
r = guestfs_aug_close (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _int_bool guestfs_aug_defnode (IntPtr h, [In] string name, [In] string expr, [In] string val);
/// <summary>
/// define an Augeas node
/// </summary>
public _int_bool aug_defnode (string name, string expr, string val)
{
_int_bool r;
r = guestfs_aug_defnode (_handle, name, expr, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_defvar (IntPtr h, [In] string name, [In] string expr);
/// <summary>
/// define an Augeas variable
/// </summary>
public int aug_defvar (string name, string expr)
{
int r;
r = guestfs_aug_defvar (_handle, name, expr);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_aug_get (IntPtr h, [In] string augpath);
/// <summary>
/// look up the value of an Augeas path
/// </summary>
public string aug_get (string augpath)
{
string r;
r = guestfs_aug_get (_handle, augpath);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_init (IntPtr h, [In] string root, int flags);
/// <summary>
/// create a new Augeas handle
/// </summary>
public void aug_init (string root, int flags)
{
int r;
r = guestfs_aug_init (_handle, root, flags);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_insert (IntPtr h, [In] string augpath, [In] string label, bool before);
/// <summary>
/// insert a sibling Augeas node
/// </summary>
public void aug_insert (string augpath, string label, bool before)
{
int r;
r = guestfs_aug_insert (_handle, augpath, label, before);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_load (IntPtr h);
/// <summary>
/// load files into the tree
/// </summary>
public void aug_load ()
{
int r;
r = guestfs_aug_load (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_aug_ls (IntPtr h, [In] string augpath);
/// <summary>
/// list Augeas nodes under augpath
/// </summary>
public string[] aug_ls (string augpath)
{
string[] r;
r = guestfs_aug_ls (_handle, augpath);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_aug_match (IntPtr h, [In] string augpath);
/// <summary>
/// return Augeas nodes which match augpath
/// </summary>
public string[] aug_match (string augpath)
{
string[] r;
r = guestfs_aug_match (_handle, augpath);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_mv (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// move Augeas node
/// </summary>
public void aug_mv (string src, string dest)
{
int r;
r = guestfs_aug_mv (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_rm (IntPtr h, [In] string augpath);
/// <summary>
/// remove an Augeas path
/// </summary>
public int aug_rm (string augpath)
{
int r;
r = guestfs_aug_rm (_handle, augpath);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_save (IntPtr h);
/// <summary>
/// write all pending Augeas changes to disk
/// </summary>
public void aug_save ()
{
int r;
r = guestfs_aug_save (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_aug_set (IntPtr h, [In] string augpath, [In] string val);
/// <summary>
/// set Augeas path to value
/// </summary>
public void aug_set (string augpath, string val)
{
int r;
r = guestfs_aug_set (_handle, augpath, val);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_available (IntPtr h, [In] string[] groups);
/// <summary>
/// test availability of some parts of the API
/// </summary>
public void available (string[] groups)
{
int r;
r = guestfs_available (_handle, groups);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_available_all_groups (IntPtr h);
/// <summary>
/// return a list of all optional groups
/// </summary>
public string[] available_all_groups ()
{
string[] r;
r = guestfs_available_all_groups (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_base64_in (IntPtr h, [In] string base64file, [In] string filename);
/// <summary>
/// upload base64-encoded data to file
/// </summary>
public void base64_in (string base64file, string filename)
{
int r;
r = guestfs_base64_in (_handle, base64file, filename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_base64_out (IntPtr h, [In] string filename, [In] string base64file);
/// <summary>
/// download file and encode as base64
/// </summary>
public void base64_out (string filename, string base64file)
{
int r;
r = guestfs_base64_out (_handle, filename, base64file);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_blkid (IntPtr h, [In] string device);
/// <summary>
/// print block device attributes
/// </summary>
public Hashtable blkid (string device)
{
string[] r;
r = guestfs_blkid (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_flushbufs (IntPtr h, [In] string device);
/// <summary>
/// flush device buffers
/// </summary>
public void blockdev_flushbufs (string device)
{
int r;
r = guestfs_blockdev_flushbufs (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_getbsz (IntPtr h, [In] string device);
/// <summary>
/// get blocksize of block device
/// </summary>
public int blockdev_getbsz (string device)
{
int r;
r = guestfs_blockdev_getbsz (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_getro (IntPtr h, [In] string device);
/// <summary>
/// is block device set to read-only
/// </summary>
public bool blockdev_getro (string device)
{
int r;
r = guestfs_blockdev_getro (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_blockdev_getsize64 (IntPtr h, [In] string device);
/// <summary>
/// get total size of device in bytes
/// </summary>
public long blockdev_getsize64 (string device)
{
long r;
r = guestfs_blockdev_getsize64 (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_getss (IntPtr h, [In] string device);
/// <summary>
/// get sectorsize of block device
/// </summary>
public int blockdev_getss (string device)
{
int r;
r = guestfs_blockdev_getss (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_blockdev_getsz (IntPtr h, [In] string device);
/// <summary>
/// get total size of device in 512-byte sectors
/// </summary>
public long blockdev_getsz (string device)
{
long r;
r = guestfs_blockdev_getsz (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_rereadpt (IntPtr h, [In] string device);
/// <summary>
/// reread partition table
/// </summary>
public void blockdev_rereadpt (string device)
{
int r;
r = guestfs_blockdev_rereadpt (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_setbsz (IntPtr h, [In] string device, int blocksize);
/// <summary>
/// set blocksize of block device
/// </summary>
public void blockdev_setbsz (string device, int blocksize)
{
int r;
r = guestfs_blockdev_setbsz (_handle, device, blocksize);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_setro (IntPtr h, [In] string device);
/// <summary>
/// set block device to read-only
/// </summary>
public void blockdev_setro (string device)
{
int r;
r = guestfs_blockdev_setro (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_blockdev_setrw (IntPtr h, [In] string device);
/// <summary>
/// set block device to read-write
/// </summary>
public void blockdev_setrw (string device)
{
int r;
r = guestfs_blockdev_setrw (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_device_add (IntPtr h, [In] string[] devices, [In] string fs);
/// <summary>
/// add devices to a btrfs filesystem
/// </summary>
public void btrfs_device_add (string[] devices, string fs)
{
int r;
r = guestfs_btrfs_device_add (_handle, devices, fs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_device_delete (IntPtr h, [In] string[] devices, [In] string fs);
/// <summary>
/// remove devices from a btrfs filesystem
/// </summary>
public void btrfs_device_delete (string[] devices, string fs)
{
int r;
r = guestfs_btrfs_device_delete (_handle, devices, fs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_filesystem_balance (IntPtr h, [In] string fs);
/// <summary>
/// balance a btrfs filesystem
/// </summary>
public void btrfs_filesystem_balance (string fs)
{
int r;
r = guestfs_btrfs_filesystem_balance (_handle, fs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_filesystem_resize (IntPtr h, [In] string mountpoint);
/// <summary>
/// resize a btrfs filesystem
/// </summary>
public void btrfs_filesystem_resize (string mountpoint)
{
int r;
r = guestfs_btrfs_filesystem_resize (_handle, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_filesystem_sync (IntPtr h, [In] string fs);
/// <summary>
/// sync a btrfs filesystem
/// </summary>
public void btrfs_filesystem_sync (string fs)
{
int r;
r = guestfs_btrfs_filesystem_sync (_handle, fs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_fsck (IntPtr h, [In] string device);
/// <summary>
/// check a btrfs filesystem
/// </summary>
public void btrfs_fsck (string device)
{
int r;
r = guestfs_btrfs_fsck (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_set_seeding (IntPtr h, [In] string device, bool seeding);
/// <summary>
/// enable or disable the seeding feature of device
/// </summary>
public void btrfs_set_seeding (string device, bool seeding)
{
int r;
r = guestfs_btrfs_set_seeding (_handle, device, seeding);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_subvolume_create (IntPtr h, [In] string dest);
/// <summary>
/// create a btrfs snapshot
/// </summary>
public void btrfs_subvolume_create (string dest)
{
int r;
r = guestfs_btrfs_subvolume_create (_handle, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_subvolume_delete (IntPtr h, [In] string subvolume);
/// <summary>
/// delete a btrfs snapshot
/// </summary>
public void btrfs_subvolume_delete (string subvolume)
{
int r;
r = guestfs_btrfs_subvolume_delete (_handle, subvolume);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _btrfssubvolume[] guestfs_btrfs_subvolume_list (IntPtr h, [In] string fs);
/// <summary>
/// list btrfs snapshots and subvolumes
/// </summary>
public _btrfssubvolume[] btrfs_subvolume_list (string fs)
{
_btrfssubvolume[] r;
r = guestfs_btrfs_subvolume_list (_handle, fs);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_subvolume_set_default (IntPtr h, long id, [In] string fs);
/// <summary>
/// set default btrfs subvolume
/// </summary>
public void btrfs_subvolume_set_default (long id, string fs)
{
int r;
r = guestfs_btrfs_subvolume_set_default (_handle, id, fs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_btrfs_subvolume_snapshot (IntPtr h, [In] string source, [In] string dest);
/// <summary>
/// create a writable btrfs snapshot
/// </summary>
public void btrfs_subvolume_snapshot (string source, string dest)
{
int r;
r = guestfs_btrfs_subvolume_snapshot (_handle, source, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_case_sensitive_path (IntPtr h, [In] string path);
/// <summary>
/// return true path on case-insensitive filesystem
/// </summary>
public string case_sensitive_path (string path)
{
string r;
r = guestfs_case_sensitive_path (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_cat (IntPtr h, [In] string path);
/// <summary>
/// list the contents of a file
/// </summary>
public string cat (string path)
{
string r;
r = guestfs_cat (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_checksum (IntPtr h, [In] string csumtype, [In] string path);
/// <summary>
/// compute MD5, SHAx or CRC checksum of file
/// </summary>
public string checksum (string csumtype, string path)
{
string r;
r = guestfs_checksum (_handle, csumtype, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_checksum_device (IntPtr h, [In] string csumtype, [In] string device);
/// <summary>
/// compute MD5, SHAx or CRC checksum of the contents of a device
/// </summary>
public string checksum_device (string csumtype, string device)
{
string r;
r = guestfs_checksum_device (_handle, csumtype, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_checksums_out (IntPtr h, [In] string csumtype, [In] string directory, [In] string sumsfile);
/// <summary>
/// compute MD5, SHAx or CRC checksum of files in a directory
/// </summary>
public void checksums_out (string csumtype, string directory, string sumsfile)
{
int r;
r = guestfs_checksums_out (_handle, csumtype, directory, sumsfile);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_chmod (IntPtr h, int mode, [In] string path);
/// <summary>
/// change file mode
/// </summary>
public void chmod (int mode, string path)
{
int r;
r = guestfs_chmod (_handle, mode, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_chown (IntPtr h, int owner, int group, [In] string path);
/// <summary>
/// change file owner and group
/// </summary>
public void chown (int owner, int group, string path)
{
int r;
r = guestfs_chown (_handle, owner, group, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_command (IntPtr h, [In] string[] arguments);
/// <summary>
/// run a command from the guest filesystem
/// </summary>
public string command (string[] arguments)
{
string r;
r = guestfs_command (_handle, arguments);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_command_lines (IntPtr h, [In] string[] arguments);
/// <summary>
/// run a command, returning lines
/// </summary>
public string[] command_lines (string[] arguments)
{
string[] r;
r = guestfs_command_lines (_handle, arguments);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_compress_device_out (IntPtr h, [In] string ctype, [In] string device, [In] string zdevice);
/// <summary>
/// output compressed device
/// </summary>
public void compress_device_out (string ctype, string device, string zdevice)
{
int r;
r = guestfs_compress_device_out (_handle, ctype, device, zdevice);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_compress_out (IntPtr h, [In] string ctype, [In] string file, [In] string zfile);
/// <summary>
/// output compressed file
/// </summary>
public void compress_out (string ctype, string file, string zfile)
{
int r;
r = guestfs_compress_out (_handle, ctype, file, zfile);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_config (IntPtr h, [In] string qemuparam, [In] string qemuvalue);
/// <summary>
/// add qemu parameters
/// </summary>
public void config (string qemuparam, string qemuvalue)
{
int r;
r = guestfs_config (_handle, qemuparam, qemuvalue);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_copy_device_to_device (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy from source device to destination device
/// </summary>
public void copy_device_to_device (string src, string dest)
{
int r;
r = guestfs_copy_device_to_device (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_copy_device_to_file (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy from source device to destination file
/// </summary>
public void copy_device_to_file (string src, string dest)
{
int r;
r = guestfs_copy_device_to_file (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_copy_file_to_device (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy from source file to destination device
/// </summary>
public void copy_file_to_device (string src, string dest)
{
int r;
r = guestfs_copy_file_to_device (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_copy_file_to_file (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy from source file to destination file
/// </summary>
public void copy_file_to_file (string src, string dest)
{
int r;
r = guestfs_copy_file_to_file (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_copy_size (IntPtr h, [In] string src, [In] string dest, long size);
/// <summary>
/// copy size bytes from source to destination using dd
/// </summary>
public void copy_size (string src, string dest, long size)
{
int r;
r = guestfs_copy_size (_handle, src, dest, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_cp (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy a file
/// </summary>
public void cp (string src, string dest)
{
int r;
r = guestfs_cp (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_cp_a (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy a file or directory recursively
/// </summary>
public void cp_a (string src, string dest)
{
int r;
r = guestfs_cp_a (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_dd (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// copy from source to destination using dd
/// </summary>
public void dd (string src, string dest)
{
int r;
r = guestfs_dd (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_debug (IntPtr h, [In] string subcmd, [In] string[] extraargs);
/// <summary>
/// debugging and internals
/// </summary>
public string debug (string subcmd, string[] extraargs)
{
string r;
r = guestfs_debug (_handle, subcmd, extraargs);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_debug_cmdline (IntPtr h);
/// <summary>
/// debug the QEMU command line (internal use only)
/// </summary>
public string[] debug_cmdline ()
{
string[] r;
r = guestfs_debug_cmdline (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_debug_drives (IntPtr h);
/// <summary>
/// debug the drives (internal use only)
/// </summary>
public string[] debug_drives ()
{
string[] r;
r = guestfs_debug_drives (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_debug_upload (IntPtr h, [In] string filename, [In] string tmpname, int mode);
/// <summary>
/// upload a file to the appliance (internal use only)
/// </summary>
public void debug_upload (string filename, string tmpname, int mode)
{
int r;
r = guestfs_debug_upload (_handle, filename, tmpname, mode);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_df (IntPtr h);
/// <summary>
/// report file system disk space usage
/// </summary>
public string df ()
{
string r;
r = guestfs_df (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_df_h (IntPtr h);
/// <summary>
/// report file system disk space usage (human readable)
/// </summary>
public string df_h ()
{
string r;
r = guestfs_df_h (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_dmesg (IntPtr h);
/// <summary>
/// return kernel messages
/// </summary>
public string dmesg ()
{
string r;
r = guestfs_dmesg (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_download (IntPtr h, [In] string remotefilename, [In] string filename);
/// <summary>
/// download a file to the local machine
/// </summary>
public void download (string remotefilename, string filename)
{
int r;
r = guestfs_download (_handle, remotefilename, filename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_download_offset (IntPtr h, [In] string remotefilename, [In] string filename, long offset, long size);
/// <summary>
/// download a file to the local machine with offset and size
/// </summary>
public void download_offset (string remotefilename, string filename, long offset, long size)
{
int r;
r = guestfs_download_offset (_handle, remotefilename, filename, offset, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_drop_caches (IntPtr h, int whattodrop);
/// <summary>
/// drop kernel page cache, dentries and inodes
/// </summary>
public void drop_caches (int whattodrop)
{
int r;
r = guestfs_drop_caches (_handle, whattodrop);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_du (IntPtr h, [In] string path);
/// <summary>
/// estimate file space usage
/// </summary>
public long du (string path)
{
long r;
r = guestfs_du (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_e2fsck (IntPtr h, [In] string device);
/// <summary>
/// check an ext2/ext3 filesystem
/// </summary>
public void e2fsck (string device)
{
int r;
r = guestfs_e2fsck (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_e2fsck_f (IntPtr h, [In] string device);
/// <summary>
/// check an ext2/ext3 filesystem
/// </summary>
public void e2fsck_f (string device)
{
int r;
r = guestfs_e2fsck_f (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_echo_daemon (IntPtr h, [In] string[] words);
/// <summary>
/// echo arguments back to the client
/// </summary>
public string echo_daemon (string[] words)
{
string r;
r = guestfs_echo_daemon (_handle, words);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_egrep (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] egrep (string regex, string path)
{
string[] r;
r = guestfs_egrep (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_egrepi (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] egrepi (string regex, string path)
{
string[] r;
r = guestfs_egrepi (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_equal (IntPtr h, [In] string file1, [In] string file2);
/// <summary>
/// test if two files have equal contents
/// </summary>
public bool equal (string file1, string file2)
{
int r;
r = guestfs_equal (_handle, file1, file2);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_exists (IntPtr h, [In] string path);
/// <summary>
/// test if file or directory exists
/// </summary>
public bool exists (string path)
{
int r;
r = guestfs_exists (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_fallocate (IntPtr h, [In] string path, int len);
/// <summary>
/// preallocate a file in the guest filesystem
/// </summary>
public void fallocate (string path, int len)
{
int r;
r = guestfs_fallocate (_handle, path, len);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_fallocate64 (IntPtr h, [In] string path, long len);
/// <summary>
/// preallocate a file in the guest filesystem
/// </summary>
public void fallocate64 (string path, long len)
{
int r;
r = guestfs_fallocate64 (_handle, path, len);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_fgrep (IntPtr h, [In] string pattern, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] fgrep (string pattern, string path)
{
string[] r;
r = guestfs_fgrep (_handle, pattern, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_fgrepi (IntPtr h, [In] string pattern, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] fgrepi (string pattern, string path)
{
string[] r;
r = guestfs_fgrepi (_handle, pattern, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_file (IntPtr h, [In] string path);
/// <summary>
/// determine file type
/// </summary>
public string file (string path)
{
string r;
r = guestfs_file (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_file_architecture (IntPtr h, [In] string filename);
/// <summary>
/// detect the architecture of a binary file
/// </summary>
public string file_architecture (string filename)
{
string r;
r = guestfs_file_architecture (_handle, filename);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_filesize (IntPtr h, [In] string file);
/// <summary>
/// return the size of the file in bytes
/// </summary>
public long filesize (string file)
{
long r;
r = guestfs_filesize (_handle, file);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_fill (IntPtr h, int c, int len, [In] string path);
/// <summary>
/// fill a file with octets
/// </summary>
public void fill (int c, int len, string path)
{
int r;
r = guestfs_fill (_handle, c, len, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_fill_pattern (IntPtr h, [In] string pattern, int len, [In] string path);
/// <summary>
/// fill a file with a repeating pattern of bytes
/// </summary>
public void fill_pattern (string pattern, int len, string path)
{
int r;
r = guestfs_fill_pattern (_handle, pattern, len, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_find (IntPtr h, [In] string directory);
/// <summary>
/// find all files and directories
/// </summary>
public string[] find (string directory)
{
string[] r;
r = guestfs_find (_handle, directory);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_find0 (IntPtr h, [In] string directory, [In] string files);
/// <summary>
/// find all files and directories, returning NUL-separated list
/// </summary>
public void find0 (string directory, string files)
{
int r;
r = guestfs_find0 (_handle, directory, files);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_findfs_label (IntPtr h, [In] string label);
/// <summary>
/// find a filesystem by label
/// </summary>
public string findfs_label (string label)
{
string r;
r = guestfs_findfs_label (_handle, label);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_findfs_uuid (IntPtr h, [In] string uuid);
/// <summary>
/// find a filesystem by UUID
/// </summary>
public string findfs_uuid (string uuid)
{
string r;
r = guestfs_findfs_uuid (_handle, uuid);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_fsck (IntPtr h, [In] string fstype, [In] string device);
/// <summary>
/// run the filesystem checker
/// </summary>
public int fsck (string fstype, string device)
{
int r;
r = guestfs_fsck (_handle, fstype, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_append (IntPtr h);
/// <summary>
/// get the additional kernel options
/// </summary>
public string get_append ()
{
string r;
r = guestfs_get_append (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_attach_method (IntPtr h);
/// <summary>
/// get the attach method
/// </summary>
public string get_attach_method ()
{
string r;
r = guestfs_get_attach_method (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_autosync (IntPtr h);
/// <summary>
/// get autosync mode
/// </summary>
public bool get_autosync ()
{
int r;
r = guestfs_get_autosync (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_direct (IntPtr h);
/// <summary>
/// get direct appliance mode flag
/// </summary>
public bool get_direct ()
{
int r;
r = guestfs_get_direct (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_e2attrs (IntPtr h, [In] string file);
/// <summary>
/// get ext2 file attributes of a file
/// </summary>
public string get_e2attrs (string file)
{
string r;
r = guestfs_get_e2attrs (_handle, file);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_get_e2generation (IntPtr h, [In] string file);
/// <summary>
/// get ext2 file generation of a file
/// </summary>
public long get_e2generation (string file)
{
long r;
r = guestfs_get_e2generation (_handle, file);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_e2label (IntPtr h, [In] string device);
/// <summary>
/// get the ext2/3/4 filesystem label
/// </summary>
public string get_e2label (string device)
{
string r;
r = guestfs_get_e2label (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_e2uuid (IntPtr h, [In] string device);
/// <summary>
/// get the ext2/3/4 filesystem UUID
/// </summary>
public string get_e2uuid (string device)
{
string r;
r = guestfs_get_e2uuid (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_memsize (IntPtr h);
/// <summary>
/// get memory allocated to the qemu subprocess
/// </summary>
public int get_memsize ()
{
int r;
r = guestfs_get_memsize (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_network (IntPtr h);
/// <summary>
/// get enable network flag
/// </summary>
public bool get_network ()
{
int r;
r = guestfs_get_network (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_path (IntPtr h);
/// <summary>
/// get the search path
/// </summary>
public string get_path ()
{
string r;
r = guestfs_get_path (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_pgroup (IntPtr h);
/// <summary>
/// get process group flag
/// </summary>
public bool get_pgroup ()
{
int r;
r = guestfs_get_pgroup (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_pid (IntPtr h);
/// <summary>
/// get PID of qemu subprocess
/// </summary>
public int get_pid ()
{
int r;
r = guestfs_get_pid (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_get_qemu (IntPtr h);
/// <summary>
/// get the qemu binary
/// </summary>
public string get_qemu ()
{
string r;
r = guestfs_get_qemu (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_recovery_proc (IntPtr h);
/// <summary>
/// get recovery process enabled flag
/// </summary>
public bool get_recovery_proc ()
{
int r;
r = guestfs_get_recovery_proc (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_selinux (IntPtr h);
/// <summary>
/// get SELinux enabled flag
/// </summary>
public bool get_selinux ()
{
int r;
r = guestfs_get_selinux (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_smp (IntPtr h);
/// <summary>
/// get number of virtual CPUs in appliance
/// </summary>
public int get_smp ()
{
int r;
r = guestfs_get_smp (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_state (IntPtr h);
/// <summary>
/// get the current state
/// </summary>
public int get_state ()
{
int r;
r = guestfs_get_state (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_trace (IntPtr h);
/// <summary>
/// get command trace enabled flag
/// </summary>
public bool get_trace ()
{
int r;
r = guestfs_get_trace (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_umask (IntPtr h);
/// <summary>
/// get the current umask
/// </summary>
public int get_umask ()
{
int r;
r = guestfs_get_umask (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_get_verbose (IntPtr h);
/// <summary>
/// get verbose mode
/// </summary>
public bool get_verbose ()
{
int r;
r = guestfs_get_verbose (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_getcon (IntPtr h);
/// <summary>
/// get SELinux security context
/// </summary>
public string getcon ()
{
string r;
r = guestfs_getcon (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_getxattr (IntPtr h, [In] string path, [In] string name);
/// <summary>
/// get a single extended attribute
/// </summary>
public string getxattr (string path, string name)
{
string r;
r = guestfs_getxattr (_handle, path, name);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _xattr[] guestfs_getxattrs (IntPtr h, [In] string path);
/// <summary>
/// list extended attributes of a file or directory
/// </summary>
public _xattr[] getxattrs (string path)
{
_xattr[] r;
r = guestfs_getxattrs (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_glob_expand (IntPtr h, [In] string pattern);
/// <summary>
/// expand a wildcard path
/// </summary>
public string[] glob_expand (string pattern)
{
string[] r;
r = guestfs_glob_expand (_handle, pattern);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_grep (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] grep (string regex, string path)
{
string[] r;
r = guestfs_grep (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_grepi (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] grepi (string regex, string path)
{
string[] r;
r = guestfs_grepi (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_grub_install (IntPtr h, [In] string root, [In] string device);
/// <summary>
/// install GRUB 1
/// </summary>
public void grub_install (string root, string device)
{
int r;
r = guestfs_grub_install (_handle, root, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_head (IntPtr h, [In] string path);
/// <summary>
/// return first 10 lines of a file
/// </summary>
public string[] head (string path)
{
string[] r;
r = guestfs_head (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_head_n (IntPtr h, int nrlines, [In] string path);
/// <summary>
/// return first N lines of a file
/// </summary>
public string[] head_n (int nrlines, string path)
{
string[] r;
r = guestfs_head_n (_handle, nrlines, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_hexdump (IntPtr h, [In] string path);
/// <summary>
/// dump a file in hexadecimal
/// </summary>
public string hexdump (string path)
{
string r;
r = guestfs_hexdump (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_initrd_cat (IntPtr h, [In] string initrdpath, [In] string filename);
/// <summary>
/// list the contents of a single file in an initrd
/// </summary>
public string initrd_cat (string initrdpath, string filename)
{
string r;
r = guestfs_initrd_cat (_handle, initrdpath, filename);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_initrd_list (IntPtr h, [In] string path);
/// <summary>
/// list files in an initrd
/// </summary>
public string[] initrd_list (string path)
{
string[] r;
r = guestfs_initrd_list (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_inotify_add_watch (IntPtr h, [In] string path, int mask);
/// <summary>
/// add an inotify watch
/// </summary>
public long inotify_add_watch (string path, int mask)
{
long r;
r = guestfs_inotify_add_watch (_handle, path, mask);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inotify_close (IntPtr h);
/// <summary>
/// close the inotify handle
/// </summary>
public void inotify_close ()
{
int r;
r = guestfs_inotify_close (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_inotify_files (IntPtr h);
/// <summary>
/// return list of watched files that had events
/// </summary>
public string[] inotify_files ()
{
string[] r;
r = guestfs_inotify_files (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inotify_init (IntPtr h, int maxevents);
/// <summary>
/// create an inotify handle
/// </summary>
public void inotify_init (int maxevents)
{
int r;
r = guestfs_inotify_init (_handle, maxevents);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _inotify_event[] guestfs_inotify_read (IntPtr h);
/// <summary>
/// return list of inotify events
/// </summary>
public _inotify_event[] inotify_read ()
{
_inotify_event[] r;
r = guestfs_inotify_read (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inotify_rm_watch (IntPtr h, int wd);
/// <summary>
/// remove an inotify watch
/// </summary>
public void inotify_rm_watch (int wd)
{
int r;
r = guestfs_inotify_rm_watch (_handle, wd);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_arch (IntPtr h, [In] string root);
/// <summary>
/// get architecture of inspected operating system
/// </summary>
public string inspect_get_arch (string root)
{
string r;
r = guestfs_inspect_get_arch (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_distro (IntPtr h, [In] string root);
/// <summary>
/// get distro of inspected operating system
/// </summary>
public string inspect_get_distro (string root)
{
string r;
r = guestfs_inspect_get_distro (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_inspect_get_drive_mappings (IntPtr h, [In] string root);
/// <summary>
/// get drive letter mappings
/// </summary>
public Hashtable inspect_get_drive_mappings (string root)
{
string[] r;
r = guestfs_inspect_get_drive_mappings (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_inspect_get_filesystems (IntPtr h, [In] string root);
/// <summary>
/// get filesystems associated with inspected operating system
/// </summary>
public string[] inspect_get_filesystems (string root)
{
string[] r;
r = guestfs_inspect_get_filesystems (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_format (IntPtr h, [In] string root);
/// <summary>
/// get format of inspected operating system
/// </summary>
public string inspect_get_format (string root)
{
string r;
r = guestfs_inspect_get_format (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_hostname (IntPtr h, [In] string root);
/// <summary>
/// get hostname of the operating system
/// </summary>
public string inspect_get_hostname (string root)
{
string r;
r = guestfs_inspect_get_hostname (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_icon (IntPtr h, [In] string root);
/// <summary>
/// get the icon corresponding to this operating system
/// </summary>
public string inspect_get_icon (string root)
{
string r;
r = guestfs_inspect_get_icon (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inspect_get_major_version (IntPtr h, [In] string root);
/// <summary>
/// get major version of inspected operating system
/// </summary>
public int inspect_get_major_version (string root)
{
int r;
r = guestfs_inspect_get_major_version (_handle, root);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inspect_get_minor_version (IntPtr h, [In] string root);
/// <summary>
/// get minor version of inspected operating system
/// </summary>
public int inspect_get_minor_version (string root)
{
int r;
r = guestfs_inspect_get_minor_version (_handle, root);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_inspect_get_mountpoints (IntPtr h, [In] string root);
/// <summary>
/// get mountpoints of inspected operating system
/// </summary>
public Hashtable inspect_get_mountpoints (string root)
{
string[] r;
r = guestfs_inspect_get_mountpoints (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_package_format (IntPtr h, [In] string root);
/// <summary>
/// get package format used by the operating system
/// </summary>
public string inspect_get_package_format (string root)
{
string r;
r = guestfs_inspect_get_package_format (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_package_management (IntPtr h, [In] string root);
/// <summary>
/// get package management tool used by the operating system
/// </summary>
public string inspect_get_package_management (string root)
{
string r;
r = guestfs_inspect_get_package_management (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_product_name (IntPtr h, [In] string root);
/// <summary>
/// get product name of inspected operating system
/// </summary>
public string inspect_get_product_name (string root)
{
string r;
r = guestfs_inspect_get_product_name (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_product_variant (IntPtr h, [In] string root);
/// <summary>
/// get product variant of inspected operating system
/// </summary>
public string inspect_get_product_variant (string root)
{
string r;
r = guestfs_inspect_get_product_variant (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_inspect_get_roots (IntPtr h);
/// <summary>
/// return list of operating systems found by last inspection
/// </summary>
public string[] inspect_get_roots ()
{
string[] r;
r = guestfs_inspect_get_roots (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_type (IntPtr h, [In] string root);
/// <summary>
/// get type of inspected operating system
/// </summary>
public string inspect_get_type (string root)
{
string r;
r = guestfs_inspect_get_type (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_windows_current_control_set (IntPtr h, [In] string root);
/// <summary>
/// get Windows CurrentControlSet of inspected operating system
/// </summary>
public string inspect_get_windows_current_control_set (string root)
{
string r;
r = guestfs_inspect_get_windows_current_control_set (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_inspect_get_windows_systemroot (IntPtr h, [In] string root);
/// <summary>
/// get Windows systemroot of inspected operating system
/// </summary>
public string inspect_get_windows_systemroot (string root)
{
string r;
r = guestfs_inspect_get_windows_systemroot (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inspect_is_live (IntPtr h, [In] string root);
/// <summary>
/// get live flag for install disk
/// </summary>
public bool inspect_is_live (string root)
{
int r;
r = guestfs_inspect_is_live (_handle, root);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inspect_is_multipart (IntPtr h, [In] string root);
/// <summary>
/// get multipart flag for install disk
/// </summary>
public bool inspect_is_multipart (string root)
{
int r;
r = guestfs_inspect_is_multipart (_handle, root);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_inspect_is_netinst (IntPtr h, [In] string root);
/// <summary>
/// get netinst (network installer) flag for install disk
/// </summary>
public bool inspect_is_netinst (string root)
{
int r;
r = guestfs_inspect_is_netinst (_handle, root);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern _application[] guestfs_inspect_list_applications (IntPtr h, [In] string root);
/// <summary>
/// get list of applications installed in the operating system
/// </summary>
public _application[] inspect_list_applications (string root)
{
_application[] r;
r = guestfs_inspect_list_applications (_handle, root);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_inspect_os (IntPtr h);
/// <summary>
/// inspect disk and return list of operating systems found
/// </summary>
public string[] inspect_os ()
{
string[] r;
r = guestfs_inspect_os (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_internal_autosync (IntPtr h);
/// <summary>
/// internal autosync operation
/// </summary>
public void internal_autosync ()
{
int r;
r = guestfs_internal_autosync (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_blockdev (IntPtr h, [In] string path);
/// <summary>
/// test if block device
/// </summary>
public bool is_blockdev (string path)
{
int r;
r = guestfs_is_blockdev (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_busy (IntPtr h);
/// <summary>
/// is busy processing a command
/// </summary>
public bool is_busy ()
{
int r;
r = guestfs_is_busy (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_chardev (IntPtr h, [In] string path);
/// <summary>
/// test if character device
/// </summary>
public bool is_chardev (string path)
{
int r;
r = guestfs_is_chardev (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_config (IntPtr h);
/// <summary>
/// is in configuration state
/// </summary>
public bool is_config ()
{
int r;
r = guestfs_is_config (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_dir (IntPtr h, [In] string path);
/// <summary>
/// test if a directory
/// </summary>
public bool is_dir (string path)
{
int r;
r = guestfs_is_dir (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_fifo (IntPtr h, [In] string path);
/// <summary>
/// test if FIFO (named pipe)
/// </summary>
public bool is_fifo (string path)
{
int r;
r = guestfs_is_fifo (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_file (IntPtr h, [In] string path);
/// <summary>
/// test if a regular file
/// </summary>
public bool is_file (string path)
{
int r;
r = guestfs_is_file (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_launching (IntPtr h);
/// <summary>
/// is launching subprocess
/// </summary>
public bool is_launching ()
{
int r;
r = guestfs_is_launching (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_lv (IntPtr h, [In] string device);
/// <summary>
/// test if device is a logical volume
/// </summary>
public bool is_lv (string device)
{
int r;
r = guestfs_is_lv (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_ready (IntPtr h);
/// <summary>
/// is ready to accept commands
/// </summary>
public bool is_ready ()
{
int r;
r = guestfs_is_ready (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_socket (IntPtr h, [In] string path);
/// <summary>
/// test if socket
/// </summary>
public bool is_socket (string path)
{
int r;
r = guestfs_is_socket (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_symlink (IntPtr h, [In] string path);
/// <summary>
/// test if symbolic link
/// </summary>
public bool is_symlink (string path)
{
int r;
r = guestfs_is_symlink (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_zero (IntPtr h, [In] string path);
/// <summary>
/// test if a file contains all zero bytes
/// </summary>
public bool is_zero (string path)
{
int r;
r = guestfs_is_zero (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_is_zero_device (IntPtr h, [In] string device);
/// <summary>
/// test if a device contains all zero bytes
/// </summary>
public bool is_zero_device (string device)
{
int r;
r = guestfs_is_zero_device (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern _isoinfo guestfs_isoinfo (IntPtr h, [In] string isofile);
/// <summary>
/// get ISO information from primary volume descriptor of ISO file
/// </summary>
public _isoinfo isoinfo (string isofile)
{
_isoinfo r;
r = guestfs_isoinfo (_handle, isofile);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _isoinfo guestfs_isoinfo_device (IntPtr h, [In] string device);
/// <summary>
/// get ISO information from primary volume descriptor of device
/// </summary>
public _isoinfo isoinfo_device (string device)
{
_isoinfo r;
r = guestfs_isoinfo_device (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_kill_subprocess (IntPtr h);
/// <summary>
/// kill the qemu subprocess
/// </summary>
public void kill_subprocess ()
{
int r;
r = guestfs_kill_subprocess (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_launch (IntPtr h);
/// <summary>
/// launch the qemu subprocess
/// </summary>
public void launch ()
{
int r;
r = guestfs_launch (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lchown (IntPtr h, int owner, int group, [In] string path);
/// <summary>
/// change file owner and group
/// </summary>
public void lchown (int owner, int group, string path)
{
int r;
r = guestfs_lchown (_handle, owner, group, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_lgetxattr (IntPtr h, [In] string path, [In] string name);
/// <summary>
/// get a single extended attribute
/// </summary>
public string lgetxattr (string path, string name)
{
string r;
r = guestfs_lgetxattr (_handle, path, name);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _xattr[] guestfs_lgetxattrs (IntPtr h, [In] string path);
/// <summary>
/// list extended attributes of a file or directory
/// </summary>
public _xattr[] lgetxattrs (string path)
{
_xattr[] r;
r = guestfs_lgetxattrs (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_list_9p (IntPtr h);
/// <summary>
/// list 9p filesystems
/// </summary>
public string[] list_9p ()
{
string[] r;
r = guestfs_list_9p (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_list_devices (IntPtr h);
/// <summary>
/// list the block devices
/// </summary>
public string[] list_devices ()
{
string[] r;
r = guestfs_list_devices (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_list_dm_devices (IntPtr h);
/// <summary>
/// list device mapper devices
/// </summary>
public string[] list_dm_devices ()
{
string[] r;
r = guestfs_list_dm_devices (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_list_filesystems (IntPtr h);
/// <summary>
/// list filesystems
/// </summary>
public Hashtable list_filesystems ()
{
string[] r;
r = guestfs_list_filesystems (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_list_md_devices (IntPtr h);
/// <summary>
/// list Linux md (RAID) devices
/// </summary>
public string[] list_md_devices ()
{
string[] r;
r = guestfs_list_md_devices (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_list_partitions (IntPtr h);
/// <summary>
/// list the partitions
/// </summary>
public string[] list_partitions ()
{
string[] r;
r = guestfs_list_partitions (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_ll (IntPtr h, [In] string directory);
/// <summary>
/// list the files in a directory (long format)
/// </summary>
public string ll (string directory)
{
string r;
r = guestfs_ll (_handle, directory);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_llz (IntPtr h, [In] string directory);
/// <summary>
/// list the files in a directory (long format with SELinux contexts)
/// </summary>
public string llz (string directory)
{
string r;
r = guestfs_llz (_handle, directory);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ln (IntPtr h, [In] string target, [In] string linkname);
/// <summary>
/// create a hard link
/// </summary>
public void ln (string target, string linkname)
{
int r;
r = guestfs_ln (_handle, target, linkname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ln_f (IntPtr h, [In] string target, [In] string linkname);
/// <summary>
/// create a hard link
/// </summary>
public void ln_f (string target, string linkname)
{
int r;
r = guestfs_ln_f (_handle, target, linkname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ln_s (IntPtr h, [In] string target, [In] string linkname);
/// <summary>
/// create a symbolic link
/// </summary>
public void ln_s (string target, string linkname)
{
int r;
r = guestfs_ln_s (_handle, target, linkname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ln_sf (IntPtr h, [In] string target, [In] string linkname);
/// <summary>
/// create a symbolic link
/// </summary>
public void ln_sf (string target, string linkname)
{
int r;
r = guestfs_ln_sf (_handle, target, linkname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lremovexattr (IntPtr h, [In] string xattr, [In] string path);
/// <summary>
/// remove extended attribute of a file or directory
/// </summary>
public void lremovexattr (string xattr, string path)
{
int r;
r = guestfs_lremovexattr (_handle, xattr, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_ls (IntPtr h, [In] string directory);
/// <summary>
/// list the files in a directory
/// </summary>
public string[] ls (string directory)
{
string[] r;
r = guestfs_ls (_handle, directory);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lsetxattr (IntPtr h, [In] string xattr, [In] string val, int vallen, [In] string path);
/// <summary>
/// set extended attribute of a file or directory
/// </summary>
public void lsetxattr (string xattr, string val, int vallen, string path)
{
int r;
r = guestfs_lsetxattr (_handle, xattr, val, vallen, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _stat guestfs_lstat (IntPtr h, [In] string path);
/// <summary>
/// get file information for a symbolic link
/// </summary>
public _stat lstat (string path)
{
_stat r;
r = guestfs_lstat (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _stat[] guestfs_lstatlist (IntPtr h, [In] string path, [In] string[] names);
/// <summary>
/// lstat on multiple files
/// </summary>
public _stat[] lstatlist (string path, string[] names)
{
_stat[] r;
r = guestfs_lstatlist (_handle, path, names);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_add_key (IntPtr h, [In] string device, [In] string key, [In] string newkey, int keyslot);
/// <summary>
/// add a key on a LUKS encrypted device
/// </summary>
public void luks_add_key (string device, string key, string newkey, int keyslot)
{
int r;
r = guestfs_luks_add_key (_handle, device, key, newkey, keyslot);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_close (IntPtr h, [In] string device);
/// <summary>
/// close a LUKS device
/// </summary>
public void luks_close (string device)
{
int r;
r = guestfs_luks_close (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_format (IntPtr h, [In] string device, [In] string key, int keyslot);
/// <summary>
/// format a block device as a LUKS encrypted device
/// </summary>
public void luks_format (string device, string key, int keyslot)
{
int r;
r = guestfs_luks_format (_handle, device, key, keyslot);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_format_cipher (IntPtr h, [In] string device, [In] string key, int keyslot, [In] string cipher);
/// <summary>
/// format a block device as a LUKS encrypted device
/// </summary>
public void luks_format_cipher (string device, string key, int keyslot, string cipher)
{
int r;
r = guestfs_luks_format_cipher (_handle, device, key, keyslot, cipher);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_kill_slot (IntPtr h, [In] string device, [In] string key, int keyslot);
/// <summary>
/// remove a key from a LUKS encrypted device
/// </summary>
public void luks_kill_slot (string device, string key, int keyslot)
{
int r;
r = guestfs_luks_kill_slot (_handle, device, key, keyslot);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_open (IntPtr h, [In] string device, [In] string key, [In] string mapname);
/// <summary>
/// open a LUKS-encrypted block device
/// </summary>
public void luks_open (string device, string key, string mapname)
{
int r;
r = guestfs_luks_open (_handle, device, key, mapname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_luks_open_ro (IntPtr h, [In] string device, [In] string key, [In] string mapname);
/// <summary>
/// open a LUKS-encrypted block device read-only
/// </summary>
public void luks_open_ro (string device, string key, string mapname)
{
int r;
r = guestfs_luks_open_ro (_handle, device, key, mapname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvcreate (IntPtr h, [In] string logvol, [In] string volgroup, int mbytes);
/// <summary>
/// create an LVM logical volume
/// </summary>
public void lvcreate (string logvol, string volgroup, int mbytes)
{
int r;
r = guestfs_lvcreate (_handle, logvol, volgroup, mbytes);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvcreate_free (IntPtr h, [In] string logvol, [In] string volgroup, int percent);
/// <summary>
/// create an LVM logical volume in % remaining free space
/// </summary>
public void lvcreate_free (string logvol, string volgroup, int percent)
{
int r;
r = guestfs_lvcreate_free (_handle, logvol, volgroup, percent);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_lvm_canonical_lv_name (IntPtr h, [In] string lvname);
/// <summary>
/// get canonical name of an LV
/// </summary>
public string lvm_canonical_lv_name (string lvname)
{
string r;
r = guestfs_lvm_canonical_lv_name (_handle, lvname);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvm_clear_filter (IntPtr h);
/// <summary>
/// clear LVM device filter
/// </summary>
public void lvm_clear_filter ()
{
int r;
r = guestfs_lvm_clear_filter (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvm_remove_all (IntPtr h);
/// <summary>
/// remove all LVM LVs, VGs and PVs
/// </summary>
public void lvm_remove_all ()
{
int r;
r = guestfs_lvm_remove_all (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvm_set_filter (IntPtr h, [In] string[] devices);
/// <summary>
/// set LVM device filter
/// </summary>
public void lvm_set_filter (string[] devices)
{
int r;
r = guestfs_lvm_set_filter (_handle, devices);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvremove (IntPtr h, [In] string device);
/// <summary>
/// remove an LVM logical volume
/// </summary>
public void lvremove (string device)
{
int r;
r = guestfs_lvremove (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvrename (IntPtr h, [In] string logvol, [In] string newlogvol);
/// <summary>
/// rename an LVM logical volume
/// </summary>
public void lvrename (string logvol, string newlogvol)
{
int r;
r = guestfs_lvrename (_handle, logvol, newlogvol);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvresize (IntPtr h, [In] string device, int mbytes);
/// <summary>
/// resize an LVM logical volume
/// </summary>
public void lvresize (string device, int mbytes)
{
int r;
r = guestfs_lvresize (_handle, device, mbytes);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_lvresize_free (IntPtr h, [In] string lv, int percent);
/// <summary>
/// expand an LV to fill free space
/// </summary>
public void lvresize_free (string lv, int percent)
{
int r;
r = guestfs_lvresize_free (_handle, lv, percent);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_lvs (IntPtr h);
/// <summary>
/// list the LVM logical volumes (LVs)
/// </summary>
public string[] lvs ()
{
string[] r;
r = guestfs_lvs (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_lv[] guestfs_lvs_full (IntPtr h);
/// <summary>
/// list the LVM logical volumes (LVs)
/// </summary>
public _lvm_lv[] lvs_full ()
{
_lvm_lv[] r;
r = guestfs_lvs_full (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_lvuuid (IntPtr h, [In] string device);
/// <summary>
/// get the UUID of a logical volume
/// </summary>
public string lvuuid (string device)
{
string r;
r = guestfs_lvuuid (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _xattr[] guestfs_lxattrlist (IntPtr h, [In] string path, [In] string[] names);
/// <summary>
/// lgetxattr on multiple files
/// </summary>
public _xattr[] lxattrlist (string path, string[] names)
{
_xattr[] r;
r = guestfs_lxattrlist (_handle, path, names);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_md_create (IntPtr h, [In] string name, [In] string[] devices);
/// <summary>
/// create a Linux md (RAID) device
/// </summary>
public void md_create (string name, string[] devices)
{
int r;
r = guestfs_md_create (_handle, name, devices);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_md_detail (IntPtr h, [In] string md);
/// <summary>
/// obtain metadata for an MD device
/// </summary>
public Hashtable md_detail (string md)
{
string[] r;
r = guestfs_md_detail (_handle, md);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern _mdstat[] guestfs_md_stat (IntPtr h, [In] string md);
/// <summary>
/// get underlying devices from an MD device
/// </summary>
public _mdstat[] md_stat (string md)
{
_mdstat[] r;
r = guestfs_md_stat (_handle, md);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_md_stop (IntPtr h, [In] string md);
/// <summary>
/// stop a Linux md (RAID) device
/// </summary>
public void md_stop (string md)
{
int r;
r = guestfs_md_stop (_handle, md);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkdir (IntPtr h, [In] string path);
/// <summary>
/// create a directory
/// </summary>
public void mkdir (string path)
{
int r;
r = guestfs_mkdir (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkdir_mode (IntPtr h, [In] string path, int mode);
/// <summary>
/// create a directory with a particular mode
/// </summary>
public void mkdir_mode (string path, int mode)
{
int r;
r = guestfs_mkdir_mode (_handle, path, mode);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkdir_p (IntPtr h, [In] string path);
/// <summary>
/// create a directory and parents
/// </summary>
public void mkdir_p (string path)
{
int r;
r = guestfs_mkdir_p (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_mkdtemp (IntPtr h, [In] string tmpl);
/// <summary>
/// create a temporary directory
/// </summary>
public string mkdtemp (string tmpl)
{
string r;
r = guestfs_mkdtemp (_handle, tmpl);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mke2fs_J (IntPtr h, [In] string fstype, int blocksize, [In] string device, [In] string journal);
/// <summary>
/// make ext2/3/4 filesystem with external journal
/// </summary>
public void mke2fs_J (string fstype, int blocksize, string device, string journal)
{
int r;
r = guestfs_mke2fs_J (_handle, fstype, blocksize, device, journal);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mke2fs_JL (IntPtr h, [In] string fstype, int blocksize, [In] string device, [In] string label);
/// <summary>
/// make ext2/3/4 filesystem with external journal
/// </summary>
public void mke2fs_JL (string fstype, int blocksize, string device, string label)
{
int r;
r = guestfs_mke2fs_JL (_handle, fstype, blocksize, device, label);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mke2fs_JU (IntPtr h, [In] string fstype, int blocksize, [In] string device, [In] string uuid);
/// <summary>
/// make ext2/3/4 filesystem with external journal
/// </summary>
public void mke2fs_JU (string fstype, int blocksize, string device, string uuid)
{
int r;
r = guestfs_mke2fs_JU (_handle, fstype, blocksize, device, uuid);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mke2journal (IntPtr h, int blocksize, [In] string device);
/// <summary>
/// make ext2/3/4 external journal
/// </summary>
public void mke2journal (int blocksize, string device)
{
int r;
r = guestfs_mke2journal (_handle, blocksize, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mke2journal_L (IntPtr h, int blocksize, [In] string label, [In] string device);
/// <summary>
/// make ext2/3/4 external journal with label
/// </summary>
public void mke2journal_L (int blocksize, string label, string device)
{
int r;
r = guestfs_mke2journal_L (_handle, blocksize, label, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mke2journal_U (IntPtr h, int blocksize, [In] string uuid, [In] string device);
/// <summary>
/// make ext2/3/4 external journal with UUID
/// </summary>
public void mke2journal_U (int blocksize, string uuid, string device)
{
int r;
r = guestfs_mke2journal_U (_handle, blocksize, uuid, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkfifo (IntPtr h, int mode, [In] string path);
/// <summary>
/// make FIFO (named pipe)
/// </summary>
public void mkfifo (int mode, string path)
{
int r;
r = guestfs_mkfifo (_handle, mode, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkfs (IntPtr h, [In] string fstype, [In] string device);
/// <summary>
/// make a filesystem
/// </summary>
public void mkfs (string fstype, string device)
{
int r;
r = guestfs_mkfs (_handle, fstype, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkfs_b (IntPtr h, [In] string fstype, int blocksize, [In] string device);
/// <summary>
/// make a filesystem with block size
/// </summary>
public void mkfs_b (string fstype, int blocksize, string device)
{
int r;
r = guestfs_mkfs_b (_handle, fstype, blocksize, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkfs_btrfs (IntPtr h, [In] string[] devices);
/// <summary>
/// create a btrfs filesystem
/// </summary>
public void mkfs_btrfs (string[] devices)
{
int r;
r = guestfs_mkfs_btrfs (_handle, devices);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkfs_opts (IntPtr h, [In] string fstype, [In] string device);
/// <summary>
/// make a filesystem
/// </summary>
public void mkfs_opts (string fstype, string device)
{
int r;
r = guestfs_mkfs_opts (_handle, fstype, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkmountpoint (IntPtr h, [In] string exemptpath);
/// <summary>
/// create a mountpoint
/// </summary>
public void mkmountpoint (string exemptpath)
{
int r;
r = guestfs_mkmountpoint (_handle, exemptpath);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mknod (IntPtr h, int mode, int devmajor, int devminor, [In] string path);
/// <summary>
/// make block, character or FIFO devices
/// </summary>
public void mknod (int mode, int devmajor, int devminor, string path)
{
int r;
r = guestfs_mknod (_handle, mode, devmajor, devminor, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mknod_b (IntPtr h, int mode, int devmajor, int devminor, [In] string path);
/// <summary>
/// make block device node
/// </summary>
public void mknod_b (int mode, int devmajor, int devminor, string path)
{
int r;
r = guestfs_mknod_b (_handle, mode, devmajor, devminor, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mknod_c (IntPtr h, int mode, int devmajor, int devminor, [In] string path);
/// <summary>
/// make char device node
/// </summary>
public void mknod_c (int mode, int devmajor, int devminor, string path)
{
int r;
r = guestfs_mknod_c (_handle, mode, devmajor, devminor, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkswap (IntPtr h, [In] string device);
/// <summary>
/// create a swap partition
/// </summary>
public void mkswap (string device)
{
int r;
r = guestfs_mkswap (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkswap_L (IntPtr h, [In] string label, [In] string device);
/// <summary>
/// create a swap partition with a label
/// </summary>
public void mkswap_L (string label, string device)
{
int r;
r = guestfs_mkswap_L (_handle, label, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkswap_U (IntPtr h, [In] string uuid, [In] string device);
/// <summary>
/// create a swap partition with an explicit UUID
/// </summary>
public void mkswap_U (string uuid, string device)
{
int r;
r = guestfs_mkswap_U (_handle, uuid, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mkswap_file (IntPtr h, [In] string path);
/// <summary>
/// create a swap file
/// </summary>
public void mkswap_file (string path)
{
int r;
r = guestfs_mkswap_file (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_modprobe (IntPtr h, [In] string modulename);
/// <summary>
/// load a kernel module
/// </summary>
public void modprobe (string modulename)
{
int r;
r = guestfs_modprobe (_handle, modulename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount (IntPtr h, [In] string device, [In] string mountpoint);
/// <summary>
/// mount a guest disk at a position in the filesystem
/// </summary>
public void mount (string device, string mountpoint)
{
int r;
r = guestfs_mount (_handle, device, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_9p (IntPtr h, [In] string mounttag, [In] string mountpoint);
/// <summary>
/// mount 9p filesystem
/// </summary>
public void mount_9p (string mounttag, string mountpoint)
{
int r;
r = guestfs_mount_9p (_handle, mounttag, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_local (IntPtr h, [In] string localmountpoint);
/// <summary>
/// mount on the local filesystem
/// </summary>
public void mount_local (string localmountpoint)
{
int r;
r = guestfs_mount_local (_handle, localmountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_local_run (IntPtr h);
/// <summary>
/// run main loop of mount on the local filesystem
/// </summary>
public void mount_local_run ()
{
int r;
r = guestfs_mount_local_run (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_loop (IntPtr h, [In] string file, [In] string mountpoint);
/// <summary>
/// mount a file using the loop device
/// </summary>
public void mount_loop (string file, string mountpoint)
{
int r;
r = guestfs_mount_loop (_handle, file, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_options (IntPtr h, [In] string options, [In] string device, [In] string mountpoint);
/// <summary>
/// mount a guest disk with mount options
/// </summary>
public void mount_options (string options, string device, string mountpoint)
{
int r;
r = guestfs_mount_options (_handle, options, device, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_ro (IntPtr h, [In] string device, [In] string mountpoint);
/// <summary>
/// mount a guest disk, read-only
/// </summary>
public void mount_ro (string device, string mountpoint)
{
int r;
r = guestfs_mount_ro (_handle, device, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mount_vfs (IntPtr h, [In] string options, [In] string vfstype, [In] string device, [In] string mountpoint);
/// <summary>
/// mount a guest disk with mount options and vfstype
/// </summary>
public void mount_vfs (string options, string vfstype, string device, string mountpoint)
{
int r;
r = guestfs_mount_vfs (_handle, options, vfstype, device, mountpoint);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_mountpoints (IntPtr h);
/// <summary>
/// show mountpoints
/// </summary>
public Hashtable mountpoints ()
{
string[] r;
r = guestfs_mountpoints (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_mounts (IntPtr h);
/// <summary>
/// show mounted filesystems
/// </summary>
public string[] mounts ()
{
string[] r;
r = guestfs_mounts (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_mv (IntPtr h, [In] string src, [In] string dest);
/// <summary>
/// move a file
/// </summary>
public void mv (string src, string dest)
{
int r;
r = guestfs_mv (_handle, src, dest);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfs_3g_probe (IntPtr h, bool rw, [In] string device);
/// <summary>
/// probe NTFS volume
/// </summary>
public int ntfs_3g_probe (bool rw, string device)
{
int r;
r = guestfs_ntfs_3g_probe (_handle, rw, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfsclone_in (IntPtr h, [In] string backupfile, [In] string device);
/// <summary>
/// restore NTFS from backup file
/// </summary>
public void ntfsclone_in (string backupfile, string device)
{
int r;
r = guestfs_ntfsclone_in (_handle, backupfile, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfsclone_out (IntPtr h, [In] string device, [In] string backupfile);
/// <summary>
/// save NTFS to backup file
/// </summary>
public void ntfsclone_out (string device, string backupfile)
{
int r;
r = guestfs_ntfsclone_out (_handle, device, backupfile);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfsfix (IntPtr h, [In] string device);
/// <summary>
/// fix common errors and force Windows to check NTFS
/// </summary>
public void ntfsfix (string device)
{
int r;
r = guestfs_ntfsfix (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfsresize (IntPtr h, [In] string device);
/// <summary>
/// resize an NTFS filesystem
/// </summary>
public void ntfsresize (string device)
{
int r;
r = guestfs_ntfsresize (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfsresize_opts (IntPtr h, [In] string device);
/// <summary>
/// resize an NTFS filesystem
/// </summary>
public void ntfsresize_opts (string device)
{
int r;
r = guestfs_ntfsresize_opts (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ntfsresize_size (IntPtr h, [In] string device, long size);
/// <summary>
/// resize an NTFS filesystem (with size)
/// </summary>
public void ntfsresize_size (string device, long size)
{
int r;
r = guestfs_ntfsresize_size (_handle, device, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_add (IntPtr h, [In] string device, [In] string prlogex, long startsect, long endsect);
/// <summary>
/// add a partition to the device
/// </summary>
public void part_add (string device, string prlogex, long startsect, long endsect)
{
int r;
r = guestfs_part_add (_handle, device, prlogex, startsect, endsect);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_del (IntPtr h, [In] string device, int partnum);
/// <summary>
/// delete a partition
/// </summary>
public void part_del (string device, int partnum)
{
int r;
r = guestfs_part_del (_handle, device, partnum);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_disk (IntPtr h, [In] string device, [In] string parttype);
/// <summary>
/// partition whole disk with a single primary partition
/// </summary>
public void part_disk (string device, string parttype)
{
int r;
r = guestfs_part_disk (_handle, device, parttype);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_get_bootable (IntPtr h, [In] string device, int partnum);
/// <summary>
/// return true if a partition is bootable
/// </summary>
public bool part_get_bootable (string device, int partnum)
{
int r;
r = guestfs_part_get_bootable (_handle, device, partnum);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_get_mbr_id (IntPtr h, [In] string device, int partnum);
/// <summary>
/// get the MBR type byte (ID byte) from a partition
/// </summary>
public int part_get_mbr_id (string device, int partnum)
{
int r;
r = guestfs_part_get_mbr_id (_handle, device, partnum);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_part_get_parttype (IntPtr h, [In] string device);
/// <summary>
/// get the partition table type
/// </summary>
public string part_get_parttype (string device)
{
string r;
r = guestfs_part_get_parttype (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_init (IntPtr h, [In] string device, [In] string parttype);
/// <summary>
/// create an empty partition table
/// </summary>
public void part_init (string device, string parttype)
{
int r;
r = guestfs_part_init (_handle, device, parttype);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _partition[] guestfs_part_list (IntPtr h, [In] string device);
/// <summary>
/// list partitions on a device
/// </summary>
public _partition[] part_list (string device)
{
_partition[] r;
r = guestfs_part_list (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_set_bootable (IntPtr h, [In] string device, int partnum, bool bootable);
/// <summary>
/// make a partition bootable
/// </summary>
public void part_set_bootable (string device, int partnum, bool bootable)
{
int r;
r = guestfs_part_set_bootable (_handle, device, partnum, bootable);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_set_mbr_id (IntPtr h, [In] string device, int partnum, int idbyte);
/// <summary>
/// set the MBR type byte (ID byte) of a partition
/// </summary>
public void part_set_mbr_id (string device, int partnum, int idbyte)
{
int r;
r = guestfs_part_set_mbr_id (_handle, device, partnum, idbyte);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_set_name (IntPtr h, [In] string device, int partnum, [In] string name);
/// <summary>
/// set partition name
/// </summary>
public void part_set_name (string device, int partnum, string name)
{
int r;
r = guestfs_part_set_name (_handle, device, partnum, name);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_part_to_dev (IntPtr h, [In] string partition);
/// <summary>
/// convert partition name to device name
/// </summary>
public string part_to_dev (string partition)
{
string r;
r = guestfs_part_to_dev (_handle, partition);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_part_to_partnum (IntPtr h, [In] string partition);
/// <summary>
/// convert partition name to partition number
/// </summary>
public int part_to_partnum (string partition)
{
int r;
r = guestfs_part_to_partnum (_handle, partition);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_ping_daemon (IntPtr h);
/// <summary>
/// ping the guest daemon
/// </summary>
public void ping_daemon ()
{
int r;
r = guestfs_ping_daemon (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_pread (IntPtr h, [In] string path, int count, long offset);
/// <summary>
/// read part of a file
/// </summary>
public string pread (string path, int count, long offset)
{
string r;
r = guestfs_pread (_handle, path, count, offset);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_pread_device (IntPtr h, [In] string device, int count, long offset);
/// <summary>
/// read part of a device
/// </summary>
public string pread_device (string device, int count, long offset)
{
string r;
r = guestfs_pread_device (_handle, device, count, offset);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_pvcreate (IntPtr h, [In] string device);
/// <summary>
/// create an LVM physical volume
/// </summary>
public void pvcreate (string device)
{
int r;
r = guestfs_pvcreate (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_pvremove (IntPtr h, [In] string device);
/// <summary>
/// remove an LVM physical volume
/// </summary>
public void pvremove (string device)
{
int r;
r = guestfs_pvremove (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_pvresize (IntPtr h, [In] string device);
/// <summary>
/// resize an LVM physical volume
/// </summary>
public void pvresize (string device)
{
int r;
r = guestfs_pvresize (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_pvresize_size (IntPtr h, [In] string device, long size);
/// <summary>
/// resize an LVM physical volume (with size)
/// </summary>
public void pvresize_size (string device, long size)
{
int r;
r = guestfs_pvresize_size (_handle, device, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_pvs (IntPtr h);
/// <summary>
/// list the LVM physical volumes (PVs)
/// </summary>
public string[] pvs ()
{
string[] r;
r = guestfs_pvs (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_pv[] guestfs_pvs_full (IntPtr h);
/// <summary>
/// list the LVM physical volumes (PVs)
/// </summary>
public _lvm_pv[] pvs_full ()
{
_lvm_pv[] r;
r = guestfs_pvs_full (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_pvuuid (IntPtr h, [In] string device);
/// <summary>
/// get the UUID of a physical volume
/// </summary>
public string pvuuid (string device)
{
string r;
r = guestfs_pvuuid (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_pwrite (IntPtr h, [In] string path, [In] string content, long offset);
/// <summary>
/// write to part of a file
/// </summary>
public int pwrite (string path, string content, long offset)
{
int r;
r = guestfs_pwrite (_handle, path, content, offset);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_pwrite_device (IntPtr h, [In] string device, [In] string content, long offset);
/// <summary>
/// write to part of a device
/// </summary>
public int pwrite_device (string device, string content, long offset)
{
int r;
r = guestfs_pwrite_device (_handle, device, content, offset);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_read_file (IntPtr h, [In] string path);
/// <summary>
/// read a file
/// </summary>
public string read_file (string path)
{
string r;
r = guestfs_read_file (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_read_lines (IntPtr h, [In] string path);
/// <summary>
/// read file as lines
/// </summary>
public string[] read_lines (string path)
{
string[] r;
r = guestfs_read_lines (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _dirent[] guestfs_readdir (IntPtr h, [In] string dir);
/// <summary>
/// read directories entries
/// </summary>
public _dirent[] readdir (string dir)
{
_dirent[] r;
r = guestfs_readdir (_handle, dir);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_readlink (IntPtr h, [In] string path);
/// <summary>
/// read the target of a symbolic link
/// </summary>
public string readlink (string path)
{
string r;
r = guestfs_readlink (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_readlinklist (IntPtr h, [In] string path, [In] string[] names);
/// <summary>
/// readlink on multiple files
/// </summary>
public string[] readlinklist (string path, string[] names)
{
string[] r;
r = guestfs_readlinklist (_handle, path, names);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_realpath (IntPtr h, [In] string path);
/// <summary>
/// canonicalized absolute pathname
/// </summary>
public string realpath (string path)
{
string r;
r = guestfs_realpath (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_removexattr (IntPtr h, [In] string xattr, [In] string path);
/// <summary>
/// remove extended attribute of a file or directory
/// </summary>
public void removexattr (string xattr, string path)
{
int r;
r = guestfs_removexattr (_handle, xattr, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_resize2fs (IntPtr h, [In] string device);
/// <summary>
/// resize an ext2, ext3 or ext4 filesystem
/// </summary>
public void resize2fs (string device)
{
int r;
r = guestfs_resize2fs (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_resize2fs_M (IntPtr h, [In] string device);
/// <summary>
/// resize an ext2, ext3 or ext4 filesystem to the minimum size
/// </summary>
public void resize2fs_M (string device)
{
int r;
r = guestfs_resize2fs_M (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_resize2fs_size (IntPtr h, [In] string device, long size);
/// <summary>
/// resize an ext2, ext3 or ext4 filesystem (with size)
/// </summary>
public void resize2fs_size (string device, long size)
{
int r;
r = guestfs_resize2fs_size (_handle, device, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_rm (IntPtr h, [In] string path);
/// <summary>
/// remove a file
/// </summary>
public void rm (string path)
{
int r;
r = guestfs_rm (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_rm_rf (IntPtr h, [In] string path);
/// <summary>
/// remove a file or directory recursively
/// </summary>
public void rm_rf (string path)
{
int r;
r = guestfs_rm_rf (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_rmdir (IntPtr h, [In] string path);
/// <summary>
/// remove a directory
/// </summary>
public void rmdir (string path)
{
int r;
r = guestfs_rmdir (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_rmmountpoint (IntPtr h, [In] string exemptpath);
/// <summary>
/// remove a mountpoint
/// </summary>
public void rmmountpoint (string exemptpath)
{
int r;
r = guestfs_rmmountpoint (_handle, exemptpath);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_scrub_device (IntPtr h, [In] string device);
/// <summary>
/// scrub (securely wipe) a device
/// </summary>
public void scrub_device (string device)
{
int r;
r = guestfs_scrub_device (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_scrub_file (IntPtr h, [In] string file);
/// <summary>
/// scrub (securely wipe) a file
/// </summary>
public void scrub_file (string file)
{
int r;
r = guestfs_scrub_file (_handle, file);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_scrub_freespace (IntPtr h, [In] string dir);
/// <summary>
/// scrub (securely wipe) free space
/// </summary>
public void scrub_freespace (string dir)
{
int r;
r = guestfs_scrub_freespace (_handle, dir);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_append (IntPtr h, [In] string append);
/// <summary>
/// add options to kernel command line
/// </summary>
public void set_append (string append)
{
int r;
r = guestfs_set_append (_handle, append);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_attach_method (IntPtr h, [In] string attachmethod);
/// <summary>
/// set the attach method
/// </summary>
public void set_attach_method (string attachmethod)
{
int r;
r = guestfs_set_attach_method (_handle, attachmethod);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_autosync (IntPtr h, bool autosync);
/// <summary>
/// set autosync mode
/// </summary>
public void set_autosync (bool autosync)
{
int r;
r = guestfs_set_autosync (_handle, autosync);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_direct (IntPtr h, bool direct);
/// <summary>
/// enable or disable direct appliance mode
/// </summary>
public void set_direct (bool direct)
{
int r;
r = guestfs_set_direct (_handle, direct);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_e2attrs (IntPtr h, [In] string file, [In] string attrs);
/// <summary>
/// set ext2 file attributes of a file
/// </summary>
public void set_e2attrs (string file, string attrs)
{
int r;
r = guestfs_set_e2attrs (_handle, file, attrs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_e2generation (IntPtr h, [In] string file, long generation);
/// <summary>
/// set ext2 file generation of a file
/// </summary>
public void set_e2generation (string file, long generation)
{
int r;
r = guestfs_set_e2generation (_handle, file, generation);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_e2label (IntPtr h, [In] string device, [In] string label);
/// <summary>
/// set the ext2/3/4 filesystem label
/// </summary>
public void set_e2label (string device, string label)
{
int r;
r = guestfs_set_e2label (_handle, device, label);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_e2uuid (IntPtr h, [In] string device, [In] string uuid);
/// <summary>
/// set the ext2/3/4 filesystem UUID
/// </summary>
public void set_e2uuid (string device, string uuid)
{
int r;
r = guestfs_set_e2uuid (_handle, device, uuid);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_label (IntPtr h, [In] string device, [In] string label);
/// <summary>
/// set filesystem label
/// </summary>
public void set_label (string device, string label)
{
int r;
r = guestfs_set_label (_handle, device, label);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_memsize (IntPtr h, int memsize);
/// <summary>
/// set memory allocated to the qemu subprocess
/// </summary>
public void set_memsize (int memsize)
{
int r;
r = guestfs_set_memsize (_handle, memsize);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_network (IntPtr h, bool network);
/// <summary>
/// set enable network flag
/// </summary>
public void set_network (bool network)
{
int r;
r = guestfs_set_network (_handle, network);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_path (IntPtr h, [In] string searchpath);
/// <summary>
/// set the search path
/// </summary>
public void set_path (string searchpath)
{
int r;
r = guestfs_set_path (_handle, searchpath);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_pgroup (IntPtr h, bool pgroup);
/// <summary>
/// set process group flag
/// </summary>
public void set_pgroup (bool pgroup)
{
int r;
r = guestfs_set_pgroup (_handle, pgroup);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_qemu (IntPtr h, [In] string qemu);
/// <summary>
/// set the qemu binary
/// </summary>
public void set_qemu (string qemu)
{
int r;
r = guestfs_set_qemu (_handle, qemu);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_recovery_proc (IntPtr h, bool recoveryproc);
/// <summary>
/// enable or disable the recovery process
/// </summary>
public void set_recovery_proc (bool recoveryproc)
{
int r;
r = guestfs_set_recovery_proc (_handle, recoveryproc);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_selinux (IntPtr h, bool selinux);
/// <summary>
/// set SELinux enabled or disabled at appliance boot
/// </summary>
public void set_selinux (bool selinux)
{
int r;
r = guestfs_set_selinux (_handle, selinux);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_smp (IntPtr h, int smp);
/// <summary>
/// set number of virtual CPUs in appliance
/// </summary>
public void set_smp (int smp)
{
int r;
r = guestfs_set_smp (_handle, smp);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_trace (IntPtr h, bool trace);
/// <summary>
/// enable or disable command traces
/// </summary>
public void set_trace (bool trace)
{
int r;
r = guestfs_set_trace (_handle, trace);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_set_verbose (IntPtr h, bool verbose);
/// <summary>
/// set verbose mode
/// </summary>
public void set_verbose (bool verbose)
{
int r;
r = guestfs_set_verbose (_handle, verbose);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_setcon (IntPtr h, [In] string context);
/// <summary>
/// set SELinux security context
/// </summary>
public void setcon (string context)
{
int r;
r = guestfs_setcon (_handle, context);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_setxattr (IntPtr h, [In] string xattr, [In] string val, int vallen, [In] string path);
/// <summary>
/// set extended attribute of a file or directory
/// </summary>
public void setxattr (string xattr, string val, int vallen, string path)
{
int r;
r = guestfs_setxattr (_handle, xattr, val, vallen, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_sfdisk (IntPtr h, [In] string device, int cyls, int heads, int sectors, [In] string[] lines);
/// <summary>
/// create partitions on a block device
/// </summary>
public void sfdisk (string device, int cyls, int heads, int sectors, string[] lines)
{
int r;
r = guestfs_sfdisk (_handle, device, cyls, heads, sectors, lines);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_sfdiskM (IntPtr h, [In] string device, [In] string[] lines);
/// <summary>
/// create partitions on a block device
/// </summary>
public void sfdiskM (string device, string[] lines)
{
int r;
r = guestfs_sfdiskM (_handle, device, lines);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_sfdisk_N (IntPtr h, [In] string device, int partnum, int cyls, int heads, int sectors, [In] string line);
/// <summary>
/// modify a single partition on a block device
/// </summary>
public void sfdisk_N (string device, int partnum, int cyls, int heads, int sectors, string line)
{
int r;
r = guestfs_sfdisk_N (_handle, device, partnum, cyls, heads, sectors, line);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_sfdisk_disk_geometry (IntPtr h, [In] string device);
/// <summary>
/// display the disk geometry from the partition table
/// </summary>
public string sfdisk_disk_geometry (string device)
{
string r;
r = guestfs_sfdisk_disk_geometry (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_sfdisk_kernel_geometry (IntPtr h, [In] string device);
/// <summary>
/// display the kernel geometry
/// </summary>
public string sfdisk_kernel_geometry (string device)
{
string r;
r = guestfs_sfdisk_kernel_geometry (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_sfdisk_l (IntPtr h, [In] string device);
/// <summary>
/// display the partition table
/// </summary>
public string sfdisk_l (string device)
{
string r;
r = guestfs_sfdisk_l (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_sh (IntPtr h, [In] string command);
/// <summary>
/// run a command via the shell
/// </summary>
public string sh (string command)
{
string r;
r = guestfs_sh (_handle, command);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_sh_lines (IntPtr h, [In] string command);
/// <summary>
/// run a command via the shell returning lines
/// </summary>
public string[] sh_lines (string command)
{
string[] r;
r = guestfs_sh_lines (_handle, command);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_sleep (IntPtr h, int secs);
/// <summary>
/// sleep for some seconds
/// </summary>
public void sleep (int secs)
{
int r;
r = guestfs_sleep (_handle, secs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _stat guestfs_stat (IntPtr h, [In] string path);
/// <summary>
/// get file information
/// </summary>
public _stat stat (string path)
{
_stat r;
r = guestfs_stat (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _statvfs guestfs_statvfs (IntPtr h, [In] string path);
/// <summary>
/// get file system statistics
/// </summary>
public _statvfs statvfs (string path)
{
_statvfs r;
r = guestfs_statvfs (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_strings (IntPtr h, [In] string path);
/// <summary>
/// print the printable strings in a file
/// </summary>
public string[] strings (string path)
{
string[] r;
r = guestfs_strings (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_strings_e (IntPtr h, [In] string encoding, [In] string path);
/// <summary>
/// print the printable strings in a file
/// </summary>
public string[] strings_e (string encoding, string path)
{
string[] r;
r = guestfs_strings_e (_handle, encoding, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapoff_device (IntPtr h, [In] string device);
/// <summary>
/// disable swap on device
/// </summary>
public void swapoff_device (string device)
{
int r;
r = guestfs_swapoff_device (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapoff_file (IntPtr h, [In] string file);
/// <summary>
/// disable swap on file
/// </summary>
public void swapoff_file (string file)
{
int r;
r = guestfs_swapoff_file (_handle, file);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapoff_label (IntPtr h, [In] string label);
/// <summary>
/// disable swap on labeled swap partition
/// </summary>
public void swapoff_label (string label)
{
int r;
r = guestfs_swapoff_label (_handle, label);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapoff_uuid (IntPtr h, [In] string uuid);
/// <summary>
/// disable swap on swap partition by UUID
/// </summary>
public void swapoff_uuid (string uuid)
{
int r;
r = guestfs_swapoff_uuid (_handle, uuid);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapon_device (IntPtr h, [In] string device);
/// <summary>
/// enable swap on device
/// </summary>
public void swapon_device (string device)
{
int r;
r = guestfs_swapon_device (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapon_file (IntPtr h, [In] string file);
/// <summary>
/// enable swap on file
/// </summary>
public void swapon_file (string file)
{
int r;
r = guestfs_swapon_file (_handle, file);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapon_label (IntPtr h, [In] string label);
/// <summary>
/// enable swap on labeled swap partition
/// </summary>
public void swapon_label (string label)
{
int r;
r = guestfs_swapon_label (_handle, label);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_swapon_uuid (IntPtr h, [In] string uuid);
/// <summary>
/// enable swap on swap partition by UUID
/// </summary>
public void swapon_uuid (string uuid)
{
int r;
r = guestfs_swapon_uuid (_handle, uuid);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_sync (IntPtr h);
/// <summary>
/// sync disks, writes are flushed through to the disk image
/// </summary>
public void sync ()
{
int r;
r = guestfs_sync (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_tail (IntPtr h, [In] string path);
/// <summary>
/// return last 10 lines of a file
/// </summary>
public string[] tail (string path)
{
string[] r;
r = guestfs_tail (_handle, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_tail_n (IntPtr h, int nrlines, [In] string path);
/// <summary>
/// return last N lines of a file
/// </summary>
public string[] tail_n (int nrlines, string path)
{
string[] r;
r = guestfs_tail_n (_handle, nrlines, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_tar_in (IntPtr h, [In] string tarfile, [In] string directory);
/// <summary>
/// unpack tarfile to directory
/// </summary>
public void tar_in (string tarfile, string directory)
{
int r;
r = guestfs_tar_in (_handle, tarfile, directory);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_tar_out (IntPtr h, [In] string directory, [In] string tarfile);
/// <summary>
/// pack directory into tarfile
/// </summary>
public void tar_out (string directory, string tarfile)
{
int r;
r = guestfs_tar_out (_handle, directory, tarfile);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_test0 (IntPtr h, [In] string str, [In] string optstr, [In] string[] strlist, bool b, int integer, long integer64, [In] string filein, [In] string fileout, [In] string bufferin);
/// <summary>
/// internal test function - do not use
/// </summary>
public void test0 (string str, string optstr, string[] strlist, bool b, int integer, long integer64, string filein, string fileout, string bufferin)
{
int r;
r = guestfs_test0 (_handle, str, optstr, strlist, b, integer, integer64, filein, fileout, bufferin);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_test0rbool (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public bool test0rbool (string val)
{
int r;
r = guestfs_test0rbool (_handle, val);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_test0rboolerr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public bool test0rboolerr ()
{
int r;
r = guestfs_test0rboolerr (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r != 0 ? true : false;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rbufferout (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rbufferout (string val)
{
string r;
r = guestfs_test0rbufferout (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rbufferouterr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rbufferouterr ()
{
string r;
r = guestfs_test0rbufferouterr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rconstoptstring (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rconstoptstring (string val)
{
string r;
r = guestfs_test0rconstoptstring (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rconstoptstringerr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rconstoptstringerr ()
{
string r;
r = guestfs_test0rconstoptstringerr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rconststring (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rconststring (string val)
{
string r;
r = guestfs_test0rconststring (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rconststringerr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rconststringerr ()
{
string r;
r = guestfs_test0rconststringerr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_test0rhashtable (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public Hashtable test0rhashtable (string val)
{
string[] r;
r = guestfs_test0rhashtable (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_test0rhashtableerr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public Hashtable test0rhashtableerr ()
{
string[] r;
r = guestfs_test0rhashtableerr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_test0rint (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public int test0rint (string val)
{
int r;
r = guestfs_test0rint (_handle, val);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_test0rint64 (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public long test0rint64 (string val)
{
long r;
r = guestfs_test0rint64 (_handle, val);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern long guestfs_test0rint64err (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public long test0rint64err ()
{
long r;
r = guestfs_test0rint64err (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_test0rinterr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public int test0rinterr ()
{
int r;
r = guestfs_test0rinterr (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rstring (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rstring (string val)
{
string r;
r = guestfs_test0rstring (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_test0rstringerr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public string test0rstringerr ()
{
string r;
r = guestfs_test0rstringerr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_test0rstringlist (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public string[] test0rstringlist (string val)
{
string[] r;
r = guestfs_test0rstringlist (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_test0rstringlisterr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public string[] test0rstringlisterr ()
{
string[] r;
r = guestfs_test0rstringlisterr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_pv guestfs_test0rstruct (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public _lvm_pv test0rstruct (string val)
{
_lvm_pv r;
r = guestfs_test0rstruct (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_pv guestfs_test0rstructerr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public _lvm_pv test0rstructerr ()
{
_lvm_pv r;
r = guestfs_test0rstructerr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_pv[] guestfs_test0rstructlist (IntPtr h, [In] string val);
/// <summary>
/// internal test function - do not use
/// </summary>
public _lvm_pv[] test0rstructlist (string val)
{
_lvm_pv[] r;
r = guestfs_test0rstructlist (_handle, val);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_pv[] guestfs_test0rstructlisterr (IntPtr h);
/// <summary>
/// internal test function - do not use
/// </summary>
public _lvm_pv[] test0rstructlisterr ()
{
_lvm_pv[] r;
r = guestfs_test0rstructlisterr (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_tgz_in (IntPtr h, [In] string tarball, [In] string directory);
/// <summary>
/// unpack compressed tarball to directory
/// </summary>
public void tgz_in (string tarball, string directory)
{
int r;
r = guestfs_tgz_in (_handle, tarball, directory);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_tgz_out (IntPtr h, [In] string directory, [In] string tarball);
/// <summary>
/// pack directory into compressed tarball
/// </summary>
public void tgz_out (string directory, string tarball)
{
int r;
r = guestfs_tgz_out (_handle, directory, tarball);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_touch (IntPtr h, [In] string path);
/// <summary>
/// update file timestamps or create a new file
/// </summary>
public void touch (string path)
{
int r;
r = guestfs_touch (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_truncate (IntPtr h, [In] string path);
/// <summary>
/// truncate a file to zero size
/// </summary>
public void truncate (string path)
{
int r;
r = guestfs_truncate (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_truncate_size (IntPtr h, [In] string path, long size);
/// <summary>
/// truncate a file to a particular size
/// </summary>
public void truncate_size (string path, long size)
{
int r;
r = guestfs_truncate_size (_handle, path, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_tune2fs (IntPtr h, [In] string device);
/// <summary>
/// adjust ext2/ext3/ext4 filesystem parameters
/// </summary>
public void tune2fs (string device)
{
int r;
r = guestfs_tune2fs (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_tune2fs_l (IntPtr h, [In] string device);
/// <summary>
/// get ext2/ext3/ext4 superblock details
/// </summary>
public Hashtable tune2fs_l (string device)
{
string[] r;
r = guestfs_tune2fs_l (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
Hashtable rr = new Hashtable ();
for (size_t i = 0; i < r.Length; i += 2)
rr.Add (r[i], r[i+1]);
return rr;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_txz_in (IntPtr h, [In] string tarball, [In] string directory);
/// <summary>
/// unpack compressed tarball to directory
/// </summary>
public void txz_in (string tarball, string directory)
{
int r;
r = guestfs_txz_in (_handle, tarball, directory);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_txz_out (IntPtr h, [In] string directory, [In] string tarball);
/// <summary>
/// pack directory into compressed tarball
/// </summary>
public void txz_out (string directory, string tarball)
{
int r;
r = guestfs_txz_out (_handle, directory, tarball);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_umask (IntPtr h, int mask);
/// <summary>
/// set file mode creation mask (umask)
/// </summary>
public int umask (int mask)
{
int r;
r = guestfs_umask (_handle, mask);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_umount (IntPtr h, [In] string pathordevice);
/// <summary>
/// unmount a filesystem
/// </summary>
public void umount (string pathordevice)
{
int r;
r = guestfs_umount (_handle, pathordevice);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_umount_all (IntPtr h);
/// <summary>
/// unmount all filesystems
/// </summary>
public void umount_all ()
{
int r;
r = guestfs_umount_all (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_umount_local (IntPtr h);
/// <summary>
/// unmount a locally mounted filesystem
/// </summary>
public void umount_local ()
{
int r;
r = guestfs_umount_local (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_upload (IntPtr h, [In] string filename, [In] string remotefilename);
/// <summary>
/// upload a file from the local machine
/// </summary>
public void upload (string filename, string remotefilename)
{
int r;
r = guestfs_upload (_handle, filename, remotefilename);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_upload_offset (IntPtr h, [In] string filename, [In] string remotefilename, long offset);
/// <summary>
/// upload a file from the local machine with offset
/// </summary>
public void upload_offset (string filename, string remotefilename, long offset)
{
int r;
r = guestfs_upload_offset (_handle, filename, remotefilename, offset);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_utimens (IntPtr h, [In] string path, long atsecs, long atnsecs, long mtsecs, long mtnsecs);
/// <summary>
/// set timestamp of a file with nanosecond precision
/// </summary>
public void utimens (string path, long atsecs, long atnsecs, long mtsecs, long mtnsecs)
{
int r;
r = guestfs_utimens (_handle, path, atsecs, atnsecs, mtsecs, mtnsecs);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern _version guestfs_version (IntPtr h);
/// <summary>
/// get the library version number
/// </summary>
public _version version ()
{
_version r;
r = guestfs_version (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_vfs_label (IntPtr h, [In] string device);
/// <summary>
/// get the filesystem label
/// </summary>
public string vfs_label (string device)
{
string r;
r = guestfs_vfs_label (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_vfs_type (IntPtr h, [In] string device);
/// <summary>
/// get the Linux VFS type corresponding to a mounted device
/// </summary>
public string vfs_type (string device)
{
string r;
r = guestfs_vfs_type (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_vfs_uuid (IntPtr h, [In] string device);
/// <summary>
/// get the filesystem UUID
/// </summary>
public string vfs_uuid (string device)
{
string r;
r = guestfs_vfs_uuid (_handle, device);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_vg_activate (IntPtr h, bool activate, [In] string[] volgroups);
/// <summary>
/// activate or deactivate some volume groups
/// </summary>
public void vg_activate (bool activate, string[] volgroups)
{
int r;
r = guestfs_vg_activate (_handle, activate, volgroups);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_vg_activate_all (IntPtr h, bool activate);
/// <summary>
/// activate or deactivate all volume groups
/// </summary>
public void vg_activate_all (bool activate)
{
int r;
r = guestfs_vg_activate_all (_handle, activate);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_vgcreate (IntPtr h, [In] string volgroup, [In] string[] physvols);
/// <summary>
/// create an LVM volume group
/// </summary>
public void vgcreate (string volgroup, string[] physvols)
{
int r;
r = guestfs_vgcreate (_handle, volgroup, physvols);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_vglvuuids (IntPtr h, [In] string vgname);
/// <summary>
/// get the LV UUIDs of all LVs in the volume group
/// </summary>
public string[] vglvuuids (string vgname)
{
string[] r;
r = guestfs_vglvuuids (_handle, vgname);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_vgmeta (IntPtr h, [In] string vgname);
/// <summary>
/// get volume group metadata
/// </summary>
public string vgmeta (string vgname)
{
string r;
r = guestfs_vgmeta (_handle, vgname);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_vgpvuuids (IntPtr h, [In] string vgname);
/// <summary>
/// get the PV UUIDs containing the volume group
/// </summary>
public string[] vgpvuuids (string vgname)
{
string[] r;
r = guestfs_vgpvuuids (_handle, vgname);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_vgremove (IntPtr h, [In] string vgname);
/// <summary>
/// remove an LVM volume group
/// </summary>
public void vgremove (string vgname)
{
int r;
r = guestfs_vgremove (_handle, vgname);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_vgrename (IntPtr h, [In] string volgroup, [In] string newvolgroup);
/// <summary>
/// rename an LVM volume group
/// </summary>
public void vgrename (string volgroup, string newvolgroup)
{
int r;
r = guestfs_vgrename (_handle, volgroup, newvolgroup);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_vgs (IntPtr h);
/// <summary>
/// list the LVM volume groups (VGs)
/// </summary>
public string[] vgs ()
{
string[] r;
r = guestfs_vgs (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern _lvm_vg[] guestfs_vgs_full (IntPtr h);
/// <summary>
/// list the LVM volume groups (VGs)
/// </summary>
public _lvm_vg[] vgs_full ()
{
_lvm_vg[] r;
r = guestfs_vgs_full (_handle);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_vgscan (IntPtr h);
/// <summary>
/// rescan for LVM physical volumes, volume groups and logical volumes
/// </summary>
public void vgscan ()
{
int r;
r = guestfs_vgscan (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_vguuid (IntPtr h, [In] string vgname);
/// <summary>
/// get the UUID of a volume group
/// </summary>
public string vguuid (string vgname)
{
string r;
r = guestfs_vguuid (_handle, vgname);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_wait_ready (IntPtr h);
/// <summary>
/// wait until the qemu subprocess launches (no op)
/// </summary>
public void wait_ready ()
{
int r;
r = guestfs_wait_ready (_handle);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_wc_c (IntPtr h, [In] string path);
/// <summary>
/// count characters in a file
/// </summary>
public int wc_c (string path)
{
int r;
r = guestfs_wc_c (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_wc_l (IntPtr h, [In] string path);
/// <summary>
/// count lines in a file
/// </summary>
public int wc_l (string path)
{
int r;
r = guestfs_wc_l (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_wc_w (IntPtr h, [In] string path);
/// <summary>
/// count words in a file
/// </summary>
public int wc_w (string path)
{
int r;
r = guestfs_wc_w (_handle, path);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_wipefs (IntPtr h, [In] string device);
/// <summary>
/// wipe a filesystem signature from a device
/// </summary>
public void wipefs (string device)
{
int r;
r = guestfs_wipefs (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_write (IntPtr h, [In] string path, [In] string content);
/// <summary>
/// create a new file
/// </summary>
public void write (string path, string content)
{
int r;
r = guestfs_write (_handle, path, content);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_write_append (IntPtr h, [In] string path, [In] string content);
/// <summary>
/// append content to end of file
/// </summary>
public void write_append (string path, string content)
{
int r;
r = guestfs_write_append (_handle, path, content);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_write_file (IntPtr h, [In] string path, [In] string content, int size);
/// <summary>
/// create a file
/// </summary>
public void write_file (string path, string content, int size)
{
int r;
r = guestfs_write_file (_handle, path, content, size);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_zegrep (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] zegrep (string regex, string path)
{
string[] r;
r = guestfs_zegrep (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_zegrepi (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] zegrepi (string regex, string path)
{
string[] r;
r = guestfs_zegrepi (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_zero (IntPtr h, [In] string device);
/// <summary>
/// write zeroes to the device
/// </summary>
public void zero (string device)
{
int r;
r = guestfs_zero (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_zero_device (IntPtr h, [In] string device);
/// <summary>
/// write zeroes to an entire device
/// </summary>
public void zero_device (string device)
{
int r;
r = guestfs_zero_device (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_zero_free_space (IntPtr h, [In] string directory);
/// <summary>
/// zero free space in a filesystem
/// </summary>
public void zero_free_space (string directory)
{
int r;
r = guestfs_zero_free_space (_handle, directory);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern int guestfs_zerofree (IntPtr h, [In] string device);
/// <summary>
/// zero unused inodes and disk blocks on ext2/3 filesystem
/// </summary>
public void zerofree (string device)
{
int r;
r = guestfs_zerofree (_handle, device);
if (r == -1)
throw new Error (guestfs_last_error (_handle));
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_zfgrep (IntPtr h, [In] string pattern, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] zfgrep (string pattern, string path)
{
string[] r;
r = guestfs_zfgrep (_handle, pattern, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_zfgrepi (IntPtr h, [In] string pattern, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] zfgrepi (string pattern, string path)
{
string[] r;
r = guestfs_zfgrepi (_handle, pattern, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string guestfs_zfile (IntPtr h, [In] string meth, [In] string path);
/// <summary>
/// determine file type inside a compressed file
/// </summary>
public string zfile (string meth, string path)
{
string r;
r = guestfs_zfile (_handle, meth, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_zgrep (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] zgrep (string regex, string path)
{
string[] r;
r = guestfs_zgrep (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
[DllImport ("libguestfs.so.0")]
static extern string[] guestfs_zgrepi (IntPtr h, [In] string regex, [In] string path);
/// <summary>
/// return lines matching a pattern
/// </summary>
public string[] zgrepi (string regex, string path)
{
string[] r;
r = guestfs_zgrepi (_handle, regex, path);
if (r == null)
throw new Error (guestfs_last_error (_handle));
return r;
}
}
}
|