diff options
author | Michael Matz <matz@suse.de> | 2007-12-27 17:32:46 +0000 |
---|---|---|
committer | Michael Matz <matz@suse.de> | 2007-12-27 17:32:46 +0000 |
commit | 2d8658e1b24a89ad1e09ddce50f91e88e25a4ba9 (patch) | |
tree | d39f68cf5f7f735fb30e57c0b24e1acafdd4e166 /src/strpool.h | |
parent | b7ccaa70e4e8a07e2da0329cfdda8263b4942d1a (diff) | |
download | libsolv-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.h | 7 |
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 |