-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgwypini.h
82 lines (62 loc) · 3.8 KB
/
gwypini.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*----------------------------------------------------------------------
| gwini.h
|
| This file contains the headers and definitions that are used to implement
| reading and writing "INI" files. These routines were developed over many years
| for prime95, so there are several routines that are not used by gwnum.
|
| NOTE: These routines only work if you open no more than 10 ini files. Also,
| you must not change the working directory at any time during program execution.
|
| ALSO NOTE: Sorry, memory allocation errors are not handled properly and
| documentation is incredibly poor.
|
| Copyright 2016-2017 Mersenne Research, Inc. All rights reserved.
+---------------------------------------------------------------------*/
#ifndef _GWINI_H
#define _GWINI_H
/* This is a C library. If used in a C++ program, don't let the C++ */
/* compiler mangle names. */
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* INI file Routines *
******************************************************************************/
void IniGetString (const char *, const char *, char *, unsigned int, const char *);
void IniSectionGetString (const char *, const char *, const char *, char *, unsigned int, const char *);
void IniGetNthString (const char *, const char *, int, char *, unsigned int, const char *);
void IniSectionGetNthString (const char *, const char *, const char *, int, char *, unsigned int, const char *);
void IniGetTimedString (const char *, const char *, char *, unsigned int, const char *, unsigned int *);
void IniSectionGetTimedString (const char *, const char *, const char *, char *, unsigned int, const char *, unsigned int *);
void IniSectionGetNthTimedString (const char *, const char *, const char *, int, char *, unsigned int, const char *, unsigned int *);
long IniGetInt (const char *, const char *, long);
long IniSectionGetInt (const char *, const char *, const char *, long);
long IniGetTimedInt (const char *, const char *, long, unsigned int *);
long IniSectionGetTimedInt (const char *, const char *, const char *, long, unsigned int *);
float IniGetFloat (const char *, const char *, float);
float IniSectionGetFloat (const char *, const char *, const char *, float);
float IniGetTimedFloat (const char *, const char *, float, unsigned int *);
float IniSectionGetTimedFloat (const char *, const char *, const char *, float, unsigned int *);
void IniWriteString (const char *, const char *, const char *);
void IniSectionWriteString (const char *, const char *, const char *, const char *);
void IniWriteNthString (const char *, const char *, int, const char *);
void IniSectionWriteNthString (const char *, const char *, const char *, int, const char *);
void IniWriteInt (const char *, const char *, long);
void IniSectionWriteInt (const char *, const char *, const char *, long);
void IniWriteFloat (const char *, const char *, float);
void IniSectionWriteFloat (const char *, const char *, const char *, float);
/* More obscure INI file routines */
void IniDelayWrites (const char *);
void IniResumeImmediateWrites (const char *);
extern void (*INI_ERROR_CALLBACK)(const char *, int, const char *); /* Callback routine when illegal line read from INI file. */
/* Arguments are file name, line number, text on the line. */
#define IniSetErrorCallback(n) (INI_ERROR_CALLBACK = n)
void IniFileReread (const char *); /* Force the INI file to be re-read from disk */
void IniAddFileMerge (const char *, const char *, const char *); /* Merge one INI file into another. Prime95 calls these .add files */
const char *IniSectionGetStringRaw (const char *, const char *, const char *);
const char *IniSectionGetNthStringRaw (const char *, const char *, const char *, int);
#ifdef __cplusplus
}
#endif
#endif