home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / communic / pcmail / main / makework.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  1.9 KB  |  77 lines

  1. /*++
  2. /* NAME
  3. /*      makework 3
  4. /* SUMMARY
  5. /*      save the file currently being displayed as a work file
  6. /* PROJECT
  7. /*      pc-mail
  8. /* PACKAGE
  9. /*      mail
  10. /* SYNOPSIS
  11. /*    #include "mail.h"
  12. /*
  13. /*      int makework()
  14. /* DESCRIPTION
  15. /*      makework() is invoked when the user wants to capture something
  16. /*    in a work file (i.e. something that will probably be sent
  17. /*    as mail lateron). It asks for a one-line summary (to 
  18. /*    identify the work file in the main menu) and creates the
  19. /*    the necessary files in the spool directory.
  20. /*
  21. /*    The name of the source file is taken from the global string
  22. /*    message[].
  23. /* FUNCTIONS AND MACROS
  24. /*    kbdinp(), junk_desk()
  25. /* FILES
  26. /*      A work file and meta file in the spool directory.
  27. /* SEE ALSO
  28. /*      pager(3), pager(5), kbdinp(3)
  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 12:29:18 MET 1988
  36. /* LAST MODIFICATION
  37. /*    90/01/22 13:02:10
  38. /* VERSION/RELEASE
  39. /*    2.1
  40. /*--*/
  41.  
  42. #include "defs.h"
  43. #include "path.h"
  44. #include "screen.h"
  45. #include "mail.h"
  46.  
  47. hidden int install_work();
  48.  
  49. /* makework - ask for an summary for message to work on */
  50.  
  51. public int makework()
  52. {
  53.     static Screen screen[] = {
  54.     STRING,    0,    install_work,    int_error,
  55.     0,    0,    0,
  56.     getsummary,
  57.     };
  58.     kbdinp(screen);                /* ask for destination */
  59.     return(S_REDRAW);                /* say screen has changed */
  60. }
  61.  
  62. /* install_work - install meta file and work copy */
  63.  
  64. hidden int install_work(summary)
  65. char   *summary;
  66. {
  67.     register int stat;
  68.  
  69.     if (stat = workon(message, summary)) {
  70.     errdisp(stat);                /* cannot create work file */
  71.     return (S_BREAK | S_REDRAW);        /* redisplay, stop caller */
  72.     } else {
  73.     junk_desk();                /* junk message display */
  74.     return (S_BREAK);            /* terminate caller */
  75.     }
  76. }
  77.