free (ss->string);
}
+/* Exchanges the contents of A and B. */
+void
+ss_swap (struct substring *a, struct substring *b)
+{
+ struct substring tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+
/* Truncates SS to at most CNT bytes in length. */
void
ss_truncate (struct substring *ss, size_t cnt)
/* Mutators.
Functions that advance the beginning of a string should not be
used if a substring is to be deallocated. */
+void ss_swap (struct substring *, struct substring *);
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);