Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [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 | |
Lev Walkin | 11c3e17 | 2004-09-24 21:00:50 +0000 | [diff] [blame] | 8 | #include <asn_application.h> |
Lev Walkin | 3256d6f | 2004-10-21 11:22:12 +0000 | [diff] [blame] | 9 | #include <asn_codecs_prim.h> |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 10 | |
Lev Walkin | 21b41ac | 2005-07-24 09:03:44 +0000 | [diff] [blame] | 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
Lev Walkin | 8e8078a | 2004-09-26 13:10:40 +0000 | [diff] [blame] | 15 | typedef ASN__PRIMITIVE_TYPE_t REAL_t; |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 16 | |
Lev Walkin | 5e03376 | 2004-09-29 13:26:15 +0000 | [diff] [blame] | 17 | extern asn_TYPE_descriptor_t asn_DEF_REAL; |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 18 | |
| 19 | asn_struct_print_f REAL_print; |
Lev Walkin | 5f56091 | 2004-10-21 13:37:57 +0000 | [diff] [blame] | 20 | xer_type_decoder_f REAL_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 21 | xer_type_encoder_f REAL_encode_xer; |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 22 | per_type_decoder_f REAL_decode_uper; |
| 23 | per_type_encoder_f REAL_encode_uper; |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 24 | |
| 25 | /*********************************** |
| 26 | * Some handy conversion routines. * |
| 27 | ***********************************/ |
| 28 | |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 29 | ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key); |
| 30 | |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 31 | /* |
| 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 | */ |
Lev Walkin | 5e03376 | 2004-09-29 13:26:15 +0000 | [diff] [blame] | 37 | int asn_REAL2double(const REAL_t *real_ptr, double *d); |
| 38 | int asn_double2REAL(REAL_t *real_ptr, double d); |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 39 | |
Lev Walkin | 21b41ac | 2005-07-24 09:03:44 +0000 | [diff] [blame] | 40 | #ifdef __cplusplus |
| 41 | } |
| 42 | #endif |
| 43 | |
Lev Walkin | 41ba1f2 | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 44 | #endif /* ASN_TYPE_REAL_H */ |