Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/klib/blob/master/kurl.h # klib [Ported from github.com/attractivechaos/klib] added block arena Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `klib / kurl.h` 57 lines ยท 1303 bytes Raw Blame History 1 #ifndef KURL_H 2 #define KURL_H 3 4 #include 5 6 #define KURL_NULL 1 7 #define KURL_INV_WHENCE 2 8 #define KURL_SEEK_OUT 3 9 #define KURL_NO_AUTH 4 10 11 struct kurl_t; 12 typedef struct kurl_t kurl_t; 13 14 typedef struct { 15 const char *s3keyid; 16 const char *s3secretkey; 17 const char *s3key_fn; 18 } kurl_opt_t; 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 int kurl_init(void); 25 void kurl_destroy(void); 26 27 kurl_t *kurl_open(const char *url, kurl_opt_t *opt); 28 kurl_t *kurl_dopen(int fd); 29 int kurl_close(kurl_t *ku); 30 ssize_t kurl_read(kurl_t *ku, void *buf, size_t nbytes); 31 off_t kurl_seek(kurl_t *ku, off_t offset, int whence); 32 int kurl_buflen(kurl_t *ku, int len); 33 34 off_t kurl_tell(const kurl_t *ku); 35 int kurl_eof(const kurl_t *ku); 36 int kurl_fileno(const kurl_t *ku); 37 int kurl_error(const kurl_t *ku); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #ifndef KNETFILE_H 44 #define KNETFILE_H 45 typedef kurl_t knetFile; 46 #define knet_open(fn, mode) kurl_open(fn, 0) 47 #define knet_dopen(fd, mode) kurl_dopen(fd) 48 #define knet_close(fp) kurl_close(fp) 49 #define knet_read(fp, buf, len) kurl_read(fp, buf, len) 50 #define knet_seek(fp, off, whence) kurl_seek(fp, off, whence) 51 #define knet_tell(fp) kurl_tell(fp) 52 #define knet_fileno(fp) kurl_fileno(fp) 53 #define knet_win32_init() kurl_init() 54 #define knet_win32_destroy() kurl_destroy() 55 #endif 56 57 #endif