1712.1.1
by Monty Taylor
Merged libdrizzle directly into tree. |
1 |
/*
|
2 |
* Drizzle Client & Protocol Library
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Eric Day (eday@oddments.org)
|
|
5 |
* All rights reserved.
|
|
6 |
*
|
|
7 |
* Use and distribution licensed under the BSD license. See
|
|
8 |
* the COPYING file in this directory for full text.
|
|
9 |
*/
|
|
10 |
||
11 |
/**
|
|
12 |
* @file
|
|
13 |
* @brief Result Declarations
|
|
14 |
*/
|
|
15 |
||
16 |
#ifndef __DRIZZLE_RESULT_H
|
|
17 |
#define __DRIZZLE_RESULT_H
|
|
18 |
||
19 |
#ifdef __cplusplus
|
|
20 |
extern "C" { |
|
21 |
#endif
|
|
22 |
||
23 |
/**
|
|
24 |
* @addtogroup drizzle_result Result Declarations
|
|
25 |
* @ingroup drizzle_client_interface
|
|
26 |
* @ingroup drizzle_server_interface
|
|
27 |
*
|
|
28 |
* These are core result functions used by both clients and servers.
|
|
29 |
* @{
|
|
30 |
*/
|
|
31 |
||
32 |
/**
|
|
33 |
* Initialize a result structure.
|
|
34 |
*/
|
|
35 |
DRIZZLE_API
|
|
36 |
drizzle_result_st *drizzle_result_create(drizzle_con_st *con, |
|
37 |
drizzle_result_st *result); |
|
38 |
||
39 |
/**
|
|
40 |
* Clone a connection structure.
|
|
41 |
*/
|
|
42 |
DRIZZLE_API
|
|
43 |
drizzle_result_st *drizzle_result_clone(drizzle_con_st *con, |
|
44 |
drizzle_result_st *result, |
|
45 |
drizzle_result_st *from); |
|
46 |
||
47 |
/**
|
|
48 |
* Free a result structure.
|
|
49 |
*/
|
|
50 |
DRIZZLE_API
|
|
51 |
void drizzle_result_free(drizzle_result_st *result); |
|
52 |
||
53 |
/**
|
|
54 |
* Free all result structures.
|
|
55 |
*/
|
|
56 |
DRIZZLE_API
|
|
57 |
void drizzle_result_free_all(drizzle_con_st *con); |
|
58 |
||
59 |
/**
|
|
60 |
* Get the drizzle_con_st struct that the result belongs to.
|
|
61 |
*/
|
|
62 |
DRIZZLE_API
|
|
63 |
drizzle_con_st *drizzle_result_drizzle_con(drizzle_result_st *result); |
|
64 |
||
65 |
/**
|
|
66 |
* Get EOF flag for a result.
|
|
67 |
*/
|
|
68 |
DRIZZLE_API
|
|
69 |
bool drizzle_result_eof(drizzle_result_st *result); |
|
70 |
||
71 |
/**
|
|
72 |
* Get information string for a result.
|
|
73 |
*/
|
|
74 |
DRIZZLE_API
|
|
75 |
const char *drizzle_result_info(drizzle_result_st *result); |
|
76 |
||
77 |
/**
|
|
78 |
* Get error string for a result.
|
|
79 |
*/
|
|
80 |
DRIZZLE_API
|
|
81 |
const char *drizzle_result_error(drizzle_result_st *result); |
|
82 |
||
83 |
/**
|
|
84 |
* Get server defined error code for a result.
|
|
85 |
*/
|
|
86 |
DRIZZLE_API
|
|
87 |
uint16_t drizzle_result_error_code(drizzle_result_st *result); |
|
88 |
||
89 |
/**
|
|
90 |
* Get SQL state code for a result.
|
|
91 |
*/
|
|
92 |
DRIZZLE_API
|
|
93 |
const char *drizzle_result_sqlstate(drizzle_result_st *result); |
|
94 |
||
95 |
/**
|
|
96 |
* Get the number of warnings encounted during a command.
|
|
97 |
*/
|
|
98 |
DRIZZLE_API
|
|
99 |
uint16_t drizzle_result_warning_count(drizzle_result_st *result); |
|
100 |
||
101 |
/**
|
|
102 |
* Get inet ID of the last command, if any.
|
|
103 |
*/
|
|
104 |
DRIZZLE_API
|
|
105 |
uint64_t drizzle_result_insert_id(drizzle_result_st *result); |
|
106 |
||
107 |
/**
|
|
108 |
* Get the number of affected rows during the command.
|
|
109 |
*/
|
|
110 |
DRIZZLE_API
|
|
111 |
uint64_t drizzle_result_affected_rows(drizzle_result_st *result); |
|
112 |
||
113 |
/**
|
|
114 |
* Get the number of columns in a result set.
|
|
115 |
*/
|
|
116 |
DRIZZLE_API
|
|
117 |
uint16_t drizzle_result_column_count(drizzle_result_st *result); |
|
118 |
||
119 |
/**
|
|
120 |
* Get the number of rows returned for the command.
|
|
121 |
*/
|
|
122 |
DRIZZLE_API
|
|
123 |
uint64_t drizzle_result_row_count(drizzle_result_st *result); |
|
124 |
||
125 |
/** @} */
|
|
126 |
||
127 |
#ifdef __cplusplus
|
|
128 |
}
|
|
129 |
#endif
|
|
130 |
||
131 |
#endif /* __DRIZZLE_RESULT_H */ |