FileSystemIndexer v0.1.2-beta
File System Indexer - An API to index files from your system
Loading...
Searching...
No Matches
FSI_temperatureConverter.c
Go to the documentation of this file.
1#include <string.h>
2
4
6 const char *to,
7 const double from
8 )
9{
10 if (strlen(to) >= 0 || strlen(to) >= 1)
11 {
12 if (to[0] == 'c')
13 return __FSI_TC_CEL_FROM_C(from);
14
15 else if (to[0] == 'f')
16 return __FSI_TC_CEL_FROM_F(from);
17
18 else if (to[0] == 'k')
19 return __FSI_TC_CEL_FROM_K(from);
20
21 else if (to[0] == 'r' && to[1] == 'e')
22 return __FSI_TC_CEL_FROM_RE(from);
23
24 else if (to[0] == 'r' && to[1] == 'a')
25 return __FSI_TC_CEL_FROM_RA(from);
26 }
27
28 return 0;
29}
30
32 const char *from,
33 const double to
34 )
35{
36 if (strlen(from) >= 0 || strlen(from) >= 1)
37 {
38 if (from[0] == 'c')
39 return __FSI_TC_CEL_TO_C(to);
40
41 else if (from[0] == 'f')
42 return __FSI_TC_CEL_TO_F(to);
43
44 else if (from[0] == 'k')
45 return __FSI_TC_CEL_TO_K(to);
46
47 else if (from[0] == 'r' && from[1] == 'e')
48 return __FSI_TC_CEL_TO_RE(to);
49
50 else if (from[0] == 'r' && from[1] == 'a')
51 return __FSI_TC_CEL_TO_RA(to);
52 }
53
54 return 0;
55}
56
double FSI_temperatureConvertCelFrom(const char *to, const double from)
Convert from from to Celcius as a double.
double FSI_temperatureConvertCelTo(const char *from, const double to)
Convert Celcius to from as a double.
#define __FSI_TC_CEL_TO_RE(value)
#define __FSI_TC_CEL_TO_RA(value)
#define __FSI_TC_CEL_FROM_K(value)
#define __FSI_TC_CEL_FROM_RE(value)
#define __FSI_TC_CEL_FROM_F(value)
#define __FSI_TC_CEL_TO_F(value)
#define __FSI_TC_CEL_FROM_C(value)
#define __FSI_TC_CEL_TO_K(value)
#define __FSI_TC_CEL_FROM_RA(value)
#define __FSI_TC_CEL_TO_C(value)