File:  [Research Unix] / researchv9 / jerq / include / thinkclient.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#ifndef	THINKCLIENT_H
#define	THINKCLIENT_H

struct Thinksubs {
	int (*Thinkchar)();
	int (*Thinknchars)();
	int (*Thinkflush)();
	int (*Thinkmap)();
	int (*Thinkabort)();
};

#ifndef	THINKSHARE_C

#define Thfun(f)	(((struct Thinksubs *)(thclient->data))->f)

#define Thtest	((thclient || (thclient=getname("thinksubs"))) && thclient->proc)

#define Thcall0(f)		(Thtest ? Thfun(f)() : -1)
#define Thcall1(f, a)		(Thtest ? Thfun(f)(a) : -1)
#define Thcall2(f, a, b)	(Thtest ? Thfun(f)((a), (b)) : -1)

#define thinkchar(c)		Thcall1(Thinkchar, c)
#define thinknchars(n, p)	Thcall2(Thinknchars, n, p)
#define thinkflush()		Thcall0(Thinkflush)
#define thinkmap(b, r)		Thcall2(Thinkmap, b, r)
#define thinkabort()		Thcall0(Thinkabort)

struct Nqueue *thclient;

#endif

#endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.