diff options
Diffstat (limited to 'firmware/export/general.h')
-rw-r--r-- | firmware/export/general.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/firmware/export/general.h b/firmware/export/general.h index 8da4a0ad59..16c824086b 100644 --- a/firmware/export/general.h +++ b/firmware/export/general.h | |||
@@ -72,4 +72,19 @@ char *create_datetime_filename(char *buffer, const char *path, | |||
72 | bool unique_time); | 72 | bool unique_time); |
73 | #endif /* CONFIG_RTC */ | 73 | #endif /* CONFIG_RTC */ |
74 | 74 | ||
75 | /*** | ||
76 | ** Compacted pointer lists | ||
77 | ** | ||
78 | ** N-length list requires N+1 elements to ensure NULL-termination. | ||
79 | **/ | ||
80 | |||
81 | /* Find a pointer in a pointer array. Returns the addess of the element if | ||
82 | found or the address of the terminating NULL otherwise. This can be used | ||
83 | to bounds check and add items. */ | ||
84 | void ** find_array_ptr(void **arr, void *ptr); | ||
85 | |||
86 | /* Remove a pointer from a pointer array if it exists. Compacts it so that | ||
87 | no gaps exist. Returns 0 on success and -1 if the element wasn't found. */ | ||
88 | int remove_array_ptr(void **arr, void *ptr); | ||
89 | |||
75 | #endif /* GENERAL_H */ | 90 | #endif /* GENERAL_H */ |