-
Notifications
You must be signed in to change notification settings - Fork 0
/
ini_file.h
executable file
·46 lines (33 loc) · 1.13 KB
/
ini_file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef INI_FILE_H
#define INI_FILE_H
/* this module is part of dsnav, a piece of software intended to communicate with n456, a linux based command processor
that communicates with custom digital ranger boards
the initial configuration of this software was developed on April 10, 2008, by Jonathan Howland
Woods Hole Oceanographic Institution
Deep Submergence Laboratory
508-289-2653
*/
#include <stdio.h>
#define MAX_CHARACTER_COUNT 128
#define BAD_INI_FILE_READ -2000
#define GOOD_INI_FILE_READ 2000
#define INI_FILE_FALSE 0
class IniFile
{
public:
IniFile();
int open_ini(char *file_name);
void close_ini();
int read_int(const char *section, const char *attribute, int default_int);
int read_HexInt(const char *section, const char *attribute, int default_int);
double read_double(const char *section, const char *item, double default_double);
char *read_string(const char *section, const char *item, const char *default_string);
void setFD(FILE *fd);
FILE *getFD();
char *getFilename();
private:
FILE *fd;
char *fileName;
};
#endif