/* UniFLEX kermit error messages & definitions */ #include "ufk.h" char *errmsg[] = { "Unable to open communication port", "Parameter required", "Error allocating memory\l", "No line to connect to", "Log file write error - logging stopped", "Error opening directory", "No help available", "No such topic", "Ambiguous command", "Unknown command", "Only one filename allowed", "Filespec(s) required", "No files selected", "Not allowed if REMOTE", "Ambiguous 'set' command", "Unknown 'set' command", "File already open", "File open error", "Invalid device or no permission", "Can't set baudrate for 'remote' line", "Unable to set baudrate", "Invalid baudrate specified", "Illegal value specified", "Character already in use", "Invalid length specified", "Value out of range", "End of line must be different of start of packet", "Start of packet must be different of end of line", "Invalid block check type", "Invalid character", "Ambiguous 'show' command", "Unknown 'show' command", "Get password id error", "Invalid directory specified", "Syntax error", "Privileged support task error", "Invalid support task protocol", "Error setting file permissions", "Can't spawn 'shell'" }; char *pktmsg[] = { "Aborted by user", "Unimplemented server command", "Packet error", "Device full", "UniFLEX error writing data, error ", "Cannot create file ", "Cannot open file " }; prterr(num) int num; { fprintf(stderr,"%s%c\n",errmsg[num],BELL); /* Send indexed error message */ return(num); } /* * send an error packet with the message. */ error(number,fmt, a1, a2, a3, a4, a5) int number; char *fmt; { char msg1[80], msg2[80]; char len; strcpy(msg1,prompt); /* Start with prompt */ strcat(msg1," - "); strcat(msg1,pktmsg[number]); /* Append error string */ if (number >= ERR_PARAM) { sprintf(msg2,fmt,a1,a2,a3,a4,a5); /* Make it a string */ strcat(msg1,msg2); /* Form one string */ } len = strlen(msg1); spack('E',n,len,msg1,0,block_check_type); /* Send the error packet */ if (!nooutput) { if (screen) { clreol(0,19); foreground(); disp(0,19,"Error:"); disp(20,19,msg1); background(); } else printf("Error: %s\n",msg1); beep(); } }