79
79
static circular_list_t name = (circular_list_t)&name##_circular_list
80
80
/*---------------------------------------------------------------------------*/
81
81
/**
82
- * \brief The circular, singly-linked list datatype
82
+ * The circular, singly-linked list datatype.
83
83
*/
84
84
typedef void * * circular_list_t ;
85
+
86
+ /**
87
+ * The non-modifiable circular, singly-linked list datatype.
88
+ */
89
+ typedef void * const * const_circular_list_t ;
90
+
85
91
/*---------------------------------------------------------------------------*/
86
92
/**
87
93
* \brief Initialise a circular, singly-linked list.
@@ -94,14 +100,14 @@ void circular_list_init(circular_list_t cl);
94
100
* \param cl The circular, singly-linked list.
95
101
* \return A pointer to the list's head, or NULL if the list is empty
96
102
*/
97
- void * circular_list_head (const circular_list_t cl );
103
+ void * circular_list_head (const_circular_list_t cl );
98
104
99
105
/**
100
106
* \brief Return the tail of a circular, singly-linked list.
101
107
* \param cl The circular, singly-linked list.
102
108
* \return A pointer to the list's tail, or NULL if the list is empty
103
109
*/
104
- void * circular_list_tail (const circular_list_t cl );
110
+ void * circular_list_tail (const_circular_list_t cl );
105
111
106
112
/**
107
113
* \brief Add an element to a circular, singly-linked list.
@@ -139,15 +145,15 @@ void circular_list_remove(circular_list_t cl, const void *element);
139
145
* \param cl The circular, singly-linked list.
140
146
* \return The number of elements in the list
141
147
*/
142
- unsigned long circular_list_length (const circular_list_t cl );
148
+ unsigned long circular_list_length (const_circular_list_t cl );
143
149
144
150
/**
145
151
* \brief Determine whether a circular, singly-linked list is empty.
146
152
* \param cl The circular, singly-linked list.
147
153
* \retval true The list is empty
148
154
* \retval false The list is not empty
149
155
*/
150
- bool circular_list_is_empty (const circular_list_t cl );
156
+ bool circular_list_is_empty (const_circular_list_t cl );
151
157
/*---------------------------------------------------------------------------*/
152
158
#endif /* CIRCULAR_LIST_H_ */
153
159
/*---------------------------------------------------------------------------*/
0 commit comments