in.h File Reference

Header for file-to-string. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Enumerations

enum  ein { READ = 1024 }

Functions

int in (FILE *, char **)
 Read stream into providant vector.


Detailed Description

Header for file-to-string.

Definition in file in.h.


Enumeration Type Documentation

enum ein
 

byte constants

Enumeration values:
READ  members to be read

Definition at line 7 of file in.h.

00007          {
00008   READ = 1024                   
00009 };


Function Documentation

int in FILE *  pf,
char **  ppc
 

Read stream into providant vector.

Parameters:
pf lectand's whence
ppc lectate's thither

Definition at line 17 of file in.c.

References EVAL, and READ.

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 }


Generated on Tue Dec 7 06:38:25 2004 for CSCI101:ProjectLatex by  doxygen 1.3.9.1