mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
Fixed lsearch related arguments.
This commit is contained in:
parent
f4c90635ff
commit
a4eeedfa34
15 changed files with 58 additions and 33 deletions
|
|
@ -89,6 +89,15 @@ void list_swap(list_t *list, size_t i1, size_t i2);
|
|||
*/
|
||||
void *list_get(list_t *list, size_t index);
|
||||
|
||||
/*
|
||||
* Gets an element of a list and dereferences it.
|
||||
* For example, if you have a list of char *, this function
|
||||
* will return a char * instead of a char **, unlike list_get.
|
||||
* index must be less than the length of the list.
|
||||
* list must be a list of pointers.
|
||||
*/
|
||||
void *list_getp(list_t *list, size_t index);
|
||||
|
||||
/*
|
||||
* Sorts the list using the stdlib qsort() function.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ char *strip_whitespace(char *str);
|
|||
char *strip_comments(char *str);
|
||||
void strip_quotes(char *str);
|
||||
|
||||
// strcmp that dereferences args first.
|
||||
// Designed to be taken by list_lsearch and such
|
||||
int strcmp_ptr(const void *a, const void *b);
|
||||
|
||||
// strcmp that also handles null pointers.
|
||||
int lenient_strcmp(char *a, char *b);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue