#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "in.h"
Include dependency graph for in.c:

Go to the source code of this file.
Defines | |
| #define | EVAL(expr) if (expr) { errno = ENOMEM; perror(pcerr); iret = EXIT_FAILURE; goto cleanup; } |
| Evaluand gives unto status errandi. | |
Functions | |
| int | in (FILE *pf, char **ppc) |
| Read stream into providant vector. | |
Definition in file in.c.
|
|
Evaluand gives unto status errandi.
Definition at line 12 of file in.c. Referenced by digest(), in(), lex(), lexbuf(), main(), math(), migrate(), out(), parse(), parsetag(), template(), and translatetoken(). |
|
||||||||||||
|
Read stream into providant vector.
Definition at line 17 of file in.c. Referenced by main(), and template(). 00018 {
00019 int iret = EXIT_SUCCESS;
00020 size_t s = 0, scur = 0;
00021 char pcbuf[READ];
00022 const char *pcerr = "in.c in()";
00023 *ppc = (char *) malloc(0);
00024 while ((s = fread(pcbuf, sizeof(char), READ, pf))) {
00025 EVAL((*ppc = (char *) realloc(*ppc, scur + s + sizeof('\0'))) == NULL);
00026 strncpy(*ppc + scur, pcbuf, s);
00027 scur += s;
00028 }
00029 *(*ppc + scur) = '\0';
00030
00031 cleanup:
00032 return iret;
00033 }
|
1.3.9.1