leo_sobral@1
|
1 |
/**
|
leo_sobral@1
|
2 |
* GMyth Library
|
leo_sobral@1
|
3 |
*
|
leo_sobral@1
|
4 |
* @file gmyth/gmyth_query.h
|
leo_sobral@1
|
5 |
*
|
leo_sobral@1
|
6 |
* @brief <p> GMythQuery class provides a wrapper for accessing
|
leo_sobral@1
|
7 |
* the libmysqlclient funtions.
|
leo_sobral@1
|
8 |
*
|
leo_sobral@1
|
9 |
* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
|
leo_sobral@1
|
10 |
* @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
|
leo_sobral@1
|
11 |
*
|
leo_sobral@1
|
12 |
*//*
|
leo_sobral@1
|
13 |
*
|
leo_sobral@1
|
14 |
* This program is free software; you can redistribute it and/or modify
|
leo_sobral@1
|
15 |
* it under the terms of the GNU Lesser General Public License as published by
|
leo_sobral@1
|
16 |
* the Free Software Foundation; either version 2 of the License, or
|
leo_sobral@1
|
17 |
* (at your option) any later version.
|
leo_sobral@1
|
18 |
*
|
leo_sobral@1
|
19 |
* This program is distributed in the hope that it will be useful,
|
leo_sobral@1
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
leo_sobral@1
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
leo_sobral@1
|
22 |
* GNU General Public License for more details.
|
leo_sobral@1
|
23 |
*
|
leo_sobral@1
|
24 |
* You should have received a copy of the GNU Lesser General Public License
|
leo_sobral@1
|
25 |
* along with this program; if not, write to the Free Software
|
leo_sobral@1
|
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
leo_sobral@1
|
27 |
*/
|
leo_sobral@1
|
28 |
|
leo_sobral@1
|
29 |
#ifndef __GMYTH_QUERY_H__
|
leo_sobral@1
|
30 |
#define __GMYTH_QUERY_H__
|
leo_sobral@1
|
31 |
|
leo_sobral@1
|
32 |
#include <glib-object.h>
|
leo_sobral@1
|
33 |
|
leo_sobral@1
|
34 |
/* MYSQL includes */
|
rosfran@240
|
35 |
#include <mysql/mysql.h>
|
leo_sobral@1
|
36 |
|
melunko@117
|
37 |
#include "gmyth_backendinfo.h"
|
melunko@117
|
38 |
|
leo_sobral@6
|
39 |
G_BEGIN_DECLS
|
leo_sobral@1
|
40 |
|
leo_sobral@1
|
41 |
#define GMYTH_QUERY_TYPE (gmyth_query_get_type ())
|
leo_sobral@1
|
42 |
#define GMYTH_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_QUERY_TYPE, GMythQuery))
|
leo_sobral@1
|
43 |
#define GMYTH_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE, GMythQueryClass))
|
leo_sobral@1
|
44 |
#define IS_GMYTH_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_QUERY_TYPE))
|
leo_sobral@1
|
45 |
#define IS_GMYTH_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE))
|
leo_sobral@1
|
46 |
#define GMYTH_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_QUERY_TYPE, GMythQueryClass))
|
leo_sobral@1
|
47 |
|
leo_sobral@1
|
48 |
|
leo_sobral@1
|
49 |
typedef struct _GMythQuery GMythQuery;
|
leo_sobral@1
|
50 |
typedef struct _GMythQueryClass GMythQueryClass;
|
leo_sobral@1
|
51 |
|
leo_sobral@1
|
52 |
struct _GMythQueryClass
|
leo_sobral@1
|
53 |
{
|
leo_sobral@402
|
54 |
GObjectClass parent_class;
|
leo_sobral@1
|
55 |
|
leo_sobral@402
|
56 |
/* callbacks */
|
leo_sobral@402
|
57 |
/* no one for now */
|
leo_sobral@1
|
58 |
};
|
leo_sobral@1
|
59 |
|
leo_sobral@1
|
60 |
struct _GMythQuery
|
leo_sobral@1
|
61 |
{
|
leo_sobral@1
|
62 |
GObject parent;
|
leo_sobral@1
|
63 |
|
melunko@117
|
64 |
GMythBackendInfo *backend_info;
|
melunko@117
|
65 |
|
leo_sobral@402
|
66 |
/* pointer to connection handler */
|
leo_sobral@402
|
67 |
MYSQL *conn;
|
leo_sobral@1
|
68 |
};
|
leo_sobral@1
|
69 |
|
leo_sobral@1
|
70 |
|
leo_sobral@402
|
71 |
GType gmyth_query_get_type (void);
|
leo_sobral@1
|
72 |
|
leo_sobral@402
|
73 |
GMythQuery* gmyth_query_new (void);
|
leo_sobral@402
|
74 |
MYSQL_RES * gmyth_query_process_statement (GMythQuery *gmyth_query,
|
leo_sobral@402
|
75 |
gchar *stmt_str);
|
leo_sobral@1
|
76 |
|
leo_sobral@402
|
77 |
gboolean gmyth_query_connect (GMythQuery *gmyth_query,
|
leo_sobral@402
|
78 |
GMythBackendInfo *backend_info);
|
leo_sobral@402
|
79 |
gboolean gmyth_query_connect_with_timeout (GMythQuery *gmyth_query,
|
melunko@526
|
80 |
GMythBackendInfo *backend_info,
|
melunko@526
|
81 |
guint timeout);
|
leo_sobral@402
|
82 |
gboolean gmyth_query_disconnect (GMythQuery *gmyth_query);
|
leo_sobral@1
|
83 |
|
leo_sobral@6
|
84 |
G_END_DECLS
|
leo_sobral@1
|
85 |
|
leo_sobral@1
|
86 |
#endif /* __GMYTH_QUERY_H__ */
|