lv_utils.h

Functions

void *_lv_utils_bsearch(const void *key, const void *base, uint32_t n, uint32_t size, int32_t (*cmp)(const void *pRef, const void *pElement))

Searches base[0] to base[n - 1] for an item that matches *key.

Note

The function cmp must return negative if it's first argument (the search key) is less that it's second (a table entry), zero if equal, and positive if greater.

Note

Items in the array must be in ascending order.

Parameters:
  • key -- Pointer to item being searched for

  • base -- Pointer to first element to search

  • n -- Number of elements

  • size -- Size of each element

  • cmp -- Pointer to comparison function (see #unicode_list_compare as a comparison function example)

Returns:

a pointer to a matching item, or NULL if none exists.

lv_result_t lv_draw_buf_save_to_file(const lv_draw_buf_t *draw_buf, const char *path)

Save a draw buf to a file

Parameters:
  • draw_buf -- pointer to a draw buffer

  • path -- path to the file to save

Returns:

LV_RES_OK: success; LV_RES_INV: error