blob: af3e84cceba974de7e7bc317c40d78259881ba84 [file] [log] [blame]
vlm785435b2004-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
vlmd1579582004-09-24 21:00:50 +00008#include <asn_application.h>
vlm3b6e1122004-10-21 11:22:12 +00009#include <asn_codecs_prim.h>
vlm785435b2004-09-14 12:46:35 +000010
vlm3a417582005-07-24 09:03:44 +000011#ifdef __cplusplus
12extern "C" {
13#endif
14
vlm6678cb12004-09-26 13:10:40 +000015typedef ASN__PRIMITIVE_TYPE_t REAL_t;
vlm785435b2004-09-14 12:46:35 +000016
vlmef6355b2004-09-29 13:26:15 +000017extern asn_TYPE_descriptor_t asn_DEF_REAL;
vlm785435b2004-09-14 12:46:35 +000018
19asn_struct_print_f REAL_print;
vlmcce2ddb2004-10-21 13:37:57 +000020xer_type_decoder_f REAL_decode_xer;
vlm39ba4c42004-09-22 16:06:28 +000021xer_type_encoder_f REAL_encode_xer;
vlm86380d32006-10-09 12:07:58 +000022per_type_decoder_f REAL_decode_uper;
23per_type_encoder_f REAL_encode_uper;
vlm785435b2004-09-14 12:46:35 +000024
25/***********************************
26 * Some handy conversion routines. *
27 ***********************************/
28
vlm39ba4c42004-09-22 16:06:28 +000029ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key);
30
vlm785435b2004-09-14 12:46:35 +000031/*
32 * Convert between native double type and REAL representation (DER).
33 * RETURN VALUES:
34 * 0: Value converted successfully
35 * -1: An error occured while converting the value: invalid format.
36 */
vlmef6355b2004-09-29 13:26:15 +000037int asn_REAL2double(const REAL_t *real_ptr, double *d);
38int asn_double2REAL(REAL_t *real_ptr, double d);
vlm785435b2004-09-14 12:46:35 +000039
vlm3a417582005-07-24 09:03:44 +000040#ifdef __cplusplus
41}
42#endif
43
vlm785435b2004-09-14 12:46:35 +000044#endif /* ASN_TYPE_REAL_H */