660b443c |
1 | # ---?--- |
2 | # |
a24b5cfd |
3 | # $Id: misc.xs,v 1.2 2004/04/08 01:36:21 mdw Exp $ |
660b443c |
4 | # |
5 | # Miscellaneous function interfaces |
6 | # |
7 | # (c) 2001 Straylight/Edgeware |
8 | # |
9 | |
10 | #----- Licensing notice ----------------------------------------------------- |
11 | # |
12 | # This file is part of the Perl interface to Catacomb. |
13 | # |
14 | # Catacomb/Perl is free software; you can redistribute it and/or modify |
15 | # it under the terms of the GNU General Public License as published by |
16 | # the Free Software Foundation; either version 2 of the License, or |
17 | # (at your option) any later version. |
18 | # |
19 | # Catacomb/Perl is distributed in the hope that it will be useful, |
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 | # GNU General Public License for more details. |
23 | # |
24 | # You should have received a copy of the GNU General Public License |
25 | # along with Catacomb/Perl; if not, write to the Free Software Foundation, |
26 | # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
27 | |
660b443c |
28 | MODULE = Catacomb PACKAGE = Catacomb::Passphrase |
29 | |
30 | SV * |
31 | read(me, tag, len = 256) |
32 | SV *me |
33 | char *tag |
34 | int len |
35 | CODE: |
36 | RETVAL = NEWSV(0, len); |
37 | if (passphrase_read(tag, PMODE_READ, SvPVX(RETVAL), len + 1)) |
38 | XSRETURN_UNDEF; |
39 | SvCUR_set(RETVAL, strlen(SvPVX(RETVAL))); |
40 | SvPOK_on(RETVAL); |
41 | OUTPUT: |
42 | RETVAL |
43 | |
44 | SV * |
45 | verify(me, tag, len = 256) |
46 | SV *me |
47 | char *tag |
48 | int len |
49 | CODE: |
50 | RETVAL = NEWSV(0, len); |
51 | if (passphrase_read(tag, PMODE_VERIFY, SvPVX(RETVAL), len + 1)) |
52 | XSRETURN_UNDEF; |
53 | SvCUR_set(RETVAL, strlen(SvPVX(RETVAL))); |
54 | SvPOK_on(RETVAL); |
55 | OUTPUT: |
56 | RETVAL |
57 | |
58 | SV * |
59 | cancel(me, tag) |
60 | SV *me |
61 | char *tag |
62 | CODE: |
63 | passphrase_cancel(tag); |
64 | XSRETURN_UNDEF; |
65 | |
66 | MODULE = Catacomb PACKAGE = Catacomb::KeySize |
67 | |
68 | int |
69 | keysz(ksz, sz) |
70 | keysize *ksz |
71 | int sz |
72 | CODE: |
73 | RETVAL = keysz(sz, ksz); |
74 | OUTPUT: |
75 | RETVAL |
76 | |
77 | #----- That's all, folks ---------------------------------------------------- |