branches/gmyth-0.1b/src/gmyth_http.h
branchtrunk
changeset 335 aedcbbf818b7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/branches/gmyth-0.1b/src/gmyth_http.h	Thu Feb 08 14:30:36 2007 +0000
     1.3 @@ -0,0 +1,110 @@
     1.4 +/**
     1.5 + * GMyth Library
     1.6 + *
     1.7 + * @file gmyth/gmyth_http.c
     1.8 + * 
     1.9 + * @brief <p> GMythHttp class provides a wrapper to access
    1.10 + * data from the database using http+xml
    1.11 + *
    1.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    1.13 + * @author Artur Duque de Souza <@indt.org.br>
    1.14 + *
    1.15 + *//*
    1.16 + * 
    1.17 + * This program is free software; you can redistribute it and/or modify
    1.18 + * it under the terms of the GNU Lesser General Public License as published by
    1.19 + * the Free Software Foundation; either version 2 of the License, or
    1.20 + * (at your option) any later version.
    1.21 + *
    1.22 + * This program is distributed in the hope that it will be useful,
    1.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.25 + * GNU General Public License for more details.
    1.26 + *
    1.27 + * You should have received a copy of the GNU Lesser General Public License
    1.28 + * along with this program; if not, write to the Free Software
    1.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.30 + */
    1.31 +
    1.32 +#ifndef __GMYTH_HTTP_H__
    1.33 +#define __GMYTH_HTTP_H__
    1.34 +
    1.35 +#include <glib-object.h>
    1.36 +
    1.37 +#include <stdio.h>
    1.38 +#include <stdlib.h>
    1.39 +#include <string.h>
    1.40 +#include <stdarg.h>
    1.41 +#include <glib.h>
    1.42 +#include <glib/gprintf.h>
    1.43 +
    1.44 +#include "gmyth_backendinfo.h"
    1.45 +#include "gmyth_util.h"
    1.46 +
    1.47 +#include <curl/curl.h>
    1.48 +#include <curl/types.h>
    1.49 +#include <curl/easy.h>
    1.50 +
    1.51 +G_BEGIN_DECLS
    1.52 +
    1.53 +#define MYTH_PORT_STATUS 6544
    1.54 +
    1.55 +typedef struct _GMythPacket     GMythPacket;
    1.56 +typedef struct _GMythProgram    GMythProgram;
    1.57 +typedef struct _GMythChannel	GMythChannel;
    1.58 +typedef struct _GMythEpg		GMythEpg;
    1.59 +typedef struct _MemoryStruct MemoryStruct;
    1.60 +
    1.61 +struct _MemoryStruct
    1.62 +{
    1.63 +  char *memory;
    1.64 +  size_t size;
    1.65 +};
    1.66 +
    1.67 +struct _GMythPacket
    1.68 +{
    1.69 +    GString *response;
    1.70 +    int    type;
    1.71 +};
    1.72 +
    1.73 +struct _GMythProgram
    1.74 +{
    1.75 +    GString* title;
    1.76 +	GString* subtitle;
    1.77 +	GString* catType;
    1.78 +    GString* category;
    1.79 +	gint	repeat;
    1.80 +	GTimeVal* startTime;
    1.81 +	GTimeVal* endTime;
    1.82 +};
    1.83 +
    1.84 +struct _GMythChannel
    1.85 +{
    1.86 +	GString* channelName;
    1.87 +	GString* chanNum;
    1.88 +	gint	chanId;
    1.89 +	gint	callSign;
    1.90 +	GSList*	programList;
    1.91 +};
    1.92 +
    1.93 +struct _GMythEpg
    1.94 +{
    1.95 +	gint startChanId;
    1.96 +	gint endChanId;
    1.97 +	GString* version;
    1.98 +	gint protoVer;
    1.99 +	gint totalCount;
   1.100 +	gint numOfChannels;
   1.101 +	GTimeVal* asOf;
   1.102 +	GTimeVal* startTime;
   1.103 +	GTimeVal* endTime;
   1.104 +	gint details;
   1.105 +	GSList* channelList;
   1.106 +};
   1.107 +
   1.108 +GMythEpg retrieve_epg(GMythBackendInfo *backend_info, int port, GTimeVal* StartTime, GTimeVal* EndTime, gint StartChanId, gint NumOfChannels, gchar* Details);
   1.109 +MemoryStruct gmyth_http_request (GMythBackendInfo *backend_info, GString *command);
   1.110 +
   1.111 +G_END_DECLS
   1.112 +
   1.113 +#endif /* __GMYTH_HTTP_H__ */