Go to the source code of this file.
Functions | |
int | str2ffmt (char *str) |
uint8_t | set_bit_in_byte (uint8_t src, int bit, int val) |
uint16_t | set_bit_in_word (uint16_t src, int bit, int val) |
uint64_t | get_program_time (void) |
DList * | dlist_add (DList *head, AvrClass *data, DListFP_Cmp cmp) |
DList * | dlist_add_head (DList *head, AvrClass *data) |
DList * | dlist_delete (DList *head, AvrClass *data, DListFP_Cmp cmp) |
void | dlist_delete_all (DList *head) |
AvrClass * | dlist_lookup (DList *head, AvrClass *data, DListFP_Cmp cmp) |
AvrClass * | dlist_get_head_data (DList *head) |
DList * | dlist_iterator (DList *head, DListFP_Iter func, void *user_data) |
int str2ffmt | ( | char * | str | ) |
Utility function to convert a string to a FileFormatType code.
Definition at line 50 of file utils.c.
References set_bit_in_byte(), and set_bit_in_word().
uint8_t set_bit_in_byte | ( | uint8_t | src, |
int | bit, | ||
int | val | ||
) |
Set a bit in src to 1 if val != 0, clears bit if val == 0.
Referenced by str2ffmt().
uint16_t set_bit_in_word | ( | uint16_t | src, |
int | bit, | ||
int | val | ||
) |
Set a bit in src to 1 if val != 0, clears bit if val == 0.
Referenced by str2ffmt().
uint64_t get_program_time | ( | void | ) |
Return the number of milliseconds of elapsed program time.
Definition at line 76 of file utils.c.
References avr_error.
Referenced by avr_core_run().
DList* dlist_add | ( | DList * | head, |
AvrClass * | data, | ||
DListFP_Cmp | cmp | ||
) |
DList* dlist_add_head | ( | DList * | head, |
AvrClass * | data | ||
) |
DList* dlist_delete | ( | DList * | head, |
AvrClass * | data, | ||
DListFP_Cmp | cmp | ||
) |
Conditionally delete a node from the list.
Delete a node from the list if the node's data matches the specified data. Returns the head of the modified list.
Definition at line 215 of file utils.c.
References avr_error, and class_unref().
Referenced by dlist_iterator().
void dlist_delete_all | ( | DList * | head | ) |
Blow away the entire list.
Definition at line 266 of file utils.c.
References class_unref().
Referenced by avr_core_destroy().
AvrClass* dlist_lookup | ( | DList * | head, |
AvrClass * | data, | ||
DListFP_Cmp | cmp | ||
) |
Lookup an item in the list.
Walk the list pointed to by head and return a pointer to the data if found. If not found, return NULL.
head | The head of the list to be iterated. |
data | The data to be passed to the func when it is applied. |
cmp | A function to be used for comparing the items. |
Definition at line 291 of file utils.c.
References avr_error.
Referenced by mem_get_vdevice_by_name().
AvrClass* dlist_get_head_data | ( | DList * | head | ) |
DList* dlist_iterator | ( | DList * | head, |
DListFP_Iter | func, | ||
void * | user_data | ||
) |
Iterate over all elements of the list.
For each element, call the user supplied iterator function and pass it the node data and the user_data. If the iterator function return non-zero, remove the node from the list.
head | The head of the list to be iterated. |
func | The function to be applied. |
user_data | The data to be passed to the func when it is applied. |
Definition at line 357 of file utils.c.
References avr_error, and dlist_delete().