summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp/ftplib.h
Unidiff
Diffstat (limited to 'noncore/net/opieftp/ftplib.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/ftplib.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/noncore/net/opieftp/ftplib.h b/noncore/net/opieftp/ftplib.h
new file mode 100644
index 0000000..75a90ae
--- a/dev/null
+++ b/noncore/net/opieftp/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
62extern "C" {
63#endif
64
65typedef struct NetBuf netbuf;
66typedef int (*FtpCallback)(netbuf *nControl, int xfered, void *arg);
67
68/* v1 compatibility stuff */
69#if !defined(_FTPLIB_NO_COMPAT)
70netbuf *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
90GLOBALREF int ftplib_debug;
91GLOBALREF void FtpInit(void);
92GLOBALREF char *FtpLastResponse(netbuf *nControl);
93GLOBALREF int FtpConnect(const char *host, netbuf **nControl);
94GLOBALREF int FtpOptions(int opt, long val, netbuf *nControl);
95GLOBALREF int FtpLogin(const char *user, const char *pass, netbuf *nControl);
96GLOBALREF int FtpAccess(const char *path, int typ, int mode, netbuf *nControl,
97 netbuf **nData);
98GLOBALREF int FtpRead(void *buf, int max, netbuf *nData);
99GLOBALREF int FtpWrite(void *buf, int len, netbuf *nData);
100GLOBALREF int FtpClose(netbuf *nData);
101GLOBALREF int FtpSite(const char *cmd, netbuf *nControl);
102GLOBALREF int FtpSysType(char *buf, int max, netbuf *nControl);
103GLOBALREF int FtpMkdir(const char *path, netbuf *nControl);
104GLOBALREF int FtpChdir(const char *path, netbuf *nControl);
105GLOBALREF int FtpCDUp(netbuf *nControl);
106GLOBALREF int FtpRmdir(const char *path, netbuf *nControl);
107GLOBALREF int FtpPwd(char *path, int max, netbuf *nControl);
108GLOBALREF int FtpNlst(const char *output, const char *path, netbuf *nControl);
109GLOBALREF int FtpDir(const char *output, const char *path, netbuf *nControl);
110GLOBALREF int FtpSize(const char *path, int *size, char mode, netbuf *nControl);
111GLOBALREF int FtpModDate(const char *path, char *dt, int max, netbuf *nControl);
112GLOBALREF int FtpGet(const char *output, const char *path, char mode,
113 netbuf *nControl);
114GLOBALREF int FtpPut(const char *input, const char *path, char mode,
115 netbuf *nControl);
116GLOBALREF int FtpRename(const char *src, const char *dst, netbuf *nControl);
117GLOBALREF int FtpDelete(const char *fnm, netbuf *nControl);
118GLOBALREF void FtpQuit(netbuf *nControl);
119
120#ifdef __cplusplus
121};
122#endif
123
124#endif /* __FTPLIB_H */