Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

pipe.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include "merc.h"

Include dependency graph for pipe.c:

Go to the source code of this file.

Functions

char *fgetf args ((char *s, int n, register FILE *iop))
int pclose args ((FILE *stream))
FILE *popen args ((const char *command, const char *type))
void do_pipe (CHAR_DATA *ch, char *argument)
char * fgetf (char *s, int n, register FILE *iop)


Function Documentation

char* fgetf args (char *s, int n, register FILE *iop)   ) 
 

int pclose args (FILE *stream)   ) 
 

FILE* popen args (const char *command, const char *type)   ) 
 

void do_pipe CHAR_DATA ch,
char *  argument
 

Definition at line 18 of file pipe.c.

References fgetf(), and page_to_char().

00019 {
00020           
00021             
00022     
00023         
00024 
00025     char buf[5000];
00026     FILE *fp;
00027 
00028     fp = popen( argument, "r" );
00029 
00030     fgetf( buf, 5000, fp );
00031 
00032     page_to_char( buf, ch );
00033 
00034     pclose( fp );
00035 
00036     return;
00037 }

Here is the call graph for this function:

char* fgetf char *  s,
int  n,
register FILE *  iop
 

Definition at line 39 of file pipe.c.

Referenced by do_pipe().

00040 {
00041     register int c;
00042     register char *cs;
00043 
00044     c = '\0';
00045     cs = s;
00046     while( --n > 0 && (c = getc(iop)) != EOF)
00047     if ((*cs++ = c) == '\0')
00048         break;
00049     *cs = '\0';
00050     return((c == EOF && cs == s) ? NULL : s);
00051 }


Generated on Thu Jan 13 22:15:04 2005 for Beyond the Shadows by  doxygen 1.4.0