Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/pm/misc.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include	<stdio.h>
#include	<stdlib.h>
#include	<math.h>
#include	<ctype.h>
#include	<string.h>

extern char	errbuf[];
extern char	*progname;
extern int	linenum;
extern int	wantwarn;

// #define	ERROR	fflush(stdout), fprintf(stderr, "%s: ", progname), fprintf(stderr,
// #define	FATAL	), exit(1)
// #define	WARNING	)

#define	ERROR	fprintf(stdout, "\n#MESSAGE TO USER:  "), sprintf(errbuf,
#define	FATAL	), fputs(errbuf, stdout), \
		fprintf(stderr, "%s: ", progname), \
		fputs(errbuf, stderr), \
		fflush(stdout), \
		exit(1)
#define	WARNING	), fputs(errbuf, stdout), \
		wantwarn ? \
			fprintf(stderr, "%s: ", progname), \
			fputs(errbuf, stderr) : 0, \
		fflush(stdout)

#define	eq(s,t)	(strcmp(s,t) == 0)

inline	max(int x, int y)	{ return x > y ? x : y; }
inline	min(int x, int y)	{ return x > y ? y : x; }
inline	abs(int x)		{ return (x >= 0) ? x : -x; }

extern int	dbg;

extern int	pn, userpn;		// actual and user-defined page numbers
extern int	pagetop, pagebot;	// printing margins
extern int	physbot;		// physical bottom of the page

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].