gmyth/src/gmyth_query.h
author rosfran
Fri Apr 13 20:07:32 2007 +0100 (2007-04-13)
branchtrunk
changeset 545 7f0a3066f6ab
parent 526 c65fa0ad8e5a
child 567 0200f97ac289
permissions -rw-r--r--
[svn r550] A lot of GObject fixes (using the GType casting), added inheritance to the GMythFile* modules, locks all the the STOP_RECORDING messages.
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_query.h
     5  * 
     6  * @brief <p> GMythQuery class provides a wrapper for accessing
     7  * the libmysqlclient funtions.
     8  *
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Leonardo Sobral Cunha <leonardo.cunha@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_QUERY_H__
    30 #define __GMYTH_QUERY_H__
    31 
    32 #include <glib-object.h>
    33 
    34 /* MYSQL includes */
    35 #include <mysql/mysql.h>
    36 
    37 #include "gmyth_backendinfo.h"
    38 
    39 G_BEGIN_DECLS
    40 
    41 #define GMYTH_QUERY_TYPE               (gmyth_query_get_type ())
    42 #define GMYTH_QUERY(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_QUERY_TYPE, GMythQuery))
    43 #define GMYTH_QUERY_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE, GMythQueryClass))
    44 #define IS_GMYTH_QUERY(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_QUERY_TYPE))
    45 #define IS_GMYTH_QUERY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE))
    46 #define GMYTH_QUERY_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_QUERY_TYPE, GMythQueryClass))
    47 
    48 
    49 typedef struct _GMythQuery         GMythQuery;
    50 typedef struct _GMythQueryClass    GMythQueryClass;
    51 
    52 struct _GMythQueryClass
    53 {
    54     GObjectClass parent_class;
    55 
    56     /* callbacks */
    57     /* no one for now */
    58 };
    59 
    60 struct _GMythQuery
    61 {
    62     GObject parent;
    63   
    64     GMythBackendInfo *backend_info;
    65 
    66     /* pointer to connection handler */
    67     MYSQL *conn;  
    68 };
    69 
    70 
    71 GType       gmyth_query_get_type (void);
    72 
    73 GMythQuery* gmyth_query_new (void);
    74 MYSQL_RES * gmyth_query_process_statement (GMythQuery *gmyth_query,
    75                                            gchar *stmt_str);
    76 
    77 gboolean    gmyth_query_connect (GMythQuery *gmyth_query,
    78                                  GMythBackendInfo *backend_info);
    79 gboolean    gmyth_query_connect_with_timeout (GMythQuery *gmyth_query,
    80                                  GMythBackendInfo *backend_info,
    81                                  guint timeout);
    82 gboolean    gmyth_query_disconnect (GMythQuery *gmyth_query);
    83 
    84 G_END_DECLS
    85 
    86 #endif /* __GMYTH_QUERY_H__ */