+\f
+static inline struct substring
+ss_empty (void)
+{
+ struct substring ss;
+ ss.string = NULL;
+ ss.length = 0;
+ return ss;
+}
+
+/* Returns a substring whose contents are the given C-style
+ string CSTR. */
+static inline struct substring
+ss_cstr (const char *cstr)
+{
+ return ss_buffer (cstr, strlen (cstr));
+}
+
+/* Returns a substring whose contents are the N characters in
+ BUFFER. */
+static inline struct substring
+ss_buffer (const char *buffer, size_t n)
+{
+ struct substring ss;
+ ss.string = (char *) buffer;
+ ss.length = n;
+ return ss;
+}
+
+static inline char *
+xstrdup_if_nonnull (const char *s)
+{
+ return s ? xstrdup (s) : NULL;
+}