home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
games
/
chargens.zip
/
LOCAL.H
< prev
next >
Wrap
Text File
|
1987-10-25
|
866b
|
39 lines
/* label.h - definitions for use with other programs */
#ifndef FAIL
#include <stdio.h>
#define FAIL 1
#define FOREVER for (;;)
#define NO 0
#define STDERR 2
#define STDIN 0
#define STDOUT 1
#define SUCCEED 0
#define YES 1
#define bits ushort
#define bool int
#define metachar short
#define tbool char
#define ushort unsigned
#define void int
#define getln(s,n) ((fgets(s,n,stdin) == NULL) ? EOF : strlen(s))
#define ABS(x) (((x) < 0) ? -(x) : (x))
#define MAX(x,y) (((x) <(y)) ? (y) : (x))
#define MIN(x,y) (((x) <(y)) ? (x) : (y))
#endif
getline(s, lim)
char s[];
int lim;
{
int c, i;
i = 0;
while ( --lim > 0 && (c=getchar()) != EOF && c != '\n')
s[i++] = c;
if ( c == '\n')
s[i++] = c;
s[i] = '\0';
return(i);
}