home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume9 / elm2 / part01 / src / delete.c next >
C/C++ Source or Header  |  1987-03-08  |  2KB  |  104 lines

  1. /**        delete.c        **/
  2.  
  3. /**  Delete or undelete files: just set flag in header record! 
  4.      Also tags specified message(s)...
  5.  
  6.      (C) Copyright 1985  Dave Taylor
  7. **/
  8.  
  9. #include "headers.h"
  10.  
  11. delete_msg(real_del)
  12. int real_del;
  13. {
  14.     /** Delete current message.  If real-del is false, then we're
  15.         actually requested to toggle the state of the current
  16.         message... **/
  17.  
  18.     if (real_del)
  19.       header_table[current-1].status |= DELETED;
  20.     else if (ison(header_table[current-1].status, DELETED))
  21.       clearit(header_table[current-1].status, DELETED);
  22.     else
  23.       setit(header_table[current-1].status, DELETED);
  24.  
  25.     show_msg_status(current-1);
  26. }
  27.  
  28. undelete_msg()
  29. {
  30.     /** clear the deleted message flag **/
  31.  
  32.     clearit(header_table[current-1].status, DELETED);
  33.  
  34.     show_msg_status(current-1);
  35. }
  36.  
  37. show_msg_status(msg)
  38. int msg;
  39. {
  40.     /** show the status of the current message only.  **/
  41.  
  42.     if (on_page(msg)) {
  43.       MoveCursor((msg % headers_per_page) + 4, 3);
  44.       if (msg == current && !arrow_cursor) {
  45.         StartBold();
  46.         Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
  47.         EndBold();
  48.       }
  49.       else
  50.         Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
  51.     }
  52. }
  53.  
  54. tag_message()
  55. {
  56.     /** Tag current message.  If already tagged, untag it. **/
  57.  
  58.     if (ison(header_table[current-1].status, TAGGED))
  59.       clearit(header_table[current-1].status, TAGGED);
  60.     else
  61.       setit(header_table[current-1].status, TAGGED);
  62.  
  63.     show_msg_tag(current-1);
  64. }
  65.  
  66. show_msg_tag(msg)
  67. int msg;
  68. {
  69.     /** show the tag status of the current message only.  **/
  70.  
  71.     if (on_page(msg)) {
  72.       MoveCursor((msg % headers_per_page) + 4, 4);
  73.       if (msg == current && !arrow_cursor) {
  74.         StartBold();
  75.         Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
  76.         EndBold();
  77.       }
  78.       else
  79.         Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
  80.     }    
  81. }
  82.  
  83. show_new_status(msg)
  84. int msg;
  85. {
  86.     /** If the specified message is on this screen, show
  87.         the new status (could be marked for deletion now,
  88.         and could have tag removed...)
  89.     **/
  90.  
  91.     if (on_page(msg)) 
  92.       if (msg == current && !arrow_cursor) {
  93.         StartBold();
  94.         PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
  95.            ison(header_table[msg].status, DELETED)? 'D' : ' ',
  96.            ison(header_table[msg].status, TAGGED )? '+' : ' ');
  97.         EndBold();
  98.       }
  99.       else
  100.         PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
  101.            ison(header_table[msg].status, DELETED)? 'D' : ' ',
  102.            ison(header_table[msg].status, TAGGED )? '+' : ' ');
  103. }
  104.