[17] | 1 | /* -*- mode: C; tab-width:8; c-basic-offset:8 -*- |
---|
| 2 | * vi:set ts=8: |
---|
| 3 | * |
---|
| 4 | * al_config.h |
---|
| 5 | * |
---|
| 6 | * Prototypes, macros and definitions related to the input and parsing of |
---|
| 7 | * config state. |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | #ifndef AL_CONFIG_H_ |
---|
| 11 | #define AL_CONFIG_H_ |
---|
| 12 | |
---|
| 13 | #include <AL/al.h> |
---|
| 14 | |
---|
| 15 | #include "al_rctree.h" |
---|
| 16 | #include "al_rcvar.h" |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * Parse the openalrc config file, if any. Returns AL_TRUE if one was found |
---|
| 20 | * and contained valid openalrc syntax, AL_FALSE otherwise. |
---|
| 21 | */ |
---|
| 22 | ALboolean _alParseConfig( void ); |
---|
| 23 | |
---|
| 24 | /* |
---|
| 25 | * Deallocate the memory reserved in the call to _alParseConfig, as well as |
---|
| 26 | * any alrc objects that have been created since that point. |
---|
| 27 | */ |
---|
| 28 | void _alDestroyConfig( void ); |
---|
| 29 | |
---|
| 30 | /* |
---|
| 31 | * If str names an existing alrc symbol, and type matches the type of that |
---|
| 32 | * symbol, *retref is populated with the value of that symbol and this call |
---|
| 33 | * returns AL_TRUE. Otherwise, AL_FALSE is returned. |
---|
| 34 | * |
---|
| 35 | * NOTE: future revisions should replace this with a call to rc_lookup. |
---|
| 36 | */ |
---|
| 37 | ALboolean _alGetGlobalScalar( const char *str, |
---|
| 38 | ALRcEnum type, |
---|
| 39 | void *retref ); |
---|
| 40 | |
---|
| 41 | /* |
---|
| 42 | * If str names an existing alrc symbol, return a pointer to the value |
---|
| 43 | * associated with that symbol. Otherwise, return NULL. |
---|
| 44 | * |
---|
| 45 | */ |
---|
| 46 | AL_rctree *_alGlobalBinding( const char *str ); |
---|
| 47 | |
---|
| 48 | /* |
---|
| 49 | * Evaluate an alrc expression (expression), returning result. |
---|
| 50 | */ |
---|
| 51 | AL_rctree *_alEvalStr( const char *expression ); |
---|
| 52 | |
---|
| 53 | /* |
---|
| 54 | * Bind a symbol, named by symname, to the evaluation of value. |
---|
| 55 | */ |
---|
| 56 | AL_rctree *_alDefine( const char *symname, AL_rctree *value ); |
---|
| 57 | |
---|
| 58 | /* |
---|
| 59 | * Create and return a cons cell, with the car section pointing to ls1 and the |
---|
| 60 | * cdr section pointing to ls2. |
---|
| 61 | */ |
---|
| 62 | AL_rctree *alrc_cons( AL_rctree *ls1, AL_rctree *ls2 ); |
---|
| 63 | |
---|
| 64 | /* |
---|
| 65 | * Return the car section of the cons cell named by ls, or NULL if ls is not a |
---|
| 66 | * cons cell. |
---|
| 67 | */ |
---|
| 68 | AL_rctree *alrc_car( AL_rctree *ls ); |
---|
| 69 | |
---|
| 70 | /* |
---|
| 71 | * Return the cdr section of the cons cell named by ls, or NULL if ls is not a |
---|
| 72 | * cons cell. |
---|
| 73 | */ |
---|
| 74 | AL_rctree *alrc_cdr( AL_rctree *ls ); |
---|
| 75 | |
---|
| 76 | /* |
---|
| 77 | * scmtrue is returned by some of the rc_ functions. It is probably advised |
---|
| 78 | * to remove it. |
---|
| 79 | */ |
---|
| 80 | extern const AL_rctree scmtrue; |
---|
| 81 | |
---|
| 82 | #endif /* AL_CONFIG_H_ */ |
---|