.ch "Other Notesfile Utilities" The notesfile distribution includes utility programs to provide hard copy output, additional interfaces to user programs, and statistics. They are described below. .se "Hard Copy Output" The program "nfprint" sends to standard output a nicely formatted listing of the notesfile in its command line. Its format is: nfprint [-lnn] [-p] topic [ note# ] [ note#-note# ] [ ... ] The "-l" option specifies an alternate page size (the default is 66). The optional note number list specifies that only certain notes of the notesfile are to be printed. The list can specify individual notes and ranges. The notes are printed in the order specified. .se "Piped Insertion of Notes" The nfpipe program enters text from the standard input into a notesfile: nfpipe topic [-t title] [ -d ] [ -a ] The -t option allows specification of a title. The -d and -a options specify the director and anonymous flags respectively (if available). If no title is specified, one is manufactured from the first line of the note. .se "User Subroutines" The nfcomment subroutine is callable from a user's C program. It allows any user program to enter text into a notesfile: nfcomment (nfname, text, title, DIRFLAG, ANONFLAG) .KS .br The parameters are: .br .ls 1 char *nfname; /* name of notesfile */ .br char *text; /* null terminated text to be entered */ .br char *title; /* if non-null, title of note */ .br int DIRFLAG; /* != 0 -> director flag on (if allowed) */ .br int ANONFLAG; /* != 0 -> anonymous note (if allowed) */ .br .ls .KE If the *text pointer is NULL, the text of the note will be read from standard input. If no title is specified the subroutine will manufacture a title from the first line of the note. This routine is useful for error reports, user comments about programs, and automatic logging of statistics or internal states. This routine can be loaded with a C program by specifying `-lnfcom' on the `cc' command line. .se "Statistics" The notesfile system keeps statistics on where notes and responses originate, the number of network accesses, duplications and orphaned responses. Combined with the use of the log maintained by the notesfile networking software, monitoring notesfile traffic is quite easy. The -s option specifies that only a summary is to be produced, skipping the individual reports. Wildcard constructs with '*', '?', '[', and ']' are recognized by nfstats. Invoke the statistics program with: nfstats [ -s ] topic1 [ ... ] Typical output is: .KS .nf .ls 1 rbenotes on uiucdcs at 6:24 pm May 7, 1982 NOTES RESPS TOTALS Local Reads 359 115 474 Local Written 53 55 108 Networked in 0 0 0 Networked out 0 0 0 Network Dropped 0 0 0 Network Transmissions: 0 Network Receptions: 0 Orphaned Responses Received: 0 Entries into notefile: 109 Total time in notefile: 66.57 minutes Average Time/entry: 0.61 minutes Created at 10:04 pm May 5, 1982, Used on 3 days .ls .fi .KE A combined set of statistics is produced at the end of listings of more than one notesfile. The statistics are largely self explanatory. .se "Checking for new notes" The checknotes program checks if there are new notes. The exit code is arranged to make the program useful in shell scripts: 0 (TRUE) is there are new notes, 1 (FALSE) otherwise. Use the "-q" option to receive a message There are new notes if one or more of the notesfiles have notes/responses written since the user's last entry time into that notesfile. The "-n" option is similar to the "-q" option, with the exception that it yields output when there are no new notes. The output of checknotes with the "-n" option is: There are no new notes Use "-v" to print the name of each notesfile with new notes/responses. The "-s" option is suited for use conditional expressions in shell scripts; no output is generated by this option.