+char *ds_splice_uninit (struct string *, size_t ofs, size_t old_len,
+ size_t new_len);
+
+/* Other */
+/* calls relocate from gnulib on ST */
+void ds_relocate (struct string *st);
+
+
+void u8_buf_copy_rpad (uint8_t *dst, size_t dst_size,
+ const uint8_t *src, size_t src_size,
+ char pad);
+\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;
+}
+