summaryrefslogtreecommitdiff
path: root/src/strpool.h
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2007-12-27 17:32:46 +0000
committerMichael Matz <matz@suse.de>2007-12-27 17:32:46 +0000
commit2d8658e1b24a89ad1e09ddce50f91e88e25a4ba9 (patch)
treed39f68cf5f7f735fb30e57c0b24e1acafdd4e166 /src/strpool.h
parentb7ccaa70e4e8a07e2da0329cfdda8263b4942d1a (diff)
downloadlibsolv-2d8658e1b24a89ad1e09ddce50f91e88e25a4ba9.tar.gz
libsolv-2d8658e1b24a89ad1e09ddce50f91e88e25a4ba9.tar.bz2
libsolv-2d8658e1b24a89ad1e09ddce50f91e88e25a4ba9.zip
I'll have a need for inserting substrings into a stringpool.
Diffstat (limited to 'src/strpool.h')
-rw-r--r--src/strpool.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/strpool.h b/src/strpool.h
index d326c4f..c8429b9 100644
--- a/src/strpool.h
+++ b/src/strpool.h
@@ -26,6 +26,13 @@ struct _Stringpool
void stringpool_init (Stringpool *ss, const char *strs[]);
Id stringpool_str2id (Stringpool *ss, const char *str, int create);
+Id stringpool_strn2id (Stringpool *ss, const char *str, unsigned len, int create);
void stringpool_shrink (Stringpool *ss);
+static inline const char *
+stringpool_id2str (Stringpool *ss, Id id)
+{
+ return ss->stringspace + ss->strings[id];
+}
+
#endif