typo
[openssl.git] / perl / OpenSSL.xs
1 /*
2 **  OpenSSL.xs
3 */
4
5 #include "openssl.h"
6
7 SV *
8 new_ref(type, obj, mort)
9   char *type;
10   char *obj;
11 {
12     SV *ret;
13
14     if (mort)
15         ret = sv_newmortal();
16     else
17         ret = newSViv(0);
18 #ifdef DEBUG
19     printf(">new_ref %d\n",type);
20 #endif
21     sv_setref_pv(ret, type, (void *)obj);
22     return(ret);
23 }
24
25 int 
26 ex_new(obj, data, ad, idx, argl, argp)
27   char *obj;
28   SV *data;
29   CRYPTO_EX_DATA *ad;
30   int idx;
31   long argl;
32   char *argp;
33 {
34     SV *sv;
35
36 #ifdef DEBUG
37     printf("ex_new %08X %s\n",obj,argp); 
38 #endif
39     sv = sv_newmortal();
40     sv_setref_pv(sv, argp, (void *)obj);
41 #ifdef DEBUG
42     printf("%d>new_ref '%s'\n", sv, argp);
43 #endif
44     CRYPTO_set_ex_data(ad, idx, (char *)sv);
45     return(1);
46 }
47
48 void 
49 ex_cleanup(obj, data, ad, idx, argl, argp)
50   char *obj;
51   SV *data;
52   CRYPTO_EX_DATA *ad;
53   int idx;
54   long argl;
55   char *argp;
56 {
57     pr_name("ex_cleanup");
58 #ifdef DEBUG
59     printf("ex_cleanup %08X %s\n", obj, argp);
60 #endif
61     if (data != NULL)
62         SvREFCNT_dec((SV *)data);
63 }
64
65 MODULE = OpenSSL  PACKAGE = OpenSSL
66
67 PROTOTYPES: ENABLE
68
69 BOOT:
70     boot_bio();
71     boot_cipher();
72     boot_digest();
73     boot_err();
74     boot_ssl();
75     boot_OpenSSL__BN();
76     boot_OpenSSL__BIO();
77     boot_OpenSSL__Cipher();
78     boot_OpenSSL__MD();
79     boot_OpenSSL__ERR();
80     boot_OpenSSL__SSL();
81     boot_OpenSSL__X509();
82