#include #include #include #include /* * print formatters */ int sunRpcFmt(Fmt *f) { SunRpc *rpc; rpc = va_arg(f->args, SunRpc*); sunRpcPrint(f, rpc); return 0; } static SunProg **fmtProg; static int nfmtProg; static RWLock fmtLock; void sunFmtInstall(SunProg *p) { int i; wlock(&fmtLock); for(i=0; iargs, SunCall*); rlock(&fmtLock); for(i=0; iprog == c->rpc.prog && p->vers == c->rpc.vers){ runlock(&fmtLock); if(c->type < 0 || c->type >= p->nproc || (fmt=p->proc[c->type].fmt) == nil) return fmtprint(f, "unknown proc %c%d", "TR"[c->type&1], c->type>>1); (*fmt)(f, c); return 0; } } runlock(&fmtLock); fmtprint(f, "", c->rpc.prog, c->rpc.vers, "TR"[c->type&1], c->type>>1); return 0; }