// file: ht_input_1.cc
//
// isip include files
//
#include "hmm_train.h"
#include "hmm_train_constants.h"

// method: read_key_cc
//
// arguments:
//  int_4 num : (input / output) number of steps
//
// return: an int_4 with the step size
//
// this method waits for the proper keyboard input to advance frames
//
int_4 read_key_cc(int_4& num_a) {
  
  // check if need to read external input
  //
  if (num_a == (int_4)0) {

    // flush the pipes
    //
    fflush(stdout);
    fflush(stdin);

    // read control input from user
    //
    while (num_a == (int_4)0) {
      fscanf(stdin, "%ld", &num_a);
    }
  }

  // decrement the number
  //
  if (num_a > (int_4)0) {
    num_a --;
  }
  
  // return num and exit gracefully
  //
  return num_a;
}
