DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T u

⟦587982d95⟧ TextFile

    Length: 548 (0x224)
    Types: TextFile
    Names: »util.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Poker/util.c« 

TextFile

/*
** 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 );
}