Skip to content
Snippets Groups Projects
Commit c7a34802 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard
Browse files

Allow wpp users to undefine previously defined symbols.

parent 8794935e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment