Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

libhttp.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * $Id: libhttp.h,v 1.11 2004/04/09 16:46:55 alessiofender Exp $
00003  * This file is part of liberopops (http://liberopops.sf.net)                 *
00004  * This file is distributed under the terms of GNU GPL license.               *
00005  ******************************************************************************/
00006 
00007 
00008 /******************************************************************************/
00014 /******************************************************************************/
00015 
00016 
00017 #ifndef LIBHTTP_H
00018 #define LIBHTTP_H
00019 
00020 #include <pthread.h>
00021 #ifndef BEOS
00022         #include <semaphore.h>
00023 #endif
00024 
00025 #include "beos_compatibility.h"
00026 #include "osx_compatibility.h"
00027 
00031 struct prod_cons_t {
00033         sem_t rd;
00035         sem_t wr;
00036                 
00038         pthread_t pth;
00040         pthread_attr_t att;
00042         char *buffer;
00044         int stop;
00045         
00047         struct http_batton_t {
00049                 char *host;
00051                 char *file;
00053                 char *useragent;
00055                 struct cookielist_t **clp;
00056         } bt;
00057 };
00058 
00059 
00061 extern struct prod_cons_t *new_prodcons();
00062 
00064 extern void delete_prodcons(struct prod_cons_t *p);
00065 
00066 
00070 typedef struct {
00071         unsigned long first;
00072         unsigned long last;
00073 } range_t;
00074 
00078 struct cookielist_t {
00080         char *cookie;
00082         struct cookielist_t *next;
00083 };
00084 
00090 extern void set_useragent(const char *ua);
00091 
00097 extern void set_proxyaddr(const char *addr);
00098 
00105 extern void set_proxyauth(const char *pa);
00106 
00124 extern char *buildreqheader(const char *host, const char *useragent, 
00125         const char *referrer, const char *proxyauth,
00126         struct cookielist_t *cl, range_t range, char **reqheaderp);
00127 
00149 extern char *httpget(const char *server, const char *file,
00150         const char *reqheader, struct prod_cons_t *pc,
00151         char **headerp, char **bodyp);
00152 
00160 extern struct cookielist_t *addcookies(const char *header, 
00161         struct cookielist_t *cl);
00162 
00185 extern char *getpage(const char *host, const char *fileformat, 
00186         char **refp, int updateref, struct cookielist_t **clp, ...);
00187 
00193 extern char *getpage_hidepassw(const char *host, const char *fileformat, 
00194         char **refp, int updateref, struct cookielist_t **clp, ...);
00195 
00202 extern char *getpage_range(const char *host, const char *fileformat, 
00203         range_t range, char **refp, int updateref, struct cookielist_t **clp, ...);
00204 
00206 int httpget_thread(const char *file, const char *reqheader, 
00207         char **headerp, struct prod_cons_t* p);
00209 void* getpage_thread(void* x);
00210 
00211 #endif /* ndef LIBHTTP_H */

Generated on Wed May 5 15:48:03 2004 for LiberoPOPs by doxygen 1.3.6-20040222