view paper/src/StackPush.c @ 72:951cb9681030

add source code
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Thu, 04 Feb 2021 14:54:44 +0900
parents
children
line wrap: on
line source

__code pushSingleLinkedStack(struct Context *context,struct SingleLinkedStack* stack, union Data* data, enum Code next) {
    Element* element = &ALLOCATE(context, Element)->Element;
    element->next = stack->top;
    element->data = data;
    stack->top = element;
    goto meta(context, next);
}

__code pushSingleLinkedStack_stub(struct Context* context) {
	SingleLinkedStack* stack = (SingleLinkedStack*)GearImpl(context, Stack, stack);
	Data* data = Gearef(context, Stack)->data;
	enum Code next = Gearef(context, Stack)->next;
	goto pushSingleLinkedStack(context, stack, data, next);
}