remark release date
[Net-Radio-Location-SUPL-Test.git] / swgs / ASN1.i
blob5b60e421f18067cd1a85c00a6b796ec9b035b667
1 %ignore asn_TYPE_descriptor_t;
2 %ignore asn_struct_free_f;
3 %ignore asn_struct_print_f;
4 %ignore asn_constr_check_f;
5 %ignore ber_type_decoder_f;
6 %ignore der_type_encoder_f;
7 %ignore xer_type_decoder_f;
8 %ignore xer_type_encoder_f;
9 %ignore per_type_decoder_f;
10 %ignore per_type_encoder_f;
12 %typemap(arginit) OCTET_STRING_t {
13 memset(&$1, 0, sizeof($1));
16 %typemap(in) OCTET_STRING_t {
17 if( 0 == (SvFLAGS($input) & (SVf_OK & ~SVf_ROK)) )
18 croak("Argument $argnum is not a string.");
19 OCTET_STRING_fromBuf((OCTET_STRING_t *)(&$1), SvPV_nolen($input), SvCUR($input));
22 %typemap(in) OCTET_STRING_t * {
23 if( 0 == (SvFLAGS($input) & (SVf_OK & ~SVf_ROK)) )
24 croak("Argument $argnum is not a string.");
25 $1 = calloc(1, sizeof(*($1)));
26 if( NULL == $1 )
27 croak("Out of memory allocating new " "$*1_type");
28 OCTET_STRING_fromBuf((OCTET_STRING_t *)($1), SvPV_nolen($input), SvCUR($input));
31 %typemap(out) OCTET_STRING_t {
32 if (argvi >= items) {
33 EXTEND(sp,1); /* Extend the stack by 1 object */
35 $result = sv_newmortal();
36 sv_setpvn($result, (char *)($1.buf), $1.size);
38 ++argvi; /* intentional - not portable between languages */
41 %typemap(out) OCTET_STRING_t * {
42 if (argvi >= items) {
43 EXTEND(sp,1); /* Extend the stack by 1 object */
45 $result = sv_newmortal();
46 sv_setpvn($result, (char *)($1->buf), $1->size);
48 ++argvi; /* intentional - not portable between languages */
51 %typemap(arginit) BIT_STRING_t {
52 memset(&$1, 0, sizeof($1));
55 %typemap(in) BIT_STRING_t {
56 if( 0 == (SvFLAGS($input) & (SVf_OK & ~SVf_ROK)) )
57 croak("Argument $argnum is not a string.");
58 OCTET_STRING_fromBuf((OCTET_STRING_t *)(&$1), SvPV_nolen($input), SvCUR($input));
59 $1.bits_unused = 0;
62 %typemap(in) BIT_STRING_t * {
63 if( 0 == (SvFLAGS($input) & (SVf_OK & ~SVf_ROK)) )
64 croak("Argument $argnum is not a string.");
65 $1 = calloc(1, sizeof(*($1)));
66 if( NULL == $1 )
67 croak("Out of memory allocating new " "$*1_type");
68 OCTET_STRING_fromBuf((OCTET_STRING_t *)($1), SvPV_nolen($input), SvCUR($input));
69 $1->bits_unused = 0;
72 %typemap(out) BIT_STRING_t {
73 if (argvi >= items) {
74 EXTEND(sp,1); /* Extend the stack by 1 object */
76 $result = sv_newmortal();
77 sv_setpvn($result, (char *)($1.buf), $1.size); // XXX bits_unused ...
79 ++argvi; /* intentional - not portable between languages */
82 %typemap(out) BIT_STRING_t * {
83 if (argvi >= items) {
84 EXTEND(sp,1); /* Extend the stack by 1 object */
86 $result = sv_newmortal();
87 sv_setpvn($result, (char *)($1->buf), $1->size); // XXX bits_unused ...
89 ++argvi; /* intentional - not portable between languages */
92 %typemap(newfree) BIT_STRING_t "asn_DEF_BIT_STRING.free_struct(&asn_DEF_BIT_STRING, &$1, 1);"
93 %typemap(newfree) BIT_STRING_t * "if( $1 ) { asn_DEF_BIT_STRING.free_struct(&asn_DEF_BIT_STRING, $1, 0); }"
95 %typemap(newfree) OCTET_STRING_t "asn_DEF_OCTET_STRING.free_struct(&asn_DEF_OCTET_STRING, &$1, 1);"
96 %typemap(newfree) OCTET_STRING_t * "if( $1 ) { asn_DEF_OCTET_STRING.free_struct(&asn_DEF_OCTET_STRING, $1, 0); }"
98 // built-in
99 %apply OCTET_STRING_t { IA5String_t };
100 %apply OCTET_STRING_t * { IA5String_t * };
101 %apply OCTET_STRING_t { VisibleString_t };
102 %apply OCTET_STRING_t * { VisibleString_t * };