2003-07-14 22:19:11 +04:00
|
|
|
|
/* $NetBSD: for.c,v 1.14 2003/07/14 18:19:12 christos Exp $ */
|
1995-06-14 19:18:37 +04:00
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 1992, The Regents of the University of California.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
|
* without specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
1997-09-28 07:30:58 +04:00
|
|
|
|
#ifdef MAKE_BOOTSTRAP
|
2003-07-14 22:19:11 +04:00
|
|
|
|
static char rcsid[] = "$NetBSD: for.c,v 1.14 2003/07/14 18:19:12 christos Exp $";
|
1997-09-28 07:30:58 +04:00
|
|
|
|
#else
|
1997-07-02 01:17:00 +04:00
|
|
|
|
#include <sys/cdefs.h>
|
1994-03-05 03:34:29 +03:00
|
|
|
|
#ifndef lint
|
1995-06-14 19:18:37 +04:00
|
|
|
|
#if 0
|
1996-11-06 20:58:58 +03:00
|
|
|
|
static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93";
|
1995-06-14 19:18:37 +04:00
|
|
|
|
#else
|
2003-07-14 22:19:11 +04:00
|
|
|
|
__RCSID("$NetBSD: for.c,v 1.14 2003/07/14 18:19:12 christos Exp $");
|
1995-06-14 19:18:37 +04:00
|
|
|
|
#endif
|
1994-03-05 03:34:29 +03:00
|
|
|
|
#endif /* not lint */
|
1997-09-28 07:30:58 +04:00
|
|
|
|
#endif
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
|
|
/*-
|
|
|
|
|
* for.c --
|
|
|
|
|
* Functions to handle loops in a makefile.
|
|
|
|
|
*
|
|
|
|
|
* Interface:
|
|
|
|
|
* For_Eval Evaluate the loop in the passed line.
|
|
|
|
|
* For_Run Run accumulated loop
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2000-04-17 02:08:06 +04:00
|
|
|
|
#include <assert.h>
|
2002-06-15 22:24:55 +04:00
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
|
#include "make.h"
|
|
|
|
|
#include "hash.h"
|
|
|
|
|
#include "dir.h"
|
|
|
|
|
#include "buf.h"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* For statements are of the form:
|
|
|
|
|
*
|
|
|
|
|
* .for <variable> in <varlist>
|
|
|
|
|
* ...
|
|
|
|
|
* .endfor
|
|
|
|
|
*
|
|
|
|
|
* The trick is to look for the matching end inside for for loop
|
|
|
|
|
* To do that, we count the current nesting level of the for loops.
|
|
|
|
|
* and the .endfor statements, accumulating all the statements between
|
1996-11-06 20:58:58 +03:00
|
|
|
|
* the initial .for loop and the matching .endfor;
|
1994-03-05 03:34:29 +03:00
|
|
|
|
* then we evaluate the for loop for each variable in the varlist.
|
2000-04-17 02:08:06 +04:00
|
|
|
|
*
|
|
|
|
|
* Note that any nested fors are just passed through; they get handled
|
|
|
|
|
* recursively in For_Eval when we're expanding the enclosing for in
|
|
|
|
|
* For_Run.
|
1994-03-05 03:34:29 +03:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static int forLevel = 0; /* Nesting level */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* State of a for loop.
|
|
|
|
|
*/
|
1994-06-07 02:45:17 +04:00
|
|
|
|
typedef struct _For {
|
2000-04-17 02:08:06 +04:00
|
|
|
|
Buffer buf; /* Body of loop */
|
|
|
|
|
char **vars; /* Iteration variables */
|
|
|
|
|
int nvars; /* # of iteration vars */
|
|
|
|
|
Lst lst; /* List of items */
|
1994-06-07 02:45:17 +04:00
|
|
|
|
} For;
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
2000-04-17 02:08:06 +04:00
|
|
|
|
static For accumFor; /* Loop being accumulated */
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
2002-06-15 22:24:55 +04:00
|
|
|
|
static void ForAddVar(const char *, size_t);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-04-17 02:08:06 +04:00
|
|
|
|
|
|
|
|
|
/*-
|
|
|
|
|
*-----------------------------------------------------------------------
|
|
|
|
|
* ForAddVar --
|
|
|
|
|
* Add an iteration variable to the currently accumulating for.
|
|
|
|
|
*
|
|
|
|
|
* Results: none
|
|
|
|
|
* Side effects: no additional side effects.
|
|
|
|
|
*-----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2002-06-15 22:24:55 +04:00
|
|
|
|
ForAddVar(const char *data, size_t len)
|
2000-04-17 02:08:06 +04:00
|
|
|
|
{
|
|
|
|
|
Buffer buf;
|
2000-04-18 07:46:41 +04:00
|
|
|
|
int varlen;
|
2000-04-17 02:08:06 +04:00
|
|
|
|
|
|
|
|
|
buf = Buf_Init(0);
|
2003-07-14 22:19:11 +04:00
|
|
|
|
Buf_AddBytes(buf, len, (Byte *)UNCONST(data));
|
2000-04-17 02:08:06 +04:00
|
|
|
|
|
|
|
|
|
accumFor.nvars++;
|
|
|
|
|
accumFor.vars = erealloc(accumFor.vars, accumFor.nvars*sizeof(char *));
|
|
|
|
|
|
|
|
|
|
accumFor.vars[accumFor.nvars-1] = (char *) Buf_GetAll(buf, &varlen);
|
|
|
|
|
|
|
|
|
|
Buf_Destroy(buf, FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
|
/*-
|
|
|
|
|
*-----------------------------------------------------------------------
|
|
|
|
|
* For_Eval --
|
|
|
|
|
* Evaluate the for loop in the passed line. The line
|
|
|
|
|
* looks like this:
|
|
|
|
|
* .for <variable> in <varlist>
|
|
|
|
|
*
|
2002-06-15 22:24:55 +04:00
|
|
|
|
* Input:
|
|
|
|
|
* line Line to parse
|
|
|
|
|
*
|
1994-03-05 03:34:29 +03:00
|
|
|
|
* Results:
|
|
|
|
|
* TRUE: We found a for loop, or we are inside a for loop
|
|
|
|
|
* FALSE: We did not find a for loop, or we found the end of the for
|
|
|
|
|
* for loop.
|
|
|
|
|
*
|
|
|
|
|
* Side Effects:
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
*-----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
int
|
2002-06-15 22:24:55 +04:00
|
|
|
|
For_Eval(char *line)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
{
|
2000-04-17 02:08:06 +04:00
|
|
|
|
char *ptr = line, *sub, *in, *wrd;
|
1994-03-05 03:34:29 +03:00
|
|
|
|
int level; /* Level at which to report errors. */
|
|
|
|
|
|
|
|
|
|
level = PARSE_FATAL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (forLevel == 0) {
|
|
|
|
|
Buffer buf;
|
|
|
|
|
int varlen;
|
2002-03-12 23:15:15 +03:00
|
|
|
|
static const char instr[] = "in";
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
1994-06-07 02:45:17 +04:00
|
|
|
|
for (ptr++; *ptr && isspace((unsigned char) *ptr); ptr++)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
continue;
|
|
|
|
|
/*
|
|
|
|
|
* If we are not in a for loop quickly determine if the statement is
|
|
|
|
|
* a for.
|
|
|
|
|
*/
|
1994-06-07 02:45:17 +04:00
|
|
|
|
if (ptr[0] != 'f' || ptr[1] != 'o' || ptr[2] != 'r' ||
|
|
|
|
|
!isspace((unsigned char) ptr[3]))
|
1994-03-05 03:34:29 +03:00
|
|
|
|
return FALSE;
|
|
|
|
|
ptr += 3;
|
1996-11-06 20:58:58 +03:00
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
|
/*
|
|
|
|
|
* we found a for loop, and now we are going to parse it.
|
|
|
|
|
*/
|
1994-06-07 02:45:17 +04:00
|
|
|
|
while (*ptr && isspace((unsigned char) *ptr))
|
1994-03-05 03:34:29 +03:00
|
|
|
|
ptr++;
|
1996-11-06 20:58:58 +03:00
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
|
/*
|
2000-04-17 02:08:06 +04:00
|
|
|
|
* Find the "in".
|
1994-03-05 03:34:29 +03:00
|
|
|
|
*/
|
2000-04-17 02:08:06 +04:00
|
|
|
|
for (in = ptr; *in; in++) {
|
|
|
|
|
if (isspace((unsigned char) in[0]) && in[1]== 'i' &&
|
|
|
|
|
in[2] == 'n' &&
|
|
|
|
|
(in[3] == '\0' || isspace((unsigned char) in[3])))
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (*in == '\0') {
|
|
|
|
|
Parse_Error(level, "missing `in' in for");
|
1994-03-05 03:34:29 +03:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2000-04-17 02:08:06 +04:00
|
|
|
|
* Grab the variables.
|
1994-03-05 03:34:29 +03:00
|
|
|
|
*/
|
2000-04-17 02:08:06 +04:00
|
|
|
|
accumFor.vars = NULL;
|
|
|
|
|
|
|
|
|
|
while (ptr < in) {
|
|
|
|
|
wrd = ptr;
|
|
|
|
|
while (*ptr && !isspace((unsigned char) *ptr))
|
|
|
|
|
ptr++;
|
|
|
|
|
ForAddVar(wrd, ptr - wrd);
|
|
|
|
|
while (*ptr && isspace((unsigned char) *ptr))
|
|
|
|
|
ptr++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (accumFor.nvars == 0) {
|
|
|
|
|
Parse_Error(level, "no iteration variables in for");
|
1994-03-05 03:34:29 +03:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2000-04-17 02:08:06 +04:00
|
|
|
|
|
|
|
|
|
/* At this point we should be pointing right at the "in" */
|
2002-03-12 23:15:15 +03:00
|
|
|
|
/*
|
|
|
|
|
* compensate for hp/ux's brain damaged assert macro that
|
|
|
|
|
* does not handle double quotes nicely.
|
|
|
|
|
*/
|
|
|
|
|
assert(!memcmp(ptr, instr, 2));
|
2000-04-17 02:08:06 +04:00
|
|
|
|
ptr += 2;
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
1994-06-07 02:45:17 +04:00
|
|
|
|
while (*ptr && isspace((unsigned char) *ptr))
|
1994-03-05 03:34:29 +03:00
|
|
|
|
ptr++;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Make a list with the remaining words
|
|
|
|
|
*/
|
2000-04-17 02:08:06 +04:00
|
|
|
|
accumFor.lst = Lst_Init(FALSE);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
buf = Buf_Init(0);
|
1996-11-06 20:58:58 +03:00
|
|
|
|
sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
|
|
#define ADDWORD() \
|
|
|
|
|
Buf_AddBytes(buf, ptr - wrd, (Byte *) wrd), \
|
|
|
|
|
Buf_AddByte(buf, (Byte) '\0'), \
|
2000-04-17 02:08:06 +04:00
|
|
|
|
Lst_AtFront(accumFor.lst, (ClientData) Buf_GetAll(buf, &varlen)), \
|
1994-03-05 03:34:29 +03:00
|
|
|
|
Buf_Destroy(buf, FALSE)
|
|
|
|
|
|
1994-06-07 02:45:17 +04:00
|
|
|
|
for (ptr = sub; *ptr && isspace((unsigned char) *ptr); ptr++)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
for (wrd = ptr; *ptr; ptr++)
|
1994-06-07 02:45:17 +04:00
|
|
|
|
if (isspace((unsigned char) *ptr)) {
|
1994-03-05 03:34:29 +03:00
|
|
|
|
ADDWORD();
|
|
|
|
|
buf = Buf_Init(0);
|
1994-06-07 02:45:17 +04:00
|
|
|
|
while (*ptr && isspace((unsigned char) *ptr))
|
1994-03-05 03:34:29 +03:00
|
|
|
|
ptr++;
|
|
|
|
|
wrd = ptr--;
|
|
|
|
|
}
|
2000-04-17 02:08:06 +04:00
|
|
|
|
if (DEBUG(FOR)) {
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < accumFor.nvars; i++) {
|
|
|
|
|
(void) fprintf(stderr, "For: variable %s\n", accumFor.vars[i]);
|
|
|
|
|
}
|
|
|
|
|
(void) fprintf(stderr, "For: list %s\n", sub);
|
|
|
|
|
}
|
1996-11-06 20:58:58 +03:00
|
|
|
|
if (ptr - wrd > 0)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
ADDWORD();
|
|
|
|
|
else
|
|
|
|
|
Buf_Destroy(buf, TRUE);
|
|
|
|
|
free((Address) sub);
|
1996-11-06 20:58:58 +03:00
|
|
|
|
|
2000-04-17 02:08:06 +04:00
|
|
|
|
accumFor.buf = Buf_Init(0);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
forLevel++;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else if (*ptr == '.') {
|
|
|
|
|
|
1994-06-07 02:45:17 +04:00
|
|
|
|
for (ptr++; *ptr && isspace((unsigned char) *ptr); ptr++)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
continue;
|
|
|
|
|
|
1994-06-07 02:45:17 +04:00
|
|
|
|
if (strncmp(ptr, "endfor", 6) == 0 &&
|
|
|
|
|
(isspace((unsigned char) ptr[6]) || !ptr[6])) {
|
1994-03-05 03:34:29 +03:00
|
|
|
|
if (DEBUG(FOR))
|
|
|
|
|
(void) fprintf(stderr, "For: end for %d\n", forLevel);
|
|
|
|
|
if (--forLevel < 0) {
|
|
|
|
|
Parse_Error (level, "for-less endfor");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
1994-06-07 02:45:17 +04:00
|
|
|
|
else if (strncmp(ptr, "for", 3) == 0 &&
|
|
|
|
|
isspace((unsigned char) ptr[3])) {
|
1994-03-05 03:34:29 +03:00
|
|
|
|
forLevel++;
|
|
|
|
|
if (DEBUG(FOR))
|
|
|
|
|
(void) fprintf(stderr, "For: new loop %d\n", forLevel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (forLevel != 0) {
|
2000-04-17 02:08:06 +04:00
|
|
|
|
Buf_AddBytes(accumFor.buf, strlen(line), (Byte *) line);
|
|
|
|
|
Buf_AddByte(accumFor.buf, (Byte) '\n');
|
1994-03-05 03:34:29 +03:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-
|
|
|
|
|
*-----------------------------------------------------------------------
|
|
|
|
|
* For_Run --
|
2000-04-17 02:08:06 +04:00
|
|
|
|
* Run the for loop, imitating the actions of an include file
|
1994-03-05 03:34:29 +03:00
|
|
|
|
*
|
|
|
|
|
* Results:
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
* Side Effects:
|
|
|
|
|
* None.
|
|
|
|
|
*
|
|
|
|
|
*-----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
2002-06-15 22:24:55 +04:00
|
|
|
|
For_Run(void)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
{
|
1994-06-07 02:45:17 +04:00
|
|
|
|
For arg;
|
2000-04-17 02:08:06 +04:00
|
|
|
|
LstNode ln;
|
|
|
|
|
char **values;
|
|
|
|
|
int i, done = 0, len;
|
2000-06-06 08:56:52 +04:00
|
|
|
|
char *guy, *orig_guy, *old_guy;
|
2000-04-17 02:08:06 +04:00
|
|
|
|
|
|
|
|
|
if (accumFor.buf == NULL || accumFor.vars == NULL || accumFor.lst == NULL)
|
|
|
|
|
return;
|
|
|
|
|
arg = accumFor;
|
|
|
|
|
accumFor.buf = NULL;
|
|
|
|
|
accumFor.vars = NULL;
|
|
|
|
|
accumFor.nvars = 0;
|
|
|
|
|
accumFor.lst = NULL;
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
2000-04-17 02:08:06 +04:00
|
|
|
|
if (Lst_Open(arg.lst) != SUCCESS)
|
1994-03-05 03:34:29 +03:00
|
|
|
|
return;
|
|
|
|
|
|
2000-04-17 02:08:06 +04:00
|
|
|
|
values = emalloc(arg.nvars * sizeof(char *));
|
|
|
|
|
|
|
|
|
|
while (!done) {
|
|
|
|
|
/*
|
|
|
|
|
* due to the dumb way this is set up, this loop must run
|
|
|
|
|
* backwards.
|
|
|
|
|
*/
|
|
|
|
|
for (i = arg.nvars - 1; i >= 0; i--) {
|
|
|
|
|
ln = Lst_Next(arg.lst);
|
|
|
|
|
if (ln == NILLNODE) {
|
|
|
|
|
if (i != arg.nvars-1) {
|
|
|
|
|
Parse_Error(PARSE_FATAL,
|
|
|
|
|
"Not enough words in for substitution list");
|
|
|
|
|
}
|
|
|
|
|
done = 1;
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
|
|
|
|
values[i] = (char *) Lst_Datum(ln);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (done)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < arg.nvars; i++) {
|
2001-06-13 03:36:17 +04:00
|
|
|
|
Var_Set(arg.vars[i], values[i], VAR_GLOBAL, 0);
|
2000-04-17 02:08:06 +04:00
|
|
|
|
if (DEBUG(FOR))
|
|
|
|
|
(void) fprintf(stderr, "--- %s = %s\n", arg.vars[i],
|
|
|
|
|
values[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Hack, hack, kludge.
|
|
|
|
|
* This is really ugly, but to do it any better way would require
|
|
|
|
|
* making major changes to var.c, which I don't want to get into
|
|
|
|
|
* yet. There is no mechanism for expanding some variables, only
|
|
|
|
|
* for expanding a single variable. That should be corrected, but
|
|
|
|
|
* not right away. (XXX)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
guy = (char *) Buf_GetAll(arg.buf, &len);
|
2000-06-06 08:56:52 +04:00
|
|
|
|
orig_guy = guy;
|
|
|
|
|
for (i = 0; i < arg.nvars; i++) {
|
|
|
|
|
old_guy = guy;
|
|
|
|
|
guy = Var_Subst(arg.vars[i], guy, VAR_GLOBAL, FALSE);
|
|
|
|
|
if (old_guy != orig_guy)
|
|
|
|
|
free(old_guy);
|
|
|
|
|
}
|
2000-04-17 02:08:06 +04:00
|
|
|
|
Parse_FromString(guy);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < arg.nvars; i++)
|
2000-06-06 08:56:52 +04:00
|
|
|
|
Var_Delete(arg.vars[i], VAR_GLOBAL);
|
2000-04-17 02:08:06 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free(values);
|
|
|
|
|
|
|
|
|
|
Lst_Close(arg.lst);
|
|
|
|
|
|
|
|
|
|
for (i=0; i<arg.nvars; i++) {
|
|
|
|
|
free(arg.vars[i]);
|
|
|
|
|
}
|
|
|
|
|
free(arg.vars);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
2002-06-15 22:24:55 +04:00
|
|
|
|
Lst_Destroy(arg.lst, (void (*)(ClientData)) free);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
Buf_Destroy(arg.buf, TRUE);
|
|
|
|
|
}
|