ref: 5c21eca829380c28769f79beabb7cc51f1787f97
dir: /chktag.c/
#include <u.h> #include <libc.h> #include "dat.h" #include "fns.h" /* write out a single formatted block based on the tag ./6.chktag 23; ./6.chktag 24; ./6.chktag 74 */ int debug = 0; char *devfile = nil; static void usage(void) { fprint(2, "usage: chktag [-D] reli\n"); exits("usage"); } void main(int argc, char *argv[]) { u64 reli; u8 tag; ARGBEGIN{ default: usage(); case 'D': debug++; break; }ARGEND if(argc != 1) usage(); reli = atoll(argv[0]); if(reli < Ndspanid){ print("Tdata or Tdentry\n"); }else{ tag = rel2tind(reli); print("%d %s\n", tag, tagnames[tag]); } exits(0); }