Harald Welte | 92c45f3 | 2010-06-12 18:59:38 +0200 | [diff] [blame] | 1 | /*- |
| 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 | |
| 8 | #include <asn_application.h> |
| 9 | #include <asn_codecs_prim.h> |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | typedef ASN__PRIMITIVE_TYPE_t REAL_t; |
| 16 | |
| 17 | extern asn_TYPE_descriptor_t asn_DEF_REAL; |
| 18 | |
| 19 | asn_struct_print_f REAL_print; |
| 20 | xer_type_decoder_f REAL_decode_xer; |
| 21 | xer_type_encoder_f REAL_encode_xer; |
Harald Welte | ec0e217 | 2010-07-20 00:03:44 +0200 | [diff] [blame] | 22 | per_type_decoder_f REAL_decode_uper; |
| 23 | per_type_encoder_f REAL_encode_uper; |
Harald Welte | 41b85d5 | 2015-08-31 08:56:53 +0200 | [diff] [blame] | 24 | per_type_decoder_f REAL_decode_aper; |
| 25 | per_type_encoder_f REAL_encode_aper; |
Harald Welte | 92c45f3 | 2010-06-12 18:59:38 +0200 | [diff] [blame] | 26 | |
| 27 | /*********************************** |
| 28 | * Some handy conversion routines. * |
| 29 | ***********************************/ |
| 30 | |
| 31 | ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key); |
| 32 | |
| 33 | /* |
| 34 | * Convert between native double type and REAL representation (DER). |
| 35 | * RETURN VALUES: |
| 36 | * 0: Value converted successfully |
| 37 | * -1: An error occured while converting the value: invalid format. |
| 38 | */ |
| 39 | int asn_REAL2double(const REAL_t *real_ptr, double *d); |
| 40 | int asn_double2REAL(REAL_t *real_ptr, double d); |
| 41 | |
| 42 | #ifdef __cplusplus |
| 43 | } |
| 44 | #endif |
| 45 | |
| 46 | #endif /* ASN_TYPE_REAL_H */ |