~mordred/drizzle-interface/cython-interface

« back to all changes in this revision

Viewing changes to interface/libdrizzle/result_server.i

  • Committer: Monty Taylor
  • Date: 2009-10-28 02:20:39 UTC
  • mfrom: (113.1.2 c-transition)
  • Revision ID: mordred@inaugust.com-20091028022039-a202c33y8nm06x5n
Merged in transition to C.

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
 
 * drizzle-interface: Interface Wrappers for Drizzle
5
 
 * Copyright (c) 2009 Sun Microsystems
6
 
 * All rights reserved.
7
 
 *
8
 
 * Redistribution and use in source and binary forms, with or without
9
 
 * modification, are permitted provided that the following conditions are met:
10
 
 *
11
 
 * 1. Redistributions of source code must retain the above copyright
12
 
 *    notice, this list of conditions and the following disclaimer.
13
 
 * 2. Redistributions in binary form must reproduce the above copyright
14
 
 *    notice, this list of conditions and the following disclaimer in the
15
 
 *    documentation and/or other materials provided with the distribution.
16
 
 * 3. The name of the author may not be used to endorse or promote products
17
 
 *    derived from this software without specific prior written permission.
18
 
 *
19
 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
 
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23
 
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24
 
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
 
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26
 
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
 
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
 
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
 
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
 
 */
31
 
 
32
 
%rename(ResultServer) result_server;
33
 
 
34
 
class result_server : public drizzle_result {};
35
 
 
36
 
%extend result_server {
37
 
 
38
 
  void set_eof(bool eof)
39
 
  {
40
 
    drizzle_result_set_eof($self, eof);
41
 
  }
42
 
 
43
 
  void set_info(const char *info)
44
 
  {
45
 
    drizzle_result_set_info($self, info);
46
 
  }
47
 
 
48
 
  void set_error(const char *error)
49
 
  {
50
 
    drizzle_result_set_error($self, error);
51
 
  }
52
 
 
53
 
  void set_error_code(uint16_t error_code)
54
 
  {
55
 
    drizzle_result_set_error_code($self, error_code);
56
 
  }
57
 
 
58
 
  void set_sqlstate(const char *sqlstate)
59
 
  {
60
 
    drizzle_result_set_sqlstate($self, sqlstate);
61
 
  }
62
 
 
63
 
  void set_warning_count(uint16_t warning_count)
64
 
  {
65
 
    drizzle_result_set_warning_count($self, warning_count);
66
 
  }
67
 
 
68
 
  void set_insert_id(uint64_t insert_id)
69
 
  {
70
 
    drizzle_result_set_insert_id($self, insert_id);
71
 
  }
72
 
 
73
 
  void set_affected_rows(uint64_t affected_rows)
74
 
  {
75
 
    drizzle_result_set_affected_rows($self, affected_rows);
76
 
  }
77
 
 
78
 
  void set_column_count(uint16_t column_count)
79
 
  {
80
 
    drizzle_result_set_column_count($self, column_count);
81
 
  }
82
 
 
83
 
 
84
 
  /* Initialize a column structure. */
85
 
  column_server *column_create() {
86
 
    return drizzle_column_create($self, NULL);
87
 
  }
88
 
 
89
 
  drizzle_return_t column_write(drizzle_column_st *column)
90
 
  {
91
 
    return drizzle_column_write($self, column);
92
 
  }
93
 
 
94
 
  drizzle_return_t row_write()
95
 
  {
96
 
    return drizzle_row_write($self);
97
 
  }
98
 
 
99
 
}