+/* Like ctf_str_add_ref(), but notes that this memory location must be added as
+ a ref by a later serialization phase, rather than adding it itself. */
+uint32_t
+ctf_str_add_pending (ctf_dict_t *fp, const char *str, uint32_t *ref)
+{
+ ctf_str_atom_t *atom;
+
+ if (!str)
+ str = "";
+
+ atom = ctf_str_add_ref_internal (fp, str, CTF_STR_PENDING_REF
+ | CTF_STR_MAKE_PROVISIONAL, ref);
+ if (!atom)
+ return 0;
+
+ return atom->csa_offset;
+}
+
+/* Note that a pending ref now located at NEW_REF has moved by BYTES bytes. */
+int
+ctf_str_move_pending (ctf_dict_t *fp, uint32_t *new_ref, ptrdiff_t bytes)
+{
+ if (bytes == 0)
+ return 0;
+
+ if (ctf_dynset_insert (fp->ctf_str_pending_ref, (void *) new_ref) < 0)
+ return (ctf_set_errno (fp, ENOMEM));
+
+ ctf_dynset_remove (fp->ctf_str_pending_ref,
+ (void *) ((signed char *) new_ref - bytes));
+ return 0;
+}
+