GDA/DSN.pm untested

filter: Statementstmt 0.0% 0 / 39 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 77 CC 9 SCAR 16.2
CC
9
Cov
0%
list
6.0
name
6.0
provider
6.0
CRAP 5.0
1 #!/usr/bin/perl -w
2 #
3 # DSN.pm
4 #
5 # $Revision: 1.2 $
6 #
7 # NOTE:
8 #
9 # * Mapped 'gda_name' to 'name'
10 # * Mapped 'dsn' to 'connect'
11 #
12 # TODO:
13 #
14 # * gda_list_datasources()
15 # * gda_list_datasources_for_provider()
16 #
17 # Copyright (C) 2001 Gregor N. Purdy. All rights reserved.
18 #
19 # This program is free software. It may be modified and/or
20 # distributed under the same terms as Perl itself.
21 #
22  
23 use strict;
24  
25 package GDA::DSN;
26  
27 use GDA;
28  
29 use Inline 'C';
30  
31 use Inline 'C' => Config =>
32 INC => '-I/usr/include/gda -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/gtk-1.2 -I/usr/include/gnome-xml',
33 AUTO_INCLUDE => '#include "gda-config.h"',
34 LIBS => '-lgda-common';
35  
36 sub list
37 {
38 my $class = shift;
39  
40 if (@_) {
41 return list_some($class, @_);
42 } else {
43 return list_all($class); # See comment for 'list_all', below
44 }
45 }
46  
47 sub name
48 {
49 if (@_) {
50 set_name(@_);
51 } else {
52 return get_name();
53 }
54 }
55  
56 sub provider
57 {
58 if (@_) {
59 set_provider(@_);
60 } else {
61 return get_provider();
62 }
63  
64 }
65  
66 sub connect
67 {
68 if (@_) {
69 set_connect(@_);
70 } else {
71 return get_connect();
72 }
73 }
74  
75 sub description
76 {
77 if (@_) {
78 set_description(@_);
79 } else {
80 return get_description();
81 }
82  
83 }
84  
85 sub username
86 {
87 if (@_) {
88 set_username(@_);
89 } else {
90 return get_username();
91 }
92 }
93  
94 sub config
95 {
96 if (@_) {
97 set_config(@_);
98 } else {
99 return get_config();
100 }
101 }
102  
103 sub global
104 {
105 if (@_) {
106 set_global(@_);
107 } else {
108 return get_global();
109 }
110 }
111  
112 sub remove # See 'remove_dsn' below for explanation.
113 {
114 remove_dsn(@_);
115 }
116  
117 1;
118  
119 =head1 NAME
120  
121 GDA::DSN - GDA data source Perl bindings
122  
123 =head1 SYNOPSIS
124  
125 use GDA 'my_app', 'my_ver', 'my_prog';
126 use GDA::DSN;
127 ...
128  
129 =head1 DESCRIPTION
130  
131 TODO
132  
133 =head1 AUTHOR
134  
135 Gregor N. Purdy E<lt>gregor@focusresearch.comE<gt>
136  
137 =head1 LICENSE
138  
139 This program is free software. It may be modified and/or
140 distributed under the same terms as Perl itself.
141  
142 =head1 COPYRIGHT
143  
144 Copyright (C) 2001 Gregor N. Purdy. All rights reserved.
145  
146 =cut
147  
148 __DATA__