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 | |
| 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; |
| 18 | |
| 19 | /*********************************** |
| 20 | * Some handy conversion routines. * |
| 21 | ***********************************/ |
| 22 | |
| 23 | /* |
| 24 | * Convert between native double type and REAL representation (DER). |
| 25 | * RETURN VALUES: |
| 26 | * 0: Value converted successfully |
| 27 | * -1: An error occured while converting the value: invalid format. |
| 28 | */ |
| 29 | int asn1_REAL2double(const REAL_t *real_ptr, double *d); |
| 30 | int asn1_double2REAL(REAL_t *real_ptr, double d); |
| 31 | |
| 32 | #endif /* ASN_TYPE_REAL_H */ |