sys_stat \
tempname \
trunc \
+ unicase/u8-casecmp \
+ unicase/u8-casefold \
unictype/ctype-print \
unictype/property-id-continue \
unictype/property-id-start \
unigbrk/uc-is-grapheme-break \
unilbrk/u8-possible-linebreaks \
+ uninorm/nfkd \
unistd \
unistr/u8-check \
unistr/u8-cpy \
#include "libpspp/array.h"
#include "libpspp/hash-functions.h"
+#include "libpspp/i18n.h"
#include "gl/xalloc.h"
{
struct attribute *attr;
HMAP_FOR_EACH_WITH_HASH (attr, struct attribute, node,
- hash_case_string (name, 0), &set->map)
- if (!strcasecmp (attribute_get_name (attr), name))
+ utf8_hash_case_string (name, 0), &set->map)
+ if (!utf8_strcasecmp (attribute_get_name (attr), name))
break;
return attr;
}
{
const char *name = attribute_get_name (attr);
assert (attrset_lookup (set, name) == NULL);
- hmap_insert (&set->map, &attr->node, hash_case_string (name, 0));
+ hmap_insert (&set->map, &attr->node, utf8_hash_case_string (name, 0));
}
/* Deletes any attribute from SET that matches NAME
vardict->dict = d;
vardict->var = v;
hmap_insert (&d->name_map, &vardict->name_node,
- hash_case_string (var_get_name (v), 0));
+ utf8_hash_case_string (var_get_name (v), 0));
vardict->case_index = d->next_value_idx;
var_set_vardict (v, vardict);
struct vardict_info *vardict;
HMAP_FOR_EACH_WITH_HASH (vardict, struct vardict_info, name_node,
- hash_case_string (name, 0), &d->name_map)
+ utf8_hash_case_string (name, 0), &d->name_map)
{
struct variable *var = vardict->var;
- if (!strcasecmp (var_get_name (var), name))
+ if (!utf8_strcasecmp (var_get_name (var), name))
return var;
}
struct vardict_info *vardict = var_get_vardict (v);
var_clear_vardict (v);
var_set_name (v, new_name);
- vardict->name_node.hash = hash_case_string (new_name, 0);
+ vardict->name_node.hash = utf8_hash_case_string (new_name, 0);
var_set_vardict (v, vardict);
}
dict_rename_var (struct dictionary *d, struct variable *v,
const char *new_name)
{
- assert (!strcasecmp (var_get_name (v), new_name)
+ assert (!utf8_strcasecmp (var_get_name (v), new_name)
|| dict_lookup_var (d, new_name) == NULL);
unindex_var (d, var_get_vardict (v));
{
size_t i;
for (i = 0; i < d->vector_cnt; i++)
- if (!strcasecmp (vector_get_name (d->vector[i]), name))
+ if (!utf8_strcasecmp (vector_get_name (d->vector[i]), name))
return d->vector[i];
return NULL;
}
size_t i;
for (i = 0; i < dict->n_mrsets; i++)
- if (!strcasecmp (name, dict->mrsets[i]->name))
+ if (!utf8_strcasecmp (name, dict->mrsets[i]->name))
return i;
return SIZE_MAX;
struct file_handle *handle;
HMAP_FOR_EACH_WITH_HASH (handle, struct file_handle, name_node,
- hash_case_string (id, 0), &named_handles)
- if (!strcasecmp (id, handle->id))
+ utf8_hash_case_string (id, 0), &named_handles)
+ if (!utf8_strcasecmp (id, handle->id))
{
return fh_ref (handle);
}
if (id != NULL)
{
hmap_insert (&named_handles, &handle->name_node,
- hash_case_string (handle->id, 0));
+ utf8_hash_case_string (handle->id, 0));
}
return handle;
#include "libpspp/assertion.h"
#include "libpspp/cast.h"
#include "libpspp/hash-functions.h"
+#include "libpspp/i18n.h"
#include "libpspp/str.h"
#include "libpspp/hmapx.h"
if (old != NULL)
session_remove_dataset (s, old);
- hmapx_insert (&s->datasets, ds, hash_case_string (dataset_name (ds), 0));
+ hmapx_insert (&s->datasets, ds,
+ utf8_hash_case_string (dataset_name (ds), 0));
if (s->active == NULL)
s->active = ds;
struct hmapx_node *node;
struct dataset *ds;
- HMAPX_FOR_EACH_WITH_HASH (ds, node, hash_case_string (name, 0), &s->datasets)
- if (!strcasecmp (dataset_name (ds), name))
+ HMAPX_FOR_EACH_WITH_HASH (ds, node, utf8_hash_case_string (name, 0),
+ &s->datasets)
+ if (!utf8_strcasecmp (dataset_name (ds), name))
return node;
return NULL;
}
/* Identify any duplicates. */
- if (strcasecmp (var_get_short_name (var, 0), long_name)
+ if (utf8_strcasecmp (var_get_short_name (var, 0), long_name)
&& dict_lookup_var (dict, long_name) != NULL)
{
sys_warn (r, record->pos,
const struct variable *a = a_;
const struct variable *b = b_;
- return strcasecmp (a->name, b->name);
+ return utf8_strcasecmp (a->name, b->name);
}
/* A hsh_hash_func that hashes variable V based on its name. */
{
const struct variable *v = v_;
- return hash_case_string (v->name, 0);
+ return utf8_hash_case_string (v->name, 0);
}
/* A hsh_compare_func that orders pointers to variables A and B
struct variable *const *a = a_;
struct variable *const *b = b_;
- return strcasecmp (var_get_name (*a), var_get_name (*b));
+ return utf8_strcasecmp (var_get_name (*a), var_get_name (*b));
}
/* A hsh_compare_func that orders pointers to variables A and B
{
struct variable *const *v = v_;
- return hash_case_string (var_get_name (*v), 0);
+ return utf8_hash_case_string (var_get_name (*v), 0);
}
\f
/* Returns the type of variable V. */
/* PSPP - a program for statistical analysis.
- Copyright (C) 2006, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2006, 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 "data/dictionary.h"
#include "data/identifier.h"
#include "libpspp/assertion.h"
+#include "libpspp/i18n.h"
#include "libpspp/str.h"
#include "gl/xalloc.h"
struct vector *a = *pa;
struct vector *b = *pb;
- return strcasecmp (a->name, b->name);
+ return utf8_strcasecmp (a->name, b->name);
}
#include "libpspp/cast.h"
#include "libpspp/hash-functions.h"
#include "libpspp/hmap.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/str.h"
#include "libpspp/misc.h"
static unsigned int
hash_dummy (const char *name, size_t name_len)
{
- return hash_case_bytes (name, name_len, 0);
+ return utf8_hash_case_bytes (name, name_len, 0);
}
static const struct dummy_var *
HMAP_FOR_EACH_WITH_HASH (dv, struct dummy_var, hmap_node,
hash_dummy (name, name_len), hmap)
- if (strcasecmp (dv->name, name))
+ if (utf8_strcasecmp (dv->name, name))
return dv;
return NULL;
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 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/bit-vector.h"
#include "libpspp/compiler.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/str.h"
result = a_index < b_index ? -1 : a_index > b_index;
}
else
- result = strcasecmp (var_get_name (a), var_get_name (b));
+ result = utf8_strcasecmp (var_get_name (a), var_get_name (b));
if (!ordering->forward)
result = -result;
return result;
const struct var_renaming *a = a_;
const struct var_renaming *b = b_;
- return strcasecmp (a->new_name, b->new_name);
+ return utf8_strcasecmp (a->new_name, b->new_name);
}
/* Returns true if performing VM on dictionary D would not cause
/* PSPP - a program for statistical analysis.
- Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 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
if (width == c->width
&& value_equal (value, &c->value, width))
{
- if (!c->warned && strcasecmp (c->label, label))
+ if (!c->warned && utf8_strcasecmp (c->label, label))
{
char *s = data_out (value, var_get_encoding (var),
var_get_print_format (var));
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 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 "language/lexer/lexer.h"
#include "language/lexer/variable-parser.h"
#include "libpspp/assertion.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/pool.h"
}
for (i = 0; i < vector_cnt; i++)
- if (!strcasecmp (vectors[i], lex_tokcstr (lexer)))
+ if (!utf8_strcasecmp (vectors[i], lex_tokcstr (lexer)))
{
msg (SE, _("Vector name %s is given twice."),
lex_tokcstr (lexer));
/* 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;
for (i = 0; i < dsc->var_cnt; i++)
{
struct dsc_var *dsc_var = &dsc->vars[i];
- if (dsc_var->z_name != NULL && !strcasecmp (dsc_var->z_name, name))
+ if (dsc_var->z_name != NULL && !utf8_strcasecmp (dsc_var->z_name, name))
return false;
}
return true;
int result;
if (dsc->sort_by_stat == DSC_NAME)
- result = strcasecmp (var_get_name (a->v), var_get_name (b->v));
+ result = utf8_strcasecmp (var_get_name (a->v), var_get_name (b->v));
else
{
double as = a->stats[dsc->sort_by_stat];
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2008, 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
return hash_bytes (s, strlen (s), basis);
}
-/* Returns a hash value for the N bytes at S, with lowercase and uppercase
- letters treated as equal, starting from BASIS. */
-unsigned int
-hash_case_bytes (const void *s_, size_t n, unsigned int basis)
-{
- const char *s = s_;
- uint32_t a, b, c;
- uint32_t tmp[3];
- int i;
-
- a = b = c = 0xdeadbeef + n + basis;
-
- while (n >= 12)
- {
- for (i = 0; i < 12; i++)
- ((unsigned char *)tmp)[i] = toupper ((unsigned char) s[i]);
- a += tmp[0];
- b += tmp[1];
- c += tmp[2];
- HASH_MIX (a, b, c);
- n -= 12;
- s += 12;
- }
-
- if (n > 0)
- {
- memset (tmp, 0, 12);
- for (i = 0; i < n; i++)
- ((unsigned char *)tmp)[i] = toupper ((unsigned char) s[i]);
- a += tmp[0];
- b += tmp[1];
- c += tmp[2];
- }
-
- HASH_FINAL (a, b, c);
- return c;
-}
-
-/* Returns a hash value for null-terminated string S, with
- lowercase and uppercase letters treated as equal, starting
- from BASIS. */
-unsigned int
-hash_case_string (const char *s, unsigned int basis)
-{
- return hash_case_bytes (s, strlen (s), basis);
-}
-
/* Returns a hash value for integer X, starting from BASIS. */
unsigned int
hash_int (int x, unsigned int basis)
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 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
unsigned int hash_bytes (const void *, size_t, unsigned int basis);
unsigned int hash_string (const char *, unsigned int basis);
-unsigned int hash_case_bytes (const void *, size_t, unsigned int basis);
-unsigned int hash_case_string (const char *, unsigned int basis);
unsigned int hash_int (int, unsigned int basis);
unsigned int hash_double (double, unsigned int basis);
unsigned int hash_pointer (const void *, unsigned int basis);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unicase.h>
#include <unigbrk.h>
#include "libpspp/assertion.h"
#include "gl/c-strcase.h"
#include "gl/localcharset.h"
+#include "gl/minmax.h"
#include "gl/xalloc.h"
#include "gl/relocatable.h"
#include "gl/xstrndup.h"
return buffer;
}
\f
+/* UTF-8 functions that deal with uppercase/lowercase distinctions. */
+
+/* Returns a hash value for the N bytes of UTF-8 encoded data starting at S,
+ with lowercase and uppercase letters treated as equal, starting from
+ BASIS. */
+unsigned int
+utf8_hash_case_bytes (const char *s, size_t n, unsigned int basis)
+{
+ uint8_t folded_buf[2048];
+ size_t folded_len = sizeof folded_buf;
+ uint8_t *folded_s;
+ unsigned int hash;
+
+ folded_s = u8_casefold (CHAR_CAST (const uint8_t *, s), n,
+ NULL, UNINORM_NFKD, folded_buf, &folded_len);
+ if (folded_s != NULL)
+ {
+ hash = hash_bytes (folded_s, folded_len, basis);
+ if (folded_s != folded_buf)
+ free (folded_s);
+ }
+ else
+ {
+ if (errno == ENOMEM)
+ xalloc_die ();
+ hash = hash_bytes (s, n, basis);
+ }
+
+ return hash;
+}
+
+/* Returns a hash value for null-terminated UTF-8 string S, with lowercase and
+ uppercase letters treated as equal, starting from BASIS. */
+unsigned int
+utf8_hash_case_string (const char *s, unsigned int basis)
+{
+ return utf8_hash_case_bytes (s, strlen (s), basis);
+}
+
+/* Compares UTF-8 strings A and B case-insensitively.
+ Returns a negative value if A < B, zero if A == B, positive if A > B. */
+int
+utf8_strcasecmp (const char *a, const char *b)
+{
+ return utf8_strncasecmp (a, strlen (a), b, strlen (b));
+}
+
+/* Compares UTF-8 strings A (with length AN) and B (with length BN)
+ case-insensitively.
+ Returns a negative value if A < B, zero if A == B, positive if A > B. */
+int
+utf8_strncasecmp (const char *a, size_t an, const char *b, size_t bn)
+{
+ int result;
+
+ if (u8_casecmp (CHAR_CAST (const uint8_t *, a), an,
+ CHAR_CAST (const uint8_t *, b), bn,
+ NULL, UNINORM_NFKD, &result))
+ {
+ if (errno == ENOMEM)
+ xalloc_die ();
+
+ result = memcmp (a, b, MIN (an, bn));
+ if (result == 0)
+ result = an < bn ? -1 : an > bn;
+ }
+
+ return result;
+}
+\f
bool
get_encoding_info (struct encoding_info *e, const char *name)
{
bool set_encoding_from_locale (const char *loc);
const char *uc_name (ucs4_t uc, char buffer[16]);
+
+unsigned int utf8_hash_case_bytes (const char *, size_t n, unsigned int basis);
+unsigned int utf8_hash_case_string (const char *, unsigned int basis);
+int utf8_strcasecmp (const char *, const char *);
+int utf8_strncasecmp (const char *, size_t, const char *, size_t);
\f
/* Information about character encodings. */
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 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 <string.h>
#include "libpspp/hash-functions.h"
+#include "libpspp/i18n.h"
#include "libpspp/string-set.h"
#include "libpspp/stringi-set.h"
struct stringi_map_node *
stringi_map_find_node (const struct stringi_map *map, const char *key)
{
- return stringi_map_find_node__ (map, key, hash_case_string (key, 0));
+ return stringi_map_find_node__ (map, key, utf8_hash_case_string (key, 0));
}
/* If MAP contains KEY (or an equivalent with different case) as a key, deletes
stringi_map_insert (struct stringi_map *map, const char *key,
const char *value)
{
- unsigned int hash = hash_case_string (key, 0);
+ unsigned int hash = utf8_hash_case_string (key, 0);
struct stringi_map_node *node = stringi_map_find_node__ (map, key, hash);
if (node == NULL)
node = stringi_map_insert__ (map, xstrdup (key), xstrdup (value), hash);
struct stringi_map_node *
stringi_map_insert_nocopy (struct stringi_map *map, char *key, char *value)
{
- unsigned int hash = hash_case_string (key, 0);
+ unsigned int hash = utf8_hash_case_string (key, 0);
struct stringi_map_node *node = stringi_map_find_node__ (map, key, hash);
if (node == NULL)
node = stringi_map_insert__ (map, key, value, hash);
stringi_map_replace (struct stringi_map *map, const char *key,
const char *value)
{
- unsigned int hash = hash_case_string (key, 0);
+ unsigned int hash = utf8_hash_case_string (key, 0);
struct stringi_map_node *node = stringi_map_find_node__ (map, key, hash);
if (node == NULL)
node = stringi_map_insert__ (map, xstrdup (key), xstrdup (value), hash);
struct stringi_map_node *
stringi_map_replace_nocopy (struct stringi_map *map, char *key, char *value)
{
- unsigned int hash = hash_case_string (key, 0);
+ unsigned int hash = utf8_hash_case_string (key, 0);
struct stringi_map_node *node = stringi_map_find_node__ (map, key, hash);
if (node == NULL)
node = stringi_map_insert__ (map, key, value, hash);
bool
stringi_map_delete (struct stringi_map *map, const char *key)
{
- return stringi_map_delete__ (map, key, hash_case_string (key, 0));
+ return stringi_map_delete__ (map, key, utf8_hash_case_string (key, 0));
}
/* Deletes NODE from MAP and destroys the node and its key and value. */
HMAP_FOR_EACH_WITH_HASH (node, struct stringi_map_node, hmap_node,
hash, &map->hmap)
- if (!strcasecmp (key, node->key))
+ if (!utf8_strcasecmp (key, node->key))
return node;
return NULL;
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 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/cast.h"
#include "libpspp/hash-functions.h"
+#include "libpspp/i18n.h"
#include "gl/xalloc.h"
struct stringi_set_node *
stringi_set_find_node (const struct stringi_set *set, const char *s)
{
- return stringi_set_find_node__ (set, s, hash_case_string (s, 0));
+ return stringi_set_find_node__ (set, s, utf8_hash_case_string (s, 0));
}
/* Inserts a copy of S into SET. Returns true if successful, false if SET
bool
stringi_set_insert (struct stringi_set *set, const char *s)
{
- unsigned int hash = hash_case_string (s, 0);
+ unsigned int hash = utf8_hash_case_string (s, 0);
if (!stringi_set_find_node__ (set, s, hash))
{
stringi_set_insert__ (set, xstrdup (s), hash);
bool
stringi_set_insert_nocopy (struct stringi_set *set, char *s)
{
- unsigned int hash = hash_case_string (s, 0);
+ unsigned int hash = utf8_hash_case_string (s, 0);
if (!stringi_set_find_node__ (set, s, hash))
{
stringi_set_insert__ (set, s, hash);
bool
stringi_set_delete (struct stringi_set *set, const char *s)
{
- return stringi_set_delete__ (set, s, hash_case_string (s, 0));
+ return stringi_set_delete__ (set, s, utf8_hash_case_string (s, 0));
}
/* Deletes NODE from SET, and frees NODE and its string. */
{
const char *const *a = a_;
const char *const *b = b_;
- return strcasecmp (*a, *b);
+ return utf8_strcasecmp (*a, *b);
}
/* Allocates and returns an array that points to each of the strings in SET.
caller it is responsible for freeing the returned array itself (with
free()).
- The returned array is ordered according to strcasecmp(). */
+ The returned array is ordered according to utf8_strcasecmp(). */
char **
stringi_set_get_sorted_array (const struct stringi_set *set)
{
HMAP_FOR_EACH_WITH_HASH (node, struct stringi_set_node, hmap_node,
hash, &set->hmap)
- if (!strcasecmp (s, node->string))
+ if (!utf8_strcasecmp (s, node->string))
return node;
return NULL;
tests/data/data-in.at \
tests/data/data-out.at \
tests/data/datasheet-test.at \
+ tests/data/dictionary.at \
tests/data/format-guesser.at \
tests/data/por-file.at \
tests/data/sys-file-reader.at \
--- /dev/null
+AT_BANNER([dictionary])
+
+AT_SETUP([dictionary case-insensitivity])
+AT_DATA([dictionary.sps], [dnl
+DATA LIST LIST /aèiöu aeiou.
+BEGIN DATA
+1 2
+END DATA.
+LIST AÈIÖU
+RENAME VARIABLE (aèiöu=AÈIÖU).
+LIST.
+RENAME VARIABLE (aeiou=aèiöu).
+])
+AT_CLEANUP
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 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/hash-functions.h"
#include "libpspp/compiler.h"
+#include "libpspp/i18n.h"
#include "libpspp/str.h"
#include "libpspp/string-set.h"
#include "libpspp/stringi-set.h"
node = stringi_map_find_node (map, key);
check (node != NULL);
- check (!strcasecmp (key, stringi_map_node_get_key (node)));
+ check (!utf8_strcasecmp (key, stringi_map_node_get_key (node)));
check (!strcmp (value, stringi_map_node_get_value (node)));
check (node == stringi_map_insert (map, key, "012"));
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 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 <string.h>
#include "libpspp/compiler.h"
+#include "libpspp/i18n.h"
#include "libpspp/str.h"
\f
/* Exit with a failure code.
node = stringi_set_find_node (set, string);
check (node != NULL);
- check (!strcasecmp (string, stringi_set_node_get_string (node)));
+ check (!utf8_strcasecmp (string, stringi_set_node_get_string (node)));
}
/* Checks that SET contains the CNT strings in DATA, that its structure is
check (s == array[i]);
for (j = 0; j < left; j++)
- if (!strcasecmp (s, make_string (data_copy[j])))
+ if (!utf8_strcasecmp (s, make_string (data_copy[j])))
{
data_copy[j] = data_copy[--left];
goto next;
for (i = 0; i < cnt; i++)
{
if (i > 0)
- check (strcasecmp (array[i - 1], array[i]) < 0);
+ check (utf8_strcasecmp (array[i - 1], array[i]) < 0);
check (stringi_set_contains (set, array[i]));
}
free (array);