blob: bd59799405a5c43ed105260f68c971ef30160ce1 [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 Walkin8e8078a2004-09-26 13:10:40 +00009#include <ber_codec_prim.h>
Lev Walkin41ba1f22004-09-14 12:46:35 +000010
Lev Walkin8e8078a2004-09-26 13:10:40 +000011typedef ASN__PRIMITIVE_TYPE_t REAL_t;
Lev Walkin41ba1f22004-09-14 12:46:35 +000012
Lev Walkin5e033762004-09-29 13:26:15 +000013extern asn_TYPE_descriptor_t asn_DEF_REAL;
Lev Walkin41ba1f22004-09-14 12:46:35 +000014
15asn_struct_print_f REAL_print;
Lev Walkina9cc46e2004-09-22 16:06:28 +000016xer_type_encoder_f REAL_encode_xer;
Lev Walkin41ba1f22004-09-14 12:46:35 +000017
18/***********************************
19 * Some handy conversion routines. *
20 ***********************************/
21
Lev Walkina9cc46e2004-09-22 16:06:28 +000022ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key);
23
Lev Walkin41ba1f22004-09-14 12:46:35 +000024/*
25 * Convert between native double type and REAL representation (DER).
26 * RETURN VALUES:
27 * 0: Value converted successfully
28 * -1: An error occured while converting the value: invalid format.
29 */
Lev Walkin5e033762004-09-29 13:26:15 +000030int asn_REAL2double(const REAL_t *real_ptr, double *d);
31int asn_double2REAL(REAL_t *real_ptr, double d);
Lev Walkin41ba1f22004-09-14 12:46:35 +000032
33#endif /* ASN_TYPE_REAL_H */