vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | /*- |
| 2 | * Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved. |
| 3 | * Redistribution and modifications are permitted subject to BSD license. |
| 4 | */ |
| 5 | #ifndef _INTEGER_H_ |
| 6 | #define _INTEGER_H_ |
| 7 | |
vlm | d157958 | 2004-09-24 21:00:50 +0000 | [diff] [blame] | 8 | #include <asn_application.h> |
vlm | 6678cb1 | 2004-09-26 13:10:40 +0000 | [diff] [blame] | 9 | #include <ber_codec_prim.h> |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 10 | |
vlm | 6678cb1 | 2004-09-26 13:10:40 +0000 | [diff] [blame] | 11 | typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 12 | |
| 13 | extern asn1_TYPE_descriptor_t asn1_DEF_INTEGER; |
| 14 | |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 15 | asn_struct_print_f INTEGER_print; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 16 | ber_type_decoder_f INTEGER_decode_ber; |
| 17 | der_type_encoder_f INTEGER_encode_der; |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 18 | xer_type_encoder_f INTEGER_encode_xer; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 19 | |
| 20 | /*********************************** |
| 21 | * Some handy conversion routines. * |
| 22 | ***********************************/ |
| 23 | |
| 24 | /* |
| 25 | * Returns 0 if it was possible to convert, -1 otherwise. |
| 26 | * -1/EINVAL: Mandatory argument missing |
| 27 | * -1/ERANGE: Value encoded is out of range for long representation |
| 28 | */ |
| 29 | int asn1_INTEGER2long(const INTEGER_t *i, long *l); |
| 30 | |
| 31 | #endif /* _INTEGER_H_ */ |