Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
apihelp.c
Package: unzip540.zip [view]
Upload User: andy_li
Upload Date: 2007-01-06
Package Size: 1019k
Code Size: 5k
Category:
Compress-Decompress algrithms
Development Platform:
MultiPlatform
- /* apihelp.c */
- #ifdef API_DOC
- #define UNZIP_INTERNAL
- #include "unzip.h"
- #include "version.h"
- APIDocStruct APIDoc[] = {
- {
- "UZPVERSION" , "UzpVersion" ,
- "UzpVer *UzpVersion(void);",
- "Get version numbers of the API and the underlying UnZip code.nn"
- "ttThis is used for comparing the version numbers of the run-timen"
- "ttDLL code with those expected from the unzip.h at compile time.n"
- "ttIf the version numbers do not match, there may be compatibilityn"
- "ttproblems with further use of the DLL.nn"
- " Example:t/* Check the major version number of the DLL code. */n"
- "ttUzpVer *pVersion;n"
- "ttpVersion = UzpVersion();n"
- "ttif (pVersion->unzip.major != UZ_MAJORVER)n"
- "tt fprintf(stderr, "error: using wrong version of DLL\n");nn"
- "ttSee unzip.h for details and unzipstb.c for an example.n"
- },
- {
- "UZPMAIN" , "UzpMain" ,
- "int UzpMain(int argc, char *argv[]);",
- "Provide a direct entry point to the command line interface.nn"
- "ttThis is used by the UnZip stub but you can use it in yourn"
- "ttown program as well. Output is sent to stdout.n"
- "tt0 on return indicates success.nn"
- " Example:t/* Extract 'test.zip' silently, junking paths. */n"
- "ttchar *argv[] = { "-q", "-j", "test.zip" };n"
- "ttint argc = 3;n"
- "ttif (UzpMain(argc,argv))n"
- "tt printf("error: unzip failed\n");nn"
- "ttSee unzip.h for details.n"
- },
- {
- "UZPALTMAIN" , "UzpAltMain" ,
- "int UzpAltMain(int argc, char *argv[], UzpInit *init);",
- "Provide a direct entry point to the command line interface,n"
- "optionally installing replacement I/O handler functions.nn"
- "ttAs with UzpMain(), output is sent to stdout by default.n"
- "tt`InputFn *inputfn' is not yet implemented. 0 on returnn"
- "ttindicates success.nn"
- " Example:t/* Replace normal output and `more' functions. */n"
- "ttchar *argv[] = { "-q", "-j", "test.zip" };n"
- "ttint argc = 3;n"
- "ttUzpInit init = { 16, MyMessageFn, NULL, MyPauseFn };n"
- "ttif (UzpAltMain(argc,argv,&init))n"
- "tt printf("error: unzip failed\n");nn"
- "ttSee unzip.h for details.n"
- },
- {
- "UZPUNZIPTOMEMORY", "UzpUnzipToMemory",
- "int UzpUnzipToMemory(char *zip, char *file, UzpBuffer *retstr);",
- "Pass the name of the zip file and the name of the filen"
- "ttyou wish to extract. UzpUnzipToMemory will create an"
- "ttbuffer and return it in *retstr; 0 on return indicatesn"
- "ttfailure.nn"
- "ttSee unzip.h for details.n"
- },
- {
- "UZPFILETREE", "UzpFileTree",
- "int UzpFileTree(char *name, cbList(callBack),n"
- "tttchar *cpInclude[], char *cpExclude[]);",
- "Pass the name of the zip file, a callback function, ann"
- "ttinclude and exclude file list. UzpFileTree calls then"
- "ttcallback for each valid file found in the zip file.n"
- "tt0 on return indicates failure.nn"
- "ttSee unzip.h for details.n"
- },
- { 0 }
- };
- static int function_help OF((__GPRO__ APIDocStruct *doc, char *fname));
- static int function_help(__G__ doc, fname)
- __GDEF
- APIDocStruct *doc;
- char *fname;
- {
- strcpy(slide, fname);
- /* strupr(slide); non-standard */
- while (doc->compare && STRNICMP(doc->compare,slide,strlen(fname)))
- doc++;
- if (!doc->compare)
- return 0;
- else
- Info(slide, 0, ((char *)slide,
- " Function:t%snn Syntax:t%snn Purpose:t%s",
- doc->function, doc->syntax, doc->purpose));
- return 1;
- }
- void APIhelp(__G__ argc, argv)
- __GDEF
- int argc;
- char **argv;
- {
- if (argc > 1) {
- struct APIDocStruct *doc;
- if (function_help(__G__ APIDoc, argv[1]))
- return;
- #ifdef SYSTEM_API_DETAILS
- if (function_help(__G__ SYSTEM_API_DETAILS, argv[1]))
- return;
- #endif
- Info(slide, 0, ((char *)slide,
- "%s is not a documented command.nn", argv[1]));
- }
- Info(slide, 0, ((char *)slide, "
- This API provides a number of external C and REXX functions for handlingn
- zipfiles in OS/2. Programmers are encouraged to expand this API.n
- n
- C functions: -- See unzip.h for detailsn
- UzpVer *UzpVersion(void);n
- int UzpMain(int argc, char *argv[]);n
- int UzpAltMain(int argc, char *argv[], UzpInit *init);n
- int UzpUnzipToMemory(char *zip, char *file, UzpBuffer *retstr);n
- int UzpFileTree(char *name, cbList(callBack),n
- char *cpInclude[], char *cpExclude[]);nn"));
- #ifdef SYSTEM_API_BRIEF
- Info(slide, 0, ((char *)slide, SYSTEM_API_BRIEF));
- #endif
- Info(slide, 0, ((char *)slide,
- "nFor more information, type 'unzip -A <function-name>'n"));
- }
- #endif /* API_DOC */