File: Informix.xs

package info (click to toggle)
libdbd-informix-perl 2003.04-3
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k, sarge
  • size: 1,232 kB
  • ctags: 467
  • sloc: perl: 7,349; ansic: 5,340; sh: 184; makefile: 58
file content (98 lines) | stat: -rw-r--r-- 2,678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 * @(#)$Id: Informix.xs,v 2003.1 2003/03/04 19:37:44 jleffler Exp $
 *
 * Copyright 1994-95 Tim Bunce
 * Copyright 1995-96 Alligator Descartes
 * Copyright 1996-99 Jonathan Leffler
 * Copyright 2000    Informix Software Inc
 * Copyright 2002-03 IBM
 *
 * You may distribute under the terms of either the GNU General Public
 * License or the Artistic License, as specified in the Perl README file.
 */

/*TABSTOP=4*/

#include "Informix.h"

DBISTATE_DECLARE;

/* Assume string concatenation is available */
#ifndef lint
static const char rcs[] = "@(#)$Id: Informix.xs,v 2003.1 2003/03/04 19:37:44 jleffler Exp $";
static const char esqlc_ver[] = "@(#)" ESQLC_VERSION_STRING;
#endif

MODULE = DBD::Informix	PACKAGE = DBD::Informix

I32
constant()
    PROTOTYPE:
    ALIAS:
	IX_SMALLINT   = SQLSMINT
	IX_INTEGER    = SQLINT
	IX_SERIAL     = SQLSERIAL
	IX_INT8       = SQLINT8
	IX_SERIAL8    = SQLSERIAL8
	IX_DECIMAL    = SQLDECIMAL
	IX_MONEY      = SQLMONEY
	IX_FLOAT      = SQLFLOAT
	IX_SMALLFLOAT = SQLSMFLOAT
	IX_CHAR       = SQLCHAR
	IX_VARCHAR    = SQLVCHAR
	IX_NCHAR      = SQLNCHAR
	IX_NVARCHAR   = SQLNVCHAR
	IX_LVARCHAR   = SQLLVARCHAR
	IX_BOOLEAN    = SQLBOOL
	IX_DATE       = SQLDATE
	IX_DATETIME   = SQLDTIME
	IX_INTERVAL   = SQLINTERVAL
	IX_BYTE       = SQLBYTES
	IX_TEXT       = SQLTEXT
	IX_SET        = SQLSET
	IX_MULTISET   = SQLMULTISET
	IX_LIST       = SQLLIST
	IX_ROW        = SQLROW
	IX_COLLECTION = SQLCOLLECTION
	IX_VARUDT     = SQLUDTVAR
	IX_FIXUDT     = SQLUDTFIXED
	# In the Informix system catalog, CLOB and BLOB types are simply
	# specific cases of a fixed UDT.  They seem to have extended ids
	# 10, 11.  However, they are also base types (opaque), and there
	# is storage information for them in the create table statement
	# (a PUT clause after the column list).  We need to handle them
	# specially, so define unique values for them in dbdimp.h.
	IX_CLOB       = DBD_IX_SQLCLOB
	IX_BLOB       = DBD_IX_SQLBLOB
    CODE:
    RETVAL = ix;
    OUTPUT:
    RETVAL

INCLUDE: Informix.xsi

MODULE = DBD::Informix	PACKAGE = DBD::Informix::dr

# Initialize the DBD::Informix driver data structure
void
driver_init(drh)
	SV *        drh
	CODE:
	ST(0) = dbd_ix_dr_driver(drh) ? &sv_yes : &sv_no;

# Fetch a driver attribute.  The keys are always strings.
# For some reason, not a part of the DBI standard
void
FETCH(drh, keysv)
	SV *        drh
	SV *        keysv
	CODE:
	D_imp_drh(drh);
	SV *valuesv = dbd_ix_dr_FETCH_attrib(imp_drh, keysv);
	if (!valuesv)
		valuesv = DBIc_DBISTATE(imp_drh)->get_attr(drh, keysv);
	ST(0) = valuesv;    /* dbd_dr_FETCH_attrib did sv_2mortal  */

MODULE = DBD::Informix    PACKAGE = DBD::Informix::st

# end of Informix.xs