branches/gmyth-0.1b/src/gmyth_http.h
author rosfran
Thu Feb 08 14:30:36 2007 +0000 (2007-02-08)
branchtrunk
changeset 335 aedcbbf818b7
permissions -rw-r--r--
[svn r337] Changed the g_object_unref's in the do_get_file_info.
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_http.c
     5  * 
     6  * @brief <p> GMythHttp class provides a wrapper to access
     7  * data from the database using http+xml
     8  *
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Artur Duque de Souza <@indt.org.br>
    11  *
    12  *//*
    13  * 
    14  * This program is free software; you can redistribute it and/or modify
    15  * it under the terms of the GNU Lesser General Public License as published by
    16  * the Free Software Foundation; either version 2 of the License, or
    17  * (at your option) any later version.
    18  *
    19  * This program is distributed in the hope that it will be useful,
    20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22  * GNU General Public License for more details.
    23  *
    24  * You should have received a copy of the GNU Lesser General Public License
    25  * along with this program; if not, write to the Free Software
    26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    27  */
    28 
    29 #ifndef __GMYTH_HTTP_H__
    30 #define __GMYTH_HTTP_H__
    31 
    32 #include <glib-object.h>
    33 
    34 #include <stdio.h>
    35 #include <stdlib.h>
    36 #include <string.h>
    37 #include <stdarg.h>
    38 #include <glib.h>
    39 #include <glib/gprintf.h>
    40 
    41 #include "gmyth_backendinfo.h"
    42 #include "gmyth_util.h"
    43 
    44 #include <curl/curl.h>
    45 #include <curl/types.h>
    46 #include <curl/easy.h>
    47 
    48 G_BEGIN_DECLS
    49 
    50 #define MYTH_PORT_STATUS 6544
    51 
    52 typedef struct _GMythPacket     GMythPacket;
    53 typedef struct _GMythProgram    GMythProgram;
    54 typedef struct _GMythChannel	GMythChannel;
    55 typedef struct _GMythEpg		GMythEpg;
    56 typedef struct _MemoryStruct MemoryStruct;
    57 
    58 struct _MemoryStruct
    59 {
    60   char *memory;
    61   size_t size;
    62 };
    63 
    64 struct _GMythPacket
    65 {
    66     GString *response;
    67     int    type;
    68 };
    69 
    70 struct _GMythProgram
    71 {
    72     GString* title;
    73 	GString* subtitle;
    74 	GString* catType;
    75     GString* category;
    76 	gint	repeat;
    77 	GTimeVal* startTime;
    78 	GTimeVal* endTime;
    79 };
    80 
    81 struct _GMythChannel
    82 {
    83 	GString* channelName;
    84 	GString* chanNum;
    85 	gint	chanId;
    86 	gint	callSign;
    87 	GSList*	programList;
    88 };
    89 
    90 struct _GMythEpg
    91 {
    92 	gint startChanId;
    93 	gint endChanId;
    94 	GString* version;
    95 	gint protoVer;
    96 	gint totalCount;
    97 	gint numOfChannels;
    98 	GTimeVal* asOf;
    99 	GTimeVal* startTime;
   100 	GTimeVal* endTime;
   101 	gint details;
   102 	GSList* channelList;
   103 };
   104 
   105 GMythEpg retrieve_epg(GMythBackendInfo *backend_info, int port, GTimeVal* StartTime, GTimeVal* EndTime, gint StartChanId, gint NumOfChannels, gchar* Details);
   106 MemoryStruct gmyth_http_request (GMythBackendInfo *backend_info, GString *command);
   107 
   108 G_END_DECLS
   109 
   110 #endif /* __GMYTH_HTTP_H__ */