source: libcfa/src/parseconfig.hfa @ eb2413d3

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
3struct config_entry {
4        const char * key;
5        void * variable;
6        bool (*parse)(const char *, void *);
7};
8
9static inline void ?{}( config_entry & this ) {}
10
11forall(T & | { bool parse(const char *, T & ); })
12static 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
18forall(T &)
19static 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
25void 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.