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; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef _libdrizzle_drizzle_res_h
22
#define _libdrizzle_drizzle_res_h
30
#include <libdrizzle/drizzle_field.h>
31
#include <libdrizzle/drizzle_data.h>
32
#include <libdrizzle/drizzle_rows.h>
33
#include <libdrizzle/drizzle.h>
37
typedef struct st_drizzle_res {
39
DRIZZLE_FIELD *fields;
41
DRIZZLE_ROWS *data_cursor;
42
uint32_t *lengths; /* column lengths of current row */
43
struct st_drizzle *handle; /* for unbuffered reads */
44
const struct st_drizzle_methods *methods;
45
DRIZZLE_ROW row; /* If unbuffered read */
46
DRIZZLE_ROW current_row; /* buffer to current row */
47
uint32_t field_count, current_field;
48
bool eof; /* Used by drizzle_fetch_row */
49
/* drizzle_stmt_close() had to cancel this result */
50
bool unbuffered_fetch_cancelled;
56
Functions to get information from the DRIZZLE and DRIZZLE_RES structures
57
Should definitely be used if one uses shared libraries.
60
uint64_t drizzle_num_rows(const DRIZZLE_RES *res);
61
unsigned int drizzle_num_fields(const DRIZZLE_RES *res);
62
bool drizzle_eof(const DRIZZLE_RES *res);
63
const DRIZZLE_FIELD * drizzle_fetch_field_direct(const DRIZZLE_RES *res,
64
unsigned int fieldnr);
65
const DRIZZLE_FIELD * drizzle_fetch_fields(const DRIZZLE_RES *res);
66
DRIZZLE_ROW_OFFSET drizzle_row_tell(const DRIZZLE_RES *res);
67
DRIZZLE_FIELD_OFFSET drizzle_field_tell(const DRIZZLE_RES *res);
69
void drizzle_free_result(DRIZZLE_RES *result);
70
void drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
71
DRIZZLE_ROW_OFFSET drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
72
DRIZZLE_FIELD_OFFSET drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
73
DRIZZLE_ROW drizzle_fetch_row(DRIZZLE_RES *result);
74
uint32_t * drizzle_fetch_lengths(DRIZZLE_RES *result);
75
DRIZZLE_FIELD * drizzle_fetch_field(DRIZZLE_RES *result);
81
#endif /* _libdrizzle_drizzle_res_h */