1 /* 2 Copyright (C) 2017-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: dk4mao8dns.ctr 12 */ 13 14 #ifndef DK4MAO8DNS_H_INCLUDED 15 /** Avoid multiple inclusions. */ 16 #define DK4MAO8DNS_H_INCLUDED 1 17 18 19 20 /** @file dk4mao8dns.h Print double without scientific notation. 21 22 The dk4ma_write_c8_double_no_sci_to_stream() function is intended to write 23 coordinates to PDF, PS and EPS output. 24 25 In contrast to the dk4c8dbl_double_to_stream() function from the dk4c8dbl 26 this function uses parameter eps to print 0 instead of 27 very small absolute values. 28 29 This module is in the libdk4c library, not libdk4maio8d, as it uses 30 the dk4_stream_t data type and related functions. 31 32 */ 33 34 #ifndef DK4CONF_H_INCLUDED 35 #if DK4_BUILDING_DKTOOLS4 36 #include "dk4conf.h" 37 #else 38 #include <dktools-4/dk4conf.h> 39 #endif 40 #endif 41 42 #ifndef DK4TYPES_H_INCLUDED 43 #if DK4_BUILDING_DKTOOLS4 44 #include <libdk4base/dk4types.h> 45 #else 46 #include <dktools-4/dk4types.h> 47 #endif 48 #endif 49 50 #ifndef DK4ERROR_H_INCLUDED 51 #if DK4_BUILDING_DKTOOLS4 52 #include <libdk4base/dk4error.h> 53 #else 54 #include <dktools-4/dk4error.h> 55 #endif 56 #endif 57 58 #ifndef DK4STRM_H_INCLUDED 59 #if DK4_BUILDING_DKTOOLS4 60 #include <libdk4c/dk4strm.h> 61 #else 62 #include <dktools-4/dk4strm.h> 63 #endif 64 #endif 65 66 #ifndef STDLIB_H_INCLUDED 67 #include <stdlib.h> 68 #define STDLIB_H_INCLUDED 1 69 #endif 70 71 #ifdef __cplusplus 72 extern "C" { 73 #endif 74 75 /** Write a double value stored in a buffer to a stream, avoid 76 scientific notation. 77 @param strm Stream to write to. 78 @param buf Buffer containing string representation of double value. 79 The buffer contents is modified and probably 80 damaged during operation. 81 @param erp Error report, may be NULL. 82 @return 1 on success, 0 on error. 83 84 Error codes: 85 - DK4_E_INVALID_ARGUMENTS<br> 86 if strm or buf is NULL, 87 - DK4_E_WRITE_FAILED<br> 88 if writing one ore multiple bytes to the stream failed, 89 - DK4_E_FLUSH_FAILED<br> 90 if flushing data downwards failed, 91 - DK4_E_MATH_OVERFLOW<br> 92 if the exponent is out of range for integer values,<br> 93 - DK4_E_SYNTAX<br> 94 if input contains invalid characters. 95 */ 96 int 97 dk4ma_write_c8_double_string_no_sci_to_stream( 98 dk4_stream_t *strm, 99 char *buf, 100 dk4_er_t *erp 101 ); 102 103 /** Write double value to stream, avoid scientific notation. 104 @param strm Stream to write to. 105 @param v Value to write. 106 @param eps Epsilon (values below epsilon are written as 0). 107 @param ex Flag: Use exact representation. 108 @param min Minimize text representation. 109 @param erp Error report, may be NULL. 110 @return 1 on success, 0 on error. 111 112 Error codes: 113 - DK4_E_INVALID_ARGUMENTS<br> 114 if strm is NULL. 115 - DK4_E_WRITE_FAILED<br> 116 if writing one ore multiple bytes to the stream failed, 117 - DK4_E_FLUSH_FAILED<br> 118 if flushing data downwards failed, 119 - DK4_E_MATH_OVERFLOW<br> 120 if the exponent is out of range for integer values,<br> 121 - DK4_E_SYNTAX<br> 122 if input contains invalid characters. 123 */ 124 int 125 dk4ma_write_c8_double_no_sci_to_stream( 126 dk4_stream_t *strm, 127 double v, 128 double eps, 129 int ex, 130 int min, 131 dk4_er_t *erp 132 ); 133 134 #ifdef __cplusplus 135 } 136 #endif 137 138 139 /* vim: set ai sw=4 ts=4 : */ 140 141 142 #endif 143