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 LIBDRIZZLECLIENT_DRIZZLE_RES_H
21
#define LIBDRIZZLECLIENT_DRIZZLE_RES_H
23
#include "drizzle_field.h"
24
#include "drizzle_data.h"
25
#include "drizzle_rows.h"
29
#if !defined(__cplusplus)
39
typedef struct st_drizzle_res {
41
DRIZZLE_FIELD *fields;
43
DRIZZLE_ROWS *data_cursor;
44
uint32_t *lengths; /* column lengths of current row */
45
struct st_drizzle *handle; /* for unbuffered reads */
46
const struct st_drizzle_methods *methods;
47
DRIZZLE_ROW row; /* If unbuffered read */
48
DRIZZLE_ROW current_row; /* buffer to current row */
49
uint32_t field_count, current_field;
50
bool eof; /* Used by drizzleclient_fetch_row */
51
/* drizzle_stmt_close() had to cancel this result */
52
bool unbuffered_fetch_cancelled;
58
Functions to get information from the DRIZZLE and DRIZZLE_RES structures
59
Should definitely be used if one uses shared libraries.
62
uint64_t drizzleclient_num_rows(const DRIZZLE_RES *res);
63
unsigned int drizzleclient_num_fields(const DRIZZLE_RES *res);
64
bool drizzleclient_eof(const DRIZZLE_RES *res);
65
const DRIZZLE_FIELD * drizzleclient_fetch_field_direct(const DRIZZLE_RES *res,
66
unsigned int fieldnr);
67
const DRIZZLE_FIELD * drizzleclient_fetch_fields(const DRIZZLE_RES *res);
68
DRIZZLE_ROW_OFFSET drizzleclient_row_tell(const DRIZZLE_RES *res);
69
DRIZZLE_FIELD_OFFSET drizzleclient_field_tell(const DRIZZLE_RES *res);
71
void drizzleclient_free_result(DRIZZLE_RES *result);
72
void drizzleclient_data_seek(DRIZZLE_RES *result, uint64_t offset);
73
DRIZZLE_ROW_OFFSET drizzleclient_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
74
DRIZZLE_FIELD_OFFSET drizzleclient_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
75
DRIZZLE_ROW drizzleclient_fetch_row(DRIZZLE_RES *result);
76
uint32_t * drizzleclient_fetch_lengths(DRIZZLE_RES *result);
77
DRIZZLE_FIELD * drizzleclient_fetch_field(DRIZZLE_RES *result);
83
#endif /* LIBDRIZZLECLIENT_DRIZZLE_RES_H */