FileSystemIndexer v0.1.2-beta
File System Indexer - An API to index files from your system
Loading...
Searching...
No Matches
FSI_temperatureConverter.c File Reference
Include dependency graph for FSI_temperatureConverter.c:

Go to the source code of this file.

Functions

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.

Function Documentation

◆ FSI_temperatureConvertCelFrom()

double FSI_temperatureConvertCelFrom ( const char * to,
const double from )

Convert from from to Celcius as a double.

Parameters
fromThe value of the temperature
toFrom celcius to the temperature
Returns
The exact converted temperature

Definition at line 5 of file FSI_temperatureConverter.c.

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}
#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_FROM_C(value)
#define __FSI_TC_CEL_FROM_RA(value)

References __FSI_TC_CEL_FROM_C, __FSI_TC_CEL_FROM_F, __FSI_TC_CEL_FROM_K, __FSI_TC_CEL_FROM_RA, and __FSI_TC_CEL_FROM_RE.

Referenced by fsi::modules::tc::convertFrom(), and main().

Here is the caller graph for this function:

◆ FSI_temperatureConvertCelTo()

double FSI_temperatureConvertCelTo ( const char * from,
const double to )

Convert Celcius to from as a double.

Parameters
fromConvert to from celcius
toThe value of the temperature
Returns
The exact converted temperature

Definition at line 31 of file FSI_temperatureConverter.c.

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}
#define __FSI_TC_CEL_TO_RE(value)
#define __FSI_TC_CEL_TO_RA(value)
#define __FSI_TC_CEL_TO_F(value)
#define __FSI_TC_CEL_TO_K(value)
#define __FSI_TC_CEL_TO_C(value)

References __FSI_TC_CEL_TO_C, __FSI_TC_CEL_TO_F, __FSI_TC_CEL_TO_K, __FSI_TC_CEL_TO_RA, and __FSI_TC_CEL_TO_RE.

Referenced by fsi::modules::tc::convertTo(), and main().

Here is the caller graph for this function: