Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
nf_utilities.h
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#ifndef nf_utilities_h_included
11#define nf_utilities_h_included
12
13#define _USE_MATH_DEFINES
14#include <stdio.h>
15#include <stdint.h>
16#include <string.h>
17#include <stdarg.h>
18#include <math.h>
19
21
22extern int nfu_SMR_libraryID;
23
24#ifdef __APPLE__
25#ifndef NFU_USEHEAP
26#define NFU_USEHEAP 1
27#endif
28#endif
29
30#define nf_floatToShortestString_trimZeros ( 1 << 0 )
31#define nf_floatToShortestString_keepPeriod ( 1 << 1 )
32#define nf_floatToShortestString_includeSign ( 1 << 2 )
33
34#if defined __cplusplus
35 extern "C" {
36#endif
37
64
65/*
66* Functions in nf_utilities.c
67*/
68int nfu_setup( void );
69double nfu_getNAN( void );
70int nfu_isNAN( double d );
71double nfu_getInfinity( double sign );
72const char *nfu_statusMessage( nfu_status status );
73void nfu_setMemoryDebugMode( int mode );
74void nfu_printMsg( char const *fmt, ... );
75void nfu_printErrorMsg( char const *fmt, ... );
76
77/*
78* These function are to be deleted when conversion to statusMessageReporting is completed.
79*/
80void *nfu_malloc( size_t size );
81void *nfu_calloc( size_t size, size_t n );
82void *nfu_realloc( size_t size, void *old );
83void *nfu_free( void *p );
84/*
85* Functions in nf_stringToInt32s.c
86*/
87int32_t *nfu_stringToListOfInt32s( statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, char **endCharacter );
88int nfu_stringToInt32( statusMessageReporting *smr, char const *str, char **endCharacter, int32_t *value );
89/*
90* Functions in nf_stringToDoubles.c
91*/
92double *nfu_stringToListOfDoubles( statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted,
93 char **endCharacter, int useSystem_strtod );
94double nf_strtod( char const *ptr, char **endCharacter );
95char *nf_floatToShortestString( double value, int significantDigits, int favorEFormBy, int flags );
96
97#if defined __cplusplus
98 }
99#endif
100
101#endif /* End of nf_utilities_h_included. */
double * nfu_stringToListOfDoubles(statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, char **endCharacter, int useSystem_strtod)
int nfu_isNAN(double d)
nfu_status_e
@ nfu_unsupportedInterpolation
@ nfu_domainsNotMutual
@ nfu_XNotAscending
@ nfu_invalidInterpolation
@ nfu_Okay
@ nfu_badSelf
@ nfu_badLogValue
@ nfu_oddNumberOfValues
@ nfu_mallocError
@ nfu_insufficientMemory
@ nfu_flatInterpolation
@ nfu_badNorm
@ nfu_badIntegrationInput
@ nfu_XOutsideDomain
@ nfu_badIndex
@ nfu_failedToConverge
@ nfu_tooFewPoints
@ nfu_unsupportedInterpolationConversion
@ nfu_badInput
@ nfu_badIndexForX
@ nfu_Error
@ nfu_empty
@ nfu_divByZero
@ nfu_otherInterpolation
void nfu_setMemoryDebugMode(int mode)
void nfu_printMsg(char const *fmt,...)
enum nfu_status_e nfu_status
void * nfu_free(void *p)
void * nfu_realloc(size_t size, void *old)
void * nfu_calloc(size_t size, size_t n)
double nfu_getInfinity(double sign)
void nfu_printErrorMsg(char const *fmt,...)
void * nfu_malloc(size_t size)
int nfu_SMR_libraryID
const char * nfu_statusMessage(nfu_status status)
int32_t * nfu_stringToListOfInt32s(statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, char **endCharacter)
double nf_strtod(char const *ptr, char **endCharacter)
double nfu_getNAN(void)
int nfu_setup(void)
char * nf_floatToShortestString(double value, int significantDigits, int favorEFormBy, int flags)
int nfu_stringToInt32(statusMessageReporting *smr, char const *str, char **endCharacter, int32_t *value)