blob: 45259e239a43a76b8e05a07f866febd10e0d94a4 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*-
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
Lev Walkin11c3e172004-09-24 21:00:50 +00008#include <asn_application.h>
Lev Walkind703ff42004-10-21 11:21:25 +00009#include <asn_codecs_prim.h>
Lev Walkinf15320b2004-06-03 03:38:44 +000010
Lev Walkin8e8078a2004-09-26 13:10:40 +000011typedef ASN__PRIMITIVE_TYPE_t INTEGER_t;
Lev Walkinf15320b2004-06-03 03:38:44 +000012
Lev Walkin5e033762004-09-29 13:26:15 +000013extern asn_TYPE_descriptor_t asn_DEF_INTEGER;
Lev Walkinf15320b2004-06-03 03:38:44 +000014
Lev Walkina9cc46e2004-09-22 16:06:28 +000015asn_struct_print_f INTEGER_print;
Lev Walkinf15320b2004-06-03 03:38:44 +000016ber_type_decoder_f INTEGER_decode_ber;
17der_type_encoder_f INTEGER_encode_der;
Lev Walkind703ff42004-10-21 11:21:25 +000018xer_type_decoder_f INTEGER_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +000019xer_type_encoder_f INTEGER_encode_xer;
Lev Walkinf15320b2004-06-03 03:38:44 +000020
21/***********************************
22 * Some handy conversion routines. *
23 ***********************************/
24
25/*
26 * Returns 0 if it was possible to convert, -1 otherwise.
27 * -1/EINVAL: Mandatory argument missing
28 * -1/ERANGE: Value encoded is out of range for long representation
Lev Walkind703ff42004-10-21 11:21:25 +000029 * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()).
Lev Walkinf15320b2004-06-03 03:38:44 +000030 */
Lev Walkin5e033762004-09-29 13:26:15 +000031int asn_INTEGER2long(const INTEGER_t *i, long *l);
Lev Walkind703ff42004-10-21 11:21:25 +000032int asn_long2INTEGER(INTEGER_t *i, long l);
Lev Walkinf15320b2004-06-03 03:38:44 +000033
34#endif /* _INTEGER_H_ */