diff options
Diffstat (limited to 'firmware/include/buflib.h')
-rw-r--r-- | firmware/include/buflib.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/include/buflib.h b/firmware/include/buflib.h index db7b5ec50a..3d8f43ef5f 100644 --- a/firmware/include/buflib.h +++ b/firmware/include/buflib.h | |||
@@ -153,7 +153,8 @@ size_t buflib_available(struct buflib_context *ctx); | |||
153 | * | 153 | * |
154 | * size: How many bytes to allocate | 154 | * size: How many bytes to allocate |
155 | * | 155 | * |
156 | * Returns: An integer handle identifying this allocation | 156 | * Returns: A positive integer handle identifying this allocation, or |
157 | * a negative value on error (0 is also not a valid handle) | ||
157 | */ | 158 | */ |
158 | int buflib_alloc(struct buflib_context *context, size_t size); | 159 | int buflib_alloc(struct buflib_context *context, size_t size); |
159 | 160 | ||
@@ -166,7 +167,8 @@ int buflib_alloc(struct buflib_context *context, size_t size); | |||
166 | * size: How many bytes to allocate | 167 | * size: How many bytes to allocate |
167 | * ops: a struct with pointers to callback functions (see above) | 168 | * ops: a struct with pointers to callback functions (see above) |
168 | * | 169 | * |
169 | * Returns: An integer handle identifying this allocation | 170 | * Returns: A positive integer handle identifying this allocation, or |
171 | * a negative value on error (0 is also not a valid handle) | ||
170 | */ | 172 | */ |
171 | int buflib_alloc_ex(struct buflib_context *ctx, size_t size, const char *name, | 173 | int buflib_alloc_ex(struct buflib_context *ctx, size_t size, const char *name, |
172 | struct buflib_callbacks *ops); | 174 | struct buflib_callbacks *ops); |
@@ -188,7 +190,8 @@ int buflib_alloc_ex(struct buflib_context *ctx, size_t size, const char *name, | |||
188 | * size: The actual size will be returned into size | 190 | * size: The actual size will be returned into size |
189 | * ops: a struct with pointers to callback functions | 191 | * ops: a struct with pointers to callback functions |
190 | * | 192 | * |
191 | * Returns: An integer handle identifying this allocation | 193 | * Returns: A positive integer handle identifying this allocation, or |
194 | * a negative value on error (0 is also not a valid handle) | ||
192 | */ | 195 | */ |
193 | int buflib_alloc_maximum(struct buflib_context* ctx, const char* name, | 196 | int buflib_alloc_maximum(struct buflib_context* ctx, const char* name, |
194 | size_t *size, struct buflib_callbacks *ops); | 197 | size_t *size, struct buflib_callbacks *ops); |
@@ -233,7 +236,7 @@ bool buflib_shrink(struct buflib_context *ctx, int handle, void* newstart, size_ | |||
233 | /** | 236 | /** |
234 | * Frees memory associated with the given handle | 237 | * Frees memory associated with the given handle |
235 | * | 238 | * |
236 | * Returns: 0 (to invalidate handles in one line) | 239 | * Returns: 0 (to invalidate handles in one line, 0 is not a valid handle) |
237 | */ | 240 | */ |
238 | int buflib_free(struct buflib_context *context, int handle); | 241 | int buflib_free(struct buflib_context *context, int handle); |
239 | 242 | ||