home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / 1_1_contri / usd / 11_notes / 4_3 < prev    next >
Encoding:
Text File  |  1986-05-27  |  2.5 KB  |  95 lines

  1. .\"    @(#)4.3    6.1 (Berkeley) 5/26/86
  2. .\"
  3. .se "User Subroutines"
  4.  
  5. .ss "Nfcomment"
  6.  
  7.     The nfcomment subroutine is callable from a user's C program. It
  8. allows any user program to enter text into a notesfile:
  9.  
  10.     nfcomment (nfname, text, title, dirflag, anonflag)
  11.  
  12. .KS
  13. .br
  14. The parameters are:
  15.  
  16. .br
  17. .ls 1
  18.     char *nfname;    /* name of notesfile */
  19. .br
  20.     char *text;    /* null terminated text to be entered */
  21. .br
  22.     char *title;    /* if non-null, title of note */
  23. .br
  24.     int dirflag;    /* != 0 -> director flag on (if allowed) */
  25. .br
  26.     int anonflag;    /* != 0 -> anonymous note (if allowed) */
  27. .br
  28. .ls
  29. .KE
  30.  
  31.     If the text pointer is NULL, the text of the note will be read
  32. from standard input.
  33. If no title is specified the subroutine will manufacture a title
  34. from the first line of the note.
  35. This routine is useful for error reports, user comments
  36. about programs, and automatic logging of statistics or internal states.
  37.  
  38.     This routine can be loaded with a C program by specifying `-lnfcom'
  39. on the `cc' command line.
  40.  
  41. .ss "Nfabort"
  42.  
  43.     Nfabort allows users to generate core images of their
  44. process, save the core image in a ``known'' place,
  45. and
  46. log that fact in a notesfile.
  47. This proves useful for intermittent failures;
  48. The programmer regularly scans the notesfile and can examine
  49. the core dump at leisure.
  50. Some of the problems of recreating conditions which cause errors
  51. are eliminated by this approach.
  52.  
  53.     Nfabort is callable from the user program. It accepts
  54. the following parameters:
  55.  
  56.     nfabort (nfname, message, title, cname, exitcode)
  57.  
  58. .KS
  59. .br
  60. The parameters are:
  61.  
  62. .br
  63. .ls 1
  64.     char *nfname;    /* name of notesfile */
  65. .br
  66.     char *message;    /* text string to insert */
  67. .br
  68.     char *title;    /* title of the message */
  69. .br
  70.     char *cname;    /* prefix for core image destination */
  71. .br
  72.     int exitcode;    /* code for exit() */
  73. .ls
  74. .KE
  75.  
  76.     The core image is placed in the file specified by
  77. concatenating the ``cname'' argument and a unique 
  78. integer (the process id of the current process).
  79. The notesfile specified by the ``nfname'' parameter
  80. receives a note whose body consists of the text pointed
  81. to by ``message'' and a line telling the complete pathname
  82. of the core image.
  83. The title of the note is specified by the ``title'' 
  84. parameter.
  85. After the core image is generated and the
  86. note has been written, 
  87. nfabort terminates with the exit code specified
  88. by the ``exitcode'' parameter.
  89.  
  90.     Nfabort generates default values for each of
  91. the string parameters if NULL pointers are passed.
  92. This routine can be loaded with a C program by specifying `-lnfcom'
  93. on the `cc' command line.
  94.  
  95.