]> git.donarmstrong.com Git - samtools.git/commitdiff
this is the header file
authorHeng Li <lh3@live.co.uk>
Thu, 25 Jun 2009 12:53:19 +0000 (12:53 +0000)
committerHeng Li <lh3@live.co.uk>
Thu, 25 Jun 2009 12:53:19 +0000 (12:53 +0000)
knetfile.h [new file with mode: 0644]

diff --git a/knetfile.h b/knetfile.h
new file mode 100644 (file)
index 0000000..cadc447
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef KNETFILE_H
+#define KNETFILE_H
+
+#include <stdint.h>
+#include <fcntl.h>
+
+// FIXME: currently I/O is unbuffered
+
+#define KNF_TYPE_LOCAL 1
+#define KNF_TYPE_FTP   2
+#define KNF_TYPE_HTTP  3
+
+typedef struct knetFile_s {
+       int type, fd;
+       int64_t offset;
+       char *host;
+
+       // the following are for FTP only
+       int ctrl_fd, pasv_ip[4], pasv_port, max_response, no_reconnect;
+       char *response, *retr;
+} knetFile;
+
+#define knet_tell(fp) ((fp)->offset)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+       knetFile *knet_open(const char *fn, const char *mode);
+       off_t knet_read(knetFile *fp, void *buf, off_t len);
+       off_t knet_seek(knetFile *fp, off_t off, int whence);
+       int knet_close(knetFile *fp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif