summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/str-list.h
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-12-11 14:28:06 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-12-11 14:28:06 +0000
commit3226a8894c9f90a96a776fe36456af2cc2d078c7 (patch)
tree5d1387ede5191c9dc0ca5a1b113642cc04c48d32 /Build/source/texk/kpathsea/str-list.h
parentfc101b568d7547030fceb58ab5f097d457d49c57 (diff)
kpathsea: Resolve some const related problems
git-svn-id: svn://tug.org/texlive/trunk@28500 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/str-list.h')
-rw-r--r--Build/source/texk/kpathsea/str-list.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/Build/source/texk/kpathsea/str-list.h b/Build/source/texk/kpathsea/str-list.h
index cf33c726508..6be7b39ee45 100644
--- a/Build/source/texk/kpathsea/str-list.h
+++ b/Build/source/texk/kpathsea/str-list.h
@@ -1,6 +1,6 @@
/* str-list.h: declarations for string lists.
- Copyright 1993, 1994, 2007, 2008, 2010 Karl Berry.
+ Copyright 1993, 1994, 2007, 2008, 2010, 2012 Karl Berry.
Copyright 1999, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -24,13 +24,19 @@
/* Lists of strings; used for, e.g., directory lists. */
-
typedef struct
{
unsigned length;
string *list;
} str_list_type;
+/* Lists of const strings; used for, e.g., hash tables. */
+typedef struct
+{
+ unsigned length;
+ const_string *list;
+} cstr_list_type;
+
#define STR_LIST_LENGTH(l) ((l).length)
#define STR_LIST(l) ((l).list)
#define STR_LIST_ELT(l, n) STR_LIST (l)[n]
@@ -39,7 +45,26 @@ typedef struct
#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */
/* Return a new, empty, list. */
-extern str_list_type str_list_init (void);
+static inline str_list_type
+str_list_init (void)
+{
+ str_list_type ret;
+
+ STR_LIST_LENGTH (ret) = 0;
+ STR_LIST (ret) = NULL;
+
+ return ret;
+}
+static inline cstr_list_type
+cstr_list_init (void)
+{
+ cstr_list_type ret;
+
+ STR_LIST_LENGTH (ret) = 0;
+ STR_LIST (ret) = NULL;
+
+ return ret;
+}
#endif /* MAKE_KPSE_DLL */
@@ -47,6 +72,7 @@ extern str_list_type str_list_init (void);
deallocate S; we don't copy it. Also up to the caller to terminate
the list with a null entry. */
extern KPSEDLL void str_list_add (str_list_type *l, string s);
+extern KPSEDLL void cstr_list_add (cstr_list_type *l, const_string s);
#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */