stringi-set: New functions for not necessarily null terminated strings.
[pspp] / src / libpspp / stringi-set.h
index caccca8626e389a6e244b80d2d0f05bfc05dece2..ea4fad6bcf47e9cc34ae54aebe6867652f65b005 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 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
@@ -22,7 +22,7 @@
    This is a convenient wrapper around a "struct hmap" for storing strings. */
 
 #include <stdbool.h>
-#include <libpspp/hmap.h>
+#include "libpspp/hmap.h"
 
 /* A node in the string set. */
 struct stringi_set_node
@@ -60,8 +60,13 @@ static inline size_t stringi_set_count (const struct stringi_set *);
 static inline bool stringi_set_is_empty (const struct stringi_set *);
 
 bool stringi_set_contains (const struct stringi_set *, const char *);
+bool stringi_set_contains_len (const struct stringi_set *, const char *,
+                               size_t length);
 struct stringi_set_node *stringi_set_find_node (const struct stringi_set *,
-                                              const char *);
+                                                const char *);
+struct stringi_set_node *stringi_set_find_node_len (const struct stringi_set *,
+                                                    const char *,
+                                                    size_t length);
 
 bool stringi_set_insert (struct stringi_set *, const char *);
 bool stringi_set_insert_nocopy (struct stringi_set *, char *);
@@ -77,6 +82,9 @@ void stringi_set_union_and_intersection (struct stringi_set *,
 void stringi_set_intersect (struct stringi_set *, const struct stringi_set *);
 void stringi_set_subtract (struct stringi_set *, const struct stringi_set *);
 
+char **stringi_set_get_array (const struct stringi_set *);
+char **stringi_set_get_sorted_array (const struct stringi_set *);
+
 static inline const struct stringi_set_node *stringi_set_first (
   const struct stringi_set *);
 static inline const struct stringi_set_node *stringi_set_next (