vlm | 785435b | 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 | |
| 8 | #include <constr_TYPE.h> |
| 9 | |
| 10 | typedef struct REAL { |
| 11 | uint8_t *buf; /* Buffer with REAL type encoding */ |
| 12 | int size; /* Size of the buffer */ |
| 13 | } REAL_t; |
| 14 | |
| 15 | extern asn1_TYPE_descriptor_t asn1_DEF_REAL; |
| 16 | |
| 17 | asn_struct_print_f REAL_print; |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 18 | xer_type_encoder_f REAL_encode_xer; |
vlm | 785435b | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 19 | |
| 20 | /*********************************** |
| 21 | * Some handy conversion routines. * |
| 22 | ***********************************/ |
| 23 | |
vlm | 39ba4c4 | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 24 | ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key); |
| 25 | |
vlm | 785435b | 2004-09-14 12:46:35 +0000 | [diff] [blame] | 26 | /* |
| 27 | * Convert between native double type and REAL representation (DER). |
| 28 | * RETURN VALUES: |
| 29 | * 0: Value converted successfully |
| 30 | * -1: An error occured while converting the value: invalid format. |
| 31 | */ |
| 32 | int asn1_REAL2double(const REAL_t *real_ptr, double *d); |
| 33 | int asn1_double2REAL(REAL_t *real_ptr, double d); |
| 34 | |
| 35 | #endif /* ASN_TYPE_REAL_H */ |