1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef _libdrizzle_drizzle_res_h
21
#define _libdrizzle_drizzle_res_h
28
#if !defined(__cplusplus)
31
#include <libdrizzle/drizzle_field.h>
32
#include <libdrizzle/drizzle_data.h>
33
#include <libdrizzle/drizzle_rows.h>
34
#include <libdrizzle/drizzle.h>
38
typedef struct st_drizzle_res {
40
DRIZZLE_FIELD *fields;
42
DRIZZLE_ROWS *data_cursor;
43
uint32_t *lengths; /* column lengths of current row */
44
struct st_drizzle *handle; /* for unbuffered reads */
45
const struct st_drizzle_methods *methods;
46
DRIZZLE_ROW row; /* If unbuffered read */
47
DRIZZLE_ROW current_row; /* buffer to current row */
48
uint32_t field_count, current_field;
49
bool eof; /* Used by drizzle_fetch_row */
50
/* drizzle_stmt_close() had to cancel this result */
51
bool unbuffered_fetch_cancelled;
57
Functions to get information from the DRIZZLE and DRIZZLE_RES structures
58
Should definitely be used if one uses shared libraries.
61
uint64_t drizzle_num_rows(const DRIZZLE_RES *res);
62
unsigned int drizzle_num_fields(const DRIZZLE_RES *res);
63
bool drizzle_eof(const DRIZZLE_RES *res);
64
const DRIZZLE_FIELD * drizzle_fetch_field_direct(const DRIZZLE_RES *res,
65
unsigned int fieldnr);
66
const DRIZZLE_FIELD * drizzle_fetch_fields(const DRIZZLE_RES *res);
67
DRIZZLE_ROW_OFFSET drizzle_row_tell(const DRIZZLE_RES *res);
68
DRIZZLE_FIELD_OFFSET drizzle_field_tell(const DRIZZLE_RES *res);
70
void drizzle_free_result(DRIZZLE_RES *result);
71
void drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
72
DRIZZLE_ROW_OFFSET drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
73
DRIZZLE_FIELD_OFFSET drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
74
DRIZZLE_ROW drizzle_fetch_row(DRIZZLE_RES *result);
75
uint32_t * drizzle_fetch_lengths(DRIZZLE_RES *result);
76
DRIZZLE_FIELD * drizzle_fetch_field(DRIZZLE_RES *result);
82
#endif /* _libdrizzle_drizzle_res_h */