line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl -w |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# GDA.pm |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# $Revision: 1.3 $ |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# TODO: |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# * Don't hardcode the app name, etc. in init(). |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Copyright (C) 2001 Gregor N. Purdy. All rights reserved. |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# This program is free software. It may be modified and/or |
14
|
|
|
|
|
|
|
# distributed under the same terms as Perl itself. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
|
17
|
5
|
|
|
5
|
|
3372
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
189
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
package GDA; |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
5
|
|
26
|
use Carp; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
601
|
|
22
|
|
|
|
|
|
|
|
23
|
5
|
|
|
5
|
|
27
|
use vars qw($VERSION); |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
609
|
|
24
|
|
|
|
|
|
|
$VERSION = '0.2'; |
25
|
|
|
|
|
|
|
|
26
|
5
|
|
|
5
|
|
7856
|
use Inline 'C'; |
|
5
|
|
|
|
|
193009
|
|
|
5
|
|
|
|
|
42
|
|
27
|
|
|
|
|
|
|
|
28
|
5
|
|
|
|
|
24
|
use Inline 'C' => Config => |
29
|
|
|
|
|
|
|
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', |
30
|
|
|
|
|
|
|
AUTO_INCLUDE => '#include "gda-config.h"', |
31
|
5
|
|
|
5
|
|
960
|
LIBS => '-lgda-common'; |
|
5
|
|
|
|
|
10
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Inline->init; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $imported = 0; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub import |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
|
|
my $package = shift; |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
return if $imported; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
croak "GDA.pm: usage: use GDA , , ...;\n" |
44
|
0
|
0
|
|
|
|
|
. " Caller did: use GDA " . join(', ', map { "'$_'" } @_) . ";\n" |
45
|
|
|
|
|
|
|
. " (If this message is for a GDA::* module, perhaps you forgot to\n" |
46
|
|
|
|
|
|
|
. " 'use GDA ...' in your main program?)" unless @_ >= 2; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $app = shift; |
49
|
0
|
|
|
|
|
|
my $ver = shift; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $prog; |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
if (@_) { |
54
|
0
|
|
|
|
|
|
$prog = shift; |
55
|
|
|
|
|
|
|
} else { |
56
|
0
|
|
|
|
|
|
$prog = $0; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# TODO: Why were we getting undefs in the first place ('under make test')? |
60
|
|
|
|
|
|
|
|
61
|
0
|
0
|
|
|
|
|
$app = '' if not defined $app; |
62
|
0
|
0
|
|
|
|
|
$ver = '' if not defined $ver; |
63
|
0
|
0
|
|
|
|
|
$prog = '' if not defined $prog; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
init($app, $ver, $prog); |
66
|
0
|
|
|
|
|
|
$imported++; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub imported |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
0
|
|
|
return $imported; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 NAME |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
GDA - GNU Data Access library Perl bindings |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 SYNOPSIS |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
use GDA 'my_app', 'my_version', 'my_progname'; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Initializes the underlying C library. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
See the other B modules for the real functionality. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 DESCRIPTION |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
A suite of Perl modules which wrap the C library's API. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
You must |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use GDA ...; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
before using any of the other B modules. If you don't, you'll get |
97
|
|
|
|
|
|
|
complaints from the B module (at best), or crashes and core dumps |
98
|
|
|
|
|
|
|
(at worst). |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SEE ALSO |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
B, B, B and B. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 AUTHOR |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Gregor N. Purdy Egregor@focusresearch.comE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 LICENSE |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This program is free software. It may be modified and/or |
111
|
|
|
|
|
|
|
distributed under the same terms as Perl itself. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 COPYRIGHT |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Copyright (C) 2001 Gregor N. Purdy. All rights reserved. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__DATA__ |