~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle_res.h

  • Committer: Brian Aker
  • Date: 2008-07-15 06:45:16 UTC
  • Revision ID: brian@tangent.org-20080715064516-fnbq7kowh7w57bxj
Merge Monty's code.

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 _libdrizzle_drizzle_res_h
21
 
#define _libdrizzle_drizzle_res_h
22
 
 
23
 
#ifdef  __cplusplus
24
 
extern "C" {
25
 
#endif
26
 
 
27
 
#include <stdint.h>
28
 
#include <stdbool.h>
29
 
#include <libdrizzle/drizzle_field.h>
30
 
#include <libdrizzle/drizzle_data.h>
31
 
#include <libdrizzle/drizzle_rows.h>
32
 
#include <libdrizzle/drizzle.h>
33
 
 
34
 
  struct st_drizzle;
35
 
 
36
 
  typedef struct st_drizzle_res {
37
 
  uint64_t  row_count;
38
 
  DRIZZLE_FIELD  *fields;
39
 
  DRIZZLE_DATA  *data;
40
 
  DRIZZLE_ROWS  *data_cursor;
41
 
  uint32_t *lengths;    /* column lengths of current row */
42
 
  struct st_drizzle *handle;    /* for unbuffered reads */
43
 
  const struct st_drizzle_methods *methods;
44
 
  DRIZZLE_ROW  row;      /* If unbuffered read */
45
 
  DRIZZLE_ROW  current_row;    /* buffer to current row */
46
 
  uint32_t  field_count, current_field;
47
 
  bool  eof;      /* Used by drizzle_fetch_row */
48
 
  /* drizzle_stmt_close() had to cancel this result */
49
 
  bool       unbuffered_fetch_cancelled; 
50
 
  void *extension;
51
 
} DRIZZLE_RES;
52
 
 
53
 
 
54
 
/*
55
 
  Functions to get information from the DRIZZLE and DRIZZLE_RES structures
56
 
  Should definitely be used if one uses shared libraries.
57
 
*/
58
 
 
59
 
uint64_t drizzle_num_rows(const DRIZZLE_RES *res);
60
 
unsigned int drizzle_num_fields(const DRIZZLE_RES *res);
61
 
bool drizzle_eof(const DRIZZLE_RES *res);
62
 
const DRIZZLE_FIELD * drizzle_fetch_field_direct(const DRIZZLE_RES *res,
63
 
                unsigned int fieldnr);
64
 
const DRIZZLE_FIELD * drizzle_fetch_fields(const DRIZZLE_RES *res);
65
 
DRIZZLE_ROW_OFFSET drizzle_row_tell(const DRIZZLE_RES *res);
66
 
DRIZZLE_FIELD_OFFSET drizzle_field_tell(const DRIZZLE_RES *res);
67
 
 
68
 
void    drizzle_free_result(DRIZZLE_RES *result);
69
 
void    drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
70
 
DRIZZLE_ROW_OFFSET drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
71
 
DRIZZLE_FIELD_OFFSET drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
72
 
DRIZZLE_ROW  drizzle_fetch_row(DRIZZLE_RES *result);
73
 
uint32_t * drizzle_fetch_lengths(DRIZZLE_RES *result);
74
 
DRIZZLE_FIELD *  drizzle_fetch_field(DRIZZLE_RES *result);
75
 
 
76
 
#ifdef  __cplusplus
77
 
}
78
 
#endif
79
 
 
80
 
#endif /* _libdrizzle_drizzle_res_h */