blob: 751000b8fb7d2b6fa2ffcfe58db5ab53a03cd66b [file] [log] [blame]
Lev Walkin41ba1f22004-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
8#include <constr_TYPE.h>
9
10typedef struct REAL {
11 uint8_t *buf; /* Buffer with REAL type encoding */
12 int size; /* Size of the buffer */
13} REAL_t;
14
15extern asn1_TYPE_descriptor_t asn1_DEF_REAL;
16
17asn_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 */
29int asn1_REAL2double(const REAL_t *real_ptr, double *d);
30int asn1_double2REAL(REAL_t *real_ptr, double d);
31
32#endif /* ASN_TYPE_REAL_H */