Changeset 40458b9 for util.c


Ignore:
Timestamp:
Dec 24, 2003, 7:35:21 PM (20 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5c1393d
Parents:
dad943e
Message:
Filters of filters now work
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    r4b660cc r40458b9  
    697697}
    698698
     699/* add the string 'str' to the list 'list' of strings, only if it
     700 * is not already present
     701 */
     702void owl_util_list_add_unique_string(owl_list *list, char *str)
     703{
     704  int i, j;
     705
     706  j=owl_list_get_size(list);
     707  for (i=0; i<j; i++) {
     708    if (!strcmp(str, owl_list_get_element(list, i))) return;
     709  }
     710  owl_list_append_element(list, owl_strdup(str));
     711}
     712
     713int owl_util_common_strings_in_lists(owl_list *a, owl_list *b)
     714{
     715  int i, j, x, y;
     716
     717  j=owl_list_get_size(a);
     718  for (i=0; i<j; i++) {
     719    y=owl_list_get_size(b);
     720    for (x=0; x<y; x++) {
     721      if (!strcmp(owl_list_get_element(a, i), owl_list_get_element(b, x))) return(1);
     722    }
     723  }
     724  return(0);
     725}
     726
    699727/**************************************************************************/
    700728/************************* REGRESSION TESTS *******************************/
Note: See TracChangeset for help on using the changeset viewer.