+#define SS_EMPTY_INITIALIZER {NULL, 0}
+#define SS_LITERAL_INITIALIZER(LITERAL) \
+ {(char *) LITERAL, (sizeof LITERAL) - 1}
+
+/* Constructors.
+ These functions do not allocate any memory, so the substrings
+ they create should not normally be destroyed. */
+static inline struct substring ss_empty (void);
+static inline struct substring ss_cstr (const char *);
+static inline struct substring ss_buffer (const char *, size_t);
+struct substring ss_substr (struct substring, size_t start, size_t);
+struct substring ss_head (struct substring, size_t);
+struct substring ss_tail (struct substring, size_t);
+
+/* Constructors and destructor that allocate and deallocate
+ memory. */
+struct pool;
+void ss_alloc_substring (struct substring *, struct substring);
+void ss_alloc_uninit (struct substring *, size_t);
+void ss_realloc (struct substring *, size_t);
+void ss_alloc_substring_pool (struct substring *, struct substring,
+ struct pool *);
+void ss_alloc_uninit_pool (struct substring *, size_t, struct pool *);
+void ss_dealloc (struct substring *);
+
+/* Mutators.
+ Functions that advance the beginning of a string should not be
+ used if a substring is to be deallocated. */
+void ss_truncate (struct substring *, size_t);
+size_t ss_rtrim (struct substring *, struct substring trim_set);
+size_t ss_ltrim (struct substring *, struct substring trim_set);
+void ss_trim (struct substring *, struct substring trim_set);
+bool ss_chomp_byte (struct substring *, char);
+bool ss_separate (struct substring src, struct substring delimiters,
+ size_t *save_idx, struct substring *token);
+bool ss_tokenize (struct substring src, struct substring delimiters,
+ size_t *save_idx, struct substring *token);
+void ss_advance (struct substring *, size_t);
+bool ss_match_byte (struct substring *, char);
+int ss_match_byte_in (struct substring *, struct substring);
+bool ss_match_string (struct substring *, const struct substring);
+int ss_get_byte (struct substring *);
+size_t ss_get_bytes (struct substring *, size_t cnt, struct substring *);
+bool ss_get_until (struct substring *, char delimiter, struct substring *);
+size_t ss_get_long (struct substring *, long *);