~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/drizzle_res.h

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
5
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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
 
18
 */
 
19
 
 
20
#ifndef LIBDRIZZLECLIENT_DRIZZLE_RES_H
 
21
#define LIBDRIZZLECLIENT_DRIZZLE_RES_H
 
22
 
 
23
#include "drizzle_field.h"
 
24
#include "drizzle_data.h"
 
25
#include "drizzle_rows.h"
 
26
#include "drizzle.h"
 
27
 
 
28
#include <stdint.h>
 
29
#if !defined(__cplusplus)
 
30
# include <stdbool.h>
 
31
#endif
 
32
 
 
33
#ifdef  __cplusplus
 
34
extern "C" {
 
35
#endif
 
36
 
 
37
  struct st_drizzle;
 
38
 
 
39
  typedef struct st_drizzle_res {
 
40
  uint64_t  row_count;
 
41
  DRIZZLE_FIELD  *fields;
 
42
  DRIZZLE_DATA  *data;
 
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;
 
53
  void *extension;
 
54
} DRIZZLE_RES;
 
55
 
 
56
 
 
57
/*
 
58
  Functions to get information from the DRIZZLE and DRIZZLE_RES structures
 
59
  Should definitely be used if one uses shared libraries.
 
60
*/
 
61
 
 
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);
 
70
 
 
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);
 
78
 
 
79
#ifdef  __cplusplus
 
80
}
 
81
#endif
 
82
 
 
83
#endif /* LIBDRIZZLECLIENT_DRIZZLE_RES_H */