htp_list.h File Reference
#include "htp_core.h"
#include "bstr.h"
Go to the source code of this file.
Detailed Description
- Author:
- Ivan Ristic <ivanr@webkreator.com>
Define Documentation
#define htp_list_add htp_list_array_push |
#define htp_list_clear htp_list_array_clear |
#define htp_list_create htp_list_array_create |
#define htp_list_destroy htp_list_array_destroy |
#define htp_list_get htp_list_array_get |
#define htp_list_pop htp_list_array_pop |
#define htp_list_push htp_list_array_push |
#define htp_list_replace htp_list_array_replace |
#define htp_list_shift htp_list_array_shift |
#define htp_list_size htp_list_array_size |
Typedef Documentation
Function Documentation
Remove all elements from the list. It is the responsibility of the caller to iterate over list elements and deallocate them if necessary, prior to invoking this function.
- Parameters:
-
Create new array-backed list.
- Parameters:
-
- Returns:
- Newly created list.
Free the memory occupied by this list. This function assumes the elements held by the list were freed beforehand.
- Parameters:
-
Find the element at the given index.
- Parameters:
-
- Returns:
- the desired element, or NULL if the list is too small, or if the element at that position carries a NULL
Remove one element from the end of the list.
- Parameters:
-
- Returns:
- The removed element, or NULL if the list is empty.
Add new element to the end of the list, expanding the list as necessary.
- Parameters:
-
- Returns:
- HTP_OK on success or HTP_ERROR on failure.
Replace the element at the given index with the provided element.
- Parameters:
-
- Returns:
- HTP_OK if an element with the given index was replaced; HTP_ERROR if the desired index does not exist.
Remove one element from the beginning of the list.
- Parameters:
-
- Returns:
- The removed element, or NULL if the list is empty.
Returns the size of the list.
- Parameters:
-
- Returns:
- List size.
Create a new linked list.
- Returns:
- The newly created list, or NULL on memory allocation failure
Destroy list. This function will not destroy any of the data stored in it. You'll have to do that manually beforehand.
- Parameters:
-
Is the list empty?
- Parameters:
-
- Returns:
- 1 if the list is empty, 0 if it is not
Remove one element from the end of the list.
- Parameters:
-
- Returns:
- Pointer to the removed element, or NULL if the list is empty.
Add element to list.
- Parameters:
-
- Returns:
- HTP_OK on success, HTP_ERROR on error.
Remove one element from the beginning of the list.
- Parameters:
-
- Returns:
- Pointer to the removed element, or NULL if the list is empty.