]>
git.saurik.com Git - wxWidgets.git/blob - utils/Install/packzip/apihelp.c
10 APIDocStruct APIDoc
[] = {
12 "UZPVERSION" , "UzpVersion" ,
13 "UzpVer *UzpVersion(void);",
14 "Get version numbers of the API and the underlying UnZip code.\n\n"
15 "\t\tThis is used for comparing the version numbers of the run-time\n"
16 "\t\tDLL code with those expected from the unzip.h at compile time.\n"
17 "\t\tIf the version numbers do not match, there may be compatibility\n"
18 "\t\tproblems with further use of the DLL.\n\n"
19 " Example:\t/* Check the major version number of the DLL code. */\n"
20 "\t\tUzpVer *pVersion;\n"
21 "\t\tpVersion = UzpVersion();\n"
22 "\t\tif (pVersion->unzip.major != UZ_MAJORVER)\n"
23 "\t\t fprintf(stderr, \"error: using wrong version of DLL\\n\");\n\n"
24 "\t\tSee unzip.h for details and unzipstb.c for an example.\n"
28 "UZPMAIN" , "UzpMain" ,
29 "int UzpMain(int argc, char *argv[]);",
30 "Provide a direct entry point to the command line interface.\n\n"
31 "\t\tThis is used by the UnZip stub but you can use it in your\n"
32 "\t\town program as well. Output is sent to stdout.\n"
33 "\t\t0 on return indicates success.\n\n"
34 " Example:\t/* Extract 'test.zip' silently, junking paths. */\n"
35 "\t\tchar *argv[] = { \"-q\", \"-j\", \"test.zip\" };\n"
37 "\t\tif (UzpMain(argc,argv))\n"
38 "\t\t printf(\"error: unzip failed\\n\");\n\n"
39 "\t\tSee unzip.h for details.\n"
43 "UZPALTMAIN" , "UzpAltMain" ,
44 "int UzpAltMain(int argc, char *argv[], UzpInit *init);",
45 "Provide a direct entry point to the command line interface,\n"
46 "optionally installing replacement I/O handler functions.\n\n"
47 "\t\tAs with UzpMain(), output is sent to stdout by default.\n"
48 "\t\t`InputFn *inputfn' is not yet implemented. 0 on return\n"
49 "\t\tindicates success.\n\n"
50 " Example:\t/* Replace normal output and `more' functions. */\n"
51 "\t\tchar *argv[] = { \"-q\", \"-j\", \"test.zip\" };\n"
53 "\t\tUzpInit init = { 16, MyMessageFn, NULL, MyPauseFn };\n"
54 "\t\tif (UzpAltMain(argc,argv,&init))\n"
55 "\t\t printf(\"error: unzip failed\\n\");\n\n"
56 "\t\tSee unzip.h for details.\n"
60 "UZPUNZIPTOMEMORY", "UzpUnzipToMemory",
61 "int UzpUnzipToMemory(char *zip, char *file, UzpBuffer *retstr);",
62 "Pass the name of the zip file and the name of the file\n"
63 "\t\tyou wish to extract. UzpUnzipToMemory will create a\n"
64 "\t\tbuffer and return it in *retstr; 0 on return indicates\n"
66 "\t\tSee unzip.h for details.\n"
70 "UZPFILETREE", "UzpFileTree",
71 "int UzpFileTree(char *name, cbList(callBack),\n"
72 "\t\t\tchar *cpInclude[], char *cpExclude[]);",
73 "Pass the name of the zip file, a callback function, an\n"
74 "\t\tinclude and exclude file list. UzpFileTree calls the\n"
75 "\t\tcallback for each valid file found in the zip file.\n"
76 "\t\t0 on return indicates failure.\n\n"
77 "\t\tSee unzip.h for details.\n"
84 static int function_help
OF((__GPRO__ APIDocStruct
*doc
, char *fname
));
88 static int function_help(__G__ doc
, fname
)
94 /* strupr(slide); non-standard */
95 while (doc
->compare
&& STRNICMP(doc
->compare
,slide
,strlen(fname
)))
100 Info(slide
, 0, ((char *)slide
,
101 " Function:\t%s\n\n Syntax:\t%s\n\n Purpose:\t%s",
102 doc
->function
, doc
->syntax
, doc
->purpose
));
109 void APIhelp(__G__ argc
, argv
)
115 struct APIDocStruct
*doc
;
117 if (function_help(__G__ APIDoc
, argv
[1]))
119 #ifdef SYSTEM_API_DETAILS
120 if (function_help(__G__ SYSTEM_API_DETAILS
, argv
[1]))
123 Info(slide
, 0, ((char *)slide
,
124 "%s is not a documented command.\n\n\a", argv
[1]));
127 Info(slide
, 0, ((char *)slide
, "\
128 This API provides a number of external C and REXX functions for handling\n\
129 zipfiles in OS/2. Programmers are encouraged to expand this API.\n\
131 C functions: -- See unzip.h for details\n\
132 UzpVer *UzpVersion(void);\n\
133 int UzpMain(int argc, char *argv[]);\n\
134 int UzpAltMain(int argc, char *argv[], UzpInit *init);\n\
135 int UzpUnzipToMemory(char *zip, char *file, UzpBuffer *retstr);\n\
136 int UzpFileTree(char *name, cbList(callBack),\n\
137 char *cpInclude[], char *cpExclude[]);\n\n"));
139 #ifdef SYSTEM_API_BRIEF
140 Info(slide
, 0, ((char *)slide
, SYSTEM_API_BRIEF
));
143 Info(slide
, 0, ((char *)slide
,
144 "\nFor more information, type 'unzip -A <function-name>'\n"));