Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 1 | /* |
| 2 | * nanohttp.c: minimalist FTP implementation to fetch external subsets. |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * Daniel.Veillard@w3.org |
| 7 | */ |
| 8 | |
| 9 | #ifndef __NANO_FTP_H__ |
| 10 | #define __NANO_FTP_H__ |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
Daniel Veillard | aeea04f | 2000-01-25 19:27:27 +0000 | [diff] [blame^] | 15 | /** |
| 16 | * ftpListCallback: |
| 17 | * A callback for the xmlNanoFTPList command |
| 18 | */ |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 19 | typedef void (*ftpListCallback) (void *userData, |
| 20 | const char *filename, const char* attrib, |
| 21 | const char *owner, const char *group, |
| 22 | unsigned long size, int links, int year, |
| 23 | const char *month, int day, int minute); |
Daniel Veillard | aeea04f | 2000-01-25 19:27:27 +0000 | [diff] [blame^] | 24 | /** |
| 25 | * ftpDataCallback: |
| 26 | * A callback for the xmlNanoFTPGet command |
| 27 | */ |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 28 | typedef void (*ftpDataCallback) (void *userData, const char *data, int len); |
| 29 | |
Daniel Veillard | aeea04f | 2000-01-25 19:27:27 +0000 | [diff] [blame^] | 30 | /* |
| 31 | * Init |
| 32 | */ |
| 33 | void xmlNanoFTPInit (void); |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 34 | |
Daniel Veillard | aeea04f | 2000-01-25 19:27:27 +0000 | [diff] [blame^] | 35 | /* |
| 36 | * Creating/freeing contexts |
| 37 | */ |
| 38 | void * xmlNanoFTPNewCtxt (const char *URL); |
| 39 | void xmlNanoFTPFreeCtxt (void * ctx); |
| 40 | void * xmlNanoFTPConnectTo (const char *server, |
| 41 | int port); |
| 42 | /* |
| 43 | * Opening/closing session connections |
| 44 | */ |
| 45 | void * xmlNanoFTPOpen (const char *URL); |
| 46 | int xmlNanoFTPConnect (void *ctx); |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 47 | int xmlNanoFTPClose (void *ctx); |
Daniel Veillard | aeea04f | 2000-01-25 19:27:27 +0000 | [diff] [blame^] | 48 | int xmlNanoFTPQuit (void *ctx); |
| 49 | |
| 50 | |
| 51 | /* |
| 52 | * Rathern internal commands |
| 53 | */ |
| 54 | int xmlNanoFTPGetResponse (void *ctx); |
| 55 | int xmlNanoFTPCheckResponse (void *ctx); |
| 56 | |
| 57 | /* |
| 58 | * CD/DIR/GET handlers |
| 59 | */ |
| 60 | int xmlNanoFTPCwd (void *ctx, |
| 61 | char *directory); |
| 62 | |
| 63 | int xmlNanoFTPGetConnection (void *ctx); |
| 64 | int xmlNanoFTPCloseConnection(void *ctx); |
| 65 | int xmlNanoFTPList (void *ctx, |
| 66 | ftpListCallback callback, |
| 67 | void *userData, |
| 68 | char *filename); |
| 69 | int xmlNanoFTPGetSocket (void *ctx, |
| 70 | const char *filename); |
| 71 | int xmlNanoFTPGet (void *ctx, |
| 72 | ftpDataCallback callback, |
| 73 | void *userData, |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 74 | const char *filename); |
| 75 | int xmlNanoFTPRead (void *ctx, |
| 76 | void *dest, |
| 77 | int len); |
Daniel Veillard | aeea04f | 2000-01-25 19:27:27 +0000 | [diff] [blame^] | 78 | |
Daniel Veillard | da07c34 | 2000-01-25 18:31:22 +0000 | [diff] [blame] | 79 | #ifdef __cplusplus |
| 80 | } |
| 81 | #endif |
| 82 | #endif /* __NANO_FTP_H__ */ |