/* program to allow experimentation of stack implementations */

#include <stdio.h>
#include <string.h>

/* include successive stack implementations with the following line */
#include "stack-lab-2.c"

/* Functions to compare size of arguments received */
long getArgSize(stringStack stack)               { return sizeof(stack); }
long getPointerArgSize(const stringStack* stack) { return sizeof(stack); }

int
main ()
{
  /* set up a stack variable */
  stringStack myStack;
  initialize(&myStack);
 
  /* create one random string */
  char myString[StringLength];
  for (int c=0 ; c<StringLength ; c++)
    myString[c] = (rand() % 26)+'A';
  
  /* push the same string onto the stack several times */
  while ( !isFull(&myStack) )
    {
      printf("%d ",size(&myStack));
      push(&myStack, myString);
    }
  printf("\n");
  
  /* pop the strings off the stack */
  while ( !isEmpty(&myStack) )
    {
      printf("%d ",size(&myStack));
      pop(&myStack);
    }
  printf("\n");

  return 0;
}
