Changeset c36f4d0 for functions.c


Ignore:
Timestamp:
Jul 23, 2011, 9:24:37 PM (13 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
4ebbfbc (diff), c40d11a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge c40d11a3d527920acd6063b93f1de30d1f668c96 into 4ebbfbc5360fa004637dd101f5a0c833cdccd60a
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r4ebbfbc rc36f4d0  
    21322132
    21332133/* Create a new filter, or replace an existing one
    2134  * with a new definition.
     2134 * with a new definition. Returns true on success.
    21352135 */
    2136 void owl_function_create_filter(int argc, const char *const *argv)
     2136bool owl_function_create_filter(int argc, const char *const *argv)
    21372137{
    21382138  owl_filter *f;
     
    21422142  if (argc < 2) {
    21432143    owl_function_error("Wrong number of arguments to filter command");
    2144     return;
     2144    return false;
    21452145  }
    21462146
     
    21522152  if (!strcmp(argv[1], "all")) {
    21532153    owl_function_error("You may not change the 'all' filter.");
    2154     return;
     2154    return false;
    21552155  }
    21562156
     
    21602160    if (!f) {
    21612161      owl_function_error("The filter '%s' does not exist.", argv[1]);
    2162       return;
     2162      return false;
    21632163    }
    21642164    if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    21652165      owl_function_error("The color '%s' is not available.", argv[3]);
    2166       return;
     2166      return false;
    21672167    }
    21682168    owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3]));
    21692169    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    2170     return;
     2170    return false;
    21712171  }
    21722172  if (argc==4 && !strcmp(argv[2], "-b")) {
     
    21742174    if (!f) {
    21752175      owl_function_error("The filter '%s' does not exist.", argv[1]);
    2176       return;
     2176      return false;
    21772177    }
    21782178    if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    21792179      owl_function_error("The color '%s' is not available.", argv[3]);
    2180       return;
     2180      return false;
    21812181    }
    21822182    owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3]));
    21832183    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    2184     return;
     2184    return true;
    21852185  }
    21862186
     
    21892189  if (f == NULL) {
    21902190    owl_function_error("Invalid filter");
    2191     return;
     2191    return false;
    21922192  }
    21932193
     
    22102210  }
    22112211  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     2212  return true;
    22122213}
    22132214
Note: See TracChangeset for help on using the changeset viewer.