ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationpthread-emulationqualifiedEnum
Last change
on this file since eb2413d3 was
eb2413d3,
checked in by Jacob Prud'homme <jafprudhomme@…>, 3 years ago
|
Removed old config parameters
|
-
Property mode set to
100644
|
File size:
814 bytes
|
Line | |
---|
1 | #pragma once |
---|
2 | |
---|
3 | struct config_entry { |
---|
4 | const char * key; |
---|
5 | void * variable; |
---|
6 | bool (*parse)(const char *, void *); |
---|
7 | }; |
---|
8 | |
---|
9 | static inline void ?{}( config_entry & this ) {} |
---|
10 | |
---|
11 | forall(T & | { bool parse(const char *, T & ); }) |
---|
12 | static inline void ?{}( config_entry & this, const char * key, T & variable ) { |
---|
13 | this.key = key; |
---|
14 | this.variable = (void *)&variable; |
---|
15 | this.parse = (bool (*)(const char *, void *))parse; |
---|
16 | } |
---|
17 | |
---|
18 | forall(T &) |
---|
19 | static inline void ?{}( config_entry & this, const char * key, T & variable, bool (*parse)(const char *, T &) ) { |
---|
20 | this.key = key; |
---|
21 | this.variable = (void *)&variable; |
---|
22 | this.parse = (bool (*)(const char *, void *))parse; |
---|
23 | } |
---|
24 | |
---|
25 | void parse_config( const char * config_file, config_entry entries[], size_t num_entries ); |
---|
26 | |
---|
27 | // Local Variables: // |
---|
28 | // mode: c // |
---|
29 | // tab-width: 4 // |
---|
30 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.