+/**
+ * \param obj the objet to insert in the swag
+ * \param swag a swag
+ *
+ * insert (at the head... you probably had a very good reason to do
+ * that, I hope you know what you're doing) \a obj in \a swag
+ */
+void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag)
+{
+
+ if (xbt_swag_belongs(obj, swag))
+ return;
+
+ (swag->count)++;
+ if (swag->head == NULL) {
+ xbt_assert0(!(swag->tail), "Inconsistent swag.");
+ swag->head = obj;
+ swag->tail = obj;
+ return;
+ }
+
+ NEXT(obj, swag->offset) = swag->head;
+ PREV(NEXT(obj, swag->offset), swag->offset) = obj;
+
+ swag->head = obj;
+}
+
+/**
+ * \param obj the objet to insert in the swag
+ * \param swag a swag
+ *
+ * insert (at the tail... you probably had a very good reason to do
+ * that, I hope you know what you're doing) \a obj in \a swag
+ */
+void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag)
+{
+
+ if (xbt_swag_belongs(obj, swag))
+ return;
+
+ (swag->count)++;
+ if (swag->head == NULL) {
+ xbt_assert0(!(swag->tail), "Inconsistent swag.");
+ swag->head = obj;
+ swag->tail = obj;
+ return;
+ }
+
+ PREV(obj, swag->offset) = swag->tail;
+ NEXT(PREV(obj, swag->offset), swag->offset) = obj;
+
+ swag->tail = obj;
+}
+
+/**
+ * \param obj the objet to remove from the swag
+ * \param swag a swag
+ * \return \a obj if it was in the \a swag and NULL otherwise
+ *
+ * removes \a obj from \a swag
+ */
+void *xbt_swag_remove(void *obj, xbt_swag_t swag)