summaryrefslogtreecommitdiffstats
path: root/lib/libftpio/ftpio.h
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-06-17 12:26:06 +0000
committerjkh <jkh@FreeBSD.org>1996-06-17 12:26:06 +0000
commit880dd9d3c6fae1c0252b9a7ad8b0a3acd985acb6 (patch)
tree8f5d310b7f8f5268b7d1524b01546840e5a9b6f1 /lib/libftpio/ftpio.h
parentd296466eaa9e2d412ac79232f8f0308f0488b67d (diff)
downloadFreeBSD-src-880dd9d3c6fae1c0252b9a7ad8b0a3acd985acb6.zip
FreeBSD-src-880dd9d3c6fae1c0252b9a7ad8b0a3acd985acb6.tar.gz
Bring in a new library `libftpio', so named to avoid clashes with older
packages and also sort of give the (correct) impression that this basically sits on top of stdio and deals with stream pointers (FILE*).
Diffstat (limited to 'lib/libftpio/ftpio.h')
-rw-r--r--lib/libftpio/ftpio.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/libftpio/ftpio.h b/lib/libftpio/ftpio.h
new file mode 100644
index 0000000..fc24ad7
--- /dev/null
+++ b/lib/libftpio/ftpio.h
@@ -0,0 +1,53 @@
+#ifndef _FTP_H_INCLUDE
+#define _FTP_H_INCLUDE
+
+#include <sys/types.h>
+#include <time.h>
+
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ *
+ * Major Changelog:
+ *
+ * Jordan K. Hubbard
+ * 17 Jan 1996
+ *
+ * Turned inside out. Now returns xfers as new file ids, not as a special
+ * `state' of FTP_t
+ *
+ * $Id$
+ */
+
+/* Internal housekeeping data structure for FTP sessions */
+typedef struct {
+ enum { init, isopen } con_state;
+ int fd_ctrl;
+ int binary;
+ int passive;
+ int addrtype;
+ char *host;
+ char *file;
+ int errno;
+ int seek;
+} *FTP_t;
+
+/* Exported routines - deal only with FILE* type */
+extern FILE *ftpLogin(char *host, char *user, char *passwd, int port);
+extern int ftpChdir(FILE *fp, char *dir);
+extern int ftpErrno(FILE *fp);
+extern size_t ftpGetSize(FILE *fp, char *file);
+extern FILE *ftpGet(FILE *fp, char *file);
+extern FILE *ftpPut(FILE *fp, char *file);
+extern int ftpBinary(FILE *fp, int status);
+extern int ftpPassive(FILE *fp, int status);
+extern int ftpRestart(FILE *fp, int where);
+extern FILE *ftpGetURL(char *url, char *user, char *passwd);
+extern FILE *ftpPutURL(char *url, char *user, char *passwd);
+extern time_t ftpModtime(FILE *fp, char *s);
+
+#endif /* _FTP_H_INCLUDE */
OpenPOWER on IntegriCloud