FVWM: Patches so next/prev understand '!' for not

From: Douglas K. Rand <rand_at_dev-null.aero.und.edu>
Date: Wed, 23 Jul 1997 11:41:41 -0500 (CDT)

About a year ago I posted these patches so that the Next and Prev
commands would understand ! in front of screen names. For example I
use the following in my .fvwmrc to skip all the windows with names
that begin with "Fvwm" so I don't have to bother with my FvwmButtons
windows.

Key Prior A M Next [!Iconic CurrentDesk CurrentScreen !Fvwm*] FocusAndWarpToWindow
Key Next A M Prev [!Iconic CurrentDesk CurrentScreen !Fvwm*] FocusAndWarpToWindow
Key Prior A MC Next [!Iconic CurrentDesk !Fvwm*] FocusAndWarpToWindow
Key Next A MC Prev [!Iconic CurrentDesk !Fvwm*] FocusAndWarpToWindow

The patch is fairly simple, the only bad part about it is the using
the strings "NoClass" and "NoResource". The variables NoClass and
NoResource aren't available to libs/wild.c. I just recompiled FVWM on
another system and had to apply this again so I thought I'd send it
out again on the off chance it'd make the FVWM distribution.

*** wild.c-orig Tue Sep 13 14:11:47 1994
--- wild.c-dkr Wed Jul 23 11:31:13 1997
***************
*** 13,32 ****
   * This code donated by Paul Hudson <paulh_at_harlequin.co.uk>
   * It is public domain, no strings attached. No guarantees either.
   *
   *****************************************************************************/
  int matchWildcards(char *pattern, char *string)
  {
! if(string == NULL)
      {
! if(pattern == NULL)
! return TRUE;
! else if(strcmp(pattern,"*")==0)
! return TRUE;
! else
          return FALSE;
      }
! if(pattern == NULL)
! return TRUE;
  
    while (*string && *pattern)
      {
--- 13,40 ----
   * This code donated by Paul Hudson <paulh_at_harlequin.co.uk>
   * It is public domain, no strings attached. No guarantees either.
   *
+ * Simple code to understand patterns that begin with '!' to ignore
+ * specific strings. Douglas K. Rand <rand_at_aero.und.edu>
+ *
   *****************************************************************************/
  int matchWildcards(char *pattern, char *string)
  {
! if (pattern == NULL)
! return TRUE;
! else if (*pattern == '!')
      {
! /* Don't have the !pattern match the NoClass or NoResource windows */
! /* The NoClass and NoResource aren't available in libs, maybe should
! be #defines? */
! if(strcmp(string, "NoClass")==0 || strcmp(string, "NoResource")==0)
          return FALSE;
+ return !matchWildcards(pattern + 1, string);
      }
! else if(string == NULL)
! if(strcmp(pattern,"*")==0)
! return TRUE;
! else
! return FALSE;
  
    while (*string && *pattern)
      {


-- 
Douglas K. Rand                                              rand_at_aero.und.edu
System/Network Administrator      Scientific Computing Center -- UND Aerospace
Office: +1 701 777 2801                             University of North Dakota
FAX:    +1 701 777 2940                   Box 9022, Grand Forks ND  58202-9022
 echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Jul 23 1997 - 11:42:01 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST