|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T u
Length: 548 (0x224)
Types: TextFile
Names: »util.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Poker/util.c«
/*
** Various utility routines.
*/
# include <stdio.h>
# include "util.h"
char *strsave( temp )
char *temp;
{
char *p;
extern char *malloc();
p = malloc( strlen(temp) + 1 );
strcpy( p, temp );
return( p );
}
int readln( s, temp )
int s; /* fd to read from */
char *temp; /* area to read into */
{
do {
if (read( s, temp, 1) < 1)
return(0);
}
while( *temp++ != '\n');
*temp = NULL;
}
writeln( s, temp )
int s; /* channel to write on */
char *temp; /* what to write */
{
write( s, temp, strlen( temp ) );
write( s, "\n", 1 );
}