]> git.donarmstrong.com Git - samtools.git/blob - knetfile.h
this is the header file
[samtools.git] / knetfile.h
1 #ifndef KNETFILE_H
2 #define KNETFILE_H
3
4 #include <stdint.h>
5 #include <fcntl.h>
6
7 // FIXME: currently I/O is unbuffered
8
9 #define KNF_TYPE_LOCAL 1
10 #define KNF_TYPE_FTP   2
11 #define KNF_TYPE_HTTP  3
12
13 typedef struct knetFile_s {
14         int type, fd;
15         int64_t offset;
16         char *host;
17
18         // the following are for FTP only
19         int ctrl_fd, pasv_ip[4], pasv_port, max_response, no_reconnect;
20         char *response, *retr;
21 } knetFile;
22
23 #define knet_tell(fp) ((fp)->offset)
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29         knetFile *knet_open(const char *fn, const char *mode);
30         off_t knet_read(knetFile *fp, void *buf, off_t len);
31         off_t knet_seek(knetFile *fp, off_t off, int whence);
32         int knet_close(knetFile *fp);
33
34 #ifdef __cplusplus
35 }
36 #endif
37
38 #endif