author | llornkcor <llornkcor> | 2002-11-09 15:27:29 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-09 15:27:29 (UTC) |
commit | fee37fd9a7c038dbf5cce74172721ca3cdc8745b (patch) (unidiff) | |
tree | dc9ed0da618d4ef6e96777e992cfc88fa619656c /noncore/net/ftplib/ftplib.h | |
parent | d5d079c5bfaa10c310628d1ef7905d98b64dfa81 (diff) | |
download | opie-fee37fd9a7c038dbf5cce74172721ca3cdc8745b.zip opie-fee37fd9a7c038dbf5cce74172721ca3cdc8745b.tar.gz opie-fee37fd9a7c038dbf5cce74172721ca3cdc8745b.tar.bz2 |
move ftp stuff from opieftp to shared lib
-rw-r--r-- | noncore/net/ftplib/ftplib.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/noncore/net/ftplib/ftplib.h b/noncore/net/ftplib/ftplib.h new file mode 100644 index 0000000..75a90ae --- a/dev/null +++ b/noncore/net/ftplib/ftplib.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /***************************************************************************/ | ||
2 | /* ftplib.h - header file for callable ftp access routines */ | ||
3 | /* Copyright (C) 1996, 1997 Thomas Pfau, pfau@cnj.digex.net */ | ||
4 | /* 73 Catherine Street, South Bound Brook, NJ, 08880 */ | ||
5 | /* */ | ||
6 | /* This library is free software; you can redistribute it and/or */ | ||
7 | /* modify it under the terms of the GNU Library General Public */ | ||
8 | /* License as published by the Free Software Foundation; either */ | ||
9 | /* version 2 of the License, or (at your option) any later version. */ | ||
10 | /* */ | ||
11 | /* This library is distributed in the hope that it will be useful, */ | ||
12 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ | ||
13 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ | ||
14 | /* Library General Public License for more details. */ | ||
15 | /* */ | ||
16 | /* You should have received a copy of the GNU Library General Public */ | ||
17 | /* License along with this progam; if not, write to the */ | ||
18 | /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ | ||
19 | /* Boston, MA 02111-1307, USA. */ | ||
20 | /* */ | ||
21 | /***************************************************************************/ | ||
22 | |||
23 | #if !defined(__FTPLIB_H) | ||
24 | #define __FTPLIB_H | ||
25 | |||
26 | #if defined(__unix__) || defined(VMS) | ||
27 | #define GLOBALDEF | ||
28 | #define GLOBALREF extern | ||
29 | #elif defined(_WIN32) | ||
30 | #if defined BUILDING_LIBRARY | ||
31 | #define GLOBALDEF __declspec(dllexport) | ||
32 | #define GLOBALREF __declspec(dllexport) | ||
33 | #else | ||
34 | #define GLOBALREF __declspec(dllimport) | ||
35 | #endif | ||
36 | #endif | ||
37 | |||
38 | /* FtpAccess() type codes */ | ||
39 | #define FTPLIB_DIR 1 | ||
40 | #define FTPLIB_DIR_VERBOSE 2 | ||
41 | #define FTPLIB_FILE_READ 3 | ||
42 | #define FTPLIB_FILE_WRITE 4 | ||
43 | |||
44 | /* FtpAccess() mode codes */ | ||
45 | #define FTPLIB_ASCII 'A' | ||
46 | #define FTPLIB_IMAGE 'I' | ||
47 | #define FTPLIB_TEXT FTPLIB_ASCII | ||
48 | #define FTPLIB_BINARY FTPLIB_IMAGE | ||
49 | |||
50 | /* connection modes */ | ||
51 | #define FTPLIB_PASSIVE 1 | ||
52 | #define FTPLIB_PORT 2 | ||
53 | |||
54 | /* connection option names */ | ||
55 | #define FTPLIB_CONNMODE 1 | ||
56 | #define FTPLIB_CALLBACK 2 | ||
57 | #define FTPLIB_IDLETIME 3 | ||
58 | #define FTPLIB_CALLBACKARG 4 | ||
59 | #define FTPLIB_CALLBACKBYTES 5 | ||
60 | |||
61 | #ifdef __cplusplus | ||
62 | extern "C" { | ||
63 | #endif | ||
64 | |||
65 | typedef struct NetBuf netbuf; | ||
66 | typedef int (*FtpCallback)(netbuf *nControl, int xfered, void *arg); | ||
67 | |||
68 | /* v1 compatibility stuff */ | ||
69 | #if !defined(_FTPLIB_NO_COMPAT) | ||
70 | netbuf *DefaultNetbuf; | ||
71 | |||
72 | #define ftplib_lastresp FtpLastResponse(DefaultNetbuf) | ||
73 | #define ftpInit FtpInit | ||
74 | #define ftpOpen(x) FtpConnect(x, &DefaultNetbuf) | ||
75 | #define ftpLogin(x,y) FtpLogin(x, y, DefaultNetbuf) | ||
76 | #define ftpSite(x) FtpSite(x, DefaultNetbuf) | ||
77 | #define ftpMkdir(x) FtpMkdir(x, DefaultNetbuf) | ||
78 | #define ftpChdir(x) FtpChdir(x, DefaultNetbuf) | ||
79 | #define ftpRmdir(x) FtpRmdir(x, DefaultNetbuf) | ||
80 | #define ftpNlst(x, y) FtpNlst(x, y, DefaultNetbuf) | ||
81 | #define ftpDir(x, y) FtpDir(x, y, DefaultNetbuf) | ||
82 | #define ftpGet(x, y, z) FtpGet(x, y, z, DefaultNetbuf) | ||
83 | #define ftpPut(x, y, z) FtpPut(x, y, z, DefaultNetbuf) | ||
84 | #define ftpRename(x, y) FtpRename(x, y, DefaultNetbuf) | ||
85 | #define ftpDelete(x) FtpDelete(x, DefaultNetbuf) | ||
86 | #define ftpQuit() FtpQuit(DefaultNetbuf) | ||
87 | #endif /* (_FTPLIB_NO_COMPAT) */ | ||
88 | /* end v1 compatibility stuff */ | ||
89 | |||
90 | GLOBALREF int ftplib_debug; | ||
91 | GLOBALREF void FtpInit(void); | ||
92 | GLOBALREF char *FtpLastResponse(netbuf *nControl); | ||
93 | GLOBALREF int FtpConnect(const char *host, netbuf **nControl); | ||
94 | GLOBALREF int FtpOptions(int opt, long val, netbuf *nControl); | ||
95 | GLOBALREF int FtpLogin(const char *user, const char *pass, netbuf *nControl); | ||
96 | GLOBALREF int FtpAccess(const char *path, int typ, int mode, netbuf *nControl, | ||
97 | netbuf **nData); | ||
98 | GLOBALREF int FtpRead(void *buf, int max, netbuf *nData); | ||
99 | GLOBALREF int FtpWrite(void *buf, int len, netbuf *nData); | ||
100 | GLOBALREF int FtpClose(netbuf *nData); | ||
101 | GLOBALREF int FtpSite(const char *cmd, netbuf *nControl); | ||
102 | GLOBALREF int FtpSysType(char *buf, int max, netbuf *nControl); | ||
103 | GLOBALREF int FtpMkdir(const char *path, netbuf *nControl); | ||
104 | GLOBALREF int FtpChdir(const char *path, netbuf *nControl); | ||
105 | GLOBALREF int FtpCDUp(netbuf *nControl); | ||
106 | GLOBALREF int FtpRmdir(const char *path, netbuf *nControl); | ||
107 | GLOBALREF int FtpPwd(char *path, int max, netbuf *nControl); | ||
108 | GLOBALREF int FtpNlst(const char *output, const char *path, netbuf *nControl); | ||
109 | GLOBALREF int FtpDir(const char *output, const char *path, netbuf *nControl); | ||
110 | GLOBALREF int FtpSize(const char *path, int *size, char mode, netbuf *nControl); | ||
111 | GLOBALREF int FtpModDate(const char *path, char *dt, int max, netbuf *nControl); | ||
112 | GLOBALREF int FtpGet(const char *output, const char *path, char mode, | ||
113 | netbuf *nControl); | ||
114 | GLOBALREF int FtpPut(const char *input, const char *path, char mode, | ||
115 | netbuf *nControl); | ||
116 | GLOBALREF int FtpRename(const char *src, const char *dst, netbuf *nControl); | ||
117 | GLOBALREF int FtpDelete(const char *fnm, netbuf *nControl); | ||
118 | GLOBALREF void FtpQuit(netbuf *nControl); | ||
119 | |||
120 | #ifdef __cplusplus | ||
121 | }; | ||
122 | #endif | ||
123 | |||
124 | #endif /* __FTPLIB_H */ | ||