Allow wpp users to undefine previously defined symbols.
This commit is contained in:
parent
8794935e12
commit
c7a3480223
|
@ -99,7 +99,7 @@ char *pp_xstrdup(const char *str)
|
|||
}
|
||||
|
||||
/* Don't comment on the hash, its primitive but functional... */
|
||||
int pphash(char *str)
|
||||
static int pphash(const char *str)
|
||||
{
|
||||
int sum = 0;
|
||||
while(*str)
|
||||
|
@ -107,7 +107,7 @@ int pphash(char *str)
|
|||
return sum % HASHKEY;
|
||||
}
|
||||
|
||||
pp_entry_t *pplookup(char *ident)
|
||||
pp_entry_t *pplookup(const char *ident)
|
||||
{
|
||||
int idx = pphash(ident);
|
||||
pp_entry_t *ppp;
|
||||
|
@ -120,7 +120,7 @@ pp_entry_t *pplookup(char *ident)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void pp_del_define(char *name)
|
||||
void pp_del_define(const char *name)
|
||||
{
|
||||
int idx;
|
||||
pp_entry_t *ppp;
|
||||
|
|
|
@ -58,6 +58,13 @@ void wpp_add_define( const char *name, const char *value )
|
|||
}
|
||||
|
||||
|
||||
/* undefine a previously added definition */
|
||||
void wpp_del_define( const char *value )
|
||||
{
|
||||
pp_del_define( value );
|
||||
}
|
||||
|
||||
|
||||
/* add a command-line define of the form NAME=VALUE */
|
||||
void wpp_add_cmdline_define( const char *value )
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
extern void wpp_add_define( const char *name, const char *value );
|
||||
extern void wpp_del_define( const char *name );
|
||||
extern void wpp_add_cmdline_define( const char *value );
|
||||
extern void wpp_set_debug( int lex_debug, int parser_debug, int msg_debug );
|
||||
extern void wpp_set_pedantic( int on );
|
||||
|
|
|
@ -194,10 +194,10 @@ typedef struct cval {
|
|||
void *pp_xmalloc(size_t);
|
||||
void *pp_xrealloc(void *, size_t);
|
||||
char *pp_xstrdup(const char *str);
|
||||
pp_entry_t *pplookup(char *ident);
|
||||
pp_entry_t *pplookup(const char *ident);
|
||||
pp_entry_t *pp_add_define(char *def, char *text);
|
||||
pp_entry_t *pp_add_macro(char *ident, marg_t *args[], int nargs, mtext_t *exp);
|
||||
void pp_del_define(char *name);
|
||||
void pp_del_define(const char *name);
|
||||
FILE *pp_open_include(const char *name, int search, char **newpath);
|
||||
void pp_push_if(pp_if_state_t s);
|
||||
void pp_next_if_state(int);
|
||||
|
|
Loading…
Reference in New Issue