LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
flexarray.h File Reference

(7c4d7d1 userspace/term: change eyecandy inclusion to use objcopy instead of xxd)

#include <stdint.h>
#include <allocator.h>
+ Include dependency graph for flexarray.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct flexarrayflexarray_t
 

Functions

flexarray_t new_flexarray (size_t member_size, size_t initial_alloc, allocator_t *alloc)
 
void delete_flexarray (flexarray_t array)
 
uint64_t flexarray_append (flexarray_t array, void *data)
 
void flexarray_prepend (flexarray_t array, void *data)
 
void flexarray_remove (flexarray_t array, uint64_t idx)
 
uint64_t flexarray_find (flexarray_t array, void *data)
 Will return -1 when not found.
 
size_t flexarray_length (flexarray_t array)
 
size_t flexarray_member_size (flexarray_t array)
 
void flexarray_get (flexarray_t array, void *buffer, uint64_t idx)
 
void flexarray_set (flexarray_t array, void *buffer, uint64_t idx)
 
const void * flexarray_getall (flexarray_t array)
 

Typedef Documentation

◆ flexarray_t

typedef struct flexarray* flexarray_t

Definition at line 8 of file flexarray.h.

Function Documentation

◆ delete_flexarray()

void delete_flexarray ( flexarray_t  array)

Definition at line 29 of file flexarray.c.

References flexarray::allocator, and allocator::dealloc.

+ Here is the caller graph for this function:

◆ flexarray_append()

uint64_t flexarray_append ( flexarray_t  array,
void *  data 
)

Definition at line 56 of file flexarray.c.

References flexarray::alloc, flexarray::count, flexarray_data(), flexarray_grow(), flexarray::member_size, and memcpy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flexarray_find()

uint64_t flexarray_find ( flexarray_t  array,
void *  data 
)

Will return -1 when not found.

Definition at line 92 of file flexarray.c.

References flexarray::count, flexarray_data(), flexarray::member_size, and memcmp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flexarray_get()

void flexarray_get ( flexarray_t  array,
void *  buffer,
uint64_t  idx 
)

Definition at line 110 of file flexarray.c.

References flexarray::count, flexarray_data(), flexarray::member_size, and memcpy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flexarray_getall()

const void * flexarray_getall ( flexarray_t  array)

Definition at line 126 of file flexarray.c.

References flexarray_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flexarray_length()

size_t flexarray_length ( flexarray_t  array)

Definition at line 102 of file flexarray.c.

References flexarray::count.

+ Here is the caller graph for this function:

◆ flexarray_member_size()

size_t flexarray_member_size ( flexarray_t  array)

Definition at line 106 of file flexarray.c.

References flexarray::member_size.

◆ flexarray_prepend()

void flexarray_prepend ( flexarray_t  array,
void *  data 
)

Definition at line 67 of file flexarray.c.

References flexarray::alloc, flexarray::count, flexarray::data, flexarray_data(), flexarray_grow(), flexarray::member_size, memcpy(), and memmove().

+ Here is the call graph for this function:

◆ flexarray_remove()

void flexarray_remove ( flexarray_t  array,
uint64_t  idx 
)

Definition at line 78 of file flexarray.c.

References flexarray::count, flexarray_data(), flexarray::member_size, and memmove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flexarray_set()

void flexarray_set ( flexarray_t  array,
void *  buffer,
uint64_t  idx 
)

Definition at line 118 of file flexarray.c.

References flexarray::count, flexarray_data(), flexarray::member_size, and memcpy().

+ Here is the call graph for this function:

◆ new_flexarray()

flexarray_t new_flexarray ( size_t  member_size,
size_t  initial_alloc,
allocator_t alloc 
)

Definition at line 14 of file flexarray.c.

References allocator::alloc, flexarray::alloc, alloc, flexarray::allocator, flexarray::count, flexarray::data, and flexarray::member_size.

+ Here is the caller graph for this function: