#-h- man.r 1144 asc 27-apr-81 14:20:36 [002,100] #-h- defns 67 asc 27-apr-81 14:15:02 [002,100] define(AVE_TOK_SIZE,10) define(MEM_SIZE,arith(200,*,AVE_TOK_SIZE)) #-h- main 953 asc 27-apr-81 14:15:03 [002,100] DRIVER(man) integer i, getarg, j, int, open, k, opendr, desc, gdrprm character docdir(FILENAMESIZE), arg(FILENAMESIZE), buf(FILENAMESIZE) integer imget, imput, junk pointer table, iminit DS_DECL(Mem, MEM_SIZE) call query("usage: man [toolname] ...") table = iminit(MEM_SIZE, AVE_TOK_SIZE) call getdir(MANDIRECTORY, LOCAL, docdir) for (i=1; getarg(i, arg, FILENAMESIZE) != EOF; i=i+1) junk = imput(table, arg) if (i == 1) { if (opendr(docdir, desc) == ERR) call error("Cannot open directory of documentation files.") while (gdrprm(desc, arg) != EOF) junk = imput(table, arg) call closdr(desc) call imsort(table) # sort the names } while (imget(table, buf) != EOF) { call concat(docdir, buf, arg) int = open(arg, READ) if (int == ERR) { call putlin(buf, ERROUT) call remark(" : no manual entry available.") } else { call fcopy(int, STDOUT) call close(int) } } DRETURN end #-h- man.rof 692 asc 08-may-81 16:47:39 [002,100] .pl 60 .bp .rm 70 .in 0 .he 'MAN'1/11/79/'MAN' .fo ''-#-' .fi NAME .br .in 7 man - run off section of users manual .sp 1 .in SYNOPSIS .br .in 7 man [toolname] ... .sp 1 .in DESCRIPTION .br .in 7 Man locates and prints a section of the users manual describing the use of a particular tool. If no arguments are specified, all of manual entries are printed out. .sp 1 .in FILES .br .in 7 Accesses the file containing user documents. .sp 1 .in SEE ALSO .br .in 7 The tool 'intro'; the Unix command 'man' .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if the tool specified by 'toolname' cannot be located. .sp 1 .in AUTHORS .br .in 7 .sp 1 Joe Sventek