1    | /***************************************
2    |   $Revision: 1.4 $
3    | 
4    |   SQL module (sq) - MySQL implementation of SQL driver.
5    | 
6    |   Status: NOT REVUED, NOT TESTED
7    | 
8    |   ******************/ /******************
9    |   Copyright (c) 1999                              RIPE NCC
10   |  
11   |   All Rights Reserved
12   |   
13   |   Permission to use, copy, modify, and distribute this software and its
14   |   documentation for any purpose and without fee is hereby granted,
15   |   provided that the above copyright notice appear in all copies and that
16   |   both that copyright notice and this permission notice appear in
17   |   supporting documentation, and that the name of the author not be
18   |   used in advertising or publicity pertaining to distribution of the
19   |   software without specific, written prior permission.
20   |   
21   |   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
22   |   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
23   |   AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
24   |   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25   |   AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
26   |   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27   |   ***************************************/
28   | #ifndef READ_MYSQL_DRIVER
29   | #define READ_MYSQL_DRIVER
30   | 
31   | #include "mysql.h"
32   | 
33   | #define SQ_connection_t MYSQL
34   | #define SQ_result_set_t MYSQL_RES
35   | 
36   | #define SQ_row_t MYSQL_ROW
37   | 
38   | SQ_connection_t *sq_connection_init(void);
39   | SQ_connection_t *sq_connection_get(SQ_connection_t *sql_connection, const char *host, unsigned int port,const char *db, const char *user, const char *password);
40   | SQ_connection_t *SQ_get_connection(const char *host, unsigned int port, const char *db, const char *user, const char *password);
41   | SQ_result_set_t *SQ_execute_query(SQ_connection_t *sql_connection, const char *query);
42   | int SQ_get_column_count(SQ_result_set_t *result);
43   | char *SQ_get_column_label(SQ_result_set_t *result, unsigned int column);
44   | unsigned int SQ_get_column_max_length(SQ_result_set_t *result, unsigned int column);
45   | SQ_row_t *SQ_row_next(SQ_result_set_t *result);
46   | char *SQ_get_column_string(SQ_row_t *current_row, unsigned int column);
47   | char *SQ_get_column_strings(SQ_result_set_t *result, unsigned int column);
48   | int SQ_get_column_int(SQ_result_set_t *result, SQ_row_t *current_row, unsigned int column);
49   | char *SQ_result_to_string(SQ_result_set_t *result);
50   | void SQ_free_result(SQ_result_set_t *result);
51   | SQ_connection_t *SQ_connect_to_server (char *host,char *user,char *passwd,char *db,uint port);
52   | void SQ_close_connection(SQ_connection_t *sql_connection);
53   | SQ_result_set_t *SQ_query_server(SQ_connection_t *sql_connection, char *query);
54   | int SQ_num_rows(SQ_result_set_t *result);
55   | char *SQ_info_to_string(SQ_connection_t *sql_connection);
56   | char *SQ_error(SQ_connection_t *sql_connection);
57   | int SQ_errno(SQ_connection_t *sql_connection);
58   | 
59   | #endif /* READ_MYSQL_DRIVER */