=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/parse.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- src/usr.bin/make/parse.c 1999/11/11 11:40:09 1.23 +++ src/usr.bin/make/parse.c 1999/11/11 11:42:19 1.24 @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.23 1999/11/11 11:40:09 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.24 1999/11/11 11:42:19 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: parse.c,v 1.23 1999/11/11 11:40:09 espie Exp $"; +static char rcsid[] = "$OpenBSD: parse.c,v 1.24 1999/11/11 11:42:19 espie Exp $"; #endif #endif /* not lint */ @@ -137,10 +137,10 @@ * Definitions for handling #include specifications */ typedef struct IFile { - char *fname; /* name of previous file */ - unsigned long lineno; /* saved line number */ - FILE *F; /* the open stream */ - PTR *p; /* the char pointer */ + char *fname; /* name of previous file */ + unsigned long lineno; /* saved line number */ + FILE *F; /* the open stream */ + PTR *p; /* the char pointer */ } IFile; static Lst includes; /* stack of IFiles generated by @@ -1838,8 +1838,9 @@ *--------------------------------------------------------------------- */ void -Parse_FromString(str) - char *str; +Parse_FromString(str, newlineno) + char *str; + unsigned long newlineno; { IFile *oldFile; /* state associated with this file */ @@ -1857,7 +1858,7 @@ curFILE = NULL; curPTR = (PTR *) emalloc (sizeof (PTR)); curPTR->str = curPTR->ptr = str; - lineno = 0; + lineno = newlineno; fname = estrdup(fname); } @@ -2698,3 +2699,10 @@ (void) Lst_AtEnd (listmain, (ClientData)mainNode); return (listmain); } + +unsigned long +Parse_Getlineno() +{ + return lineno; +} +