diff options
author | biouman <biouman> | 2001-05-01 22:50:42 +0000 |
---|---|---|
committer | biouman <biouman> | 2001-05-01 22:50:42 +0000 |
commit | ec32dd3c2506d341fe7106418f0e538f9407fbce (patch) | |
tree | 272285e6e0f713bd1c1f7e8c4a2dad4eb93eb26a /lib | |
parent | 077892e9b4355a2e34b36bafb4fd701993c3aeaf (diff) |
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pile.c | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -18,8 +18,9 @@ pile_elem pile[PILE_MAX]; +pile_elem result_pile[PILE_MAX]; unsigned int pile_ptr = 0; - +unsigned int result_pile_ptr = 0; void push_pile(char *st) { int valid1, valid2, valid3; @@ -138,7 +139,33 @@ void flush_pile(void) pile_ptr=0; } +void move_to_resultat_pile(void) +{ pile_elem temp; + + temp=pop_pile(1); + if (result_pile_ptr!=PILE_MAX) { + if (temp.type==T_POLY) { + result_pile[result_pile_ptr]=temp; + result_pile_ptr++; + } else { + exception(2, _("move_to_resultat_pile: invalid argument type")); + } + } else { + exception(2, _("move_to_resultat_pile: Stack Overflow")); + } +} + +char * pop_resultat(void) +{ static char result[BUFSIZ]; + if (result_pile_ptr) { + result_pile_ptr--; + sprintf(result,"%s",ply_affichage(result_pile[result_pile_ptr].poly)); + } else { + exception(2, _("move_to_resultat_pile: empty stack")); + } + return result; +} |