]> git.donarmstrong.com Git - samtools.git/blobdiff - knetfile.h
* samtools-0.1.5-7 (r403)
[samtools.git] / knetfile.h
index 85f348c5886910df7b61633080c64064d549800b..2c55c802a508d2e81266320053af249861bab8d6 100644 (file)
 typedef struct knetFile_s {
        int type, fd;
        int64_t offset;
-       char *host;
+       char *host, *port;
 
        // the following are for FTP only
        int ctrl_fd, pasv_ip[4], pasv_port, max_response, no_reconnect, is_ready;
        char *response, *retr;
        int64_t seek_offset; // for lazy seek
+
+       // the following are for HTTP only
+       char *path, *http_host;
 } knetFile;
 
 #define knet_tell(fp) ((fp)->offset)
@@ -29,8 +32,22 @@ extern "C" {
 #endif
 
        knetFile *knet_open(const char *fn, const char *mode);
+
+       /* 
+          This only works with local files.
+        */
        knetFile *knet_dopen(int fd, const char *mode);
+
+       /*
+         If ->is_ready==0, this routine updates ->fd; otherwise, it simply
+         reads from ->fd.
+        */
        off_t knet_read(knetFile *fp, void *buf, off_t len);
+
+       /*
+         This routine only sets ->offset and ->is_ready=0. It does not
+         communicate with the FTP server.
+        */
        int knet_seek(knetFile *fp, off_t off, int whence);
        int knet_close(knetFile *fp);