Back to index

tetex-bin  3.0
eofeoln.c File Reference
#include "config.h"

Go to the source code of this file.


boolean eof P1C (FILE *, file)
void readln P1C (FILE *, f)

Function Documentation

boolean eoln P1C ( FILE ,

Definition at line 11 of file eofeoln.c.

  register int c;

  /* If FILE doesn't exist, return false. This happens when, for
     example, when a user does `mft' -- there's no change file,
     so we never open it, so we end up calling this with a null pointer. */
  if (!file)
    return true;
  /* Maybe we're already at the end?  */
  if (feof (file))
    return true;

  if ((c = getc (file)) == EOF)
    return true;

  /* We weren't at the end.  Back up.  */
  (void) ungetc (c, file);

  return false;

Here is the call graph for this function:

void readln P1C ( FILE ,

Definition at line 58 of file eofeoln.c.

    int c;
    while ((c = getc (f)) != '\n' && c != '\r' && c != EOF)
    if (c == '\r' && (c = getc (f)) != '\n' && c != EOF)
        ungetc (c, f);