gmyth/src/gmyth_http.h
author morphbr
Fri Jan 12 21:26:30 2007 +0000 (2007-01-12)
branchtrunk
changeset 268 91eb7e03b1b1
parent 266 1098f58ae8e1
child 300 01d60f80fa52
permissions -rw-r--r--
[svn r269] Changed structure from gmyth_http to use *libcurl*.
     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 
    39 #include "gmyth_backendinfo.h"
    40 
    41 #include <curl/curl.h>
    42 #include <curl/types.h>
    43 #include <curl/easy.h>
    44 
    45 G_BEGIN_DECLS
    46 
    47 #define MYTH_PORT_STATUS 6544
    48 #define BUFLEN 2048
    49 #define TYPE_TEXT_XML 0
    50 #define TYPE_FORM_URLENCODED 1
    51 
    52 typedef struct _GMythPacket     GMythPacket;       
    53 
    54 struct _GMythPacket
    55 {
    56     GString *response;
    57     int    type;
    58 };
    59 
    60 GString* gmyth_http_create_command(GString *command, ...);
    61 GString *gmyth_http_request (GMythBackendInfo *backend_info, GString *command);
    62 
    63 G_END_DECLS
    64 
    65 #endif /* __GMYTH_HTTP_H__ */