1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* drizzle-interface: Interface Wrappers for Drizzle
5
* Copyright (c) 2009 Sun Microsystems
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are met:
11
* 1. Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* 2. Redistributions in binary form must reproduce the above copyright
14
* notice, this list of conditions and the following disclaimer in the
15
* documentation and/or other materials provided with the distribution.
16
* 3. The name of the author may not be used to endorse or promote products
17
* derived from this software without specific prior written permission.
19
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
%rename(ResultServer) result_server;
34
class result_server : public drizzle_result {};
36
%extend result_server {
38
void set_eof(bool eof)
40
drizzle_result_set_eof($self, eof);
43
void set_info(const char *info)
45
drizzle_result_set_info($self, info);
48
void set_error(const char *error)
50
drizzle_result_set_error($self, error);
53
void set_error_code(uint16_t error_code)
55
drizzle_result_set_error_code($self, error_code);
58
void set_sqlstate(const char *sqlstate)
60
drizzle_result_set_sqlstate($self, sqlstate);
63
void set_warning_count(uint16_t warning_count)
65
drizzle_result_set_warning_count($self, warning_count);
68
void set_insert_id(uint64_t insert_id)
70
drizzle_result_set_insert_id($self, insert_id);
73
void set_affected_rows(uint64_t affected_rows)
75
drizzle_result_set_affected_rows($self, affected_rows);
78
void set_column_count(uint16_t column_count)
80
drizzle_result_set_column_count($self, column_count);
84
/* Initialize a column structure. */
85
column_server *column_create() {
86
return drizzle_column_create($self, NULL);
89
drizzle_return_t column_write(drizzle_column_st *column)
91
return drizzle_column_write($self, column);
94
drizzle_return_t row_write()
96
return drizzle_row_write($self);