home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / pcmail / part07 / mailfile.c < prev    next >
C/C++ Source or Header  |  1989-02-03  |  2KB  |  78 lines

  1. /*++
  2. /* NAME
  3. /*      mailfile 3
  4. /* SUMMARY
  5. /*      mail the file currently being displayed
  6. /* PROJECT
  7. /*      pc-mail
  8. /* PACKAGE
  9. /*      mailsh
  10. /* SYNOPSIS
  11. /*    #include "mailsh.h"
  12. /*
  13. /*      int mailfile()
  14. /* DESCRIPTION
  15. /*      mailfile() is invoked when the user wants to mail a copy of a
  16. /*    file or message to some person. The name of the file is taken
  17. /*    from the global string variable message[].
  18. /*
  19. /*    The user is asked for a destination, the necessary spool files
  20. /*    are created and the main menu display is junked.
  21. /* FUNCTIONS AND MACROS
  22. /*    kbdinp(), junk_desk()
  23. /* FILES
  24. /*      message and meta file in the spool directory.
  25. /* SEE ALSO
  26. /*      pager(3), pager(5), kbdinp(3)
  27. /* DIAGNOSTICS
  28. /*      An error message is displayed in case of problems.
  29. /* AUTHOR(S)
  30. /*      W.Z. Venema
  31. /*      Eindhoven University of Technology
  32. /*      Department of Mathematics and Computer Science
  33. /*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  34. /* CREATION DATE
  35. /*    Mon Apr  4 13:03:44 MET 1988
  36. /* LAST MODIFICATION
  37. /*    Mon Apr  4 23:44:29 MET 1988
  38. /* VERSION/RELEASE
  39. /*    1.1
  40. /*--*/
  41.  
  42. #include "defs.h"
  43. #include "path.h"
  44. #include "screen.h"
  45. #include "mailsh.h"
  46.  
  47. hidden int queue_mailfile();
  48.  
  49. /* mailfile - ask mail address to send file to */
  50.  
  51. public int mailfile()
  52. {
  53.     static Screen screen[] = {
  54.     STRING,    0,              queue_mailfile, int_error,
  55.     0,    0,              when,
  56.     "Press ESC to cancel. Send message to:",
  57.     };
  58.  
  59.     kbdinp(screen);                /* ask message destination */
  60.     return(S_REDRAW);                /* say screen has changed */
  61. }
  62.  
  63. /* queue_mailfile - queue a copy to another person */
  64.  
  65. hidden int queue_mailfile(to)
  66. char *to;
  67. {
  68.     register int stat;
  69.  
  70.     if (stat = submit(message,to)) {
  71.     errdisp(stat);                /* notify user */
  72.     return(S_BREAK|S_REDRAW);        /* say screen has changed */
  73.     } else {
  74.     junk_desk();                /* say mail box has changed */
  75.     return(S_BREAK);            /* terminate caller */
  76.     }
  77. }
  78.