source: swig/perl/language.i @ 7764378

abac0-leak
Last change on this file since 7764378 was 12a2fa7, checked in by Ted Faber <faber@…>, 11 years ago

Restore proper perl exception handling - unclear how this was working before.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1%{
2#include "SSL_keyid.h"
3%}
4
5%include "SSL_keyid.h"
6
7%include "chunk.i"
8
9%typemap(argout) bool &success {
10    --argvi;
11    SV *array = $result;
12
13    $result = sv_newmortal();
14    sv_setiv($result, *$1);
15    ++argvi;
16
17    $result = array;
18    ++argvi;
19}
20
21%typemap(in,numinputs=0) bool &success(bool temp) {
22    $1 = &temp;
23}
24
25// Handle exceptions
26%exception {
27  try {
28      $action
29  }
30  catch (std::invalid_argument) {
31        croak("std::invalid_argument");
32  }
33  catch (std::logic_error) {
34        croak("std::logic_error");
35  }
36}
37
38// Calling these makes perl 5.12.4 dump core.  We protect the user from this by
39// hiding the functions.
40%ignore Creddy::ID::write_cert(std::FILE*);
41%ignore Creddy::ID::write_privkey(std::FILE*);
42%ignore Creddy::Attribute::write(std::FILE*);
43
44// XXX We would love a typemap for FILE * in Perl, but that's not happening
45// anytime soon. It's hard (impossible?) to get a PerlIO * from a GV (glob).
46// If that were acquired, it's still funky getting a FILE * from that.
47//
48// See man perlapio for details, but you'd need:
49//
50// PerlIO_findFile(f)   // creates a FILE *
51// PerlIO_close()       // closes it
52//
53// Once you create it with findFILE, you need to close it once you are done
54// with it, so you'd need a typemap that gets called AFTER the function is done.
55//
56// Like I said, not happening.
Note: See TracBrowser for help on using the repository browser.