diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-05-24 15:35:26 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-05-24 15:35:26 +0000 |
| commit | d2857b11944146e2e6973b7f7280cb57e1ee260b (patch) | |
| tree | 51bf06d58f90953842b0e6babc9493f04934d7d9 /plugins/resistance.c | |
| parent | f7df74b9cc9369fe401d5622c097e258a124f742 (diff) | |
ECKS EM ELL
Diffstat (limited to 'plugins/resistance.c')
| -rw-r--r-- | plugins/resistance.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/plugins/resistance.c b/plugins/resistance.c index bafd362c..ee6f6e1e 100644 --- a/plugins/resistance.c +++ b/plugins/resistance.c @@ -9,23 +9,14 @@ static int resistance; static gboolean resist_windows; -static void parse_assign(char *name, ParseToken *value) +static void parse_xml(xmlDocPtr doc, xmlNodePtr node, void *d) { - if (!g_ascii_strcasecmp(name, "strength")) { - if (value->type != TOKEN_INTEGER) - yyerror("invalid value"); - else { - if (value->data.integer >= 0) - resistance = value->data.integer; - } - } else if (!g_ascii_strcasecmp(name, "windows")) { - if (value->type != TOKEN_BOOL) - yyerror("invalid value"); - else - resist_windows = value->data.bool; - } else - yyerror("invalid option"); - parse_free_token(value); + xmlNodePtr n; + + if ((n = parse_find_node("strength", node))) + resistance = parse_int(doc, n); + if ((n = parse_find_node("windows", node))) + resist_windows = parse_bool(doc, n); } void plugin_setup_config() @@ -33,7 +24,7 @@ void plugin_setup_config() resistance = 10; resist_windows = TRUE; - parse_reg_section("resistance", NULL, parse_assign); + parse_register("resistance", parse_xml, NULL); } static void resist_move(Client *c, int *x, int *y) |
