summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/str-list.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-27 16:58:57 +0000
committerKarl Berry <karl@freefriends.org>2018-01-27 16:58:57 +0000
commit14a7e126d73445bb27eed49cf89c502f142950b8 (patch)
tree27df18407c5b0b16ec4543b4d94c1a7d1c0927fe /Build/source/texk/kpathsea/str-list.h
parentab347d35d8af61e0935b23cd59beeaba0255e07f (diff)
STR_LIST_EMPTY, STR_LIST_FIRST_ELT convenience macros
git-svn-id: svn://tug.org/texlive/trunk@46459 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/str-list.h')
-rw-r--r--Build/source/texk/kpathsea/str-list.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/Build/source/texk/kpathsea/str-list.h b/Build/source/texk/kpathsea/str-list.h
index 770abbdd3d0..0644f10aac2 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, 2012 Karl Berry.
+ Copyright 1993, 1994, 2007, 2008, 2010, 2012, 2018 Karl Berry.
Copyright 1999, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -42,9 +42,12 @@ typedef struct
} cstr_list_type;
#define STR_LIST_LENGTH(l) ((l).length)
+#define STR_LIST_EMPTY(l) (STR_LIST_LENGTH (l) == 0)
+
#define STR_LIST(l) ((l).list)
-#define STR_LIST_ELT(l, n) STR_LIST (l)[n]
-#define STR_LIST_LAST_ELT(l) STR_LIST_ELT (l, STR_LIST_LENGTH (l) - 1)
+#define STR_LIST_ELT(l, n) (STR_LIST (l)[n])
+#define STR_LIST_FIRST_ELT(l) STR_LIST_ELT ((l), 0)
+#define STR_LIST_LAST_ELT(l) STR_LIST_ELT ((l), STR_LIST_LENGTH (l) - 1)
#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */