2
by Andrew Hutchings
The "it compiles!" version |
1 |
/*
|
2 |
* Drizzle Client & Protocol Library
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Eric Day (eday@oddments.org)
|
|
5 |
* All rights reserved.
|
|
6 |
*
|
|
7 |
* Redistribution and use in source and binary forms, with or without
|
|
8 |
* modification, are permitted provided that the following conditions are
|
|
9 |
* met:
|
|
10 |
*
|
|
11 |
* * Redistributions of source code must retain the above copyright
|
|
12 |
* notice, this list of conditions and the following disclaimer.
|
|
13 |
*
|
|
14 |
* * Redistributions in binary form must reproduce the above
|
|
15 |
* copyright notice, this list of conditions and the following disclaimer
|
|
16 |
* in the documentation and/or other materials provided with the
|
|
17 |
* distribution.
|
|
18 |
*
|
|
19 |
* * The names of its contributors may not be used to endorse or
|
|
20 |
* promote products derived from this software without specific prior
|
|
21 |
* written permission.
|
|
22 |
*
|
|
23 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27 |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34 |
*
|
|
35 |
*/
|
|
36 |
||
37 |
||
38 |
/**
|
|
39 |
* @file
|
|
40 |
* @brief Column Declarations
|
|
41 |
*/
|
|
42 |
||
43 |
#pragma once
|
|
44 |
||
45 |
#ifdef __cplusplus
|
|
46 |
extern "C" { |
|
47 |
#endif
|
|
48 |
||
49 |
/**
|
|
50 |
* @addtogroup drizzle_column Column Declarations
|
|
51 |
* @ingroup drizzle_client_interface
|
|
52 |
* @ingroup drizzle_server_interface
|
|
53 |
*
|
|
54 |
* These functions are used to get detailed column information. This information
|
|
55 |
* is usually sent as the first part of a result set. There are multiple ways
|
|
56 |
* for column information to be buffered depending on the functions being used.
|
|
57 |
* @{
|
|
58 |
*/
|
|
59 |
||
60 |
/**
|
|
61 |
* Initialize a column structure.
|
|
62 |
*/
|
|
40
by Andrew Hutchings
More documentation and code cleanups |
63 |
DRIZZLE_LOCAL
|
5
by Andrew Hutchings
Make create functions less prone to developer error |
64 |
drizzle_column_st *drizzle_column_create(drizzle_result_st *result); |
2
by Andrew Hutchings
The "it compiles!" version |
65 |
|
66 |
/**
|
|
67 |
* Free a column structure.
|
|
68 |
*/
|
|
69 |
DRIZZLE_API
|
|
70 |
void drizzle_column_free(drizzle_column_st *column); |
|
71 |
||
72 |
/**
|
|
73 |
* Get the drizzle_result_st struct that the column belongs to.
|
|
74 |
*/
|
|
75 |
DRIZZLE_API
|
|
76 |
drizzle_result_st *drizzle_column_drizzle_result(drizzle_column_st *column); |
|
77 |
||
78 |
/**
|
|
79 |
* Get catalog name for a column.
|
|
80 |
*/
|
|
81 |
DRIZZLE_API
|
|
82 |
const char *drizzle_column_catalog(drizzle_column_st *column); |
|
83 |
||
84 |
/**
|
|
85 |
* Get database name for a column.
|
|
86 |
*/
|
|
87 |
DRIZZLE_API
|
|
88 |
const char *drizzle_column_db(drizzle_column_st *column); |
|
89 |
||
90 |
/**
|
|
91 |
* Get table name for a column.
|
|
92 |
*/
|
|
93 |
DRIZZLE_API
|
|
94 |
const char *drizzle_column_table(drizzle_column_st *column); |
|
95 |
||
96 |
/**
|
|
97 |
* Get original table name for a column.
|
|
98 |
*/
|
|
99 |
DRIZZLE_API
|
|
100 |
const char *drizzle_column_orig_table(drizzle_column_st *column); |
|
101 |
||
102 |
/**
|
|
103 |
* Get column name for a column.
|
|
104 |
*/
|
|
105 |
DRIZZLE_API
|
|
106 |
const char *drizzle_column_name(drizzle_column_st *column); |
|
107 |
||
108 |
/**
|
|
109 |
* Get original column name for a column.
|
|
110 |
*/
|
|
111 |
DRIZZLE_API
|
|
112 |
const char *drizzle_column_orig_name(drizzle_column_st *column); |
|
113 |
||
114 |
/**
|
|
115 |
* Get charset for a column.
|
|
116 |
*/
|
|
117 |
DRIZZLE_API
|
|
118 |
drizzle_charset_t drizzle_column_charset(drizzle_column_st *column); |
|
119 |
||
120 |
/**
|
|
121 |
* Get size of a column.
|
|
122 |
*/
|
|
123 |
DRIZZLE_API
|
|
124 |
uint32_t drizzle_column_size(drizzle_column_st *column); |
|
125 |
||
126 |
/**
|
|
127 |
* Get max size of a column.
|
|
128 |
*/
|
|
129 |
DRIZZLE_API
|
|
130 |
size_t drizzle_column_max_size(drizzle_column_st *column); |
|
131 |
||
132 |
/**
|
|
133 |
* Get the type of a column.
|
|
134 |
*/
|
|
135 |
DRIZZLE_API
|
|
136 |
drizzle_column_type_t drizzle_column_type(drizzle_column_st *column); |
|
137 |
||
138 |
/**
|
|
139 |
* Get flags for a column.
|
|
140 |
*/
|
|
141 |
DRIZZLE_API
|
|
142 |
drizzle_column_flags_t drizzle_column_flags(drizzle_column_st *column); |
|
143 |
||
144 |
/**
|
|
145 |
* Get the number of decimals for numeric columns.
|
|
146 |
*/
|
|
147 |
DRIZZLE_API
|
|
148 |
uint8_t drizzle_column_decimals(drizzle_column_st *column); |
|
149 |
||
150 |
/**
|
|
151 |
* Get default value for a column.
|
|
152 |
*/
|
|
153 |
DRIZZLE_API
|
|
154 |
const uint8_t *drizzle_column_default_value(drizzle_column_st *column, |
|
155 |
size_t *size); |
|
156 |
||
4
by Andrew Hutchings
Strip more server stuff out |
157 |
DRIZZLE_LOCAL
|
158 |
void drizzle_column_set_default_value(drizzle_column_st *column, |
|
159 |
const uint8_t *default_value, |
|
160 |
size_t size); |
|
161 |
||
162 |
||
2
by Andrew Hutchings
The "it compiles!" version |
163 |
/** @} */
|
164 |
||
165 |
#ifdef __cplusplus
|
|
166 |
}
|
|
167 |
#endif
|