the data positionned at newModel[ y ] is inserted at position index in the current model
the data positionned at newModel[ y ] is inserted at position index in the current modelmodel = "abcdefg" newModel[3] = 'X' after operation insert(y=3, index = 3), model will be model = "abcXdefg"
#ifndef VLC_DIFFUTIL_H
#define VLC_DIFFUTIL_H
typedef struct {
uint32_t (*getOldSize)(
const void*
list);
uint32_t (*getNewSize)(
const void*
list);
bool (*isSame)(const void* listOld, uint32_t oldIndex, const void* listNew, uint32_t newIndex);
typedef struct {
void (*insert)(void* opaque, const void* listOld, uint32_t posOld, const void* listNew, uint32_t posNew);
void (*remove)(void* opaque, const void* listOld, uint32_t posOld, const void* listNew, uint32_t posNew);
void (*equal)(void* opaque, const void* listOld, uint32_t posOld, const void* listNew, uint32_t posNew);
};
typedef struct {
union {
struct {
uint32_t x;
uint32_t y;
uint32_t index;
} insert;
struct {
uint32_t x;
uint32_t y;
uint32_t index;
} remove;
struct {
uint32_t from;
uint32_t to;
uint32_t x;
uint32_t y;
} move;
} op;
};
int flags);
#endif
struct vlc_param ** list
Definition: core.c:402
size_t count
Definition: core.c:403
void vlc_diffutil_free_snake(diffutil_snake_t *snake)
free the snake created by vlc_diffutil_build_snake
Definition: diffutil.c:300
void vlc_diffutil_free_change_list(vlc_diffutil_changelist_t *changelist)
free the changelist created by vlc_diffutil_build_change_list
Definition: diffutil.c:612
diffutil_snake_t * vlc_diffutil_build_snake(const vlc_diffutil_callback_t *diffOp, const void *dataOld, const void *dataNew)
vlc_diffutil_build_snake compute a diff model between the dataOld model and the dataNew model.
Definition: diffutil.c:248
vlc_diffutil_changelist_t * vlc_diffutil_build_change_list(const diffutil_snake_t *snake, const vlc_diffutil_callback_t *diffOp, const void *dataOld, const void *dataNew, int flags)
Definition: diffutil.c:577
bool vlc_diffutil_walk_snake(const diffutil_snake_t *snake, const vlc_diffutil_snake_callback_t *snakeOp, void *cbData, const vlc_diffutil_callback_t *diffOp, const void *dataOld, const void *dataNew)
iterate over the changelist and callback user on each operation (keep/insert/remove)
Definition: diffutil.c:309
#define VLC_API
Definition: fourcc_gen.c:31
Definition: diffutil.c:34
this struture defines callback to access and compare elements from the old and the new list
Definition: vlc_diffutil.h:31
represent a change to the model, each change assumes that previous changes have already been applied
Definition: vlc_diffutil.h:88
Definition: vlc_diffutil.h:157
Definition: vlc_diffutil.h:40
This file is a collection of common definitions and types.
vlc_diffutil_op_type
Definition: vlc_diffutil.h:69
@ VLC_DIFFUTIL_OP_MOVE
items have been moved within the list
Definition: vlc_diffutil.h:75
@ VLC_DIFFUTIL_OP_INSERT
items have been added to the list
Definition: vlc_diffutil.h:71
@ VLC_DIFFUTIL_OP_REMOVE
items have been removed from the list
Definition: vlc_diffutil.h:73
@ VLC_DIFFUTIL_OP_IGNORE
current change should be ignored
Definition: vlc_diffutil.h:77
vlc_diffutil_result_flag
Definition: vlc_diffutil.h:159
@ VLC_DIFFUTIL_RESULT_AGGREGATE
aggreate similar consecutive operations into a single operation for instance this: [{INSERT,...
Definition: vlc_diffutil.h:169
@ VLC_DIFFUTIL_RESULT_MOVE
try to transform an insertion with a matching supression into a move operation
Definition: vlc_diffutil.h:161
This provides convenience helpers for vectors.