/*
* Copyright (C) 1993-2005 by Darren Reed.
* See the IPFILTER.LICENCE file for details on licencing.
*/
#include <ctype.h>
#include "ipf.h"
typedef struct variable {
char *v_name;
char *v_value;
} variable_t;
static char *expand_string __P((char *, int));
char *name;
{
variable_t *v;
return v;
return NULL;
}
int line;
{
char c, *s, *t, *value;
variable_t *v;
s = string;
if (*s == '{') {
s++;
for (t = s; *t != '\0'; t++)
if (*t == '}')
break;
if (*t == '\0') {
return NULL;
}
} else if (ISALPHA(*s)) {
for (t = s + 1; *t != '\0'; t++)
break;
} else {
line, *s);
return NULL;
}
*after = t;
c = *t;
*t = '\0';
v = find_var(s);
*t = c;
if (v == NULL) {
return NULL;
}
if (value != s)
free(s);
return value;
}
char *oldstring;
int line;
{
int len;
for (s = oldstring; *s != '\0'; s++)
if (*s == '$') {
*s = '\0';
s++;
switch (*s)
{
case '$' :
break;
default :
c = *s;
if (c == '\0')
return newstring;
return NULL;
return NULL;
p3++;
}
return NULL;
*(s - 1) = '\0';
break;
}
}
return newstring;
}
char *name;
char *value;
{
variable_t *v;
int len;
return;
if (v != NULL) {
return;
}
value++;
len -=2;
}
v = (variable_t *)malloc(sizeof(*v));
if (v == NULL)
return;
vtop = v;
}