gmyth/src/gmyth_query.h
author rosfran
Wed May 23 19:50:41 2007 +0100 (2007-05-23)
branchtrunk
changeset 701 2f28edb4d804
parent 698 9019388af980
child 750 312d6bc514f3
permissions -rw-r--r--
[svn r707] Fixed the wrong commentary indentation.
     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  * This program is free software; you can redistribute it and/or modify
    14  * it under the terms of the GNU Lesser General Public License as published by
    15  * the Free Software Foundation; either version 2 of the License, or
    16  * (at your option) any later version.
    17  *
    18  * This program is distributed in the hope that it will be useful,
    19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21  * GNU General Public License for more details.
    22  *
    23  * You should have received a copy of the GNU Lesser General Public License
    24  * along with this program; if not, write to the Free Software
    25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    26  */
    27 
    28 #ifndef __GMYTH_QUERY_H__
    29 #define __GMYTH_QUERY_H__
    30 
    31 #include <glib-object.h>
    32 
    33 /* MYSQL includes */
    34 #include <mysql/mysql.h>
    35 
    36 #include "gmyth_backendinfo.h"
    37 
    38 G_BEGIN_DECLS
    39 #define GMYTH_QUERY_TYPE               (gmyth_query_get_type ())
    40 #define GMYTH_QUERY(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_QUERY_TYPE, GMythQuery))
    41 #define GMYTH_QUERY_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE, GMythQueryClass))
    42 #define IS_GMYTH_QUERY(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_QUERY_TYPE))
    43 #define IS_GMYTH_QUERY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE))
    44 #define GMYTH_QUERY_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_QUERY_TYPE, GMythQueryClass))
    45 typedef struct _GMythQuery GMythQuery;
    46 typedef struct _GMythQueryClass GMythQueryClass;
    47 
    48 struct _GMythQueryClass
    49     {
    50         GObjectClass parent_class;
    51 
    52         /* callbacks */
    53         /* no one for now */
    54     };
    55 
    56 struct _GMythQuery
    57     {
    58         GObject parent;
    59 
    60         GMythBackendInfo *backend_info;
    61 
    62         /* pointer to connection handler */
    63         MYSQL *conn;
    64     };
    65 
    66 
    67 GType gmyth_query_get_type ( void );
    68 
    69 GMythQuery *gmyth_query_new ( void );
    70 MYSQL_RES *gmyth_query_process_statement ( GMythQuery * gmyth_query,
    71                                            gchar * stmt_str );
    72 MYSQL_RES *gmyth_query_process_statement_with_increment ( GMythQuery *
    73                                                           gmyth_query,
    74                                                           char *stmt_str,
    75                                                           gulong * id );
    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 #endif /* __GMYTH_QUERY_H__ */