blob: 6c26ef11864589775007d0acc85f015c133441be [file] [log] [blame]
Lev Walkin41ba1f22004-09-14 12:46:35 +00001/*-
2 * Copyright (c) 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5#ifndef ASN_TYPE_REAL_H
6#define ASN_TYPE_REAL_H
7
Lev Walkin11c3e172004-09-24 21:00:50 +00008#include <asn_application.h>
Lev Walkin3256d6f2004-10-21 11:22:12 +00009#include <asn_codecs_prim.h>
Lev Walkin41ba1f22004-09-14 12:46:35 +000010
Lev Walkin21b41ac2005-07-24 09:03:44 +000011#ifdef __cplusplus
12extern "C" {
13#endif
14
Lev Walkin8e8078a2004-09-26 13:10:40 +000015typedef ASN__PRIMITIVE_TYPE_t REAL_t;
Lev Walkin41ba1f22004-09-14 12:46:35 +000016
Lev Walkin5e033762004-09-29 13:26:15 +000017extern asn_TYPE_descriptor_t asn_DEF_REAL;
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +080018extern asn_TYPE_operation_t asn_OP_REAL;
Lev Walkin41ba1f22004-09-14 12:46:35 +000019
20asn_struct_print_f REAL_print;
Lev Walkincd2f48e2017-08-10 02:14:59 -070021asn_struct_compare_f REAL_compare;
Lev Walkin5f560912004-10-21 13:37:57 +000022xer_type_decoder_f REAL_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +000023xer_type_encoder_f REAL_encode_xer;
Lev Walkin725883b2006-10-09 12:07:58 +000024per_type_decoder_f REAL_decode_uper;
25per_type_encoder_f REAL_encode_uper;
Lev Walkina5972be2017-09-29 23:15:58 -070026asn_random_fill_f REAL_random_fill;
Lev Walkin41ba1f22004-09-14 12:46:35 +000027
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080028#define REAL_free ASN__PRIMITIVE_TYPE_free,
29#define REAL_constraint asn_generic_no_constraint
30#define REAL_decode_ber ber_decode_primitive
31#define REAL_encode_der der_encode_primitive
32
Lev Walkin41ba1f22004-09-14 12:46:35 +000033/***********************************
34 * Some handy conversion routines. *
35 ***********************************/
36
Lev Walkina9cc46e2004-09-22 16:06:28 +000037ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key);
38
Lev Walkin41ba1f22004-09-14 12:46:35 +000039/*
40 * Convert between native double type and REAL representation (DER).
41 * RETURN VALUES:
42 * 0: Value converted successfully
43 * -1: An error occured while converting the value: invalid format.
44 */
Lev Walkin5e033762004-09-29 13:26:15 +000045int asn_REAL2double(const REAL_t *real_ptr, double *d);
46int asn_double2REAL(REAL_t *real_ptr, double d);
Lev Walkin41ba1f22004-09-14 12:46:35 +000047
Lev Walkin21b41ac2005-07-24 09:03:44 +000048#ifdef __cplusplus
49}
50#endif
51
Lev Walkin41ba1f22004-09-14 12:46:35 +000052#endif /* ASN_TYPE_REAL_H */