#include #include #include #include #include "definitions.h" #include "rs232.h" #define COMMAND_LENGTH 80 /* max length of a command. */ int main() { int i=1; int file_descriptor=0; int status=FAILURE; int number_of_terminators=1; char *command=NULL; char **reply=NULL; if ((command = (char *) calloc(COMMAND_LENGTH, sizeof(char)))==NULL) { fprintf(stderr, "*ERROR* failed to allocate command buffer!"); fflush(stderr); exit(EXIT_FAILURE); } if ((reply = (char **) calloc(COMMAND_LENGTH, sizeof(char *))) == NULL) { fprintf(stderr, "*ERROR* failed to allocate command buffer!"); fflush(stderr); exit(EXIT_FAILURE); } for (i=0; i