~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle_res.h

  • Committer: Brian Aker
  • Date: 2008-08-18 04:35:40 UTC
  • mfrom: (342 codestyle)
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: brian@tangent.org-20080818043540-numg7vydi7b0bzcd
Mering Monty's work

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; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
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.
15
 
 *
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
19
 
 */
20
 
 
21
 
#ifndef _libdrizzle_drizzle_res_h
22
 
#define _libdrizzle_drizzle_res_h
23
 
 
24
 
#ifdef  __cplusplus
25
 
extern "C" {
26
 
#endif
27
 
 
28
 
#include <stdint.h>
29
 
#include <stdbool.h>
30
 
#include <libdrizzle/drizzle_field.h>
31
 
#include <libdrizzle/drizzle_data.h>
32
 
#include <libdrizzle/drizzle_rows.h>
33
 
#include <libdrizzle/drizzle.h>
34
 
 
35
 
  struct st_drizzle;
36
 
 
37
 
  typedef struct st_drizzle_res {
38
 
  uint64_t  row_count;
39
 
  DRIZZLE_FIELD  *fields;
40
 
  DRIZZLE_DATA  *data;
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; 
51
 
  void *extension;
52
 
} DRIZZLE_RES;
53
 
 
54
 
 
55
 
/*
56
 
  Functions to get information from the DRIZZLE and DRIZZLE_RES structures
57
 
  Should definitely be used if one uses shared libraries.
58
 
*/
59
 
 
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);
68
 
 
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);
76
 
 
77
 
#ifdef  __cplusplus
78
 
}
79
 
#endif
80
 
 
81
 
#endif /* _libdrizzle_drizzle_res_h */