Mercurial > hg > Papers > 2018 > nozomi-master
annotate paper/src/singleLinkedStack.c @ 116:ed6719c301fc
Update slide
author | atton <atton@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 13 Feb 2017 17:31:45 +0900 |
parents | c0693ad89f04 |
children |
rev | line source |
---|---|
65 | 1 __code pushSingleLinkedStack(struct SingleLinkedStack* stack,union Data* data, __code next(...)) { |
2 Element* element = new Element(); | |
3 element->next = stack->top; | |
4 element->data = data; | |
5 stack->top = element; | |
6 goto next(...); | |
7 } | |
8 | |
9 __code popSingleLinkedStack(struct SingleLinkedStack* stack, __code next(union Data* data, ...)) { | |
10 if (stack->top) { | |
11 data = stack->top->data; | |
12 stack->top = stack->top->next; | |
13 } else { | |
14 data = NULL; | |
15 } | |
16 goto next(data, ...); | |
17 } | |
18 |