

#include <stdio.h>


int main(){
   int key;
   int mag;
   int pid;
   char location[32] = "keypad";
   char timestamp[32] = "now"; 
   char command[128]; 
   
   while(1){
      mag = 1;
      pid = 0;
      while(1){
	 key =  //get single key stroke
	   if(key == "return key"){
	      break;
	   }
	 else{
	    pid = pid + (mag * key);
	    mag = mag * 10;
	 }
      }
      
      //package the values to be passes to insert.pl
      sprintf(command, "./insert.pl %d %s %s", pid, location, timestamp); 
      printf("command: %s\n", command); 
      //call insert.pl
      system(command);
   }
   
}
