static int add_border_sentinel( void ) { struct border_change_t *sentinel = alloc_change(); sentinel->x = sentinel->y = 0; sentinel->colour = scld_last_dec.name.hires ? display_hires_border : display_lores_border; return 0; }
void end_change_chain(void) { if (change_barrier) { /* There were no changes in this change chain. */ free(change_barrier); change_barrier = NULL; } else { /* There were some changes. Add end of chain marker. */ add_change(alloc_change()); } }
void begin_change_chain(void) { BUG_ON(change_barrier); /* * Allocate change chain barrier but add it to the change tree only if * there will be any real changes */ change_barrier = alloc_change(); change_merge = CHANGE_MERGE_NONE; }
static struct change *new_change(void) { struct change *change; if (change_barrier) { /* * We are recording series of changes (:replace for example) * and now we have just made the first change so we have to * mark beginning of the chain. * * We could have done this before when starting the change * chain but then we may have ended up with an empty chain. * We don't want to record empty changes ever. */ add_change(change_barrier); change_barrier = NULL; } change = alloc_change(); add_change(change); return change; }