Jspice3
inchar.c File Reference
#include "spice.h"
#include <errno.h>
#include "ftedefs.h"
#include "ftegraph.h"
Include dependency graph for inchar.c:

Go to the source code of this file.

Functions

int cp_inchar (FILE *fp)
 

Function Documentation

int cp_inchar ( FILE *  fp)

Definition at line 23 of file inchar.c.

26 {
27  char c;
28  int i;
29 
30  if (cp_interactive) {
31  do {
32  i = read((int) fileno(fp), &c, 1);
33  } while (i == -1 && errno == EINTR);
34 
35  if (i == 0 || c == '\004')
36  return (EOF);
37  else if (i == -1) {
38  perror("read");
39  return (EOF);
40  }
41  }
42  else {
43  c = getc(fp);
44  }
45  return ((int) c);
46 }
bool cp_interactive
Definition: help.c:100
static double c
Definition: vectors.c:16
void perror()