|
Packit |
8480eb |
/* ----------------------------------------------------------------------- *
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* macros.h - header file for module to handle macro substitution
|
|
Packit |
8480eb |
* variables for map entries.
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* Copyright 2006 Ian Kent <raven@themaw.net>
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* This program is free software; you can redistribute it and/or modify
|
|
Packit |
8480eb |
* it under the terms of the GNU General Public License as published by
|
|
Packit |
8480eb |
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
|
|
Packit |
8480eb |
* USA; either version 2 of the License, or (at your option) any later
|
|
Packit |
8480eb |
* version; incorporated herein by reference.
|
|
Packit |
8480eb |
*
|
|
Packit |
8480eb |
* ----------------------------------------------------------------------- */
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#ifndef MACROS_H
|
|
Packit |
8480eb |
#define MACROS_H
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#define MAX_MACRO_STRING 128
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
struct substvar {
|
|
Packit |
8480eb |
char *def; /* Define variable */
|
|
Packit |
8480eb |
char *val; /* Value to replace with */
|
|
Packit |
8480eb |
unsigned int readonly; /* System vars are readonly */
|
|
Packit |
8480eb |
struct substvar *next;
|
|
Packit |
8480eb |
};
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
void macro_init(void);
|
|
Packit |
8480eb |
int macro_is_systemvar(const char *str, int len);
|
|
Packit |
8480eb |
int macro_global_addvar(const char *str, int len, const char *value);
|
|
Packit |
8480eb |
int macro_parse_globalvar(const char *define);
|
|
Packit |
8480eb |
void macro_lock(void);
|
|
Packit |
8480eb |
void macro_unlock(void);
|
|
Packit |
8480eb |
struct substvar *
|
|
Packit |
8480eb |
macro_addvar(struct substvar *table, const char *str, int len, const char *value);
|
|
Packit |
8480eb |
void macro_global_removevar(const char *str, int len);
|
|
Packit |
8480eb |
struct substvar *
|
|
Packit |
8480eb |
macro_removevar(struct substvar *table, const char *str, int len);
|
|
Packit |
8480eb |
void macro_free_global_table(void);
|
|
Packit |
8480eb |
void macro_free_table(struct substvar *table);
|
|
Packit |
8480eb |
const struct substvar *
|
|
Packit |
8480eb |
macro_findvar(const struct substvar *table, const char *str, int len);
|
|
Packit |
8480eb |
void macro_setenv(struct substvar *table);
|
|
Packit |
8480eb |
|
|
Packit |
8480eb |
#endif
|