-/* Authors: Arnaud Legrand */
+/* $Id$ */
+
+/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
- under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
/* Warning, this module is done to be efficient and performs tons of
cast and dirty things. So avoid using it unless you really know
what you are doing. */
-/* This type should be added to a type that is to be used in such a swag */
-/* Whenever a new object with this struct is created, all fields have
- to be set to NULL */
+#ifndef _XBT_SWAG_H
+#define _XBT_SWAG_H
#include "xbt/sysdep.h"
+/* This type should be added to a type that is to be used in such a swag */
+/* Whenever a new object with this struct is created, all fields have
+ to be set to NULL */
typedef struct xbt_swag_hookup {
void *next;
void *prev;
void xbt_swag_free(xbt_swag_t swag);
void xbt_swag_init(xbt_swag_t swag, size_t offset);
void xbt_swag_insert(void *obj, xbt_swag_t swag);
+void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag);
+void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag);
void *xbt_swag_remove(void *obj, xbt_swag_t swag);
void *xbt_swag_extract(xbt_swag_t swag);
int xbt_swag_size(xbt_swag_t swag);
(obj)=obj_next, \
((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)): \
(obj_next=NULL)) )
+
+#endif /* _XBT_SWAG_H */