Version to 1.00 for first release.
[ZOOM-Perl-moved-to-github.git] / lib / Net / Z3950 / ZOOM.pm
1 # $Id: ZOOM.pm,v 1.4 2005-12-14 11:11:55 mike Exp $
2
3 package Net::Z3950::ZOOM; 
4
5 use 5.008;
6 use strict;
7 use warnings;
8
9 our $VERSION = '1.00';
10
11 require XSLoader;
12 XSLoader::load('Net::Z3950::ZOOM', $VERSION);
13
14
15 # The only thing this module does is define the following constants,
16 # which MUST BE KEPT SYNCHRONISED with the definitions in <yaz/zoom.h>
17
18 # Error codes, as returned from connection_error()
19 sub ERROR_NONE { 0 }
20 sub ERROR_CONNECT { 10000 }
21 sub ERROR_MEMORY { 10001 }
22 sub ERROR_ENCODE { 10002 }
23 sub ERROR_DECODE { 10003 }
24 sub ERROR_CONNECTION_LOST { 10004 }
25 sub ERROR_INIT { 10005 }
26 sub ERROR_INTERNAL { 10006 }
27 sub ERROR_TIMEOUT { 10007 }
28 sub ERROR_UNSUPPORTED_PROTOCOL { 10008 }
29 sub ERROR_UNSUPPORTED_QUERY { 10009 }
30 sub ERROR_INVALID_QUERY { 10010 }
31
32 # Event types, as returned from connection_last_event()
33 sub EVENT_NONE { 0 }
34 sub EVENT_CONNECT { 1 }
35 sub EVENT_SEND_DATA { 2 }
36 sub EVENT_RECV_DATA { 3 }
37 sub EVENT_TIMEOUT { 4 }
38 sub EVENT_UNKNOWN { 5 }
39 sub EVENT_SEND_APDU { 6 }
40 sub EVENT_RECV_APDU { 7 }
41 sub EVENT_RECV_RECORD { 8 }
42 sub EVENT_RECV_SEARCH { 9 }
43
44
45 =head1 NAME
46
47 Net::Z3950::ZOOM - Perl extension for invoking the ZOOM-C API.
48
49 =head1 SYNOPSIS
50
51  use Net::Z3950::ZOOM;
52  $conn = Net::Z3950::ZOOM::connection_new($host, $port);
53  $errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo);
54  Net::Z3950::ZOOM::connection_option_set($conn, databaseName => "foo");
55  # etc.
56
57 =head1 DESCRIPTION
58
59 This module provides a simple thin-layer through to the ZOOM-C
60 functions in the YAZ toolkit for Z39.50 and SRW/U communication.  You
61 should not be using this very nasty, low-level API.  You should be
62 using the C<ZOOM> module instead, which implements a nice, Perlish API
63 on top of this module, conformant to the ZOOM Abstract API described at
64 http://zoom.z3950.org/api/
65
66 To enforce the don't-use-this-module prohibition, I am not even going
67 to document it.  If you really, really, really want to use it, then it
68 pretty much follows the API described in the ZOOM-C documentation at
69 http://www.indexdata.dk/yaz/doc/zoom.tkl
70
71 =head1 SEE ALSO
72
73 The C<ZOOM> module, included in the same distribution as this one.
74
75 =head1 AUTHOR
76
77 Mike Taylor, E<lt>mike@indexdata.comE<gt>
78
79 =head1 COPYRIGHT AND LICENCE
80
81 Copyright (C) 2005 by Index Data.
82
83 This library is free software; you can redistribute it and/or modify
84 it under the same terms as Perl itself, either Perl version 5.8.4 or,
85 at your option, any later version of Perl 5 you may have available.
86
87 =cut
88
89 1;