blob: 83f96d019c1e1c8c76d04e34db03697e159fc8d5 [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;
Lev Walkina9cc46e2004-09-22 16:06:28 +000018xer_type_encoder_f REAL_encode_xer;
Lev Walkin41ba1f22004-09-14 12:46:35 +000019
20/***********************************
21 * Some handy conversion routines. *
22 ***********************************/
23
Lev Walkina9cc46e2004-09-22 16:06:28 +000024ssize_t REAL__dump(double d, int canonical, asn_app_consume_bytes_f *cb, void *app_key);
25
Lev Walkin41ba1f22004-09-14 12:46:35 +000026/*
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 */
32int asn1_REAL2double(const REAL_t *real_ptr, double *d);
33int asn1_double2REAL(REAL_t *real_ptr, double d);
34
35#endif /* ASN_TYPE_REAL_H */