X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Flibfirm%2Fadt%2Fplist.h;h=6a639b4261664cce9c93dee3da784fdaea5039d5;hb=15ad7ccd8dff64e1808e1d093d4a8d7cda5af33e;hp=623a07530136f4548217336169ec43c814a827e9;hpb=6f2b3c2901153e4df55ccea111c25d14b0917065;p=libfirm diff --git a/include/libfirm/adt/plist.h b/include/libfirm/adt/plist.h index 623a07530..6a639b426 100644 --- a/include/libfirm/adt/plist.h +++ b/include/libfirm/adt/plist.h @@ -19,9 +19,9 @@ /** * @file - * @author Kimon Hoffmann - * @date 14.07.2005 - * @cvs-id $Id$ + * @author Kimon Hoffmann + * @date 14.07.2005 + * @version $Id$ * @brief Simple, non circular, double linked pointer list. * Created because the properties of the standard circular list were * not very well suited for the interference graph implementation. @@ -30,6 +30,7 @@ * @note Until now the code is entirely untested so it probably contains * plenty of errors. (Matze: Is this still true, the code seems to be * used at some places....) + * @deprecated */ #ifndef FIRM_ADT_PLIST_H #define FIRM_ADT_PLIST_H @@ -37,13 +38,15 @@ #include #include "obst.h" -typedef struct _plist_element plist_element_t; -typedef struct _plist plist_t; +#include "../begin.h" + +typedef struct plist_element plist_element_t; +typedef struct plist plist_t; /** * The plist data type. */ -struct _plist { +struct plist { /** * The obstack used for all allocations. */ @@ -78,7 +81,7 @@ struct _plist { /** * An element in the pointer list. */ -struct _plist_element { +struct plist_element { plist_element_t *next; plist_element_t *prev; void *data; @@ -88,7 +91,7 @@ struct _plist_element { * Creates a new pointer list and initializes it. * @return The newly created pointer list. */ -plist_t *plist_new(void); +FIRM_API plist_t *plist_new(void); /** * Creates a new pointer list and initializes it. @@ -96,14 +99,14 @@ plist_t *plist_new(void); * @param obst The obstack to use * @return The newly created pointer list. */ -plist_t *plist_obstack_new(struct obstack *obst); +FIRM_API plist_t *plist_obstack_new(struct obstack *obst); /** * Frees the passed pointer list. * After a call to this function all references to the list and any of * its elements are invalid. */ -void plist_free(plist_t *list); +FIRM_API void plist_free(plist_t *list); /** * Returns the number of elements in a pointer list. @@ -111,41 +114,41 @@ void plist_free(plist_t *list); * @return The number of elements in a pointer list. */ #define plist_count(list) \ - ((list)->element_count) + ((list)->element_count) /** * Inserts an element at the back of a pointer list. * @param list the pointer list to append the new element to. * @param value the element value to append. */ -void plist_insert_back(plist_t *list, void *value); +FIRM_API void plist_insert_back(plist_t *list, void *value); /** * Inserts an element at the front of a pointer list. * @param list the pointer list to prepend the new element to. * @param value the element value to prepend. */ -void plist_insert_front(plist_t *list, void *value); +FIRM_API void plist_insert_front(plist_t *list, void *value); /** * Inserts an element into a pointer list before the specified element, * which must be non null. * @param list the pointer list to insert the new element into. * @param element the list element before which the new element should - * be inserted. This element must be a part of @p list. + * be inserted. This element must be a part of @p list. * @param value the element value to insert. */ -void plist_insert_before(plist_t *list, plist_element_t *element, void *value); +FIRM_API void plist_insert_before(plist_t *list, plist_element_t *element, void *value); /** * Inserts an element into a pointer list after the specified element, * which must be non null. * @param list the pointer list to insert the new element into. * @param element the list element after which the new element should - * be inserted. This element must be a part of @p list. + * be inserted. This element must be a part of @p list. * @param value the element value to insert. */ -void plist_insert_after(plist_t *list, plist_element_t *element, void *value); +FIRM_API void plist_insert_after(plist_t *list, plist_element_t *element, void *value); /** * Checks if list has an element with the given data pointer. @@ -153,7 +156,7 @@ void plist_insert_after(plist_t *list, plist_element_t *element, void *value); * @param value the data pointer to look for * @return 1 if element with data pointer found, 0 otherwise */ -int plist_has_value(plist_t *list, void *value); +FIRM_API int plist_has_value(plist_t *list, void *value); /** * Tries to find list element associated to the given data pointer. @@ -161,42 +164,42 @@ int plist_has_value(plist_t *list, void *value); * @param value the data pointer to look for * @return The first list element associated to data pointer if found, NULL otherwise */ -plist_element_t *plist_find_value(plist_t *list, void *value); +FIRM_API plist_element_t *plist_find_value(plist_t *list, void *value); /** * Erases the specified element from the pointer list. * @param list the pointer list from which the element should be erased. * @param element the list element to erase. This element must be a part - * of @p list. + * of @p list. */ -void plist_erase(plist_t *list, plist_element_t *element); +FIRM_API void plist_erase(plist_t *list, plist_element_t *element); /** * Erases all elements from the specified pointer list. * @param list the pointer list that should be cleared. */ -void plist_clear(plist_t *list); +FIRM_API void plist_clear(plist_t *list); /** * Returns the first element of a pointer list. * @param list the pointer list to iterate * @return a pointer to the element or NULL if the list is empty */ - #define plist_first(list) \ - ((list)->first_element) +#define plist_first(list) \ + ((list)->first_element) /** * Returns the last element of a pointer list. * @param list the pointer list to iterate * @return a pointer to the element or NULL if the list is empty */ - #define plist_last(list) \ - ((list)->last_element) +#define plist_last(list) \ + ((list)->last_element) /** * Checks whether a pointer list element has a successor or not. * @param element the list element that should be queried for existence - * of a successor. + * of a successor. * @return TRUE if @p element has a successor, otherwise FALSE. */ #define plist_element_has_next(element) \ @@ -205,7 +208,7 @@ void plist_clear(plist_t *list); /** * Checks whether a pointer list element has a predecessor or not. * @param element the list element that should be queried for existence - * of a predecessor. + * of a predecessor. * @return TRUE if @p element has a successor, otherwise FALSE. */ #define plist_element_has_prev(element) \ @@ -215,7 +218,7 @@ void plist_clear(plist_t *list); * Gets the successor of the passed list element. * @param element the list element to return the successor of. * @return The successor of @p element or NULL if @p element is the last - * element in the sequence. + * element in the sequence. */ #define plist_element_get_next(element) \ ((element)->next) @@ -224,7 +227,7 @@ void plist_clear(plist_t *list); * Gets the predecessor of the passed list element. * @param element the list element to return the predecessor of. * @return The predecessor of @p element or NULL if @p element is the last - * element in the sequence. + * element in the sequence. */ #define plist_element_get_prev(element) \ ((element)->prev) @@ -243,4 +246,6 @@ void plist_clear(plist_t *list); #define foreach_plist(list, el) \ for (el = plist_first(list); el; el = plist_element_get_next(el)) -#endif /*_PLIST_H_*/ +#include "../end.h" + +#endif