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.

备注

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.

备注

Items in the array must be in ascending order.

参数:
  • 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)

返回:

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

参数:
  • draw_buf -- pointer to a draw buffer

  • path -- path to the file to save

返回:

LV_RES_OK: success; LV_RES_INV: error