Main Page | Class List | File List | Class Members | File Members

fetch.h

Go to the documentation of this file.
00001 /*
00002  *  $Id: fetch.h,v 1.6 2006/04/17 22:45:19 ghost666 Exp $
00003  *
00004  *  rssbgr - RSS backgroud reader
00005  *  Copyright (C) 2005, 2006 Piotr 'GhosT' Wydrych
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #ifndef _RSSBGR_CONFIG_H
00023 #define _RSSBGR_CONFIG_H
00024 #include "config.h"
00025 #endif /* ifndef _RSSBGR_CONFIG_H */
00026 
00027 #ifndef _RSSBGR_FETCH_H
00028 #define _RSSBGR_FETCH_H
00029 
00030 #include <stdio.h>
00031 #include <ctype.h>
00032 #define __USE_XOPEN
00033 #include <time.h>
00034 #include <sys/types.h>
00035 #include <unistd.h>
00036 #include <sys/socket.h>
00037 #include <netdb.h>
00038 #include <netinet/in.h>
00039 #include <pthread.h>
00040 #include <libxml/parser.h>
00041 #include <libxml/tree.h>
00042 
00043 #include "share.h"
00044 #include "execute.h"
00045 #include "lockfile.h"
00046 #include "md5.h"
00047 #include "readconfig.h"
00048 #include "replace_fields.h"
00049 /*#include "xml.h"*/
00050 
00051 #ifndef HAVE_STRLCPY
00052 #include "compat/strlcpy.h"
00053 #endif /* ifndef HAVE_STRLCPY */
00054 
00055 #define FETCH_BUFFER_SIZE 10240
00056 #define WRITE_BUFFER_SIZE 100
00057 
00058 enum HTTP_STATE {HTTP_STATE_OK = 200, HTTP_STATE_REDIRECT = 300, HTTP_STATE_ERROR = 400};
00059 
00060 int find_in_file(FILE *fd, char *string);
00061 
00062 void process_rss(xmlNode *root_node, int config_item_i);
00063 
00064 time_t string_to_time(char *data);
00065 
00066 enum HTTP_STATE process_header(char *data, int len, int config_item_i);
00067 
00068 void *fetch_thread(void *parameters);
00069 
00070 char *fetch(int *responsesize, const char *host, const uint16_t port, const char *request);
00071 
00072 #endif /* ifndef _RSSBGR_FETCH_H */

Generated on Fri May 26 08:40:18 2006 for RSSbgr by doxygen 1.3.6