~drizzle-trunk/drizzle/development

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 for Servers
14
 */
15
16
#ifndef __DRIZZLE_RESULT_SERVER_H
17
#define __DRIZZLE_RESULT_SERVER_H
18
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
23
/**
24
 * @addtogroup drizzle_result_server Result Declarations for Servers
25
 * @ingroup drizzle_server_interface
26
 *
27
 * These functions allow you to send result packets over a connection.
28
 * @{
29
 */
30
31
/**
32
 * Write result packet.
33
 */
34
DRIZZLE_API
35
drizzle_return_t drizzle_result_write(drizzle_con_st *con,
36
                                      drizzle_result_st *result, bool flush);
37
38
/**
39
 * Set result row packet size.
40
 */
41
DRIZZLE_API
42
void drizzle_result_set_row_size(drizzle_result_st *result, size_t size);
43
44
/**
45
 * Set result row packet size from field and size arrays.
46
 */
47
DRIZZLE_API
48
void drizzle_result_calc_row_size(drizzle_result_st *result,
49
                                  const drizzle_field_t *field,
50
                                  const size_t *size);
51
52
/**
53
 * Set information string for a result.
54
 */
55
DRIZZLE_API
56
void drizzle_result_set_eof(drizzle_result_st *result, bool eof);
57
58
/**
59
 * Set information string for a result.
60
 */
61
DRIZZLE_API
62
void drizzle_result_set_info(drizzle_result_st *result, const char *info);
63
64
/**
65
 * Set error string for a result.
66
 */
67
DRIZZLE_API
68
void drizzle_result_set_error(drizzle_result_st *result, const char *error);
69
70
/**
71
 * Set server defined error code for a result.
72
 */
73
DRIZZLE_API
74
void drizzle_result_set_error_code(drizzle_result_st *result,
75
                                   uint16_t error_code);
76
77
/**
78
 * Set SQL state code for a result.
79
 */
80
DRIZZLE_API
81
void drizzle_result_set_sqlstate(drizzle_result_st *result,
82
                                 const char *sqlstate);
83
84
/**
85
 * Set the number of warnings encounted during a command.
86
 */
87
DRIZZLE_API
88
void drizzle_result_set_warning_count(drizzle_result_st *result,
89
                                      uint16_t warning_count);
90
91
/**
92
 * Set inet ID of the last command, if any.
93
 */
94
DRIZZLE_API
95
void drizzle_result_set_insert_id(drizzle_result_st *result,
96
                                  uint64_t insert_id);
97
98
/**
99
 * Set the number of affected rows during the command.
100
 */
101
DRIZZLE_API
102
void drizzle_result_set_affected_rows(drizzle_result_st *result,
103
                                      uint64_t affected_rows);
104
105
/**
106
 * Set the number of fields in a result set.
107
 */
108
DRIZZLE_API
109
void drizzle_result_set_column_count(drizzle_result_st *result,
110
                                     uint16_t column_count);
111
112
/** @} */
113
114
#ifdef __cplusplus
115
}
116
#endif
117
118
#endif /* __DRIZZLE_RESULT_SERVER_H */