+static inline
+void dummy_pos(struct stream_pos *pos, struct stream_pos *dummy)
+{
+ memcpy(dummy, pos, sizeof(struct stream_pos));
+ dummy->dummy = 1;
+ dummy->fd = -1;
+}
+
+/*
+ * Check if current packet can hold data.
+ * Returns 0 for success, negative error otherwise.
+ */
+static inline
+int pos_packet(struct stream_pos *dummy)
+{
+ if (dummy->offset > dummy->packet_size)
+ return -ENOSPC;
+ return 0;
+}
+
+static inline
+void pos_pad_packet(struct stream_pos *pos)
+{
+ move_pos(pos, pos->packet_size - pos->offset);
+}
+