summaryrefslogtreecommitdiff
path: root/Build/source/libs/zziplib/zziplib-0.13.58/docs/manpages.ar
blob: 4d45c3b07d55a2b7488cb5bc41bfbad742ec337d (plain)
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
!<arch>
//                                              1400      `
zzip_compr_str.3/
zzip_createdir.3/
zzip_dir_alloc.3/
zzip_dir_alloc_ext_io.3/
zzip_dir_close.3/
zzip_dir_creat.3/
zzip_dir_creat_ext_io.3/
zzip_dir_fdopen.3/
zzip_dir_fdopen_ext_io.3/
zzip_dirhandle.3/
zzip_dir_open_ext_io.3/
zzip_disk_close.3/
zzip_disk_entry_fopen.3/
zzip_disk_entry_strdup_comment.3/
zzip_disk_entry_strdup_name.3/
zzip_disk_entry_to_data.3/
zzip_disk_entry_to_file_header.3/
zzip_disk_fclose.3/
zzip_disk_feof.3/
zzip_disk_findfile.3/
zzip_disk_findfirst.3/
zzip_disk_findmatch.3/
zzip_disk_findnext.3/
zzip_disk_fopen.3/
zzip_disk_fread.3/
zzip_disk_init.3/
zzip_disk_mmap.3/
zzip_disk_munmap.3/
zzip_disk_open.3/
zzip_entry_data_offset.3/
zzip_entry_fclose.3/
zzip_entry_feof.3/
zzip_entry_ffile.3/
zzip_entry_findfile.3/
zzip_entry_findfirst.3/
zzip_entry_findmatch.3/
zzip_entry_findnext.3/
zzip_entry_fopen.3/
zzip_entry_fread.3/
zzip_entry_fread_file_header.3/
zzip_entry_free.3/
zzip_entry_strdup_name.3/
__zzip_fetch_disk_trailer.3/
zzip_file_close.3/
zzip_file_creat.3/
zzip_file_mkdir.3/
zzip_file_open.3/
zzip_file_read.3/
zzip_file_real.3/
zzip_file_stat.3/
zzip_file_write.3/
zzip_get_default_io.3/
zzip_inflate_init.3/
zzip_mem_disk_fdopen.3/
zzip_mem_disk_load.3/
zzip_mem_disk_open.3/
zzip_mem_entry_new.3/
zzip_opendir_ext_io.3/
zzip_open_ext_io.3/
zzip_open_shared_io.3/
__zzip_parse_root_directory.3/
zzip_rewinddir.3/
zzip_strerror_of.3/
__zzip_try_open.3/

zzip_close.3/   1154977710  1001  0     100644  23        `
.so man3/zzip_fclose.3

zzip_closedir.3/1154977710  1001  0     100644  1054      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_CLOSEDIR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_closedir \- (zzip/dir.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 18
\fBint\ \fBzzip_closedir\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_closedir function\fR
is the equivalent of
\fBclosedir\fR(3) for a realdir or zipfile.
.PP
\fBThe zzip_closedir function\fR
is magic \- if the given arg\-ZZIP_DIR is a real directory, it will call the real
\fBclosedir\fR(3) and then free the wrapping ZZIP_DIR structure. Otherwise it will divert to
\fBzzip_dir_close\fR
which will free the ZZIP_DIR structure.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/0              1154977710  1001  0     100644  789       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_COMPR_STR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_compr_str \- (zzip/info.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 28
\fBzzip_char_t*\ \fBzzip_compr_str\fR\fR\fB(\fR\fBint\ compr\fR\fB);\fR
.SH "DESCRIPTION"
.PP
return static const string of the known compression methods, otherwise just "zipped" is returned
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

zzip_creat.3/   1154977710  1001  0     100644  22        `
.so man3/zzip_mkdir.3
/18             1154977710  1001  0     100644  2443      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_CREATEDIR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_createdir \- create a new archive area for writing
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 25
\fBZZIP_DIR*\ \fBzzip_createdir\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_createdir function\fR
will create a new archive area. This may either be a a new zip archive or a new directory in the filesystem. The returned parameter is a new "zzip dir" handle that should be saved to a variable so it can be used a base argument for
\fBzzip_file_mkdir\fR
and
\fBzzip_file_creat\fR
calls. The returned handle wraps both possibilities, it can be representing a zip central directory that must be saved to disk using
\fBzzip_closedir\fR
or it is just a handle for the name of the real directory that still must be run through
\fBzzip_closedir\fR
to release the wrapper around the directory name.
.PP
The magic is pushed through the o_mode argument. Using a mode that has no group\-write bit set (S_IWGRP = 0040) then the file is created as a zip directory. Note that this is unabridged of any umask value in the system where the argument to
\fBthe zzip_createdir function\fR
could be 0775 but with an umask of 0755 it turns out as 0755 for a real directory. Using 0755 directly would not create it as a real directory but as a zip archive handle.
.PP
\fBThe zzip_createdir function\fR
is not yet implemented, check for #def ZZIP_NO_CREAT Write\-support will extend
\fBzzip_closedir\fR
with semantics to finalize the zip\-archive by writing the zip\-trailer and closing the archive file.
.PP
Returns null on error and sets errno. Remember, according to posix the
\fBcreat\fR(2) call is equivalent to
.sp
.nf
  open (path, O_WRONLY | O_CREAT | O_TRUNC, o_mode)
.fi
.sp
so any previous zip\-archive will be overwritten unconditionally and EEXIST errors from
\fBmkdir\fR(2) are suppressed. (fixme: delete the given subtree? like suggested by O_TRUNC? not done so far!)
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/36             1154977710  1001  0     100644  33        `
.so man3/zzip_dir_alloc_ext_io.3

/54             1154977710  1001  0     100644  1523      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIR_ALLOC_EXT_I" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dir_alloc_ext_io, zzip_dir_alloc \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 32
\fBZZIP_DIR*\ \fBzzip_dir_alloc_ext_io\fR\fR\fB(\fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBconst\ zzip_plugin_io_t\ io\fR\fB);\fR
.HP 25
\fBZZIP_DIR*\ \fBzzip_dir_alloc\fR\fR\fB(\fR\fBzzip_strings_t*\ fileext\fR\fB);\fR
.SH "DESCRIPTION"
.PP
allocate a new ZZIP_DIR handle and do basic initializations before usage by
\fBzzip_dir_fdopen\fR\fBzzip_dir_open\fR\fBzzip_file_open\fR
or through
\fBzzip_open\fR
(ext==null flags uses { ".zip" , ".ZIP" } ) (io ==null flags use of posix io defaults)
.PP
\fBthe zzip_dir_alloc function\fR
is obsolete \- it was generally used for implementation and exported to let other code build on it. It is now advised to use
\fBzzip_dir_alloc_ext_io\fR
now on explicitly, just set that second argument to zero to achieve the same functionality as the old style.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

/79             1154977710  1001  0     100644  25        `
.so man3/zzip_dir_free.3

/97             1154977710  1001  0     100644  2417      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIR_CREAT" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dir_creat, zzip_dir_creat_ext_io \- create a new zip archive for writing
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 25
\fBZZIP_DIR*\ \fBzzip_dir_creat\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 32
\fBZZIP_DIR*\ \fBzzip_dir_creat_ext_io\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_dir_creat function\fR
will create a new zip archive. The returned parameter is a new "zzip dir" handle that should be saved to a variable so it can be used a base argument for
\fBzzip_mkdir\fR
and
\fBzzip_creat\fR
calls. The returned handle represents a zip central directory that must be saved to disk using
\fBzzip_closedir\fR.
.PP
Returns null on error and sets errno. Remember, according to posix the
\fBcreat\fR(2) call is equivalent to
.sp
.nf
  open (path, O_WRONLY | O_CREAT | O_TRUNC, o_mode)
.fi
.sp
so any previous zip\-archive will be overwritten unconditionally and EEXIST errors from
\fBmkdir\fR(2) are suppressed. (fixme: delete the given subtree? like suggested by O_TRUNC? not done so far!)
.PP
.PP
If the third argument "ext" has another special meaning here, as it is used to ensure that a given zip\-file is created with the first entry of the ext\-list appended as an extension unless the file\-path already ends with a file\-extension registered in the list. Therefore {"",0} matches all files and creates them as zip\-archives under the given nonmodified name. (Some magic here? If the path ends in the path separator then make a real directory even in the presence of ext\-list?)
.PP
\fBThe zzip_dir_creat_ext_io function\fR
is not yet implemented, check for #def ZZIP_NO_CREAT Write\-support will extend
\fBzzip_closedir\fR
with semantics to finalize the zip\-archive by writing the zip\-trailer and closing the archive file.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/115            1154977710  1001  0     100644  26        `
.so man3/zzip_dir_creat.3
zzip_dirfd.3/   1154977710  1001  0     100644  26        `
.so man3/zzip_dirhandle.3
/140            1154977710  1001  0     100644  1543      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIR_FDOPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dir_fdopen, zzip_dir_fdopen_ext_io \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 27
\fBZZIP_DIR\ *\ \fBzzip_dir_fdopen\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBzzip_error_t\ *\ errcode_p\fR\fB);\fR
.HP 34
\fBZZIP_DIR\ *\ \fBzzip_dir_fdopen_ext_io\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBzzip_error_t\ *\ errcode_p\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBconst\ zzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
used by the
\fBzzip_dir_open\fR
and zzip_opendir(2) call. Opens the zip\-archive as specified with the fd which points to an already openend file.
\fBThe zzip_dir_fdopen function\fR
then search and parse the zip's central directory.
.PP
NOTE: refcount is zero, so an _open/_close pair will also delete this _dirhandle
.PP
\fBthe zzip_dir_fdopen_ext_io function\fR
uses explicit ext and io instead of the internal defaults, setting these to zero is equivalent to
\fBzzip_dir_fdopen\fR
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

/159            1154977710  1001  0     100644  27        `
.so man3/zzip_dir_fdopen.3

zzip_dir_free.3/1154977710  1001  0     100644  1347      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIR_FREE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dir_free, zzip_dir_close \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 18
\fBint\ \fBzzip_dir_free\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 19
\fBint\ \fBzzip_dir_close\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.SH "DESCRIPTION"
.PP
will free the zzip_dir handle unless there are still zzip_files attached (that may use its cache buffer). This is the inverse of
\fBzzip_dir_alloc\fR
, and both are helper functions used implicitly in other zzipcalls e.g.
\fBzzip_dir_close\fR
= zzip_close
.PP
returns zero on sucess returns the refcount when files are attached.
.PP
It will also
\fBfree\fR(2) the
\fBZZIP_DIR\fR\-handle given. the counterpart for
\fBzzip_dir_open\fR
see also
\fBzzip_dir_free\fR
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

/185            1154977710  1001  0     100644  1257      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIRHANDLE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dirhandle, zzip_dirfd \- (zzip/info.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 26
\fBZZIP_DIR\ *\ \fBzzip_dirhandle\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.HP 15
\fBint\ \fBzzip_dirfd\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_dirhandle function\fR
will just return fp\->dir
.PP
If a ZZIP_FILE is contained within a zip\-file that one will be a valid pointer, otherwise a NULL is returned and the ZZIP_FILE wraps a real file.
.PP
\fBThe zzip_dirfd function\fR
will just return dir\->fd
.PP
If a ZZIP_DIR does point to a zipfile then the file\-descriptor of that zipfile is returned, otherwise a NULL is returned and the ZZIP_DIR wraps a real directory DIR (if you have dirent on your system).
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

zzip_dir_open.3/1154977710  1001  0     100644  1709      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIR_OPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dir_open, zzip_dir_open_ext_io, zzip_dir_read \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 24
\fBZZIP_DIR*\ \fBzzip_dir_open\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBzzip_error_t*\ e\fR\fB);\fR
.HP 31
\fBZZIP_DIR*\ \fBzzip_dir_open_ext_io\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBzzip_error_t*\ e\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.HP 18
\fBint\ \fBzzip_dir_read\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB, \fR\fBZZIP_DIRENT\ *\ d\fR\fB);\fR
.SH "DESCRIPTION"
.PP
Opens the zip\-archive (if available). the two ext_io arguments will default to use posix io and a set of default fileext that can atleast add .zip ext itself.
.PP
\fBthe zzip_dir_open_ext_io function\fR
uses explicit ext and io instead of the internal defaults. Setting these to zero is equivalent to
\fBzzip_dir_open\fR
.PP
fills the dirent\-argument with the values and increments the read\-pointer of the dir\-argument.
.PP
returns 0 if there no entry (anymore).
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

/203            1154977710  1001  0     100644  25        `
.so man3/zzip_dir_open.3

zzip_dir_read.3/1154977710  1001  0     100644  25        `
.so man3/zzip_dir_open.3

zzip_dir_real.3/1154977710  1001  0     100644  26        `
.so man3/zzip_file_real.3
zzip_dir_stat.3/1154977710  1001  0     100644  2029      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DIR_STAT" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_dir_stat, zzip_file_stat, zzip_fstat \- (zzip/stat.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 18
\fBint\ \fBzzip_dir_stat\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBZZIP_STAT\ *\ zs\fR\fB, \fR\fBint\ flags\fR\fB);\fR
.HP 19
\fBint\ \fBzzip_file_stat\fR\fR\fB(\fR\fBZZIP_FILE*\ file\fR\fB, \fR\fBZZIP_STAT*\ zs\fR\fB);\fR
.HP 15
\fBint\ \fBzzip_fstat\fR\fR\fB(\fR\fBZZIP_FILE*\ file\fR\fB, \fR\fBZZIP_STAT*\ zs\fR\fB);\fR
.SH "DESCRIPTION"
.PP
obtain information about a filename in an opened zip\-archive without opening that file first. Mostly used to obtain the uncompressed size of a file inside a zip\-archive. see
\fBzzip_dir_open\fR.
.PP
\fBThe zzip_file_stat function\fR
will obtain information about a opened file _within_ a zip\-archive. The file is supposed to be open (otherwise \-1 is returned). The st_size stat\-member contains the uncompressed size. The optional d_name is never set here.
.PP
\fBThe zzip_fstat function\fR
will obtain information about a opened file which may be either real/zipped. The file is supposed to be open (otherwise \-1 is returned). The st_size stat\-member contains the uncompressed size. The optional d_name is never set here. For a real file, we do set the d_csize := st_size and d_compr := 0 for meaningful defaults.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>

/227            1154977710  1001  0     100644  26        `
.so man3/zzip_disk_mmap.3
/246            1154977710  1001  0     100644  27        `
.so man3/zzip_disk_fopen.3

/271            1154977710  1001  0     100644  35        `
.so man3/zzip_disk_entry_to_data.3

/305            1154977710  1001  0     100644  35        `
.so man3/zzip_disk_entry_to_data.3

/336            1154977710  1001  0     100644  2418      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DISK_ENTRY_TO_D" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_disk_entry_to_data, zzip_disk_entry_to_file_header, zzip_disk_entry_strdup_name, zzip_disk_entry_strdup_comment \- helper functions for (mmapped) zip access api
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 37
\fBzzip_byte_t*\ \fBzzip_disk_entry_to_data\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ entry\fR\fB);\fR
.HP 56
\fBstruct\ zzip_file_header*\ \fBzzip_disk_entry_to_file_header\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ entry\fR\fB);\fR
.HP 46
\fBzzip__new__\ char*\ \fBzzip_disk_entry_strdup_name\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ entry\fR\fB);\fR
.HP 49
\fBzzip__new__\ char*\ \fBzzip_disk_entry_strdup_comment\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ entry\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_disk_entry_to_data function\fR
augments the other zzip_disk_entry_* helpers: here we move a disk_entry pointer (as returned by _find* functions) into a pointer to the data block right after the file_header. Only disk\->buffer would be needed to perform the seek but we check the mmapped range end as well.
.PP
\fBThe zzip_disk_entry_to_file_header function\fR
does half the job of
\fBzzip_disk_entry_to_data\fR
where it can augment with
\fBzzip_file_header_to_data\fR
helper from format/fetch.h
.PP
\fBThe zzip_disk_entry_strdup_name function\fR
is a big helper despite its little name: in a zip file the encoded filenames are usually NOT zero\-terminated but for common usage with libc we need it that way. Secondly, the filename SHOULD be present in the zip central directory but if not then we fallback to the filename given in the file_header of each compressed data portion.
.PP
\fBThe zzip_disk_entry_strdup_comment function\fR
is similar creating a reference to a zero terminated string but it can only exist in the zip central directory entry.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/363            1154977710  1001  0     100644  35        `
.so man3/zzip_disk_entry_to_data.3

/397            1154977710  1001  0     100644  27        `
.so man3/zzip_disk_fopen.3

/417            1154977710  1001  0     100644  27        `
.so man3/zzip_disk_fopen.3

/435            1154977710  1001  0     100644  4351      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DISK_FINDFILE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_disk_findfile, zzip_disk_findfirst, zzip_disk_findnext, zzip_disk_findmatch \- search for files in the (mmapped) zip central directory
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 43
\fBstruct\ zzip_disk_entry*\ \fBzzip_disk_findfile\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ after\fR\fB, \fR\fBzzip_strcmp_fn_t\ compare\fR\fB);\fR
.HP 44
\fBstruct\ zzip_disk_entry*\ \fBzzip_disk_findfirst\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB);\fR
.HP 43
\fBstruct\ zzip_disk_entry*\ \fBzzip_disk_findnext\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ entry\fR\fB);\fR
.HP 44
\fBstruct\ zzip_disk_entry*\ \fBzzip_disk_findmatch\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBchar*\ filespec\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ after\fR\fB, \fR\fBzzip_fnmatch_fn_t\ compare\fR\fB, \fR\fBint\ flags\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_disk_findfile function\fR
is given a filename as an additional argument, to find the disk_entry matching a given filename. The compare\-function is usually strcmp or strcasecmp or perhaps strcoll, if null then strcmp is used. \- use null as argument for "after"\-entry when searching the first matching entry, otherwise the last returned value if you look for other entries with a special "compare" function (if null then a doubled search is rather useless with this variant of _findfile).
.PP
.PP
\fBThe zzip_disk_findfirst function\fR
is the first call of all the zip access functions here. It contains the code to find the first entry of the zip central directory. Here we require the mmapped block to represent a real zip file where the disk_trailer is _last_ in the file area, so that its position would be at a fixed offset from the end of the file area if not for the comment field allowed to be of variable length (which needs us to do a little search for the disk_tailer). However, in this simple implementation we disregard any disk_trailer info telling about multidisk archives, so we just return a pointer to the zip central directory.
.PP
For an actual means, we are going to search backwards from the end of the mmaped block looking for the PK\-magic signature of a disk_trailer. If we see one then we check the rootseek value to find the first disk_entry of the root central directory. If we find the correct PK\-magic signature of a disk_entry over there then we assume we are done and we are going to return a pointer to that label.
.PP
The return value is a pointer to the first zzip_disk_entry being checked to be within the bounds of the file area specified by the arguments. If no disk_trailer was found then null is returned, and likewise we only accept a disk_trailer with a seekvalue that points to a disk_entry and both parts have valid PK\-magic parts. Beyond some sanity check we try to catch a common brokeness with zip archives that still allows us to find the start of the zip central directory.
.PP
.PP
\fBThe zzip_disk_findnext function\fR
takes an existing disk_entry in the central root directory (e.g. from zzip_disk_findfirst) and returns the next entry within in the given bounds of the mmapped file area.
.PP
.PP
\fBThe zzip_disk_findmatch function\fR
uses a compare\-function with an additional argument and it is called just like fnmatch(3) from POSIX.2 AD:1993), i.e. the argument filespec first and the ziplocal filename second with the integer\-flags put in as third to the indirect call. If the platform has fnmatch available then null\-compare will use that one and otherwise we fall back to mere strcmp, so if you need fnmatch searching then please provide an implementation somewhere else. \- use null as argument for "after"\-entry when searching the first matching entry, or the last disk_entry return\-value to find the next entry matching the given filespec.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/457            1154977710  1001  0     100644  30        `
.so man3/zzip_disk_findfile.3
/480            1154977710  1001  0     100644  30        `
.so man3/zzip_disk_findfile.3
/503            1154977710  1001  0     100644  30        `
.so man3/zzip_disk_findfile.3
/525            1154977710  1001  0     100644  2763      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DISK_FOPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_disk_fopen, zzip_disk_entry_fopen, zzip_disk_fread, zzip_disk_fclose, zzip_disk_feof \- openening a file part wrapped within a (mmapped) zip archive
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 44
\fBzzip__new__\ ZZIP_DISK_FILE*\ \fBzzip_disk_fopen\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB);\fR
.HP 50
\fBzzip__new__\ ZZIP_DISK_FILE*\ \fBzzip_disk_entry_fopen\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBZZIP_DISK_ENTRY*\ entry\fR\fB);\fR
.HP 28
\fBzzip_size_t\ \fBzzip_disk_fread\fR\fR\fB(\fR\fBvoid*\ ptr\fR\fB, \fR\fBzzip_size_t\ sized\fR\fB, \fR\fBzzip_size_t\ nmemb\fR\fB, \fR\fBZZIP_DISK_FILE*\ file\fR\fB);\fR
.HP 21
\fBint\ \fBzzip_disk_fclose\fR\fR\fB(\fR\fBZZIP_DISK_FILE*\ file\fR\fB);\fR
.HP 19
\fBint\ \fBzzip_disk_feof\fR\fR\fB(\fR\fBZZIP_DISK_FILE*\ file\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_disk_fopen function\fR
opens a file found by name, so it does a search into the zip central directory with
\fBzzip_disk_findfile\fR
and whatever is found first is given to
\fBzzip_disk_entry_fopen\fR
.PP
.PP
the ZZIP_DISK_FILE* is rather simple in just encapsulating the arguments given to
\fBthe zzip_disk_entry_fopen function\fR
plus a zlib deflate buffer. Note that the ZZIP_DISK pointer does already contain the full mmapped file area of a zip disk, so open()ing a file part within that area happens to be a lookup of its bounds and encoding. That information is memorized on the ZZIP_DISK_FILE so that subsequent _read() operations will be able to get the next data portion or return an eof condition for that file part wrapped in the zip archive.
.PP
.PP
\fBThe zzip_disk_fread function\fR
reads more bytes into the output buffer specified as arguments. The return value is null on eof or error, the stdio\-like interface can not distinguish between these so you need to check with
\fBzzip_disk_feof\fR
for the difference.
.PP
\fBThe zzip_disk_fclose function\fR
releases any zlib decoder info needed for decompression and dumps the ZZIP_DISK_FILE* then.
.PP
.PP
\fBThe zzip_disk_feof function\fR
allows to distinguish an error from an eof condition. Actually, if we found an error but we did already reach eof then we just keep on saying that it was an eof, so the app can just continue.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/544            1154977710  1001  0     100644  27        `
.so man3/zzip_disk_fopen.3

/563            1154977710  1001  0     100644  26        `
.so man3/zzip_disk_mmap.3
/581            1154977710  1001  0     100644  2532      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_DISK_MMAP" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_disk_mmap, zzip_disk_init, zzip_disk_new, zzip_disk_munmap, zzip_disk_open, zzip_disk_close \- turn a filehandle into a mmapped zip disk archive handle
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 38
\fBzzip__new__\ ZZIP_DISK*\ \fBzzip_disk_mmap\fR\fR\fB(\fR\fBint\ fd\fR\fB);\fR
.HP 19
\fBint\ \fBzzip_disk_init\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBvoid*\ buffer\fR\fB, \fR\fBzzip_size_t\ buflen\fR\fB);\fR
.HP 37
\fBzzip__new__\ ZZIP_DISK*\ \fBzzip_disk_new\fR\fR\fB(\fR\fBvoid\fR\fB);\fR
.HP 21
\fBint\ \fBzzip_disk_munmap\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB);\fR
.HP 38
\fBZZIP_DISK*\ zzip__new__\ \fBzzip_disk_open\fR\fR\fB(\fR\fBchar*\ filename\fR\fB);\fR
.HP 20
\fBint\ \fBzzip_disk_close\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_disk_mmap function\fR
uses the given file\-descriptor to detect the length of the file and calls the system
\fBmmap\fR(2) to put it in main memory. If it is successful then a newly allocated ZZIP_DISK* is returned with disk\->buffer pointing to the mapview of the zipdisk content.
.PP
\fBThe zzip_disk_init function\fR
does primary initialization of a disk\-buffer struct.
.PP
\fBThe zzip_disk_new function\fR
allocates a new disk\-buffer with
\fBmalloc\fR(3)
.PP
\fBThe zzip_disk_munmap function\fR
is the inverse of
\fBzzip_disk_mmap\fR
and using the system munmap(2) on the buffer area and
\fBfree\fR(3) on the ZZIP_DISK structure.
.PP
.PP
\fBThe zzip_disk_open function\fR
opens the given archive by name and turn the filehandle to
\fBzzip_disk_mmap\fR
for bringing it to main memory. If it can not be
\fBmmap\fR(2)'ed then we slurp the whole file into a newly
\fBmalloc\fR(2)'ed memory block. Only if that fails too then we return null. Since handling of disk\->buffer is ambigous it should not be snatched away please.
.PP
.PP
\fBThe zzip_disk_close function\fR
will release all data needed to access a (mmapped) zip archive, including any malloc()ed blocks, sharedmem mappings and it dumps the handle struct as well.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/599            1154977710  1001  0     100644  26        `
.so man3/zzip_disk_mmap.3
zzip_disk_new.3/1154977710  1001  0     100644  26        `
.so man3/zzip_disk_mmap.3
/619            1154977710  1001  0     100644  26        `
.so man3/zzip_disk_mmap.3
/637            1154977710  1001  0     100644  2171      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_ENTRY_DATA_OFFS" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_entry_data_offset, zzip_entry_fread_file_header, zzip_entry_strdup_name \- helper functions for (fseeko) zip access api
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 34
\fBzzip_off_t\ \fBzzip_entry_data_offset\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB);\fR
.HP 47
\fBstatic\ zzip_off_t\ \fBzzip_entry_fread_file_header\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB, \fR\fBstruct\ zzip_file_header*\ file_header\fR\fB);\fR
.HP 41
\fBzzip__new__\ char*\ \fBzzip_entry_strdup_name\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_entry_data_offset function\fRs returns the seekval offset of the data portion of the file referenced by the given zzip_entry. It requires an intermediate check of the file_header structure (i.e. it reads it from disk). After this call, the contained diskfile readposition is already set to the data_offset returned here. On error \-1 is returned.
.PP
\fBThe zzip_entry_fread_file_header function\fRs read the correspoding struct zzip_file_header from the zip disk of the given "entry". The returned off_t points to the end of the file_header where the current fseek pointer has stopped. This is used to immediatly parse out any filename/extras block following the file_header. The return value is null on error.
.PP
\fBThe zzip_entry_strdup_name function\fR
is a big helper despite its little name: in a zip file the encoded filenames are usually NOT zero\-terminated but for common usage with libc we need it that way. Secondly, the filename SHOULD be present in the zip central directory but if not then we fallback to the filename given in the file_header of each compressed data portion.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/663            1154977710  1001  0     100644  28        `
.so man3/zzip_entry_fopen.3
/684            1154977710  1001  0     100644  28        `
.so man3/zzip_entry_fopen.3
/703            1154977710  1001  0     100644  28        `
.so man3/zzip_entry_fopen.3
/723            1154977710  1001  0     100644  5123      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_ENTRY_FINDFILE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_entry_findfile, zzip_entry_findfirst, zzip_entry_findnext, zzip_entry_free, zzip_entry_findmatch \- search for files in the (fseeko) zip central directory
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 44
\fBzzip__new__\ ZZIP_ENTRY*\ \fBzzip_entry_findfile\fR\fR\fB(\fR\fBFILE*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB, \fR\fBZZIP_ENTRY*\ _zzip_restrict\ entry\fR\fB, \fR\fBzzip_strcmp_fn_t\ compare\fR\fB);\fR
.HP 45
\fBzzip__new__\ ZZIP_ENTRY*\ \fBzzip_entry_findfirst\fR\fR\fB(\fR\fBFILE*\ disk\fR\fB);\fR
.HP 44
\fBzzip__new__\ ZZIP_ENTRY*\ \fBzzip_entry_findnext\fR\fR\fB(\fR\fBZZIP_ENTRY*\ _zzip_restrict\ entry\fR\fB);\fR
.HP 20
\fBint\ \fBzzip_entry_free\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB);\fR
.HP 45
\fBzzip__new__\ ZZIP_ENTRY*\ \fBzzip_entry_findmatch\fR\fR\fB(\fR\fBFILE*\ disk\fR\fB, \fR\fBchar*\ filespec\fR\fB, \fR\fBZZIP_ENTRY*\ _zzip_restrict\ entry\fR\fB, \fR\fBzzip_fnmatch_fn_t\ compare\fR\fB, \fR\fBint\ flags\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_entry_findfile function\fR
is given a filename as an additional argument, to find the disk_entry matching a given filename. The compare\-function is usually strcmp or strcasecmp or perhaps strcoll, if null then strcmp is used. \- use null as argument for "old"\-entry when searching the first matching entry, otherwise the last returned value if you look for other entries with a special "compare" function (if null then a doubled search is rather useless with this variant of _findfile). If no further entry is found then null is returned and any "old"\-entry gets already free()d.
.PP
.PP
\fBThe zzip_entry_findfirst function\fR
is the first call of all the zip access functions here. It contains the code to find the first entry of the zip central directory. Here we require the stdio handle to represent a real zip file where the disk_trailer is _last_ in the file area, so that its position would be at a fixed offset from the end of the file area if not for the comment field allowed to be of variable length (which needs us to do a little search for the disk_tailer). However, in this simple implementation we disregard any disk_trailer info telling about multidisk archives, so we just return a pointer to the first entry in the zip central directory of that file.
.PP
For an actual means, we are going to search backwards from the end of the mmaped block looking for the PK\-magic signature of a disk_trailer. If we see one then we check the rootseek value to find the first disk_entry of the root central directory. If we find the correct PK\-magic signature of a disk_entry over there then we assume we are done and we are going to return a pointer to that label.
.PP
The return value is a pointer to the first zzip_disk_entry being checked to be within the bounds of the file area specified by the arguments. If no disk_trailer was found then null is returned, and likewise we only accept a disk_trailer with a seekvalue that points to a disk_entry and both parts have valid PK\-magic parts. Beyond some sanity check we try to catch a common brokeness with zip archives that still allows us to find the start of the zip central directory.
.PP
.PP
\fBThe zzip_entry_findnext function\fR
takes an existing "entry" in the central root directory (e.g. from zzip_entry_findfirst) and moves it to point to the next entry. On error it returns 0, otherwise the old entry. If no further match is found then null is returned and the entry already free()d. If you want to stop searching for matches before that case then please call
\fBzzip_entry_free\fR
on the cursor struct ZZIP_ENTRY.
.PP
\fBthe zzip_entry_free function\fR
releases the malloc()ed areas needed for zzip_entry, the pointer is invalid afterwards.
\fBThe zzip_entry_free function\fR
has #define synonyms of zzip_entry_findlast(), zzip_entry_findlastfile(), zzip_entry_findlastmatch()
.PP
.PP
\fBThe zzip_entry_findmatch function\fR
uses a compare\-function with an additional argument and it is called just like fnmatch(3) from POSIX.2 AD:1993), i.e. the argument filespec first and the ziplocal filename second with the integer\-flags put in as third to the indirect call. If the platform has fnmatch available then null\-compare will use that one and otherwise we fall back to mere strcmp, so if you need fnmatch searching then please provide an implementation somewhere else. \- use null as argument for "after"\-entry when searching the first matching entry, or the last disk_entry return\-value to find the next entry matching the given filespec. If no further entry is found then null is returned and any "old"\-entry gets already free()d.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/746            1154977710  1001  0     100644  31        `
.so man3/zzip_entry_findfile.3

/770            1154977710  1001  0     100644  31        `
.so man3/zzip_entry_findfile.3

/794            1154977710  1001  0     100644  31        `
.so man3/zzip_entry_findfile.3

/817            1154977710  1001  0     100644  2825      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_ENTRY_FOPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_entry_fopen, zzip_entry_ffile, zzip_entry_fread, zzip_entry_fclose, zzip_entry_feof \- open a file within a zip disk for reading
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 46
\fBzzip__new__\ ZZIP_ENTRY_FILE*\ \fBzzip_entry_fopen\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB, \fR\fBint\ takeover\fR\fB);\fR
.HP 46
\fBzzip__new__\ ZZIP_ENTRY_FILE*\ \fBzzip_entry_ffile\fR\fR\fB(\fR\fBFILE*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB);\fR
.HP 29
\fBzzip_size_t\ \fBzzip_entry_fread\fR\fR\fB(\fR\fBvoid*\ ptr\fR\fB, \fR\fBzzip_size_t\ sized\fR\fB, \fR\fBzzip_size_t\ nmemb\fR\fB, \fR\fBZZIP_ENTRY_FILE*\ file\fR\fB);\fR
.HP 22
\fBint\ \fBzzip_entry_fclose\fR\fR\fB(\fR\fBZZIP_ENTRY_FILE*\ file\fR\fB);\fR
.HP 20
\fBint\ \fBzzip_entry_feof\fR\fR\fB(\fR\fBZZIP_ENTRY_FILE*\ file\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_entry_fopen function\fR
does take an "entry" argument and copies it (or just takes it over as owner) to a new ZZIP_ENTRY_FILE handle structure. That structure contains also a zlib buffer for decoding.
\fBThe zzip_entry_fopen function\fR
does seek to the file_header of the given "entry" and validates it for the data buffer following it. We do also prefetch some data from the data buffer thereby trying to match the disk pagesize for faster access later. The
\fBzzip_entry_fread\fR
will then read in chunks of pagesizes which is the size of the internal readahead buffer. If an error occurs then null is returned.
.PP
.PP
\fBThe zzip_entry_ffile function\fR
opens a file found by name, so it does a search into the zip central directory with
\fBzzip_entry_findfile\fR
and whatever is found first is given to
\fBzzip_entry_fopen\fR
.PP
.PP
\fBThe zzip_entry_fread function\fR
reads more bytes into the output buffer specified as arguments. The return value is null on eof or error, the stdio\-like interface can not distinguish between these so you need to check with
\fBzzip_entry_feof\fR
for the difference.
.PP
\fBThe zzip_entry_fclose function\fR
releases any zlib decoder info needed for decompression and dumps the ZZIP_ENTRY_FILE struct then.
.PP
.PP
\fBThe zzip_entry_feof function\fR
allows to distinguish an error from an eof condition. Actually, if we found an error but we did already reach eof then we just keep on saying that it was an eof, so the app can just continue.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/837            1154977710  1001  0     100644  28        `
.so man3/zzip_entry_fopen.3
/857            1154977710  1001  0     100644  34        `
.so man3/zzip_entry_data_offset.3
/889            1154977710  1001  0     100644  31        `
.so man3/zzip_entry_findfile.3

/908            1154977710  1001  0     100644  34        `
.so man3/zzip_entry_data_offset.3
zzip_errno.3/   1154977710  1001  0     100644  988       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_ERRNO" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_errno \- (zzip/err.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 15
\fBint\ \fBzzip_errno\fR\fR\fB(\fR\fBint\ errcode\fR\fB);\fR
.SH "DESCRIPTION"
.PP
map the error code to a system error code. This is used for the drop\-in replacement functions to return a value that can be interpreted correctly by code sections that are unaware of the fact they their
\fBopen\fR(2) call had been diverted to a file inside a zip\-archive.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_error.3/   1154977710  1001  0     100644  1001      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_ERROR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_error, zzip_seterror \- (zzip/info.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 15
\fBint\ \fBzzip_error\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 19
\fBvoid\ \fBzzip_seterror\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB, \fR\fBint\ errcode\fR\fB);\fR
.SH "DESCRIPTION"
.PP
just returns dir\->errcode of the ZZIP_DIR handle see:
\fBzzip_dir_open\fR,
\fBzzip_diropen\fR,
\fBzzip_readdir\fR,
\fBzzip_dir_read\fR
.PP
\fBThe zzip_seterror function\fR
just does dir\->errcode = errcode
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

zzip_fclose.3/  1154977710  1001  0     100644  1094      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FCLOSE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_fclose, zzip_close \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 16
\fBint\ \fBzzip_fclose\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.HP 15
\fBint\ \fBzzip_close\fR\fR\fB(\fR\fBZZIP_FILE*\ fp\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_fclose function\fR
closes the given ZZIP_FILE handle.
.PP
If the ZZIP_FILE wraps a normal stat'fd then it is just that int'fd that is being closed and the otherwise empty ZZIP_FILE gets freed.
.PP
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
/934            1154977710  1001  0     100644  1053      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "__ZZIP_FETCH_DISK_TR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
__zzip_fetch_disk_trailer \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 30
\fBint\ \fB__zzip_fetch_disk_trailer\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBzzip_off_t\ filesize\fR\fB, \fR\fBstruct\ _disk_trailer\ *\ _zzip_restrict\ trailer\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe __zzip_fetch_disk_trailer function\fR
is used by
\fBzzip_file_open\fR. It tries to find the zip's central directory info that is usually a few bytes off the end of the file.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

/963            1154977710  1001  0     100644  1031      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FILE_CLOSE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_file_close \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 20
\fBint\ \fBzzip_file_close\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.SH "DESCRIPTION"
.PP
the direct function of
\fBzzip_close\fR(fp). it will cleanup the inflate\-portion of
\fBzlib\fR
and free the structure given.
.PP
it is called quite from the error\-cleanup parts of the various
\fB_open\fR
functions.
.PP
the .refcount is decreased and if zero the fp\->dir is closed just as well.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>

/982            1154977710  1001  0     100644  3089      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FILE_CREAT" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_file_creat, zzip_file_mkdir \- start next file entry in a zip archive
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 27
\fBZZIP_FILE*\ \fBzzip_file_creat\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 20
\fBint\ \fBzzip_file_mkdir\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_file_creat function\fR
will create a new file within a zzip archive, the one given as the primary argument and additionally to the posix creat(2) \- just like zzip_mkdir has an additional argument over the posix mkdir(2) spec. For
\fBthe zzip_file_creat function\fR
the primary parameter can be null as well thereby creating a real file instead of a new one inside the zip\-archive otherwise given. If the primary parameter is not null but wraps a real directory then all new files are also real.
.PP
\fBThe zzip_file_creat function\fR
is not yet implemented, check for #def ZZIP_NO_CREAT
.PP
Returns NULL on an error setting errno, and opening a file _within_ a zip archive using O_RDONLY (and similar stuff) will surely lead to an error.
.PP
.PP
\fBThe zzip_file_mkdir function\fR
has an additional primary argument over the posix mkdir(2) \- if it is null then
\fBthe zzip_file_mkdir function\fR
behaves just like posix mkdir(2). The zzip_dir argument can be set to the result of a
\fBzzip_createdir\fR
which allows for some magic that the given directory name is created as an entry in the zip archive.
.PP
If the given dir name argument is not within the basepath of the zip central directory then a real directory is created. Any EEXIST errors are not suppressed unlike with
\fBzzip_createdir\fR
.PP
Standard usage accepts a global/threaded/modular ZZIP_DIR pointer for all zip archive operations like in:
.sp
.nf
  ZZIP_DIR* zip = zzip_createdir (sysconfpath, 0755, zip);  
   zzip_file_mkdir (zip, filepath[i], 0755);  
   ZZIP_FILE* file = zzip_file_creat (zip, filename[i], 0644);  
   zzip_write (file, buf, len);  
   zzip_close (file); file = 0;  
   zzip_closedir (zip); zip = 0;
.fi
.sp
.PP
compare with
\fBzzip_mkdir\fR
inline macro which allows to collapse the examples script to
.sp
.nf
  #define zzip_savefile myproject_saveconfig  
   #include <zzip/zzip.h>  
   ZZIP_DIR* zzip_savefile = zzip_createdir (sysconfpath, 0755);  
   zzip_mkdir (filepath[i], 0755);  
   ZZIP_FILE* file = zzip_creat(filepath[i], 0644);  
   zzip_write (file, buf, len);  
   zzip_close (file); file = 0;  
   zzip_closedir (zip_savefile);
.fi
.sp
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

/1001           1154977710  1001  0     100644  27        `
.so man3/zzip_file_creat.3

/1020           1154977710  1001  0     100644  1105      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FILE_OPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_file_open \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 27
\fBZZIP_FILE\ *\ \fBzzip_file_open\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.SH "DESCRIPTION"
.PP
open an
\fBZZIP_FILE\fR
from an already open
\fBZZIP_DIR\fR
handle. Since we have a chance to reuse a cached
\fBbuf32k\fR
and
\fBZZIP_FILE\fR
memchunk this is the best choice to unpack multiple files.
.PP
Note: the zlib supports 2..15 bit windowsize, hence we provide a 32k memchunk here... just to be safe.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>

/1038           1154977710  1001  0     100644  1400      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FILE_READ" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_file_read \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 28
\fBzzip_ssize_t\ \fBzzip_file_read\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBchar\ *\ buf\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_file_read function\fRs read data from zip\-contained file.
.PP
It works like
\fBread\fR(2) and will fill the given buffer with bytes from the opened file. It will return the number of bytes read, so if the
\fBEOF\fR
is encountered you will be prompted with the number of bytes actually read.
.PP
This is the routines that needs the
\fBbuf32k\fR
buffer, and it would have need for much more polishing but it does already work quite well.
.PP
Note: the 32K buffer is rather big. The original inflate\-algorithm required just that but the latest zlib would work just fine with a smaller buffer.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
/1056           1154977710  1001  0     100644  1662      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FILE_REAL" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_file_real, zzip_dir_real, zzip_realdir, zzip_realfd \- (zzip/info.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 19
\fBint\ \fBzzip_file_real\fR\fR\fB(\fR\fBZZIP_FILE*\ fp\fR\fB);\fR
.HP 18
\fBint\ \fBzzip_dir_real\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.HP 19
\fBvoid*\ \fBzzip_realdir\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.HP 16
\fBint\ \fBzzip_realfd\fR\fR\fB(\fR\fBZZIP_FILE*\ fp\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_file_real function\fR
checks if the ZZIP_FILE\-handle is wrapping a real file or a zip\-contained file. Returns 1 for a stat'able file, and 0 for a file inside a zip\-archive.
.PP
\fBThe zzip_dir_real function\fR
checks if the ZZIP_DIR\-handle is wrapping a real directory or a zip\-archive. Returns 1 for a stat'able directory, and 0 for a handle to zip\-archive.
.PP
\fBThe zzip_realdir function\fR
returns the posix DIR* handle (if one exists). Check before with
\fBzzip_dir_real\fR
if the the ZZIP_DIR points to a real directory.
.PP
\fBThe zzip_realfd function\fR
returns the posix file descriptor (if one exists). Check before with
\fBzzip_file_real\fR
if the the ZZIP_FILE points to a real file.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/1074           1154977710  1001  0     100644  25        `
.so man3/zzip_dir_stat.3

/1092           1154977710  1001  0     100644  22        `
.so man3/zzip_write.3
zzip_fopen.3/   1154977710  1001  0     100644  4212      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_FOPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_fopen, zzip_freopen \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 22
\fBZZIP_FILE*\ \fBzzip_fopen\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBzzip_char_t*\ mode\fR\fB);\fR
.HP 24
\fBZZIP_FILE*\ \fBzzip_freopen\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBzzip_char_t*\ mode\fR\fB, \fR\fBZZIP_FILE*\ stream\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_fopen function\fR
will
\fBfopen\fR(3) a real/zipped file.
.PP
It has some magic functionality builtin \- it will first try to open the given
\fIfilename\fR
as a normal file. If it does not exist, the given path to the filename (if any) is split into its directory\-part and the file\-part. A ".zip" extension is then added to the directory\-part to create the name of a zip\-archive. That zip\-archive (if it exists) is being searched for the file\-part, and if found a zzip\-handle is returned.
.PP
Note that if the file is found in the normal fs\-directory the returned structure is mostly empty and the
\fBzzip_read\fR
call will use the libc
\fBread\fR
to obtain data. Otherwise a
\fBzzip_file_open\fR
is performed and any error mapped to
\fBerrno\fR(3).
.PP
unlike the posix\-wrapper
\fBzzip_open\fR
the mode\-argument is a string which allows for more freedom to support the extra zzip modes called ZZIP_CASEINSENSITIVE and ZZIP_IGNOREPATH. Currently, this
\fBzzip_fopen\fR
call will convert the following characters in the mode\-string into their corrsponding mode\-bits:
.sp
.nf
\fB "r" : O_RDONLY : \fR read\-only
   \fB "b" : O_BINARY : \fR binary (win32 specific)
   \fB "f" : O_NOCTTY : \fR no char device (unix)
   \fB "i" : ZZIP_CASELESS : \fR inside zip file
   \fB "*" : ZZIP_NOPATHS : \fR inside zip file only
   
.fi
.PP
all other modes will be ignored for zip\-contained entries but they are transferred for compatibility and portability, including these extra sugar bits:
.sp
.nf
\fB "x" : O_EXCL :\fR fail if file did exist
   \fB "s" : O_SYNC :\fR synchronized access
   \fB "n" : O_NONBLOCK :\fR nonblocking access
   \fB "z#" : compression level :\fR for zlib
   \fB "g#" : group access :\fR unix access bits
   \fB "u#" : owner access :\fR unix access bits
   \fB "o#" : world access :\fR unix access bits
   
.fi
.PP
... the access bits are in traditional unix bit format with 7 = read/write/execute, 6 = read/write, 4 = read\-only.
.PP
The default access mode is 0664, and the compression level is ignored since the lib can not yet write zip files, otherwise it would be the initialisation value for the zlib deflateInit where 0 = no\-compression, 1 = best\-speed, 9 = best\-compression.
.PP
.PP
\fBThe zzip_freopen function\fR
receives an additional argument pointing to a ZZIP_FILE* being already in use. If this extra argument is null then
\fBthe zzip_freopen function\fR
is identical with calling
\fBzzip_fopen\fR
.PP
Per default, the old file stream is closed and only the internal structures associated with it are kept. These internal structures may be reused for the return value, and this is a lot quicker when the filename matches a zipped file that is incidently in the very same zip arch as the old filename wrapped in the stream struct.
.PP
That's simply because the zip arch's central directory does not need to be read again. As an extension for
\fBthe zzip_freopen function\fR, if the mode\-string contains a "q" then the old stream is not closed but left untouched, instead it is only given as a hint that a new file handle may share/copy the zip arch structures of the old file handle if that is possible, i.e when they are in the same zip arch.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_fread.3/   1154977710  1001  0     100644  21        `
.so man3/zzip_read.3

zzip_freopen.3/ 1154977710  1001  0     100644  22        `
.so man3/zzip_fopen.3
zzip_fstat.3/   1154977710  1001  0     100644  25        `
.so man3/zzip_dir_stat.3

zzip_fwrite.3/  1154977710  1001  0     100644  22        `
.so man3/zzip_write.3
__zzip_get16.3/ 1154977710  1001  0     100644  24        `
.so man3/__zzip_get32.3
__zzip_get32.3/ 1154977710  1001  0     100644  1714      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "__ZZIP_GET32" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
__zzip_get32, __zzip_get16, __zzip_get64, __zzip_set32, __zzip_set16, __zzip_set64 \- (zzip/fetch.c)
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 22
\fBuint32_t\ \fB__zzip_get32\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB);\fR
.HP 22
\fBuint16_t\ \fB__zzip_get16\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB);\fR
.HP 22
\fBuint64_t\ \fB__zzip_get64\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB);\fR
.HP 18
\fBvoid\ \fB__zzip_set32\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB, \fR\fBuint32_t\ v\fR\fB);\fR
.HP 18
\fBvoid\ \fB__zzip_set16\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB, \fR\fBuint16_t\ v\fR\fB);\fR
.HP 18
\fBvoid\ \fB__zzip_set64\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB, \fR\fBuint64_t\ v\fR\fB);\fR
.SH "DESCRIPTION"
.PP
Make 32 bit value in host byteorder from little\-endian mapped octet\-data (works also on machines which SIGBUS on misaligned data access (eg. 68000))
.PP
\fBThe __zzip_get16 function\fR
does the same for a 16 bit value.
.PP
\fBThe __zzip_get64 function\fR
does the same for an off64_t value.
.PP
\fBThe __zzip_set32 function\fR
pushes a 32bit value at the specified address
.PP
\fBThe __zzip_set16 function\fR
does the same for a 16 bit value.
.PP
\fBThe __zzip_set64 function\fR
pushes a off64_t value at the specified address
__zzip_get64.3/ 1154977710  1001  0     100644  24        `
.so man3/__zzip_get32.3
/1111           1154977710  1001  0     100644  24        `
.so man3/zzip_init_io.3
/1134           1154977710  1001  0     100644  886       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_INFLATE_INIT" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_inflate_init \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 29
\fBstatic\ int\ \fBzzip_inflate_init\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBstruct\ zzip_dir_hdr*\ hdr\fR\fB);\fR
.SH "DESCRIPTION"
.PP
call
\fBinflateInit\fR
and setup fp's iterator variables, used by lowlevel
\fB_open\fR
functions.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_init_io.3/ 1154977710  1001  0     100644  1257      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_INIT_IO" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_init_io, zzip_get_default_io \- (zzip/plugin.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 17
\fBint\ \fBzzip_init_io\fR\fR\fB(\fR\fBzzip_plugin_io_handlers_t\ io\fR\fB, \fR\fBint\ flags\fR\fB);\fR
.HP 37
\fBzzip_plugin_io_t\ \fBzzip_get_default_io\fR\fR\fB(\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_init_io function\fR
initializes the users handler struct to default values being the posix io functions in default configured environments.
.PP
\fBThe zzip_get_default_io function\fR
returns a zzip_plugin_io_t handle to static defaults wrapping the posix io file functions for actual file access.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Mike Nordell
<tamlin\-@\-algonet\-se>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Mike Nordell
<tamlin\-@\-algonet\-se>

zziplib.h.3/    1154977710  1001  0     100644  6218      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIPLIB.H" "3" "0.13.47" "the library zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zziplib.h \- library
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 20
\fBvoid\ \fBzzip_rewinddir\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 26
\fBZZIP_DIRENT*\ \fBzzip_readdir\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 23
\fBZZIP_DIR*\ \fBzzip_opendir\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB);\fR
.HP 18
\fBint\ \fBzzip_closedir\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.HP 27
\fBzzip_char_t*\ \fBzzip_strerror\fR\fR\fB(\fR\fBint\ errcode\fR\fB);\fR
.HP 15
\fBint\ \fBzzip_errno\fR\fR\fB(\fR\fBint\ errcode\fR\fB);\fR
.HP 22
\fBuint32_t\ \fB__zzip_get32\fR\fR\fB(\fR\fBunsigned\ char\ *\ s\fR\fB);\fR
.HP 20
\fBint\ \fBzzip_file_close\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.HP 27
\fBZZIP_FILE\ *\ \fBzzip_file_open\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 29
\fBstatic\ int\ \fBzzip_inflate_init\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBstruct\ zzip_dir_hdr*\ hdr\fR\fB);\fR
.HP 16
\fBint\ \fBzzip_fclose\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.HP 28
\fBzzip_ssize_t\ \fBzzip_file_read\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBchar\ *\ buf\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.HP 23
\fBzzip_ssize_t\ \fBzzip_read\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBchar\ *\ buf\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.HP 22
\fBZZIP_FILE*\ \fBzzip_fopen\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBzzip_char_t*\ mode\fR\fB);\fR
.HP 21
\fBZZIP_FILE*\ \fBzzip_open\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ o_flags\fR\fB);\fR
.HP 16
\fBint\ \fBzzip_rewind\fR\fR\fB(\fR\fBZZIP_FILE\ *fp\fR\fB);\fR
.HP 21
\fBzzip_off_t\ \fBzzip_seek\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBzzip_off_t\ offset\fR\fB, \fR\fBint\ whence\fR\fB);\fR
.HP 21
\fBzzip_off_t\ \fBzzip_tell\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.HP 34
\fBzzip_off_t\ \fBzzip_entry_data_offset\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB);\fR
.HP 44
\fBzzip__new__\ ZZIP_ENTRY*\ \fBzzip_entry_findfile\fR\fR\fB(\fR\fBFILE*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB, \fR\fBZZIP_ENTRY*\ _zzip_restrict\ entry\fR\fB, \fR\fBzzip_strcmp_fn_t\ compare\fR\fB);\fR
.HP 46
\fBzzip__new__\ ZZIP_ENTRY_FILE*\ \fBzzip_entry_fopen\fR\fR\fB(\fR\fBZZIP_ENTRY*\ entry\fR\fB, \fR\fBint\ takeover\fR\fB);\fR
.HP 15
\fBint\ \fBzzip_error\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 26
\fBZZIP_DIR\ *\ \fBzzip_dirhandle\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.HP 28
\fBzzip_char_t*\ \fBzzip_compr_str\fR\fR\fB(\fR\fBint\ compr\fR\fB);\fR
.HP 19
\fBint\ \fBzzip_file_real\fR\fR\fB(\fR\fBZZIP_FILE*\ fp\fR\fB);\fR
.HP 46
\fBzzip__new__\ ZZIP_MEM_DISK*\ \fBzzip_mem_disk_open\fR\fR\fB(\fR\fBchar*\ filename\fR\fB);\fR
.HP 48
\fBzzip__new__\ ZZIP_MEM_DISK*\ \fBzzip_mem_disk_fdopen\fR\fR\fB(\fR\fBint\ fd\fR\fB);\fR
.HP 24
\fBlong\ \fBzzip_mem_disk_load\fR\fR\fB(\fR\fBZZIP_MEM_DISK*\ dir\fR\fB, \fR\fBZZIP_DISK*\ disk\fR\fB);\fR
.HP 47
\fBzzip__new__\ ZZIP_MEM_ENTRY*\ \fBzzip_mem_entry_new\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBZZIP_DISK_ENTRY*\ entry\fR\fB);\fR
.HP 38
\fBzzip__new__\ ZZIP_DISK*\ \fBzzip_disk_mmap\fR\fR\fB(\fR\fBint\ fd\fR\fB);\fR
.HP 37
\fBzzip_byte_t*\ \fBzzip_disk_entry_to_data\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ entry\fR\fB);\fR
.HP 43
\fBstruct\ zzip_disk_entry*\ \fBzzip_disk_findfile\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB, \fR\fBstruct\ zzip_disk_entry*\ after\fR\fB, \fR\fBzzip_strcmp_fn_t\ compare\fR\fB);\fR
.HP 44
\fBzzip__new__\ ZZIP_DISK_FILE*\ \fBzzip_disk_fopen\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBchar*\ filename\fR\fB);\fR
.HP 17
\fBint\ \fBzzip_init_io\fR\fR\fB(\fR\fBzzip_plugin_io_handlers_t\ io\fR\fB, \fR\fBint\ flags\fR\fB);\fR
.HP 18
\fBint\ \fBzzip_dir_stat\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBZZIP_STAT\ *\ zs\fR\fB, \fR\fBint\ flags\fR\fB);\fR
.HP 25
\fBZZIP_DIR*\ \fBzzip_dir_creat\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 25
\fBZZIP_DIR*\ \fBzzip_createdir\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 27
\fBZZIP_FILE*\ \fBzzip_file_creat\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB, \fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 24
\fBzzip_ssize_t\ \fBzzip_write\fR\fR\fB(\fR\fBZZIP_FILE*\ file\fR\fB, \fR\fBconst\ void*\ ptr\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.HP 22
\fBint\ inline\ \fBzzip_mkdir\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 24
\fBvoid\ inline\ \fBzzip_mkfifo\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 30
\fBint\ \fB__zzip_fetch_disk_trailer\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBzzip_off_t\ filesize\fR\fB, \fR\fBstruct\ _disk_trailer\ *\ _zzip_restrict\ trailer\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.HP 32
\fBint\ \fB__zzip_parse_root_directory\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBstruct\ _disk_trailer\ *\ trailer\fR\fB, \fR\fBstruct\ zzip_dir_hdr\ **\ hdr_return\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.HP 32
\fBZZIP_DIR*\ \fBzzip_dir_alloc_ext_io\fR\fR\fB(\fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBconst\ zzip_plugin_io_t\ io\fR\fB);\fR
.HP 18
\fBint\ \fBzzip_dir_free\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 27
\fBZZIP_DIR\ *\ \fBzzip_dir_fdopen\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBzzip_error_t\ *\ errcode_p\fR\fB);\fR
.HP 20
\fBint\ \fB__zzip_try_open\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ filemode\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.HP 24
\fBZZIP_DIR*\ \fBzzip_dir_open\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBzzip_error_t*\ e\fR\fB);\fR
.SH "DESCRIPTION"
.PP
zziplib library
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>
/1155           1154977710  1001  0     100644  766       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_MEM_DISK_FDOPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_mem_disk_fdopen \- create new diskdir handle.
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 48
\fBzzip__new__\ ZZIP_MEM_DISK*\ \fBzzip_mem_disk_fdopen\fR\fR\fB(\fR\fBint\ fd\fR\fB);\fR
.SH "DESCRIPTION"
.PP
wraps underlying zzip_disk_open.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/1179           1154977710  1001  0     100644  870       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_MEM_DISK_LOAD" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_mem_disk_load \- parse central dir.
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 24
\fBlong\ \fBzzip_mem_disk_load\fR\fR\fB(\fR\fBZZIP_MEM_DISK*\ dir\fR\fB, \fR\fBZZIP_DISK*\ disk\fR\fB);\fR
.SH "DESCRIPTION"
.PP
creates an internal copy of each entry converted to the local platform. returns: number of entries, or \-1 on error (setting errno)
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/1201           1154977710  1001  0     100644  768       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_MEM_DISK_OPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_mem_disk_open \- create new diskdir handle.
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 46
\fBzzip__new__\ ZZIP_MEM_DISK*\ \fBzzip_mem_disk_open\fR\fR\fB(\fR\fBchar*\ filename\fR\fB);\fR
.SH "DESCRIPTION"
.PP
wraps underlying zzip_disk_open.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/1223           1154977710  1001  0     100644  1113      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_MEM_ENTRY_NEW" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_mem_entry_new \- convert a zip disk entry to internal format.
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 47
\fBzzip__new__\ ZZIP_MEM_ENTRY*\ \fBzzip_mem_entry_new\fR\fR\fB(\fR\fBZZIP_DISK*\ disk\fR\fB, \fR\fBZZIP_DISK_ENTRY*\ entry\fR\fB);\fR
.SH "DESCRIPTION"
.PP
creates a new item parsing the information out of the various places in the zip archive. This is a good place to extend functionality if you have a project with extra requirements as you can push more bits right into the diskdir_entry for later usage in higher layers. returns: new item, or null on error (setting errno)
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

zzip_mkdir.3/   1154977710  1001  0     100644  2200      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_MKDIR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_mkdir, zzip_creat \- create a zipped file/directory
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 22
\fBint\ inline\ \fBzzip_mkdir\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 29
\fBZZIP_FILE*\ inline\ \fBzzip_creat\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_mkdir function\fR
creates a directory entry in the default zip\-archive. If you did not specify a "#define zzip_savefile somevar" then the default zip\-archive is null and all directories are created as real directories in the filesystem.
\fBThe zzip_mkdir function\fR
is really a preprocessor macro or preferably an inline function around
\fBzzip_file_mkdir\fR, there is no such symbol generated into the library. The prototype is modelled after the posix
\fBmkdir\fR(2) call.
.sp
.nf
  #ifndef zzip_savefile  
   #define zzip_savefile 0  
   #endif  
   #define zzip_mkdir(name,mode) \\ \-
.fi
.sp
zzip_file_mkdir(zzip_savefile,name,mode)
.PP
.PP
.PP
\fBThe zzip_creat function\fR
creates a file in the default zip\-archive. If you did not specify a "#define zzip_savefile somevar" then the default zip\-archive is null and all files are created as real files.
\fBThe zzip_creat function\fR
is really a preprocessor macro or preferably an inline function around
\fBzzip_file_creat\fR, there is no such symbol generated into the library. The prototype is modelled after the posix
\fBcreat\fR(2) call.
.sp
.nf
  #ifndef zzip_savefile  
   #define zzip_savefile 0  
   #endif  
   #define zzip_creat(name,mode) \\ \-
.fi
.sp
zzip_file_creat(zzip_savefile,name,mode)
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.SH "SEE ALSO"
.PP
zzip_dir_creat, mkdir(2), creat(2), zzip_start
zzip_mkfifo.3/  1154977710  1001  0     100644  2613      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_MKFIFO" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_mkfifo, zzip_sync \- start writing to the magic zzip_savefile
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 24
\fBvoid\ inline\ \fBzzip_mkfifo\fR\fR\fB(\fR\fBzzip_char_t*\ name\fR\fB, \fR\fBint\ o_mode\fR\fB);\fR
.HP 22
\fBvoid\ inline\ \fBzzip_sync\fR\fR\fB(\fR\fBvoid\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
open a zip archive for writing via the magic zzip_savefile macro variable. The name and mode are given to
\fBzzip_createdir\fR
and the result is stored into
\fBzzip_savefile\fR
\- if the
\fBzzip_savefile\fR
did already have a zzip_dir handle then it is automatically finalized with
\fBzzip_sync\fR
and the handle closed and the zzip_savefile variable reused for the new zip archive just started with this call. \-
\fBThe zzip_mkfifo function\fR
is really a preprocessor macro or preferably an inline function around
\fBzzip_dir_create\fR, there is no such symbol generated into the library.
.sp
.nf
  #ifndef zzip_savefile  
   #define zzip_savefile 0  
   #endif  
   #define zzip_start(name,mode,ext) \\ \-
.fi
.sp
{ if (zzip_savefile) zzip_closedir(zzip_savefile); \\ \- zzip_savefile = zzip_createdir(name,mode,ext); }
\fBThe zzip_mkfifo function\fR
returns null on error or a zzip_dir handle on success. It is perfectly okay to continue with a null in the zzip_savefile variable since it makes subsequent calls to
\fBzzip_creat\fR
and
\fBzzip_mkdir\fR
to run as
\fBcreat\fR(2) /
\fBmkdir\fR(2) on the real filesystem.
.PP
.PP
finalize a zip archive thereby writing the central directory to the end of the file. If it was a real directory then we do just nothing \- even that the prototype of the call itself is modelled to be similar to the posix
\fBsync\fR(2) call.
\fBThe zzip_sync function\fR
is really a preprocessor macro or preferably an inline function around
\fBzzip_closedir\fR, there is no such symbol generated into the library.
.sp
.nf
  #ifndef zzip_savefile  
   #define zzip_savefile 0  
   #endif  
   #define zzip_sync(name,mode) \\ \-
.fi
.sp
{ zzip_closedir(zzip_savefile); zzip_savefile = 0; }
.PP
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.SH "SEE ALSO"
.PP
zzip_creat, zzip_write, zzip_closedir, sync(2)

zzip_open.3/    1154977710  1001  0     100644  4164      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_OPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_open, zzip_open_ext_io, zzip_open_shared_io \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 21
\fBZZIP_FILE*\ \fBzzip_open\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ o_flags\fR\fB);\fR
.HP 28
\fBZZIP_FILE*\ \fBzzip_open_ext_io\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ o_flags\fR\fB, \fR\fBint\ o_modes\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.HP 31
\fBZZIP_FILE*\ \fBzzip_open_shared_io\fR\fR\fB(\fR\fBZZIP_FILE*\ stream\fR\fB, \fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ o_flags\fR\fB, \fR\fBint\ o_modes\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_open function\fR
will
\fBopen\fR(2) a real/zipped file
.PP
It has some magic functionality builtin \- it will first try to open the given
\fIfilename\fR
as a normal file. If it does not exist, the given path to the filename (if any) is split into its directory\-part and the file\-part. A ".zip" extension is then added to the directory\-part to create the name of a zip\-archive. That zip\-archive (if it exists) is being searched for the file\-part, and if found a zzip\-handle is returned.
.PP
Note that if the file is found in the normal fs\-directory the returned structure is mostly empty and the
\fBzzip_read\fR
call will use the libc
\fBread\fR
to obtain data. Otherwise a
\fBzzip_file_open\fR
is performed and any error mapped to
\fBerrno\fR(3).
.PP
There was a possibility to transfer zziplib\-specific openmodes through o_flags but you should please not use them anymore and look into
\fBzzip_open_ext_io\fR
to submit them down.
\fBThe zzip_open function\fR
is shallow in that it just extracts the zzipflags and calls
.sp
.nf
\fB
   zzip_open_ext_io(filename, o_flags, zzipflags|0664, 0, 0) \fR
.fi
.PP
you must stop using this extra functionality (not well known anyway) since zzip_open might be later usable to open files for writing in which case the _EXTRAFLAGS will get in conflict.
.PP
compare with
\fBopen\fR(2) and
\fBzzip_fopen\fR
.PP
.PP
\fBThe zzip_open_ext_io function\fR
uses explicit ext and io instead of the internal defaults, setting them to zero is equivalent to
\fBzzip_open\fR
.PP
note that the two flag types have been split into an o_flags (for fcntl\-like openflags) and o_modes where the latter shall carry the zzip_flags and possibly accessmodes for unix filesystems. Since this version of zziplib can not write zipfiles, it is not yet used for anything else than zzip\-specific modeflags.
.PP
.PP
\fBThe zzip_open_shared_io function\fR
takes an extra stream argument \- if a handle has been then ext/io can be left null and the new stream handle will pick up the ext/io. This should be used only in specific environment however since
\fBzzip_file_real\fR
does not store any ext\-sequence.
.PP
The benefit for
\fBthe zzip_open_shared_io function\fR
comes in when the old file handle was openened from a file within a zip archive. When the new file is in the same zip archive then the internal zzip_dir structures will be shared. It is even quicker, as no check needs to be done anymore trying to guess the zip archive place in the filesystem, here we just check whether the zip archive's filepath is a prefix part of the filename to be opened.
.PP
Note that
\fBthe zzip_open_shared_io function\fR
is also used by
\fBzzip_freopen\fR
that will unshare the old handle, thereby possibly closing the handle.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_opendir.3/ 1154977710  1001  0     100644  1490      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_OPENDIR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_opendir, zzip_opendir_ext_io \- (zzip/dir.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 23
\fBZZIP_DIR*\ \fBzzip_opendir\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB);\fR
.HP 30
\fBZZIP_DIR*\ \fBzzip_opendir_ext_io\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ o_modes\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_opendir function\fR
is the equivalent of
\fBopendir\fR(3) for a realdir or zipfile.
.PP
\fBThe zzip_opendir function\fR
has some magic \- if the given argument\-path is a directory, it will wrap a real
\fBopendir\fR(3) into the ZZIP_DIR structure. Otherwise it will divert to
\fBzzip_dir_open\fR
which can also attach a ".zip" extension if needed to find the archive.
.PP
the error\-code is mapped to
\fBerrno\fR(3).
.PP
\fBThe zzip_opendir_ext_io function\fR
uses explicit ext and io instead of the internal defaults, setting them to zero is equivalent to
\fBzzip_opendir\fR
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
/1245           1154977710  1001  0     100644  24        `
.so man3/zzip_opendir.3
/1268           1154977710  1001  0     100644  21        `
.so man3/zzip_open.3

/1288           1154977710  1001  0     100644  21        `
.so man3/zzip_open.3

/1311           1154977710  1001  0     100644  1125      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "__ZZIP_PARSE_ROOT_DI" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
__zzip_parse_root_directory \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 32
\fBint\ \fB__zzip_parse_root_directory\fR\fR\fB(\fR\fBint\ fd\fR\fB, \fR\fBstruct\ _disk_trailer\ *\ trailer\fR\fB, \fR\fBstruct\ zzip_dir_hdr\ **\ hdr_return\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe __zzip_parse_root_directory function\fR
is used by
\fBzzip_file_open\fR, it is usually called after
\fB__zzip_find_disk_trailer\fR. It will parse the zip's central directory information and create a zziplib private directory table in memory.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

zzip_read.3/    1154977710  1001  0     100644  1578      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_READ" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_read, zzip_fread \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 23
\fBzzip_ssize_t\ \fBzzip_read\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBchar\ *\ buf\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.HP 23
\fBzzip_size_t\ \fBzzip_fread\fR\fR\fB(\fR\fBvoid\ *ptr\fR\fB, \fR\fBzzip_size_t\ size\fR\fB, \fR\fBzzip_size_t\ nmemb\fR\fB, \fR\fBZZIP_FILE\ *file\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_read function\fR
will read(2) data from a real/zipped file.
.PP
the replacement for
\fBread\fR(2) will fill the given buffer with bytes from the opened file. It will return the number of bytes read, so if the EOF is encountered you will be prompted with the number of bytes actually read.
.PP
If the file\-handle is wrapping a stat'able file then it will actually just perform a normal
\fBread\fR(2)\-call, otherwise
\fBzzip_file_read\fR
is called to decompress the data stream and any error is mapped to
\fBerrno\fR(3).
.PP
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_readdir.3/ 1154977710  1001  0     100644  1125      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_READDIR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_readdir \- (zzip/dir.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 26
\fBZZIP_DIRENT*\ \fBzzip_readdir\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_readdir function\fR
is the equivalent of a
\fBreaddir\fR(2) for a realdir or a zipfile referenced by the ZZIP_DIR returned from
\fBzzip_opendir\fR.
.PP
The ZZIP_DIR handle (as returned by
\fBzzip_opendir\fR) contains a few more entries than being copied into the ZZIP_DIRENT. The only valid fields in a ZZIP_DIRENT are d_name (the file name), d_compr (compression), d_csize (compressed size), st_size (uncompressed size).
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>

zzip_realdir.3/ 1154977710  1001  0     100644  26        `
.so man3/zzip_file_real.3
zzip_realfd.3/  1154977710  1001  0     100644  26        `
.so man3/zzip_file_real.3
zzip_rewind.3/  1154977710  1001  0     100644  889       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_REWIND" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_rewind \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 16
\fBint\ \fBzzip_rewind\fR\fR\fB(\fR\fBZZIP_FILE\ *fp\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_rewind function\fR
will rewind a real/zipped file.
.PP
It seeks to the beginning of this file's data in the zip, or the beginning of the file for a stat'fd.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>

/1342           1154977710  1001  0     100644  1398      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_REWINDDIR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_rewinddir, zzip_telldir, zzip_seekdir \- (zzip/dir.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 20
\fBvoid\ \fBzzip_rewinddir\fR\fR\fB(\fR\fBZZIP_DIR\ *\ dir\fR\fB);\fR
.HP 24
\fBzzip_off_t\ \fBzzip_telldir\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.HP 18
\fBvoid\ \fBzzip_seekdir\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB, \fR\fBzzip_off_t\ offset\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_rewinddir function\fR
is the equivalent of a
\fBrewinddir\fR(2) for a realdir or the zipfile in place of a directory. The ZZIP_DIR handle returned from
\fBzzip_opendir\fR
has a flag saying realdir or zipfile. As for a zipfile, the filenames will include the filesubpath, so take care.
.PP
\fBThe zzip_telldir function\fR
is the equivalent of
\fBtelldir\fR(2) for a realdir or zipfile.
.PP
\fBThe zzip_seekdir function\fR
is the equivalent of
\fBseekdir\fR(2) for a realdir or zipfile.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
zzip_seek.3/    1154977710  1001  0     100644  1450      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_SEEK" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_seek \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 21
\fBzzip_off_t\ \fBzzip_seek\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB, \fR\fBzzip_off_t\ offset\fR\fB, \fR\fBint\ whence\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_seek function\fR
will perform a
\fBlseek\fR(2) operation on a real/zipped file
.PP
It will try to seek to the offset specified by offset, relative to whence, which is one of SEEK_SET, SEEK_CUR or SEEK_END.
.PP
If the file\-handle is wrapping a stat'able file then it will actually just perform a normal
\fBlseek\fR(2)\-call. Otherwise the relative offset is calculated, negative offsets are transformed into positive ones by rewinding the file, and then data is read until the offset is reached. This can make the function terribly slow, but this is how gzio implements it, so I'm not sure there is a better way without using the internals of the algorithm.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_seekdir.3/ 1154977710  1001  0     100644  26        `
.so man3/zzip_rewinddir.3
__zzip_set16.3/ 1154977710  1001  0     100644  24        `
.so man3/__zzip_get32.3
__zzip_set32.3/ 1154977710  1001  0     100644  24        `
.so man3/__zzip_get32.3
__zzip_set64.3/ 1154977710  1001  0     100644  24        `
.so man3/__zzip_get32.3
zzip_seterror.3/1154977710  1001  0     100644  22        `
.so man3/zzip_error.3
zzip_strerror.3/1154977710  1001  0     100644  1417      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_STRERROR" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_strerror, zzip_strerror_of \- (zzip/err.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 27
\fBzzip_char_t*\ \fBzzip_strerror\fR\fR\fB(\fR\fBint\ errcode\fR\fB);\fR
.HP 30
\fBzzip_char_t*\ \fBzzip_strerror_of\fR\fR\fB(\fR\fBZZIP_DIR*\ dir\fR\fB);\fR
.SH "DESCRIPTION"
.PP
returns the static string for the given error code. The error code can be either a normal system error (a positive error code will flag this), it can be
\fBlibz\fR
error code (a small negative error code will flag this) or it can be an error code from
\fBlibzzip\fR, which is an negative value lower than
\fBZZIP_ERROR\fR
.PP
\fBThe zzip_strerror_of function\fR
fetches the errorcode from the
\fBDIR\fR\-handle and runs it through
\fBzzip_strerror\fR
to obtain the static string describing the error.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
.TP
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>

/1360           1154977710  1001  0     100644  25        `
.so man3/zzip_strerror.3

zzip_sync.3/    1154977710  1001  0     100644  23        `
.so man3/zzip_mkfifo.3

zzip_tell.3/    1154977710  1001  0     100644  1154      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_TELL" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_tell \- (zzip/file.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 21
\fBzzip_off_t\ \fBzzip_tell\fR\fR\fB(\fR\fBZZIP_FILE\ *\ fp\fR\fB);\fR
.SH "DESCRIPTION"
.PP
\fBThe zzip_tell function\fR
will
\fBtell\fR(2) the current position in a real/zipped file
.PP
It will return the current offset within the real/zipped file, measured in uncompressed bytes for the zipped\-file case.
.PP
If the file\-handle is wrapping a stat'able file then it will actually just perform a normal
\fBtell\fR(2)\-call, otherwise the offset is calculated from the amount of data left and the total uncompressed size;
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<Tomi.Ollila@iki.fi>
zzip_telldir.3/ 1154977710  1001  0     100644  26        `
.so man3/zzip_rewinddir.3
/1380           1154977710  1001  0     100644  991       `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "__ZZIP_TRY_OPEN" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
__zzip_try_open \- (zzip/zip.c)
.SH "SYNOPSIS"
.PP
\fB


#include <zzip/lib.h>
\fR
.HP 20
\fBint\ \fB__zzip_try_open\fR\fR\fB(\fR\fBzzip_char_t*\ filename\fR\fB, \fR\fBint\ filemode\fR\fB, \fR\fBzzip_strings_t*\ ext\fR\fB, \fR\fBzzip_plugin_io_t\ io\fR\fB);\fR
.SH "DESCRIPTION"
.PP
will attach a .zip extension and tries to open it the with
\fBopen\fR(2). This is a helper function for
\fBzzip_dir_open\fR,
\fBzzip_opendir\fR
and
\fBzzip_open\fR.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.TP
\(bu
Tomi Ollila
<too@iki.fi>

zzip_write.3/   1154977710  1001  0     100644  2460      `
.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "ZZIP_WRITE" "3" "0.13.47" "zziplib" "Manual Pages"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
zzip_write, zzip_file_write, zzip_fwrite \- write to zzip storage
.SH "SYNOPSIS"
.PP
\fB
 #include <zziplib.h>
\fR
.HP 24
\fBzzip_ssize_t\ \fBzzip_write\fR\fR\fB(\fR\fBZZIP_FILE*\ file\fR\fB, \fR\fBconst\ void*\ ptr\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.HP 29
\fBzzip_ssize_t\ \fBzzip_file_write\fR\fR\fB(\fR\fBZZIP_FILE*\ file\fR\fB, \fR\fBconst\ void*\ ptr\fR\fB, \fR\fBzzip_size_t\ len\fR\fB);\fR
.HP 24
\fBzzip_size_t\ \fBzzip_fwrite\fR\fR\fB(\fR\fBconst\ void*\ ptr\fR\fB, \fR\fBzzip_size_t\ len\fR\fB, \fR\fBzzip_size_t\ multiply\fR\fB, \fR\fBZZIP_FILE*\ file\fR\fB);\fR
.SH "DESCRIPTION"
.PP
.PP
\fBThe zzip_write function\fR
will write data to a file descriptor. If the file descriptor represents a real file then it will be forwarded to call posix
\fBwrite\fR(2) directly. If it is a descriptor for a file within a zip directory then the data will be "deflated" using
\fBzlib\fR(3) and appended to the zip archive file.
.PP
.PP
\fBThe zzip_file_write function\fR
will write data to a file descriptor inside a zip archive. The data will be "deflated" using
\fBzlib\fR(3) compression and appended to the end of the zip archive file. Only one file descriptor may be open per zzip_dir archive handle (fifo\-like).
.PP
\fBThe zzip_file_write function\fR
is not yet implemented, check for #def ZZIP_NO_CREAT It returns immediately \-1 and sets errno=EROFS for indication.
.PP
\fBThe zzip_fwrite function\fR
is the stdc variant for writing and the arguments are forwarded to
\fBzzip_write\fR
\- the return value is floored to null as for STDC spec but there is no zzip_ferror call so far for the zziplib (later? is it actually needed?).
.PP
\fBThe zzip_fwrite function\fR
is not yet implemented, check for #def ZZIP_NO_CREAT Write\-support extends
\fBzzip_close\fR
with semantics to write out a file\-trailer to the zip\-archive leaving a name/offset marker in the (still\-open) ZZIP_DIR handle.
.SH "AUTHOR"
.TP 3
\(bu
Guido Draheim
<guidod@gmx.de>
.SH "SEE ALSO"
.PP
write(2), zlib(3), zzip_file_creat