home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / share / doc / usd / 11.notes / 4.3 < prev    next >
Encoding:
Text File  |  1991-04-17  |  4.3 KB  |  126 lines

  1. .\" Copyright (c) 1980 The Regents of the University of California.
  2. .\" All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\"    notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\"    notice, this list of conditions and the following disclaimer in the
  11. .\"    documentation and/or other materials provided with the distribution.
  12. .\" 3. All advertising materials mentioning features or use of this software
  13. .\"    must display the following acknowledgement:
  14. .\"    This product includes software developed by the University of
  15. .\"    California, Berkeley and its contributors.
  16. .\" 4. Neither the name of the University nor the names of its contributors
  17. .\"    may be used to endorse or promote products derived from this software
  18. .\"    without specific prior written permission.
  19. .\"
  20. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  21. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  24. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. .\" SUCH DAMAGE.
  31. .\"
  32. .\"    @(#)4.3    6.2 (Berkeley) 4/17/91
  33. .\"
  34. .se "User Subroutines"
  35.  
  36. .ss "Nfcomment"
  37.  
  38.     The nfcomment subroutine is callable from a user's C program. It
  39. allows any user program to enter text into a notesfile:
  40.  
  41.     nfcomment (nfname, text, title, dirflag, anonflag)
  42.  
  43. .KS
  44. .br
  45. The parameters are:
  46.  
  47. .br
  48. .ls 1
  49.     char *nfname;    /* name of notesfile */
  50. .br
  51.     char *text;    /* null terminated text to be entered */
  52. .br
  53.     char *title;    /* if non-null, title of note */
  54. .br
  55.     int dirflag;    /* != 0 -> director flag on (if allowed) */
  56. .br
  57.     int anonflag;    /* != 0 -> anonymous note (if allowed) */
  58. .br
  59. .ls
  60. .KE
  61.  
  62.     If the text pointer is NULL, the text of the note will be read
  63. from standard input.
  64. If no title is specified the subroutine will manufacture a title
  65. from the first line of the note.
  66. This routine is useful for error reports, user comments
  67. about programs, and automatic logging of statistics or internal states.
  68.  
  69.     This routine can be loaded with a C program by specifying `-lnfcom'
  70. on the `cc' command line.
  71.  
  72. .ss "Nfabort"
  73.  
  74.     Nfabort allows users to generate core images of their
  75. process, save the core image in a ``known'' place,
  76. and
  77. log that fact in a notesfile.
  78. This proves useful for intermittent failures;
  79. The programmer regularly scans the notesfile and can examine
  80. the core dump at leisure.
  81. Some of the problems of recreating conditions which cause errors
  82. are eliminated by this approach.
  83.  
  84.     Nfabort is callable from the user program. It accepts
  85. the following parameters:
  86.  
  87.     nfabort (nfname, message, title, cname, exitcode)
  88.  
  89. .KS
  90. .br
  91. The parameters are:
  92.  
  93. .br
  94. .ls 1
  95.     char *nfname;    /* name of notesfile */
  96. .br
  97.     char *message;    /* text string to insert */
  98. .br
  99.     char *title;    /* title of the message */
  100. .br
  101.     char *cname;    /* prefix for core image destination */
  102. .br
  103.     int exitcode;    /* code for exit() */
  104. .ls
  105. .KE
  106.  
  107.     The core image is placed in the file specified by
  108. concatenating the ``cname'' argument and a unique 
  109. integer (the process id of the current process).
  110. The notesfile specified by the ``nfname'' parameter
  111. receives a note whose body consists of the text pointed
  112. to by ``message'' and a line telling the complete pathname
  113. of the core image.
  114. The title of the note is specified by the ``title'' 
  115. parameter.
  116. After the core image is generated and the
  117. note has been written, 
  118. nfabort terminates with the exit code specified
  119. by the ``exitcode'' parameter.
  120.  
  121.     Nfabort generates default values for each of
  122. the string parameters if NULL pointers are passed.
  123. This routine can be loaded with a C program by specifying `-lnfcom'
  124. on the `cc' command line.
  125.  
  126.