[BACK]Return to lowparse.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/lowparse.c between version 1.17 and 1.18

version 1.17, 2002/12/29 17:29:35 version 1.18, 2004/04/07 13:11:36
Line 108 
Line 108 
 static int ParseSkipEmptyLines(Buffer);  static int ParseSkipEmptyLines(Buffer);
   
 static IFile *  static IFile *
 new_ifile(name, stream)  new_ifile(const char *name, FILE *stream)
     const char *name;  
     FILE *stream;  
 {  {
     IFile *ifile;      IFile *ifile;
 #if 0  #if 0
Line 128 
Line 126 
 }  }
   
 static void  static void
 free_ifile(ifile)  free_ifile(IFile *ifile)
     IFile *ifile;  
 {  {
     if (ifile->F && fileno(ifile->F) != STDIN_FILENO)      if (ifile->F && fileno(ifile->F) != STDIN_FILENO)
         (void)fclose(ifile->F);          (void)fclose(ifile->F);
Line 140 
Line 137 
 }  }
   
 static IFile *  static IFile *
 new_istring(str, name, lineno)  new_istring(char *str, const char *name, unsigned long lineno)
     char *str;  
     const char *name;  
     unsigned long lineno;  
 {  {
     IFile *ifile;      IFile *ifile;
   
Line 161 
Line 155 
   
   
 void  void
 Parse_FromString(str, lineno)  Parse_FromString(char *str, unsigned long lineno)
     char                *str;  
     unsigned long       lineno;  
 {  {
     if (DEBUG(FOR))      if (DEBUG(FOR))
         (void)fprintf(stderr, "%s\n----\n", str);          (void)fprintf(stderr, "%s\n----\n", str);
Line 175 
Line 167 
   
   
 void  void
 Parse_FromFile(name, stream)  Parse_FromFile(const char *name, FILE *stream)
     const char          *name;  
     FILE                *stream;  
 {  {
     if (current != NULL)      if (current != NULL)
         Lst_Push(&input_stack, current);          Lst_Push(&input_stack, current);
Line 185 
Line 175 
 }  }
   
 bool  bool
 Parse_NextFile()  Parse_NextFile(void)
 {  {
     if (current != NULL)      if (current != NULL)
         free_ifile(current);          free_ifile(current);
Line 194 
Line 184 
 }  }
   
 static int  static int
 newline()  newline(void)
 {  {
     size_t len;      size_t len;
   
Line 211 
Line 201 
 }  }
   
 static int  static int
 skiptoendofline()  skiptoendofline(void)
 {  {
     if (current->F) {      if (current->F) {
         if (current->end - current->ptr > 1)          if (current->end - current->ptr > 1)
Line 231 
Line 221 
   
   
 char *  char *
 Parse_ReadNextConditionalLine(linebuf)  Parse_ReadNextConditionalLine(Buffer linebuf)
     Buffer linebuf;  
 {  {
     int c;      int c;
   
Line 257 
Line 246 
 }  }
   
 static void  static void
 ParseFoldLF(linebuf, c)  ParseFoldLF(Buffer linebuf, int c)
     Buffer linebuf;  
     int c;  
 {  {
     for (;;) {      for (;;) {
         if (c == '\n') {          if (c == '\n') {
Line 291 
Line 278 
 }  }
   
 char *  char *
 Parse_ReadUnparsedLine(linebuf, type)  Parse_ReadUnparsedLine(Buffer linebuf, const char *type)
     Buffer      linebuf;  
     const char  *type;  
 {  {
     int c;      int c;
   
Line 329 
Line 314 
 /* This is a fairly complex function, but without it, we could not skip  /* This is a fairly complex function, but without it, we could not skip
  * blocks of comments without reading them. */   * blocks of comments without reading them. */
 static int  static int
 ParseSkipEmptyLines(linebuf)  ParseSkipEmptyLines(Buffer linebuf)
     Buffer      linebuf;  
 {  {
     int         c;              /* the current character */      int         c;              /* the current character */
   
Line 401 
Line 385 
 }  }
   
 /* Parse_ReadNormalLine removes beginning and trailing blanks (but keeps  /* Parse_ReadNormalLine removes beginning and trailing blanks (but keeps
  * the first tab), handles escaped newlines, and skip over uninteresting   * the first tab), handles escaped newlines, and skips over uninteresting
  * lines.   * lines.
  *   *
  * The line number is advanced, which implies that continuation   * The line number is incremented, which implies that continuation
  * lines are numbered with the last line no (we could do better, at a   * lines are numbered with the last line number (we could do better, at a
  * price).   * price).
  *   *
  * Trivial comments are also removed, but we can't do more, as   * Trivial comments are also removed, but we can't do more, as
  * we don't know which lines are shell commands or not.  */   * we don't know which lines are shell commands or not.  */
 char *  char *
 Parse_ReadNormalLine(linebuf)  Parse_ReadNormalLine(Buffer linebuf)
     Buffer      linebuf;  
 {  {
     int         c;              /* the current character */      int         c;              /* the current character */
   
Line 428 
Line 411 
 }  }
   
 unsigned long  unsigned long
 Parse_Getlineno()  Parse_Getlineno(void)
 {  {
     return current ? current->lineno : 0;      return current ? current->lineno : 0;
 }  }
   
 const char *  const char *
 Parse_Getfilename()  Parse_Getfilename(void)
 {  {
     return current ? current->fname : NULL;      return current ? current->fname : NULL;
 }  }
   
 #ifdef CLEANUP  #ifdef CLEANUP
 void  void
 LowParse_Init()  LowParse_Init(void)
 {  {
     Static_Lst_Init(&input_stack);      Static_Lst_Init(&input_stack);
     current = NULL;      current = NULL;
 }  }
   
 void  void
 LowParse_End()  LowParse_End(void)
 {  {
     Lst_Destroy(&input_stack, NOFREE);  /* Should be empty now */      Lst_Destroy(&input_stack, NOFREE);  /* Should be empty now */
 #if 0  #if 0
Line 459 
Line 442 
   
   
 void  void
 Parse_ReportErrors()  Parse_ReportErrors(void)
 {  {
     if (fatal_errors) {      if (fatal_errors) {
 #ifdef CLEANUP  #ifdef CLEANUP

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18