Changeset 7a20e4c


Ignore:
Timestamp:
Feb 8, 2007, 4:39:31 PM (17 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
952b1660
Parents:
801b7ac
git-author:
Nelson Elhage <nelhage@mit.edu> (02/01/07 12:03:34)
git-committer:
Nelson Elhage <nelhage@mit.edu> (02/08/07 16:39:31)
Message:
smartnarrowing to an unclass is now the same as narrowing to the
corresponding class. We may want to make this more customizable.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r801b7ac r7a20e4c  
    26172617 * name of the filter, which the caller must free.
    26182618 */
    2619 char *owl_function_classinstfilt(char *class, char *instance)
     2619char *owl_function_classinstfilt(char *c, char *i)
    26202620{
    26212621  owl_list *fl;
     
    26232623  char *argbuff, *filtname;
    26242624  char *tmpclass, *tmpinstance = NULL;
     2625  char *class, *instance = NULL;
    26252626  int len;
     2627
     2628  class = owl_util_baseclass(c);
     2629  if(i) {
     2630    instance = owl_util_baseclass(i);
     2631  }
    26262632
    26272633  fl=owl_global_get_filterlist(&g);
  • util.c

    r0138478 r7a20e4c  
    737737}
    738738
     739/* Return the base class or instance from a zephyr class, by removing
     740   leading `un' or trailing `.d'.
     741   Modified ``class'' in place, and does not allocate memory.
     742*/
     743char * owl_util_baseclass(char * class)
     744{
     745  char * end;
     746  while(!strncmp(class, "un", 2)) {
     747    class += 2;
     748  }
     749  end = class + strlen(class) - 1;
     750  while(*end == 'd' && *(end-1) == '.') {
     751    end -= 2;
     752  }
     753  *(end + 1) = 0;
     754  return class;
     755}
     756
    739757/**************************************************************************/
    740758/************************* REGRESSION TESTS *******************************/
Note: See TracChangeset for help on using the changeset viewer.