/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "libpspp/assertion.h"
#include "libpspp/cast.h"
#include "libpspp/hash-functions.h"
+#include "libpspp/i18n.h"
#include "libpspp/hmapx.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
struct hmapx_node *node;
struct variable **varp;
- HMAPX_FOR_EACH_WITH_HASH (varp, node, hash_case_string (name, 0),
+ HMAPX_FOR_EACH_WITH_HASH (varp, node, utf8_hash_case_string (name, 0),
&avs->vars_by_name)
- if (!strcasecmp (name, var_get_name (*varp)))
+ if (!utf8_strcasecmp (name, var_get_name (*varp)))
{
*idx = varp - avs->var;
return true;
return NULL;
}
hmapx_insert (&avs->vars_by_name, CONST_CAST (void *, &avs->var[i]),
- hash_case_string (name, 0));
+ utf8_hash_case_string (name, 0));
}
return vs;
}
/* An interaction is a variable followed by {*, BY} followed by an interaction */
-bool
-parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact)
+static bool
+parse_internal_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact, struct interaction **it)
{
const struct variable *v = NULL;
assert (iact);
if (! lex_match_variable (lexer, dict, &v))
{
- interaction_destroy (*iact);
+ if (it)
+ interaction_destroy (*it);
*iact = NULL;
return false;
}
if ( lex_match (lexer, T_ASTERISK) || lex_match (lexer, T_BY))
{
- return parse_design_interaction (lexer, dict, iact);
+ return parse_internal_interaction (lexer, dict, iact, iact);
}
return true;
}
+bool
+parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact)
+{
+ return parse_internal_interaction (lexer, dict, iact, NULL);
+}
+