tizshufflelst

group tizshufflelst

Simple implementation of the Knuth-Fisher-Yates shuffle algorithm.

Typedefs

typedef struct tiz_shuffle_lst tiz_shuffle_lst_t

Shuffle list opaque handle.

Functions

OMX_ERRORTYPE tiz_shuffle_lst_init(tiz_shuffle_lst_ptr_t *app_shuffle_lst, const size_t a_list_size)

Create a new shuffled list of integers.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_S32 tiz_shuffle_lst_next(tiz_shuffle_lst_t *ap_shuffle_lst)

Return the next integer in the list.

Return

0 if success, -1 otherwise.

OMX_S32 tiz_shuffle_lst_prev(tiz_shuffle_lst_t *ap_shuffle_lst)

Return the prev integer in the list.

Return

0 if success, -1 otherwise.

OMX_S32 tiz_shuffle_lst_jump(tiz_shuffle_lst_t *ap_shuffle_lst, const OMX_S32 a_jump)

Return the prev integer in the list.

Return

0 if success, -1 otherwise.

void tiz_shuffle_lst_destroy(tiz_shuffle_lst_t *p_shuffle_lst)

Destroy the shuffled list object.