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(ResultClientBuffered) result_client_buffered;
35
class result_client_buffered : public result_client {};
38
%extend result_client_buffered {
41
* Get an array of all field sizes for buffered rows.
43
size_t *row_field_sizes()
45
return drizzle_row_field_sizes($self);
49
* Get next buffered row from a fully buffered result.
51
drizzle_row_t row_next(row_buffered *buffer)
53
buffer->row= drizzle_row_next($self);
54
buffer->field_count= drizzle_result_column_count($self);
55
buffer->result= $self;
60
* Get previous buffered row from a fully buffered result.
62
drizzle_row_t row_prev(row_buffered *buffer)
64
buffer->row= drizzle_row_prev($self);
65
buffer->field_count= drizzle_result_column_count($self);
66
buffer->result= $self;
71
* Get a field at the specified position from the given row.
73
char *get_row_field(drizzle_row_t row, int pos)
75
if (pos > drizzle_result_column_count($self))
81
* Seek to the given buffered row in a fully buffered result.
83
void row_seek(uint64_t row)
85
drizzle_row_seek($self, row);
89
* Get the given buffered row from a fully buffered result.
91
void row_index(row_buffered *buffer, uint64_t row)
93
buffer->row= drizzle_row_index($self, row);
94
buffer->field_count= drizzle_result_column_count($self);
95
buffer->result= $self;
99
* Get current row number.
101
uint64_t row_current()
103
return drizzle_row_current($self);