File: dstack.h

package info (click to toggle)
openssn 1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,340 kB
  • sloc: cpp: 10,973; makefile: 80
file content (34 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// $Id: dstack.h,v 1.2 2003/04/14 05:51:03 mbridak Exp $
// dstack.h -- Dynamic stack (DStack) declaration and function prototypes.
//

#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif

typedef struct
{
   float value;
   void *next, *previous;
} STACKVALUE;

class DStack
{
  private:
    STACKVALUE *bottom_;
    STACKVALUE *top_;
    int number_items;

  public:
    DStack();
    ~DStack();
    void clear_stack();    // erase everything
    int push(float val);
    int num_items();
    float pop();
    int empty();
    void print();
};