| 1 |
/* ----------------------------------------------------------------------- * |
| 2 |
* |
| 3 |
* macros.h - header file for module to handle macro substitution |
| 4 |
* variables for map entries. |
| 5 |
* |
| 6 |
* Copyright 2006 Ian Kent <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, |
| 11 |
* USA; either version 2 of the License, or (at your option) any later |
| 12 |
* version; incorporated herein by reference. |
| 13 |
* |
| 14 |
* ----------------------------------------------------------------------- */ |
| 15 |
|
| 16 |
#ifndef MACROS_H |
| 17 |
#define MACROS_H |
| 18 |
|
| 19 |
#define MAX_MACRO_STRING 128 |
| 20 |
|
| 21 |
struct substvar { |
| 22 |
char *def; /* Define variable */ |
| 23 |
char *val; /* Value to replace with */ |
| 24 |
unsigned int readonly; /* System vars are readonly */ |
| 25 |
struct substvar *next; |
| 26 |
}; |
| 27 |
|
| 28 |
void macro_init(void); |
| 29 |
int macro_is_systemvar(const char *str, int len); |
| 30 |
int macro_global_addvar(const char *str, int len, const char *value); |
| 31 |
int macro_parse_globalvar(const char *define); |
| 32 |
void macro_lock(void); |
| 33 |
void macro_unlock(void); |
| 34 |
struct substvar * |
| 35 |
macro_addvar(struct substvar *table, const char *str, int len, const char *value); |
| 36 |
void macro_global_removevar(const char *str, int len); |
| 37 |
struct substvar * |
| 38 |
macro_removevar(struct substvar *table, const char *str, int len); |
| 39 |
void macro_free_global_table(void); |
| 40 |
void macro_free_table(struct substvar *table); |
| 41 |
const struct substvar * |
| 42 |
macro_findvar(const struct substvar *table, const char *str, int len); |
| 43 |
void macro_setenv(struct substvar *table); |
| 44 |
|
| 45 |
#endif |