blob: 45259e239a43a76b8e05a07f866febd10e0d94a4 [file] [log] [blame]
vlmfa67ddc2004-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
vlmd1579582004-09-24 21:00:50 +00008#include <asn_application.h>
vlma4799a62004-10-21 11:21:25 +00009#include <asn_codecs_prim.h>
vlmfa67ddc2004-06-03 03:38:44 +000010
vlm6678cb12004-09-26 13:10:40 +000011typedef ASN__PRIMITIVE_TYPE_t INTEGER_t;
vlmfa67ddc2004-06-03 03:38:44 +000012
vlmef6355b2004-09-29 13:26:15 +000013extern asn_TYPE_descriptor_t asn_DEF_INTEGER;
vlmfa67ddc2004-06-03 03:38:44 +000014
vlm39ba4c42004-09-22 16:06:28 +000015asn_struct_print_f INTEGER_print;
vlmfa67ddc2004-06-03 03:38:44 +000016ber_type_decoder_f INTEGER_decode_ber;
17der_type_encoder_f INTEGER_encode_der;
vlma4799a62004-10-21 11:21:25 +000018xer_type_decoder_f INTEGER_decode_xer;
vlm39ba4c42004-09-22 16:06:28 +000019xer_type_encoder_f INTEGER_encode_xer;
vlmfa67ddc2004-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
vlma4799a62004-10-21 11:21:25 +000029 * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()).
vlmfa67ddc2004-06-03 03:38:44 +000030 */
vlmef6355b2004-09-29 13:26:15 +000031int asn_INTEGER2long(const INTEGER_t *i, long *l);
vlma4799a62004-10-21 11:21:25 +000032int asn_long2INTEGER(INTEGER_t *i, long l);
vlmfa67ddc2004-06-03 03:38:44 +000033
34#endif /* _INTEGER_H_ */