1: #include "parms.h"
   2: #include "structs.h"
   3: 
   4: #ifdef  RCSIDENT
   5: static char rcsid[] = "$Header: adresp.c,v 1.7.0.1 85/09/09 18:30:38 notes Rel $";
   6: #endif	RCSIDENT
   7: 
   8: /*
   9:  *	addresp(io, fid, notenum)
  10:  *		grab text from the terminal, with the appropriate
  11:  *	prepending from fid, and stick it in the notefile as a response
  12:  *	to notenumber notenum. OF course the policy note can't have
  13:  *	responses so we check that.
  14:  *
  15:  *	Original coding:	Ray Essick	January 1982
  16:  */
  17: 
  18: addresp (io, preface, notenum, editflag)
  19: struct io_f *io;
  20: FILE * preface;
  21: {
  22:     char    anon;
  23:     char    c;
  24:     int     status;
  25:     int     resp;
  26:     struct when_f   now;
  27:     struct auth_f   auth;
  28:     struct id_f unique;
  29:     struct daddr_f  where;
  30:     struct note_f   note;
  31: 
  32: #ifndef WRITEARCH                   /* allowing writes */
  33:     if (io -> descr.d_stat & ISARCH && !allow (io, DRCTOK))
  34:     {
  35:     at (0, PROMPTMSGX);
  36:     printf ("Sorry, you can not write in an archive");
  37:     fflush (stdout);
  38:     sleep (2);
  39:     return (0);
  40:     }
  41: #endif	WRITEARCH
  42:     resp = 0;
  43:     at (0, PROMPTMSGX);
  44:     if (editflag == EDIT)
  45:     printf ("\nEdit Response Text:\n");
  46:     if (gettext (io, &where, preface, editflag) != 0)
  47:     {
  48:     anon = 'n';
  49:     if ((editflag == EDIT) && io -> descr.d_stat & ANONOK)
  50:     {
  51:         anon = askyn ("Do you wish this response to be anonymous (y/n): ");
  52:         printf ("\r                                                     \r");
  53:         if (anon == 'y')                /* verify */
  54:         {
  55:         anon = askyn ("Do you REALLY wish this response to be anonymous (y/n): ");
  56:         printf ("\r                                                            \r");
  57:         }
  58:     }
  59:     status = 0;
  60:     if ((editflag == EDIT) && allow (io, DRCTOK))   /* director mesg */
  61:     {
  62:         c = askyn ("Director message (y/n): ");
  63:         printf ("\r                            \r");
  64:         if (c == 'y')
  65:         status |= DIRMES;
  66:     }
  67: 
  68:     gettime (&now);                 /* get time of writing */
  69:     getname (&auth, anon == 'y');           /* and author */
  70:     locknf (io, 'n');               /* lock up notesfile */
  71:     if ((resp = putresp (io, &where, status, notenum, &now, &auth, &note,
  72:             NOLOCKIT, &unique, ADDID, System, ADDTIME, &now)) == 0)
  73:     {
  74:         printf ("\nSorry, this note has just been deleted.\n");
  75:         fflush (stdout);                /* force it out */
  76:         sleep (2);
  77:     }
  78:     unlocknf (io, 'n');             /* free now */
  79:     }
  80:     return resp;                    /* tell him which one */
  81: }

Defined functions

addresp defined in line 18; used 4 times

Defined variables

rcsid defined in line 5; never used
Last modified: 1985-10-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1029
Valid CSS Valid XHTML 1.0 Strict