home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume13 / contool / patch4.02 / patch.2
Encoding:
Text File  |  1991-06-18  |  53.9 KB  |  1,656 lines

  1. *** contool.info.orig    Wed May 29 12:09:21 1991
  2. --- contool.info    Wed May 29 11:59:50 1991
  3. ***************
  4. *** 58,63 ****
  5. --- 58,65 ----
  6.   
  7.   If "Flash icon" is selected, contool's icon will flash, alternating between the "Check console" and "Flash" images specified in the contool Properties dialog box.
  8.   
  9. + If "Log message" is selected, contool will write the message to the log file, provided that logging is enabled and occurs after filtering.
  10.   If "Open window" is selected, contool will open to a window (if iconic) and move in front of any obscuring windows.
  11.   
  12.   If "Timestamp" is selected, a timestamp will be written to the console before the message text.  Timestamping is further controlled by the timestamp resolution defined in the contool Properties dialog box.
  13. ***************
  14. *** 196,201 ****
  15. --- 198,217 ----
  16.   :stop
  17.   The End pattern text field contains a regular expression (see ed(1) for more on regular expressions) which will match the last line of a multi-line filter.
  18.   # 
  19. + :filter_timeout
  20. + This numeric text field determines how long contool will process a multi-line filter.  If contool does not receive a message matching the specified end pattern before the timeout value, the filter is disabled.  This prevents a filter with an erroneous end pattern from absorbing all subsequent console messages.
  21. + A timeout value of zero indicates that no timeout will be in effect.
  22. + This item is only enabled if "Type" is set to "Multi-line filter".
  23. + # 
  24. + :filter_timeout_units
  25. + This numeric text field determines how long contool will process a multi-line filter.  If contool does not receive a message matching the specified end pattern before the timeout value, the filter is disabled.  This prevents a filter with an erroneous end pattern from absorbing all subsequent console messages.
  26. + A timeout value of zero indicates that no timeout will be in effect.
  27. + This item is only enabled if "Type" is set to "Multi-line filter".
  28. + # 
  29.   :comment
  30.   The Comment text field should contain a short description of what the current filter does.  Since some filters can be quite arcane, this description can be helpful to new users.
  31.   
  32. ***************
  33. *** 217,222 ****
  34. --- 233,240 ----
  35.   
  36.   If "Flash icon" is selected, contool's icon will flash, alternating between the "Check console" and "Flash" images specified in the contool Properties dialog box.
  37.   
  38. + If "Log message" is selected, contool will write the message to the log file, provided that logging is enabled and occurs after filtering.
  39.   If "Open window" is selected, contool will open to a window (if iconic) and move in front of any obscuring windows.
  40.   
  41.   If "Timestamp" is selected, a timestamp will be written to the console before the message text.  Timestamping is further controlled by the timestamp resolution defined in the contool Properties dialog box.
  42. ***************
  43. *** 241,248 ****
  44.   :filters_apply
  45.   The Apply button takes the set of filters displayed in the filter list and makes them the current contool filter set.  Before Apply is pressed, any additions, deletions, or changes made to the filters remain local to the Filters dialog box.
  46.   
  47. ! Even after pressing Apply, the filter changes are not written to the configuration file.  In roder to make your changes take effect for subsequent invocations of contool, use the Save Configuration dialog box to write them to your configuration file.
  48.   # 
  49.   :filters_reset
  50.   The Reset button discards any changes you have made to the displayed filter set, restoring the filters to match the set currently in use by contool.
  51.   
  52. --- 259,272 ----
  53.   :filters_apply
  54.   The Apply button takes the set of filters displayed in the filter list and makes them the current contool filter set.  Before Apply is pressed, any additions, deletions, or changes made to the filters remain local to the Filters dialog box.
  55.   
  56. ! Even after pressing Apply, the filter changes are not written to the configuration file.  In order to make your changes take effect for subsequent invocations of contool, use the Save Configuration dialog box to write them to your configuration file.
  57.   # 
  58. + :filters_apply_and_save
  59. + The Apply and Save button takes the set of filters displayed in the filter list and makes them the current contool filter set.  The filters are then saved to the current configuration file, along with the current tool properties.  If you wish to save just the filters or just the tool properties, or wish to save to a different file, you should press the Apply button instead and use the more general purpose Save Configuration dialog box.
  60. + Before this button is pressed, any additions, deletions, or changes made to the filters remain local to the Filters dialog box.
  61. + # 
  62.   :filters_reset
  63.   The Reset button discards any changes you have made to the displayed filter set, restoring the filters to match the set currently in use by contool.
  64.   
  65. ***************
  66. *** 351,358 ****
  67.   This window allows you to send mail concerning contool to its developer.  You are encouraged to send comments and suggestions in order to make contool a better tool.
  68.   # 
  69.   :address
  70. ! This choice item lets you select the address to which your mail will be sent.  If your machine understands Internet-style addresses, you should use the first choice item.  If you are a UUCP-based site, you should use the second item.  If neither address works, use the third item to enter a valid address.
  71.   # 
  72.   :other_address
  73.   This text field is used to enter an e-mail address to which your mail will be sent.  It should only be used if the two default addresses do not work from your site.
  74.   # 
  75. --- 375,389 ----
  76.   This window allows you to send mail concerning contool to its developer.  You are encouraged to send comments and suggestions in order to make contool a better tool.
  77.   # 
  78.   :address
  79. ! This menu lets you select the address to which your message will be sent.  You should use the first selection for Internet-style mail, the second selection for Usenet-style mail, and the third selection for unusual addressing.
  80. ! If you select the third item, a text field will appear, allowing you to enter an appropriate e-mail address.
  81.   # 
  82. + :fixed_address
  83. + This menu lets you select the address to which your message will be sent.  You should use the first selection for Internet-style mail, the second selection for Usenet-style mail, and the third selection for unusual addressing.
  84. + If you select the third item, a text field will appear, allowing you to enter an appropriate e-mail address.
  85. + # 
  86.   :other_address
  87.   This text field is used to enter an e-mail address to which your mail will be sent.  It should only be used if the two default addresses do not work from your site.
  88.   # 
  89. ***************
  90. *** 361,366 ****
  91.   # 
  92.   :accept_send
  93.   Clicking this button will send your mail message to contool's developer.
  94. - # 
  95. - :cancel_mail
  96. - Clicking this button cancels the message you were going to send.
  97. --- 392,394 ----
  98. *** contool.c.orig    Wed May 29 12:09:24 1991
  99. --- contool.c    Wed May 29 09:26:31 1991
  100. ***************
  101. *** 39,45 ****
  102.   #include    <xview/icon.h>
  103.   #include    <xview/panel.h>
  104.   #include    <xview/textsw.h>
  105. ! #include    <xview/xv_xrect.h>
  106.   
  107.   #include    "manifest.h"
  108.   #include    "contool.h"
  109. --- 39,45 ----
  110.   #include    <xview/icon.h>
  111.   #include    <xview/panel.h>
  112.   #include    <xview/textsw.h>
  113. ! #include    <xview/notify.h>
  114.   
  115.   #include    "manifest.h"
  116.   #include    "contool.h"
  117. ***************
  118. *** 56,61 ****
  119. --- 56,63 ----
  120.   
  121.   PUBLIC    Server_image        load_icon();
  122.   
  123. + PRIVATE    Notify_value        blink_proc();
  124.   PRIVATE    short    good_bits[]  = {
  125.   #include    "icons/default_good.icon"
  126.                      };
  127. ***************
  128. *** 89,94 ****
  129. --- 91,97 ----
  130.   PRIVATE    int            old_time = 0;
  131.   PRIVATE    char            *program;
  132.   PRIVATE    FILE            *slave = NULL;
  133. + PRIVATE    int            filter_timeout = 0;
  134.   
  135.   PRIVATE    struct    itimerval    timer = {{0, 500000}, {0, 500000}};
  136.   
  137. ***************
  138. *** 131,153 ****
  139.   /************************************************************************/
  140.   
  141.   /************************************************************************/
  142. ! EXPORT    acquire_console()
  143.   
  144.   {
  145. !     if (ioctl(fileno(slave), TIOCCONS, NULL) == -1)
  146. !        abend("%s: could not attach to /dev/console", program);
  147.   }
  148.   
  149.   /************************************************************************/
  150. ! EXPORT    stop_blinking()
  151.   
  152. ! {    Icon    icon;
  153. !     notify_set_itimer_func(contool_base->base, NULL, ITIMER_REAL, NULL, NULL);
  154. !     icon = (Icon) xv_get(contool_base->base, FRAME_ICON);
  155. !     xv_set(icon, ICON_IMAGE, good, NULL);
  156. !     xv_set(contool_base->base, FRAME_ICON, icon, 0);
  157. !     blinking = FALSE;
  158.   }
  159.   
  160.   /************************************************************************/
  161. --- 134,154 ----
  162.   /************************************************************************/
  163.   
  164.   /************************************************************************/
  165. ! PRIVATE    stop_blinking()
  166.   
  167.   {
  168. !     if (filter_timeout <= 0)
  169. !        notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, NULL, NULL);
  170. !     change_icon(good, good == default_good_icon);
  171. !     blinking = FALSE;
  172.   }
  173.   
  174.   /************************************************************************/
  175. ! EXPORT    acquire_console()
  176.   
  177. ! {
  178. !     if (ioctl(fileno(slave), TIOCCONS, NULL) == -1)
  179. !        abend("%s: could not attach to /dev/console", program);
  180.   }
  181.   
  182.   /************************************************************************/
  183. ***************
  184. *** 157,165 ****
  185. --- 158,184 ----
  186.       curr_filter = NULL;
  187.       xv_set(contool_base->base, FRAME_LEFT_FOOTER, "", NULL);
  188.       end_command();
  189. +     filter_timeout = 0;
  190. +     if (!blinking && beep_count == 0)
  191. +        notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, NULL, NULL);
  192.   }
  193.   
  194.   /************************************************************************/
  195. + EXPORT    adjust_window_limit()
  196. + {    int    sw_len;
  197. +     char    *temp;
  198. +     sw_len = (int) xv_get(contool_base->display, TEXTSW_LENGTH);
  199. +     temp = (char *) malloc((unsigned) sw_len);
  200. +     xv_get(contool_base->display, TEXTSW_CONTENTS, 0, temp, sw_len);
  201. +     xv_set(contool_base->display, TEXTSW_MEMORY_MAXIMUM, defaults.max_size + defaults.max_size / 10, NULL);
  202. +     textsw_reset(contool_base->display, 0, 0);
  203. +     textsw_insert(contool_base->display, temp, sw_len);
  204. +     free(temp);
  205. + }
  206. + /************************************************************************/
  207.   /*    Various small features                        */
  208.   /************************************************************************/
  209.   
  210. ***************
  211. *** 364,370 ****
  212.             change_icon(bad, bad == default_bad_icon);
  213.          bad_is_up = !bad_is_up;
  214.          }
  215. !     if (beep_count == 0 && !blinking)
  216.          notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, NULL, NULL);
  217.       return(NOTIFY_DONE);
  218.   }
  219. --- 383,392 ----
  220.             change_icon(bad, bad == default_bad_icon);
  221.          bad_is_up = !bad_is_up;
  222.          }
  223. !     if (filter_timeout > 0)
  224. !        if (--filter_timeout <= 0)
  225. !           filters_changed();
  226. !     if (beep_count == 0 && !blinking && filter_timeout <= 0)
  227.          notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, NULL, NULL);
  228.       return(NOTIFY_DONE);
  229.   }
  230. ***************
  231. *** 379,389 ****
  232.   
  233.   {
  234.       event_in_progress = TRUE;
  235. !     if (event_action(event) == ACTION_OPEN && blinking) {
  236. !        notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, NULL, NULL);
  237. !        change_icon(good, good == default_good_icon);
  238. !        blinking = FALSE;
  239. !        }
  240.       event_in_progress = FALSE;
  241.       return(notify_next_event_func(frame, event, arg, type));
  242.   }
  243. --- 401,408 ----
  244.   
  245.   {
  246.       event_in_progress = TRUE;
  247. !     if (event_action(event) == ACTION_OPEN && blinking)
  248. !        stop_blinking();
  249.       event_in_progress = FALSE;
  250.       return(notify_next_event_func(frame, event, arg, type));
  251.   }
  252. ***************
  253. *** 404,409 ****
  254. --- 423,443 ----
  255.   }
  256.   
  257.   /************************************************************************/
  258. + PRIVATE    Notify_value    signal_proc(frame, sig, when)
  259. + Frame    frame;
  260. + int    sig;
  261. + Notify_signal_mode    when;
  262. + {
  263. +     if (sig == SIGUSR1)
  264. +        stop_blinking();
  265. +     else if (sig == SIGHUP)
  266. +        update_logging();
  267. +     return(NOTIFY_DONE);
  268. + }
  269. + /************************************************************************/
  270.   /*    Routines which handle capturing and displaying messages        */
  271.   /************************************************************************/
  272.   
  273. ***************
  274. *** 417,433 ****
  275.       char    *temp;
  276.   
  277.       while ((int) xv_get(contool_base->display, TEXTSW_LENGTH) + len > defaults.max_size) {
  278.          first = 1;
  279.          last = TEXTSW_INFINITY;
  280.          if (textsw_find_bytes(contool_base->display, &first, &last, "\n<<<", 4, 0) == -1)
  281.             if (textsw_find_bytes(contool_base->display, &first, &last, "\n", 1, 0) == -1)
  282. !              first = defaults.delete_amount;
  283. !        textsw_erase(contool_base->display, 0, first + 1);
  284. !        sw_len = (int) xv_get(contool_base->display, TEXTSW_LENGTH);
  285.          temp = (char *) malloc((unsigned) sw_len);
  286.          xv_get(contool_base->display, TEXTSW_CONTENTS, 0, temp, sw_len);
  287.          textsw_reset(contool_base->display, 0, 0);
  288. !        textsw_insert(contool_base->display, temp, sw_len);
  289.          free(temp);
  290.          }
  291.       xv_set(contool_base->display, TEXTSW_INSERTION_POINT, TEXTSW_INFINITY, 0);
  292. --- 451,466 ----
  293.       char    *temp;
  294.   
  295.       while ((int) xv_get(contool_base->display, TEXTSW_LENGTH) + len > defaults.max_size) {
  296. +        sw_len = (int) xv_get(contool_base->display, TEXTSW_LENGTH);
  297.          first = 1;
  298.          last = TEXTSW_INFINITY;
  299.          if (textsw_find_bytes(contool_base->display, &first, &last, "\n<<<", 4, 0) == -1)
  300.             if (textsw_find_bytes(contool_base->display, &first, &last, "\n", 1, 0) == -1)
  301. !              first = (defaults.delete_amount < sw_len)? defaults.delete_amount : sw_len;
  302.          temp = (char *) malloc((unsigned) sw_len);
  303.          xv_get(contool_base->display, TEXTSW_CONTENTS, 0, temp, sw_len);
  304.          textsw_reset(contool_base->display, 0, 0);
  305. !        textsw_insert(contool_base->display, temp + first, sw_len - first);
  306.          free(temp);
  307.          }
  308.       xv_set(contool_base->display, TEXTSW_INSERTION_POINT, TEXTSW_INFINITY, 0);
  309. ***************
  310. *** 501,511 ****
  311.                            if (f->stop == NULL)
  312.                               end_command();
  313.                            }
  314. !                       if (defaults.log_after)
  315.                    write_log(t);
  316.                         }
  317.                      if (f->stop) {
  318.                         curr_filter = f;
  319.                         sprintf(buf, "Filtering \"%s\"...", f->start);
  320.                         xv_set(contool_base->base, FRAME_LEFT_FOOTER, buf, NULL);
  321.                         }
  322. --- 534,545 ----
  323.                            if (f->stop == NULL)
  324.                               end_command();
  325.                            }
  326. !                       if (defaults.log_after && f->log)
  327.                    write_log(t);
  328.                         }
  329.                      if (f->stop) {
  330.                         curr_filter = f;
  331. +                       filter_timeout = f->timeout * 2;
  332.                         sprintf(buf, "Filtering \"%s\"...", f->start);
  333.                         xv_set(contool_base->base, FRAME_LEFT_FOOTER, buf, NULL);
  334.                         }
  335. ***************
  336. *** 519,525 ****
  337.                      continue_command(t);
  338.                      end_command();
  339.                      }
  340. !             if (defaults.log_after)
  341.                      write_log(t);
  342.                   do_insertion(t, strlen(t));
  343.                   update_value(do_blink, defaults.flash);
  344. --- 553,559 ----
  345.                      continue_command(t);
  346.                      end_command();
  347.                      }
  348. !             if (defaults.log_after && defaults.log)
  349.                      write_log(t);
  350.                   do_insertion(t, strlen(t));
  351.                   update_value(do_blink, defaults.flash);
  352. ***************
  353. *** 531,537 ****
  354.                if (curr_filter->save) {
  355.                   if (curr_filter->stamp)
  356.                      time_stamp();
  357. !             if (defaults.log_after)
  358.                      write_log(t);
  359.               do_insertion(t, strlen(t));
  360.               if (curr_filter->command)
  361. --- 565,571 ----
  362.                if (curr_filter->save) {
  363.                   if (curr_filter->stamp)
  364.                      time_stamp();
  365. !             if (defaults.log_after && curr_filter->log)
  366.                      write_log(t);
  367.               do_insertion(t, strlen(t));
  368.               if (curr_filter->command)
  369. ***************
  370. *** 557,563 ****
  371.             bad_is_up = TRUE;
  372.             notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, &timer, NULL);
  373.             }
  374. !     if (beep_count > 0 || blinking)
  375.          notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, &timer, NULL);
  376.       return(NOTIFY_DONE);
  377.   }
  378. --- 591,597 ----
  379.             bad_is_up = TRUE;
  380.             notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, &timer, NULL);
  381.             }
  382. !     if (beep_count > 0 || blinking || filter_timeout > 0)
  383.          notify_set_itimer_func(contool_base->base, blink_proc, ITIMER_REAL, &timer, NULL);
  384.       return(NOTIFY_DONE);
  385.   }
  386. ***************
  387. *** 604,609 ****
  388. --- 638,644 ----
  389.             defaults.log_file = log_file;
  390.          if (log)
  391.             enable_logging();
  392. +        adjust_window_limit();
  393.          }
  394.       else if (explicit_filters)
  395.          error("Could not read configuration file %s", filter_file);
  396. ***************
  397. *** 664,670 ****
  398.   
  399.       hints.res_class = "Contool";
  400.       hints.res_name = (p = rindex(program, '/'))? p + 1 : program;
  401. !     XSetClassHint(xv_get(contool_base->base, XV_DISPLAY), xv_get(xv_get(contool_base->base, XV_ROOT), XV_XID), &hints);
  402.   
  403.       parse_options(&argc, argv);
  404.       load_filters();
  405. --- 699,705 ----
  406.   
  407.       hints.res_class = "Contool";
  408.       hints.res_name = (p = rindex(program, '/'))? p + 1 : program;
  409. !     XSetClassHint(xv_get(contool_base->base, XV_DISPLAY), xv_get(contool_base->base, XV_XID), &hints);
  410.   
  411.       parse_options(&argc, argv);
  412.       load_filters();
  413. ***************
  414. *** 675,680 ****
  415. --- 710,717 ----
  416.       notify_set_input_func(contool_base->base, input_func, fileno(master));
  417.       notify_interpose_destroy_func(contool_base->base, destroy_proc);
  418.       notify_interpose_event_func(contool_base->base, close_proc, NOTIFY_SAFE);
  419. +     notify_set_signal_func(contool_base->base, signal_proc, SIGUSR1, NOTIFY_SYNC);
  420. +     notify_set_signal_func(contool_base->base, signal_proc, SIGHUP, NOTIFY_SYNC);
  421.   
  422.       xv_main_loop(contool_base->base);
  423.       exit(0);
  424. *** contool.h.orig    Wed May 29 12:09:25 1991
  425. --- contool.h    Wed May 29 08:13:12 1991
  426. ***************
  427. *** 28,35 ****
  428.   #define        BEEP_BIT        0x01
  429.   #define        COMMAND_BIT        0x02
  430.   #define        FLASH_BIT        0x04
  431. ! #define        OPEN_BIT        0x08
  432. ! #define        STAMP_BIT        0x10
  433.   
  434.   typedef    struct    filter    Filter;
  435.   typedef    struct    props    Props;
  436. --- 28,36 ----
  437.   #define        BEEP_BIT        0x01
  438.   #define        COMMAND_BIT        0x02
  439.   #define        FLASH_BIT        0x04
  440. ! #define        LOG_BIT            0x08
  441. ! #define        OPEN_BIT        0x10
  442. ! #define        STAMP_BIT        0x20
  443.   
  444.   typedef    struct    filter    Filter;
  445.   typedef    struct    props    Props;
  446. ***************
  447. *** 44,51 ****
  448. --- 45,54 ----
  449.            int    save;
  450.            int    beep;
  451.            int    flash;
  452. +          int    log;
  453.            int    open;
  454.            int    stamp;
  455. +          int    timeout;
  456.            char    *command;
  457.            Filter    *next;
  458.           };
  459. ***************
  460. *** 52,57 ****
  461. --- 55,61 ----
  462.   
  463.   struct    props    {int    beep;
  464.            int    flash;
  465. +          int    log;
  466.            int    open;
  467.            int    stamp;
  468.            char    *command;
  469. ***************
  470. *** 75,77 ****
  471. --- 79,82 ----
  472.   PUBLIC    Filter    *filters;
  473.   PUBLIC    int    parse_errors_occured;
  474.   PUBLIC    char    *filter_file;
  475. + PUBLIC    int    filter_version;
  476. *** contool_ui.h.orig    Wed May 29 12:09:29 1991
  477. --- contool_ui.h    Wed May 29 11:59:48 1991
  478. ***************
  479. *** 15,20 ****
  480. --- 15,21 ----
  481.   extern Xv_opaque    contool_filter_insert_menu_create();
  482.   extern Xv_opaque    contool_filter_edit_menu_create();
  483.   extern Xv_opaque    contool_filter_paste_menu_create();
  484. + extern Xv_opaque    contool_address_menu_create();
  485.   
  486.   typedef struct {
  487.       Xv_opaque    base;
  488. ***************
  489. *** 90,95 ****
  490. --- 91,98 ----
  491.       Xv_opaque    filter_type;
  492.       Xv_opaque    start;
  493.       Xv_opaque    stop;
  494. +     Xv_opaque    filter_timeout;
  495. +     Xv_opaque    filter_timeout_units;
  496.       Xv_opaque    comment;
  497.       Xv_opaque    ignore;
  498.       Xv_opaque    action;
  499. ***************
  500. *** 97,102 ****
  501. --- 100,106 ----
  502.       Xv_opaque    filter_beep_times;
  503.       Xv_opaque    filter_command;
  504.       Xv_opaque    filters_apply;
  505. +     Xv_opaque    filters_apply_and_save;
  506.       Xv_opaque    filters_reset;
  507.   } contool_filters_objects;
  508.   
  509. ***************
  510. *** 111,116 ****
  511. --- 115,122 ----
  512.   extern Xv_opaque    contool_filters_filter_type_create();
  513.   extern Xv_opaque    contool_filters_start_create();
  514.   extern Xv_opaque    contool_filters_stop_create();
  515. + extern Xv_opaque    contool_filters_filter_timeout_create();
  516. + extern Xv_opaque    contool_filters_filter_timeout_units_create();
  517.   extern Xv_opaque    contool_filters_comment_create();
  518.   extern Xv_opaque    contool_filters_ignore_create();
  519.   extern Xv_opaque    contool_filters_action_create();
  520. ***************
  521. *** 118,123 ****
  522. --- 124,130 ----
  523.   extern Xv_opaque    contool_filters_filter_beep_times_create();
  524.   extern Xv_opaque    contool_filters_filter_command_create();
  525.   extern Xv_opaque    contool_filters_filters_apply_create();
  526. + extern Xv_opaque    contool_filters_filters_apply_and_save_create();
  527.   extern Xv_opaque    contool_filters_filters_reset_create();
  528.   
  529.   typedef struct {
  530. ***************
  531. *** 204,214 ****
  532.       Xv_opaque    message21;
  533.       Xv_opaque    message22;
  534.       Xv_opaque    address;
  535.       Xv_opaque    other_address;
  536.       Xv_opaque    message;
  537.       Xv_opaque    mail_controls1;
  538.       Xv_opaque    accept_send;
  539. -     Xv_opaque    cancel_mail;
  540.   } contool_mail_objects;
  541.   
  542.   extern contool_mail_objects    *contool_mail_objects_initialize();
  543. --- 211,221 ----
  544.       Xv_opaque    message21;
  545.       Xv_opaque    message22;
  546.       Xv_opaque    address;
  547. +     Xv_opaque    fixed_address;
  548.       Xv_opaque    other_address;
  549.       Xv_opaque    message;
  550.       Xv_opaque    mail_controls1;
  551.       Xv_opaque    accept_send;
  552.   } contool_mail_objects;
  553.   
  554.   extern contool_mail_objects    *contool_mail_objects_initialize();
  555. ***************
  556. *** 218,226 ****
  557.   extern Xv_opaque    contool_mail_message21_create();
  558.   extern Xv_opaque    contool_mail_message22_create();
  559.   extern Xv_opaque    contool_mail_address_create();
  560.   extern Xv_opaque    contool_mail_other_address_create();
  561.   extern Xv_opaque    contool_mail_message_create();
  562.   extern Xv_opaque    contool_mail_mail_controls1_create();
  563.   extern Xv_opaque    contool_mail_accept_send_create();
  564. - extern Xv_opaque    contool_mail_cancel_mail_create();
  565.   #endif
  566. --- 225,233 ----
  567.   extern Xv_opaque    contool_mail_message21_create();
  568.   extern Xv_opaque    contool_mail_message22_create();
  569.   extern Xv_opaque    contool_mail_address_create();
  570. + extern Xv_opaque    contool_mail_fixed_address_create();
  571.   extern Xv_opaque    contool_mail_other_address_create();
  572.   extern Xv_opaque    contool_mail_message_create();
  573.   extern Xv_opaque    contool_mail_mail_controls1_create();
  574.   extern Xv_opaque    contool_mail_accept_send_create();
  575.   #endif
  576. *** filters.c.orig    Wed May 29 12:09:32 1991
  577. --- filters.c    Wed May 29 08:13:11 1991
  578. ***************
  579. *** 161,166 ****
  580. --- 161,168 ----
  581.          xv_set(contool_filters->filter_type, PANEL_INACTIVE, FALSE, PANEL_VALUE, f->stop? 1 : 0, NULL);
  582.          xv_set(contool_filters->start, PANEL_INACTIVE, FALSE, PANEL_VALUE, is_null(f->start), NULL);
  583.          xv_set(contool_filters->stop, PANEL_INACTIVE, f->stop == NULL, PANEL_VALUE, is_null(f->stop), NULL);
  584. +        xv_set(contool_filters->filter_timeout, PANEL_INACTIVE, f->stop == NULL, PANEL_VALUE, f->timeout, NULL);
  585. +        xv_set(contool_filters->filter_timeout_units, PANEL_INACTIVE, f->stop == NULL, NULL);
  586.          xv_set(contool_filters->comment, PANEL_INACTIVE, FALSE, PANEL_VALUE, is_null(f->comment), NULL);
  587.          xv_set(contool_filters->ignore, PANEL_INACTIVE, FALSE, PANEL_VALUE, f->save? 0 : 1, NULL);
  588.          if (f->save) {
  589. ***************
  590. *** 183,188 ****
  591. --- 185,192 ----
  592.                xv_set(contool_filters->filter_command, PANEL_INACTIVE, TRUE, NULL);
  593.             if (f->flash)
  594.                i |= FLASH_BIT;
  595. +           if (f->log)
  596. +              i |= LOG_BIT;
  597.             if (f->open)
  598.                i |= OPEN_BIT;
  599.             if (f->stamp)
  600. ***************
  601. *** 197,212 ****
  602.             }
  603.          }
  604.       else {
  605. !        xv_set(contool_filters->filter_update,     PANEL_INACTIVE, TRUE, NULL);
  606. !        xv_set(contool_filters->filter_type,       PANEL_INACTIVE, TRUE, NULL);
  607. !        xv_set(contool_filters->start,             PANEL_INACTIVE, TRUE, NULL);
  608. !        xv_set(contool_filters->stop,              PANEL_INACTIVE, TRUE, NULL);
  609. !        xv_set(contool_filters->comment,           PANEL_INACTIVE, TRUE, NULL);
  610. !        xv_set(contool_filters->ignore,            PANEL_INACTIVE, TRUE, NULL);
  611. !        xv_set(contool_filters->action,            PANEL_INACTIVE, TRUE, NULL);
  612. !        xv_set(contool_filters->filter_beep_count, PANEL_INACTIVE, TRUE, NULL);
  613. !        xv_set(contool_filters->filter_beep_times, PANEL_INACTIVE, TRUE, NULL);
  614. !        xv_set(contool_filters->filter_command,    PANEL_INACTIVE, TRUE, NULL);
  615.          }
  616.   }
  617.   
  618. --- 201,218 ----
  619.             }
  620.          }
  621.       else {
  622. !        xv_set(contool_filters->filter_update,        PANEL_INACTIVE, TRUE, NULL);
  623. !        xv_set(contool_filters->filter_type,          PANEL_INACTIVE, TRUE, NULL);
  624. !        xv_set(contool_filters->filter_timeout,       PANEL_INACTIVE, TRUE, NULL);
  625. !        xv_set(contool_filters->filter_timeout_units, PANEL_INACTIVE, TRUE, NULL);
  626. !        xv_set(contool_filters->start,                PANEL_INACTIVE, TRUE, NULL);
  627. !        xv_set(contool_filters->stop,                 PANEL_INACTIVE, TRUE, NULL);
  628. !        xv_set(contool_filters->comment,              PANEL_INACTIVE, TRUE, NULL);
  629. !        xv_set(contool_filters->ignore,               PANEL_INACTIVE, TRUE, NULL);
  630. !        xv_set(contool_filters->action,               PANEL_INACTIVE, TRUE, NULL);
  631. !        xv_set(contool_filters->filter_beep_count,    PANEL_INACTIVE, TRUE, NULL);
  632. !        xv_set(contool_filters->filter_beep_times,    PANEL_INACTIVE, TRUE, NULL);
  633. !        xv_set(contool_filters->filter_command,       PANEL_INACTIVE, TRUE, NULL);
  634.          }
  635.   }
  636.   
  637. ***************
  638. *** 263,270 ****
  639. --- 269,278 ----
  640.       f->beep = defaults.beep;
  641.       f->command = strsave(defaults.command);
  642.       f->flash = defaults.flash;
  643. +     f->log = defaults.log;
  644.       f->open = defaults.open;
  645.       f->stamp = defaults.stamp;
  646. +     f->timeout = 0;
  647.       f->save = TRUE;
  648.       update_controls();
  649.   /* update the scrolling view */
  650. ***************
  651. *** 315,322 ****
  652.             error("You must specify a starting message pattern");
  653.          return(FALSE);
  654.          }
  655. !     if (xv_get(contool_filters->filter_type, PANEL_VALUE) == 1)
  656.          stop = (char *) xv_get(contool_filters->stop, PANEL_VALUE);
  657.       else
  658.          stop = NULL;
  659.       if (msg = compile_exp(f, start, stop)) {
  660. --- 323,336 ----
  661.             error("You must specify a starting message pattern");
  662.          return(FALSE);
  663.          }
  664. !     if (xv_get(contool_filters->filter_type, PANEL_VALUE) == 1) {
  665.          stop = (char *) xv_get(contool_filters->stop, PANEL_VALUE);
  666. +        if (is_empty(stop)) {
  667. +           if (flag)
  668. +              error("You must specify an ending message pattern");
  669. +           return(FALSE);
  670. +           }
  671. +        }
  672.       else
  673.          stop = NULL;
  674.       if (msg = compile_exp(f, start, stop)) {
  675. ***************
  676. *** 341,346 ****
  677. --- 355,361 ----
  678.          else
  679.             f->beep = 0;
  680.          f->flash = (i & FLASH_BIT)? TRUE : FALSE;
  681. +        f->log = (i & LOG_BIT)? TRUE : FALSE;
  682.          f->open = (i & OPEN_BIT)? TRUE : FALSE;
  683.          f->stamp = (i & STAMP_BIT)? TRUE : FALSE;
  684.          f->save = TRUE;
  685. ***************
  686. *** 347,352 ****
  687. --- 362,368 ----
  688.          }
  689.       else
  690.          f->save = FALSE;
  691. +     f->timeout = (stop == NULL)? 0 : (int) xv_get(contool_filters->filter_timeout, PANEL_VALUE);
  692.       f->start = strsave(start);
  693.       f->stop = strsave(stop);
  694.       f->comment = strsave((char *) xv_get(contool_filters->comment, PANEL_VALUE));
  695. ***************
  696. *** 713,718 ****
  697. --- 729,736 ----
  698.   
  699.   {
  700.       xv_set(contool_filters->stop, PANEL_INACTIVE, value == 0, NULL);
  701. +     xv_set(contool_filters->filter_timeout, PANEL_INACTIVE, value == 0, NULL);
  702. +     xv_set(contool_filters->filter_timeout_units, PANEL_INACTIVE, value == 0, NULL);
  703.   }
  704.   
  705.   /************************************************************************/
  706. ***************
  707. *** 787,794 ****
  708.          diff = TRUE;
  709.       else if ((f->command != NULL && new.command == NULL) || (f->command == NULL && new.command != NULL))
  710.          diff = TRUE;
  711. !     else if (f->save != new.save || f->beep != new.beep || f->flash != new.flash || f->open != new.open || f->stamp != new.stamp)
  712.          diff = TRUE;
  713.       else if (f->start && strcmp(f->start, new.start) != 0)
  714.          diff = TRUE;
  715.       else if (f->stop && strcmp(f->stop, new.stop) != 0)
  716. --- 805,814 ----
  717.          diff = TRUE;
  718.       else if ((f->command != NULL && new.command == NULL) || (f->command == NULL && new.command != NULL))
  719.          diff = TRUE;
  720. !     else if (new.stop && f->timeout != new.timeout)
  721.          diff = TRUE;
  722. +     else if (f->save != new.save || f->beep != new.beep || f->flash != new.flash || f->log != new.log || f->open != new.open || f->stamp != new.stamp)
  723. +        diff = TRUE;
  724.       else if (f->start && strcmp(f->start, new.start) != 0)
  725.          diff = TRUE;
  726.       else if (f->stop && strcmp(f->stop, new.stop) != 0)
  727. ***************
  728. *** 825,834 ****
  729.       int    i, total;
  730.       char    *msg = NULL;
  731.   
  732. !     if (!check_for_update()) {
  733. !        xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  734.          return;
  735. -        }
  736.   
  737.       total = (int) xv_get(contool_filters->filter_list, PANEL_LIST_NROWS);
  738.       for (i = 0; i < total; i++)
  739. --- 845,854 ----
  740.       int    i, total;
  741.       char    *msg = NULL;
  742.   
  743. !     xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  744. !     if (!check_for_update())
  745.          return;
  746.   
  747.       total = (int) xv_get(contool_filters->filter_list, PANEL_LIST_NROWS);
  748.       for (i = 0; i < total; i++)
  749. ***************
  750. *** 839,845 ****
  751.             xv_set(contool_filters->filter_list, PANEL_LIST_SELECT, i, TRUE, NULL);
  752.             update_controls();
  753.             error(msg? msg : "No pattern is specified for the indicated filter");
  754. -           xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  755.             return;
  756.             }
  757.       free_list(filters);
  758. --- 859,864 ----
  759. ***************
  760. *** 852,857 ****
  761. --- 871,890 ----
  762.          clipboard = NULL;
  763.          }
  764.       filters_changed();
  765. +     xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, NULL);
  766. + }
  767. + /************************************************************************/
  768. + EXPORT    void    accept_and_save_filters(item, event)
  769. + Panel_item    item;
  770. + Event        *event;
  771. + {
  772. +     accept_filters(item, event);
  773. +     if (xv_get(item, PANEL_NOTIFY_STATUS) == XV_OK)
  774. +        if (!store_filters_to_file(filter_file, TRUE, TRUE))
  775. +           xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  776.   }
  777.   
  778.   /************************************************************************/
  779. *** getopt.c.orig    Wed May 29 12:09:33 1991
  780. --- getopt.c    Fri May 17 09:10:22 1991
  781. ***************
  782. *** 0 ****
  783. --- 1,64 ----
  784. + /************************************************************************/
  785. + /*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  786. + /*                                    */
  787. + /*    Full ownership of this software, and all rights pertaining to     */
  788. + /*    the for-profit distribution of this software, are retained by     */
  789. + /*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  790. + /*    use this software without fee.  This software is provided "as     */
  791. + /*    is" without express or implied warranty.  You may redistribute     */
  792. + /*    this software, provided that this copyright notice is retained,    */
  793. + /*    and that the software is not distributed for profit.  If you     */
  794. + /*    wish to use this software in a profit-making venture, you must     */
  795. + /*    first license this code and its underlying technology from     */
  796. + /*    Harris Corporation.                         */
  797. + /*                                    */
  798. + /*    Bottom line: you can have this software, you can use it, you     */
  799. + /*    can give it away.  You just can't sell any or all parts of it     */
  800. + /*    without prior permission from Harris Corporation.         */
  801. + /************************************************************************/
  802. + #include    <stdio.h>
  803. + #include    "manifest.h"
  804. + /************************************************************************/
  805. + PRIVATE    delarg(argc, argv)
  806. + int    *argc;
  807. + char    **argv;
  808. + {    char    *p;
  809. +     while (*argv = *(argv+1))
  810. +        argv++;
  811. +     (*argc)--;
  812. + }
  813. + /************************************************************************/
  814. + EXPORT    char    getopt(argc, argv, opts, parm)
  815. + int    *argc;
  816. + char    **argv;
  817. + char    *opts;
  818. + char    **parm;
  819. + {    char    c, *p, *strcpy(), *index();
  820. +     int    killed;
  821. +     *parm = NULL;
  822. +     while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
  823. +        argv++;
  824. +     if (*argv == NULL)
  825. +        return(EOF);
  826. +     c = *(*argv+1);
  827. +     *++(*argv) = '-';
  828. +     if (killed = (*(*argv+1) == '\0'))
  829. +        delarg(argc, argv);
  830. +     if ((p = index(opts, c)) == NULL)
  831. +        c = '\0';
  832. +     else if (*(p+1) == ':') {
  833. +        *parm = killed ? *argv : *argv+1;
  834. +        delarg(argc, argv);
  835. +        }
  836. +     return(c);
  837. + }
  838. *** lex.c.orig    Wed May 29 12:09:34 1991
  839. --- lex.c    Wed May 29 08:13:11 1991
  840. ***************
  841. *** 41,46 ****
  842. --- 41,47 ----
  843.                    {"flash_icon",           FLASH_ICON},
  844.                    {"good_icon",            GOOD_ICON},
  845.                    {"ignore",               IGNORE},
  846. +                  {"log",                  LOG},
  847.                    {"log_before_filtering", LOG_BEFORE_FILTERING},
  848.                    {"log_file",             LOG_FILE},
  849.                    {"match",                MATCH},
  850. ***************
  851. *** 53,60 ****
  852. --- 54,63 ----
  853.                    {"quiet",                QUIET},
  854.                    {"save",                 SAVE},
  855.                    {"stamp",                STAMP},
  856. +                  {"timeout",              TIMEOUT},
  857.                    {"timestamp",            TIMESTAMP},
  858.                    {"to",                   TO},
  859. +                  {"version",              VERSION},
  860.                    {"yes",                  YES}};
  861.   
  862.   PRIVATE    struct    {char    first;
  863. ***************
  864. *** 100,121 ****
  865.   }
  866.   
  867.   /************************************************************************/
  868. - PRIVATE    fix_escapes(buf)
  869. - char    *buf;
  870. - {    char    *q;
  871. -     int    i;
  872. -     for (q = buf; *buf; buf++, q++)
  873. -        if (*buf == '\\')
  874. -           *q = *++buf;
  875. -        else
  876. -           *q = *buf;
  877. -     *q = '\0';
  878. - }
  879. - /************************************************************************/
  880.   PRIVATE    int    is_keyword(s)
  881.   
  882.   char    *s;
  883. --- 103,108 ----
  884. ***************
  885. *** 164,179 ****
  886.          }
  887.       else if (c == '"' || c == '\'') {
  888.          for (p = buf; TRUE; p++)
  889. !           if ((*p = getch()) == c)
  890. !              break;
  891. !           else if (*p == '\\')
  892. !              *++p = getch();
  893.             else if (*p == '\n' || *p == '\r') {
  894.                yyerror("Newline in string not allowed");
  895.                break;
  896.                }
  897.          *p = '\0';
  898. -        fix_escapes(buf);
  899.          yylval.cpval = strsave(buf);
  900.          RETURN(STRING);
  901.          }
  902. --- 151,169 ----
  903.          }
  904.       else if (c == '"' || c == '\'') {
  905.          for (p = buf; TRUE; p++)
  906. !           if ((*p = getch()) == c) {
  907. !              if ((c1 = getch()) != c) {
  908. !                 ungetc = c1;
  909. !                 break;
  910. !                 }
  911. !              }
  912. !           else if (*p == '\\' && filter_version < 310)
  913. !              *p = getch();
  914.             else if (*p == '\n' || *p == '\r') {
  915.                yyerror("Newline in string not allowed");
  916.                break;
  917.                }
  918.          *p = '\0';
  919.          yylval.cpval = strsave(buf);
  920.          RETURN(STRING);
  921.          }
  922. *** load.c.orig    Wed May 29 12:09:35 1991
  923. --- load.c    Tue May 28 14:16:42 1991
  924. ***************
  925. *** 79,86 ****
  926.             }
  927.          else {
  928.             kind = (int) xv_get(ip->load_type, PANEL_VALUE);
  929. !           if (kind & 1 && parsed_defaults)
  930.                defaults = *parsed_defaults;
  931.             if (kind & 2)
  932.                filters = parsed_filters;
  933.             free(parsed_defaults);
  934. --- 79,88 ----
  935.             }
  936.          else {
  937.             kind = (int) xv_get(ip->load_type, PANEL_VALUE);
  938. !           if (kind & 1 && parsed_defaults) {
  939.                defaults = *parsed_defaults;
  940. +              adjust_window_limit();
  941. +              }
  942.             if (kind & 2)
  943.                filters = parsed_filters;
  944.             free(parsed_defaults);
  945. *** load_icon.c.orig    Wed May 29 12:09:35 1991
  946. --- load_icon.c    Thu May 23 11:59:02 1991
  947. ***************
  948. *** 29,35 ****
  949.   #define        ICON_PATH        ".:./icons:/usr/local/images:/usr/include/images"
  950.   #endif
  951.   
  952. ! PUBLIC    char    *getenv();
  953.   
  954.   /************************************************************************/
  955.   EXPORT    Server_image    load_icon(path, message)
  956. --- 29,35 ----
  957.   #define        ICON_PATH        ".:./icons:/usr/local/images:/usr/include/images"
  958.   #endif
  959.   
  960. ! PUBLIC    char    *getenv(), *index();
  961.   
  962.   /************************************************************************/
  963.   EXPORT    Server_image    load_icon(path, message)
  964. *** misc.c.orig    Wed May 29 12:09:37 1991
  965. --- misc.c    Fri May 24 13:42:46 1991
  966. ***************
  967. *** 24,29 ****
  968. --- 24,31 ----
  969.   #include    "manifest.h"
  970.   #include    "contool.h"
  971.   
  972. + PUBLIC    char    *index();
  973.   /************************************************************************/
  974.   EXPORT    int    getline(stream, string, max)
  975.   
  976. ***************
  977. *** 43,90 ****
  978.   }
  979.   
  980.   /************************************************************************/
  981. - PRIVATE    delarg(argc, argv)
  982. - int    *argc;
  983. - char    **argv;
  984. - {    char    *p;
  985. -     while (*argv = *(argv+1))
  986. -        argv++;
  987. -     (*argc)--;
  988. - }
  989. - /************************************************************************/
  990. - EXPORT    char    getopt(argc, argv, opts, parm)
  991. - int    *argc;
  992. - char    **argv;
  993. - char    *opts;
  994. - char    **parm;
  995. - {    char    c, *p, *strcpy(), *index();
  996. -     int    killed;
  997. -     *parm = NULL;
  998. -     while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
  999. -        argv++;
  1000. -     if (*argv == NULL)
  1001. -        return(EOF);
  1002. -     c = *(*argv+1);
  1003. -     *++(*argv) = '-';
  1004. -     if (killed = (*(*argv+1) == '\0'))
  1005. -        delarg(argc, argv);
  1006. -     if ((p = index(opts, c)) == NULL)
  1007. -        c = '\0';
  1008. -     else if (*(p+1) == ':') {
  1009. -        *parm = killed ? *argv : *argv+1;
  1010. -        delarg(argc, argv);
  1011. -        }
  1012. -     return(c);
  1013. - }
  1014. - /************************************************************************/
  1015.   EXPORT    int    verify(source, valid)
  1016.   
  1017.   char    *source;
  1018. --- 45,50 ----
  1019. ***************
  1020. *** 256,263 ****
  1021.       char    *p;
  1022.   
  1023.       for (p = buf; *s; s++, p++)
  1024. !        if (*s == '\\' || *s == '"') {
  1025. !           *p++ = '\\';
  1026.             *p = *s;
  1027.             }
  1028.          else
  1029. --- 216,223 ----
  1030.       char    *p;
  1031.   
  1032.       for (p = buf; *s; s++, p++)
  1033. !        if (*s == '"') {
  1034. !           *p++ = '"';
  1035.             *p = *s;
  1036.             }
  1037.          else
  1038. *** parse.y.orig    Wed May 29 12:09:38 1991
  1039. --- parse.y    Wed May 29 10:10:58 1991
  1040. ***************
  1041. *** 27,32 ****
  1042. --- 27,33 ----
  1043.   
  1044.   EXPORT    Props    *parsed_defaults;
  1045.   EXPORT    Filter    *parsed_filters;
  1046. + EXPORT    int    filter_version = 0;
  1047.   
  1048.   EXPORT    int    parse_errors_occured;
  1049.   
  1050. ***************
  1051. *** 53,62 ****
  1052.   %token        LBRACE RBRACE
  1053.   
  1054.   %token        BEEP CHECK_ICON COMMAND COMMENT DEFAULTS DELETE DISPLAY FILTERS
  1055. !         FLASH FLASH_ICON GOOD_ICON IGNORE LOG_BEFORE_FILTERING LOG_FILE
  1056. !         MATCH NO NOFLASH NOOPEN NOSTAMP OPEN PRINT QUIET SAVE STAMP TIMESTAMP TO YES
  1057.   
  1058. ! %type    <ival>    beep flash old_flash old_open old_stamp open stamp yes_no
  1059.   %type    <cpval>    command old_end_string string
  1060.   %type    <fval>    filter filter_list old_filter old_filter_list old_ignore old_quiet old_save
  1061.   
  1062. --- 54,64 ----
  1063.   %token        LBRACE RBRACE
  1064.   
  1065.   %token        BEEP CHECK_ICON COMMAND COMMENT DEFAULTS DELETE DISPLAY FILTERS
  1066. !         FLASH FLASH_ICON GOOD_ICON IGNORE LOG LOG_BEFORE_FILTERING LOG_FILE
  1067. !         MATCH NO NOFLASH NOOPEN NOSTAMP OPEN PRINT QUIET SAVE STAMP TIMEOUT
  1068. !         TIMESTAMP TO VERSION YES
  1069.   
  1070. ! %type    <ival>    beep flash log old_flash old_open old_stamp open stamp yes_no
  1071.   %type    <cpval>    command old_end_string string
  1072.   %type    <fval>    filter filter_list old_filter old_filter_list old_ignore old_quiet old_save
  1073.   
  1074. ***************
  1075. *** 100,105 ****
  1076. --- 102,109 ----
  1077.                         f->flash    = $3;
  1078.                         f->open     = $4;
  1079.                         f->stamp    = $5;
  1080. +                       f->timeout  = 0;
  1081. +                       f->log      = TRUE;
  1082.                         f->start    = $6;
  1083.                         f->stop     = $7;
  1084.                         f->start_re = NULL;
  1085. ***************
  1086. *** 123,128 ****
  1087. --- 127,134 ----
  1088.                         f->flash    = FALSE;
  1089.                         f->open     = FALSE;
  1090.                         f->stamp    = FALSE;
  1091. +                       f->timeout  = 0;
  1092. +                       f->log      = TRUE;
  1093.                         f->start    = $2;
  1094.                         f->stop     = $3;
  1095.                         f->start_re = NULL;
  1096. ***************
  1097. *** 146,151 ****
  1098. --- 152,159 ----
  1099.                         f->flash    = FALSE;
  1100.                         f->open     = FALSE;
  1101.                         f->stamp    = TRUE;
  1102. +                       f->timeout  = 0;
  1103. +                       f->log      = TRUE;
  1104.                         f->start    = $2;
  1105.                         f->stop     = $3;
  1106.                         f->start_re = NULL;
  1107. ***************
  1108. *** 183,193 ****
  1109.                       { $$ = $2; }
  1110.           ;
  1111.   
  1112. ! new_style    :    defaults
  1113. !         |    filters
  1114. !         |    defaults filters
  1115.           ;
  1116.   
  1117.   defaults    :    DEFAULTS
  1118.                       { parsed_defaults = (Props *) malloc(sizeof(Props));
  1119.                         *parsed_defaults = defaults;
  1120. --- 191,207 ----
  1121.                       { $$ = $2; }
  1122.           ;
  1123.   
  1124. ! new_style    :    version defaults
  1125. !         |    version filters
  1126. !         |    version defaults filters
  1127.           ;
  1128.   
  1129. + version        :    empty
  1130. +                     { filter_version = 0; }
  1131. +         |    VERSION INTEGER
  1132. +                     { filter_version = $2; }
  1133. +         ;
  1134.   defaults    :    DEFAULTS
  1135.                       { parsed_defaults = (Props *) malloc(sizeof(Props));
  1136.                         *parsed_defaults = defaults;
  1137. ***************
  1138. *** 209,214 ****
  1139. --- 223,230 ----
  1140.                       { parsed_defaults->command = $1; }
  1141.           |    flash
  1142.                       { parsed_defaults->flash = $1; }
  1143. +         |    log
  1144. +                     { parsed_defaults->log = $1; }
  1145.           |    open
  1146.                       { parsed_defaults->open = $1; }
  1147.           |    stamp
  1148. ***************
  1149. *** 252,257 ****
  1150. --- 268,275 ----
  1151.   filter        :    LBRACE
  1152.                       { curr = (Filter *) malloc(sizeof(Filter));
  1153.                         bzero(curr, sizeof(Filter));
  1154. +                       if (filter_version < 310)
  1155. +                          curr->log = TRUE;
  1156.                       }
  1157.               filter_attr_list RBRACE
  1158.                       { char    *msg;
  1159. ***************
  1160. *** 274,279 ****
  1161. --- 292,299 ----
  1162.                       { curr->command = $1; }
  1163.           |    flash
  1164.                       { curr->flash = $1; }
  1165. +         |    log
  1166. +                     { curr->log = $1; }
  1167.           |    open
  1168.                       { curr->open = $1; }
  1169.           |    stamp
  1170. ***************
  1171. *** 284,289 ****
  1172. --- 304,311 ----
  1173.                       { curr->save = !$2; }
  1174.           |    MATCH string
  1175.                       { curr->start = $2; }
  1176. +         |    TIMEOUT INTEGER
  1177. +                     { curr->timeout = $2; }
  1178.           |    TO string
  1179.                       { curr->stop = $2; }
  1180.           ;
  1181. ***************
  1182. *** 296,301 ****
  1183. --- 318,327 ----
  1184.                       { $$ = $2; }
  1185.           ;
  1186.   flash        :    FLASH yes_no
  1187. +                     { $$ = $2; }
  1188. +         ;
  1189. + log        :    LOG yes_no
  1190.                       { $$ = $2; }
  1191.           ;
  1192.   
  1193. *** patchlevel.h.orig    Wed May 29 12:09:39 1991
  1194. --- patchlevel.h    Tue May 28 13:27:17 1991
  1195. ***************
  1196. *** 30,34 ****
  1197. --- 30,37 ----
  1198.   /*               comp.sources.x: Volume 10, Issue 78        */
  1199.   /*                                    */
  1200.   /*      3        Bug fixes; see README for details        */
  1201. + /*               comp.sources.x: Volume 11, Issue 4        */
  1202. + /*                                    */
  1203. + /*      4        Release of version 3.1; see README for details    */
  1204.   /*                                    */
  1205.   /************************************************************************/
  1206. *** props.c.orig    Wed May 29 12:09:41 1991
  1207. --- props.c    Tue May 28 14:16:40 1991
  1208. ***************
  1209. *** 37,42 ****
  1210. --- 37,43 ----
  1211.   
  1212.   EXPORT    Props    defaults = {3,        /* beeps             */
  1213.                   TRUE,    /* flash the icon         */
  1214. +                 TRUE,    /* write the message to the log     */
  1215.                   FALSE,    /* don't pop the window         */
  1216.                   TRUE,    /* timestamp the message     */
  1217.                   NULL,    /* no command to run         */
  1218. ***************
  1219. *** 67,72 ****
  1220. --- 68,75 ----
  1221.          val |= COMMAND_BIT;
  1222.       if (defaults.flash)
  1223.          val |= FLASH_BIT;
  1224. +     if (defaults.log)
  1225. +        val |= LOG_BIT;
  1226.       if (defaults.open)
  1227.          val |= OPEN_BIT;
  1228.       if (defaults.stamp > 0)
  1229. ***************
  1230. *** 170,175 ****
  1231. --- 173,179 ----
  1232.          new.command = NULL;
  1233.   
  1234.       new.flash            = (val & FLASH_BIT)? TRUE : FALSE;
  1235. +     new.log              = (val & LOG_BIT)? TRUE : FALSE;
  1236.       new.open             = (val & OPEN_BIT)? TRUE : FALSE;
  1237.       new.stamp            = (val & STAMP_BIT)? TRUE : FALSE;
  1238.       new.log_file         = (char *) xv_get(ip->log_file,         PANEL_VALUE);
  1239. ***************
  1240. *** 213,218 ****
  1241. --- 217,223 ----
  1242.       new.command = strsave(defaults.command);
  1243.       defaults = new;
  1244.   
  1245. +     adjust_window_limit();
  1246.       update_icons();
  1247.       update_logging();
  1248.   }
  1249. *** regexp.c.orig    Wed May 29 12:09:42 1991
  1250. --- regexp.c    Fri May 24 13:42:44 1991
  1251. ***************
  1252. *** 82,87 ****
  1253. --- 82,107 ----
  1254.   }
  1255.   
  1256.   /************************************************************************/
  1257. + PRIVATE    char    *fix_control_chars(s)
  1258. + char    *s;
  1259. + {    static    char    buf[2048];
  1260. +     char    *p;
  1261. +     for (p = buf; *s; s++, p++)
  1262. +        if (*s == '\\' && *(s + 1) >= '0' && *(s + 1) <= '7') {
  1263. +           for (*p = 0, s++; *s && *s >= '0' && *s <= '7'; s++)
  1264. +              *p = (*p << 3) + *s - '0';
  1265. +           s--;
  1266. +           }
  1267. +        else
  1268. +           *p = *s;
  1269. +     *p = '\0';
  1270. +     return(buf);
  1271. + }
  1272. + /************************************************************************/
  1273.   EXPORT    char    *compile_exp(filter, start, stop)
  1274.   
  1275.   Filter    *filter;
  1276. ***************
  1277. *** 93,104 ****
  1278.   
  1279.       sre = ere = NULL;
  1280.       if (start) {
  1281. !        if ((sre = compile(start, rbuf, rbuf+1024, '\0')) == NULL)
  1282.             return(error_message);
  1283.          sc = circf;
  1284.          }
  1285.       if (stop) {
  1286. !        if ((ere = compile(stop, rbuf, rbuf+1024, '\0')) == NULL) {
  1287.             cond_free(sre);
  1288.             return(error_message);
  1289.             }
  1290. --- 113,124 ----
  1291.   
  1292.       sre = ere = NULL;
  1293.       if (start) {
  1294. !        if ((sre = compile(fix_control_chars(start), rbuf, rbuf+1024, '\0')) == NULL)
  1295.             return(error_message);
  1296.          sc = circf;
  1297.          }
  1298.       if (stop) {
  1299. !        if ((ere = compile(fix_control_chars(stop), rbuf, rbuf+1024, '\0')) == NULL) {
  1300.             cond_free(sre);
  1301.             return(error_message);
  1302.             }
  1303. *** send_mail.c.orig    Wed May 29 12:09:43 1991
  1304. --- send_mail.c    Wed May 29 11:59:52 1991
  1305. ***************
  1306. *** 33,39 ****
  1307.   
  1308.   #include    "manifest.h"
  1309.   
  1310. ! #define        VERSION            "3.0c"
  1311.   
  1312.   PUBLIC    contool_base_objects    *contool_base;
  1313.   
  1314. --- 33,39 ----
  1315.   
  1316.   #include    "manifest.h"
  1317.   
  1318. ! #define        VERSION            "3.1"
  1319.   
  1320.   PUBLIC    contool_base_objects    *contool_base;
  1321.   
  1322. ***************
  1323. *** 56,77 ****
  1324.   }
  1325.   
  1326.   /************************************************************************/
  1327. ! EXPORT    void    handle_address(item, value, event)
  1328.   
  1329. ! Panel_item    item;
  1330. ! int        value;
  1331. ! Event        *event;
  1332.   
  1333. ! {
  1334. !     if (value == 2) {
  1335. !        xv_set(dialog->other_address, WIN_SHOW, TRUE, NULL);
  1336. !        panel_paint(dialog->address, PANEL_NO_CLEAR);
  1337. !        panel_paint(dialog->other_address, PANEL_NO_CLEAR);
  1338.          }
  1339. !     else {
  1340. !        xv_set(dialog->other_address, WIN_SHOW, FALSE, NULL);
  1341. !        panel_paint(dialog->address, PANEL_NO_CLEAR);
  1342. !        }
  1343.   }
  1344.   
  1345.   /************************************************************************/
  1346. --- 56,78 ----
  1347.   }
  1348.   
  1349.   /************************************************************************/
  1350. ! EXPORT    Menu    handle_address(menu, op)
  1351.   
  1352. ! Menu_item    menu;
  1353. ! Menu_generate    op;
  1354.   
  1355. ! {    char    *addr;
  1356. !     if (op == MENU_NOTIFY) {
  1357. !        addr = (char *) xv_get(menu, MENU_STRING);
  1358. !        xv_set(dialog->other_address, WIN_SHOW, strcmp(addr, "Other:") == 0, NULL);
  1359. !        xv_set(dialog->fixed_address, PANEL_LABEL_STRING, addr, NULL);
  1360. !        panel_paint(dialog->other_address, PANEL_CLEAR);
  1361. !        panel_paint(dialog->fixed_address, PANEL_CLEAR);
  1362.          }
  1363. !     xv_set(menu, MENU_NOTIFY_STATUS, XV_ERROR, NULL);
  1364. !     xv_set(xv_get(menu, MENU_PARENT), MENU_NOTIFY_STATUS, XV_ERROR, NULL);
  1365. !     return(menu);
  1366.   }
  1367.   
  1368.   /************************************************************************/
  1369. ***************
  1370. *** 95,103 ****
  1371.       FILE    *pipe;
  1372.   
  1373.       xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, 0);
  1374. !     val = (int) xv_get(dialog->address, PANEL_VALUE);
  1375. !     if (val != 2)
  1376. !        sprintf(cmd, "%s %s", MAILER, xv_get(dialog->address, PANEL_CHOICE_STRING, val));
  1377.       else {
  1378.          buf = (char *) xv_get(dialog->other_address, PANEL_VALUE);
  1379.          if (is_empty(buf)) {
  1380. --- 96,104 ----
  1381.       FILE    *pipe;
  1382.   
  1383.       xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, 0);
  1384. !     buf = (char *) xv_get(dialog->fixed_address, PANEL_LABEL_STRING);
  1385. !     if (strcmp(buf, "Other:") != 0)
  1386. !        sprintf(cmd, "%s %s", MAILER, buf);
  1387.       else {
  1388.          buf = (char *) xv_get(dialog->other_address, PANEL_VALUE);
  1389.          if (is_empty(buf)) {
  1390. ***************
  1391. *** 129,144 ****
  1392.       free(buf);
  1393.       textsw_reset(dialog->message, 0, 0);
  1394.       lets_get_busy(contool_base->base, FALSE, NULL);
  1395. -     xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
  1396. - }
  1397. - /************************************************************************/
  1398. - EXPORT    void    cancel_mail(item, event)
  1399. - Panel_item    item;
  1400. - Event        *event;
  1401. - {
  1402. -     textsw_reset(dialog->message, 0, 0);
  1403.       xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, 0);
  1404.   }
  1405. --- 130,134 ----
  1406. *** store.c.orig    Wed May 29 12:09:43 1991
  1407. --- store.c    Wed May 29 08:13:10 1991
  1408. ***************
  1409. *** 39,44 ****
  1410. --- 39,46 ----
  1411.   
  1412.   #define        yes_no(x)        ((x)? "yes" : "no")
  1413.   
  1414. + #define        FILTER_VERSION        310
  1415.   PUBLIC    contool_base_objects    *contool_base;
  1416.   
  1417.   PRIVATE    contool_store_objects    *contool_store = NULL;
  1418. ***************
  1419. *** 68,147 ****
  1420.   }
  1421.   
  1422.   /************************************************************************/
  1423. ! EXPORT    void    store_filters(item, event)
  1424.   
  1425. ! Panel_item    item;
  1426. ! Event        *event;
  1427.   
  1428. ! {    contool_store_objects    *ip = (contool_store_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1429. !     char    *path, buf[1024];
  1430.       FILE    *f;
  1431. -     int    kind;
  1432.       Filter    *filt;
  1433.   
  1434. -     path = expand_tilde(xv_get(ip->store_file, PANEL_VALUE));
  1435.       if (access(path, W_OK) == 0) {
  1436.          sprintf(buf, "File \"%s\" exists.  You can:", path);
  1437. !        kind = notice_prompt(contool_base->base, NULL,
  1438. !                       NOTICE_MESSAGE_STRINGS, buf, NULL,
  1439. !                       NOTICE_BUTTON_YES, "Overwrite",
  1440. !                       NOTICE_BUTTON_NO, "Cancel",
  1441. !                    NULL);
  1442. !        if (kind == 0) {
  1443. !           xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1444. !           free(path);
  1445. !           return;
  1446. !           }
  1447.          }
  1448.       if ((f = fopen(path, "w")) == NULL) {
  1449.          error("Cannot write to %s: %s", path, sys_errlist[errno]);
  1450. !        xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1451. !        free(path);
  1452.          }
  1453. !     else {
  1454. !        kind = (int) xv_get(ip->store_type, PANEL_VALUE);
  1455. !        if (kind & 1) {
  1456. !           fprintf(f, "defaults {\n");
  1457. !           fprintf(f, "   beep                 %d\n", defaults.beep);
  1458. !           fprintf(f, "   command              \"%s\"\n", check_escapes(is_null(defaults.command)));
  1459. !           fprintf(f, "   flash                %s\n", yes_no(defaults.flash));
  1460. !           fprintf(f, "   open                 %s\n", yes_no(defaults.open));
  1461. !           fprintf(f, "   stamp                %s\n", yes_no(defaults.stamp));
  1462. !           fprintf(f, "   good_icon            \"%s\"\n", is_null(defaults.good_icon));
  1463. !           fprintf(f, "   check_icon           \"%s\"\n", is_null(defaults.bad_icon));
  1464. !           fprintf(f, "   flash_icon           \"%s\"\n", is_null(defaults.flash_icon));
  1465. !           fprintf(f, "   print                \"%s\"\n", defaults.print_filter);
  1466. !           fprintf(f, "   log_file             \"%s\"\n", is_null(defaults.log_file));
  1467. !           fprintf(f, "   log_before_filtering %s\n", yes_no(!defaults.log_after));
  1468. !           fprintf(f, "   timestamp            %d\n", defaults.stamp_resolution);
  1469. !           fprintf(f, "   display              %d\n", defaults.max_size);
  1470. !           fprintf(f, "   delete               %d\n", defaults.delete_amount);
  1471. !           fprintf(f, "}\n");
  1472. !           }
  1473. !        if (kind & 2) {
  1474. !           fprintf(f, "filters {\n");
  1475. !           for (filt = filters; filt; filt = filt->next) {
  1476. !              fprintf(f, "   {\n");
  1477. !              fprintf(f, "      match   \"%s\"\n", check_escapes(filt->start));
  1478. !              if (filt->stop)
  1479. !                 fprintf(f, "      to      \"%s\"\n", check_escapes(filt->stop));
  1480. !              if (filt->comment)
  1481. !                 fprintf(f, "      comment \"%s\"\n", check_escapes(filt->comment));
  1482. !              if (filt->save) {
  1483. !                 fprintf(f, "      ignore  no\n");
  1484. !                 fprintf(f, "      beep    %d\n", filt->beep);
  1485. !                 fprintf(f, "      command \"%s\"\n", check_escapes(is_null(filt->command)));
  1486. !                 fprintf(f, "      flash   %s\n", yes_no(filt->flash));
  1487. !                 fprintf(f, "      open    %s\n", yes_no(filt->open));
  1488. !                 fprintf(f, "      stamp   %s\n", yes_no(filt->stamp));
  1489. !                 }
  1490. !              else
  1491. !                 fprintf(f, "      ignore  yes\n");
  1492. !              fprintf(f, "   }\n");
  1493.                }
  1494. !           fprintf(f, "}\n");
  1495.             }
  1496. !        fclose(f);
  1497.          filter_file = path;
  1498.          }
  1499.   }
  1500. --- 70,168 ----
  1501.   }
  1502.   
  1503.   /************************************************************************/
  1504. ! EXPORT    int    store_filters_to_file(path, save_filters, save_props)
  1505.   
  1506. ! char        *path;
  1507. ! int        save_filters;
  1508. ! int        save_props;
  1509.   
  1510. ! {    char    buf[1024];
  1511. !     int    answer;
  1512.       FILE    *f;
  1513.       Filter    *filt;
  1514.   
  1515.       if (access(path, W_OK) == 0) {
  1516.          sprintf(buf, "File \"%s\" exists.  You can:", path);
  1517. !        answer = notice_prompt(contool_base->base, NULL,
  1518. !                         NOTICE_MESSAGE_STRINGS, buf, NULL,
  1519. !                         NOTICE_BUTTON_YES, "Overwrite",
  1520. !                         NOTICE_BUTTON_NO, "Cancel",
  1521. !                      NULL);
  1522. !        if (answer == 0)
  1523. !           return(FALSE);
  1524.          }
  1525.       if ((f = fopen(path, "w")) == NULL) {
  1526.          error("Cannot write to %s: %s", path, sys_errlist[errno]);
  1527. !        return(FALSE);
  1528.          }
  1529. !     fprintf(f, "version %d\n", FILTER_VERSION);
  1530. !     if (save_props) {
  1531. !        fprintf(f, "defaults {\n");
  1532. !        fprintf(f, "   beep                 %d\n", defaults.beep);
  1533. !        fprintf(f, "   command              \"%s\"\n", check_escapes(is_null(defaults.command)));
  1534. !        fprintf(f, "   flash                %s\n", yes_no(defaults.flash));
  1535. !        fprintf(f, "   log                  %s\n", yes_no(defaults.log));
  1536. !        fprintf(f, "   open                 %s\n", yes_no(defaults.open));
  1537. !        fprintf(f, "   stamp                %s\n", yes_no(defaults.stamp));
  1538. !        fprintf(f, "   good_icon            \"%s\"\n", is_null(defaults.good_icon));
  1539. !        fprintf(f, "   check_icon           \"%s\"\n", is_null(defaults.bad_icon));
  1540. !        fprintf(f, "   flash_icon           \"%s\"\n", is_null(defaults.flash_icon));
  1541. !        fprintf(f, "   print                \"%s\"\n", defaults.print_filter);
  1542. !        fprintf(f, "   log_file             \"%s\"\n", is_null(defaults.log_file));
  1543. !        fprintf(f, "   log_before_filtering %s\n", yes_no(!defaults.log_after));
  1544. !        fprintf(f, "   timestamp            %d\n", defaults.stamp_resolution);
  1545. !        fprintf(f, "   display              %d\n", defaults.max_size);
  1546. !        fprintf(f, "   delete               %d\n", defaults.delete_amount);
  1547. !        fprintf(f, "}\n");
  1548. !        }
  1549. !     if (save_filters) {
  1550. !        fprintf(f, "filters {\n");
  1551. !        for (filt = filters; filt; filt = filt->next) {
  1552. !           fprintf(f, "   {\n");
  1553. !           fprintf(f, "      match   \"%s\"\n", check_escapes(filt->start));
  1554. !           if (filt->stop) {
  1555. !              fprintf(f, "      to      \"%s\"\n", check_escapes(filt->stop));
  1556. !              fprintf(f, "      timeout %d\n", filt->timeout);
  1557.                }
  1558. !           if (filt->comment)
  1559. !              fprintf(f, "      comment \"%s\"\n", check_escapes(filt->comment));
  1560. !           if (filt->save) {
  1561. !              fprintf(f, "      ignore  no\n");
  1562. !              fprintf(f, "      beep    %d\n", filt->beep);
  1563. !              fprintf(f, "      command \"%s\"\n", check_escapes(is_null(filt->command)));
  1564. !              fprintf(f, "      flash   %s\n", yes_no(filt->flash));
  1565. !              fprintf(f, "      log     %s\n", yes_no(filt->log));
  1566. !              fprintf(f, "      open    %s\n", yes_no(filt->open));
  1567. !              fprintf(f, "      stamp   %s\n", yes_no(filt->stamp));
  1568. !              }
  1569. !           else
  1570. !              fprintf(f, "      ignore  yes\n");
  1571. !           fprintf(f, "   }\n");
  1572.             }
  1573. !        fprintf(f, "}\n");
  1574. !        }
  1575. !     fclose(f);
  1576. !     return(TRUE);
  1577. ! }
  1578. ! /************************************************************************/
  1579. ! EXPORT    void    store_filters(item, event)
  1580. ! Panel_item    item;
  1581. ! Event        *event;
  1582. ! {    contool_store_objects    *ip = (contool_store_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1583. !     char    *path;
  1584. !     int    kind;
  1585. !     path = expand_tilde(xv_get(ip->store_file, PANEL_VALUE));
  1586. !     kind = (int) xv_get(ip->store_type, PANEL_VALUE);
  1587. !     if (store_filters_to_file(path, kind & 2, kind & 1)) {
  1588. !        xv_set(item, PANEL_NOTIFY_STATUS, XV_OK, NULL);
  1589.          filter_file = path;
  1590. +        }
  1591. +     else {
  1592. +        free(path);
  1593. +        xv_set(item, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1594.          }
  1595.   }
  1596.