#include "solid.h"

void quit(int msg_index, char filename[], int linenum)
{
    static char linenum_c[] = {", line       \n"};
    static char *message[] = {
        " at file ", /* 0 */
        "insufficient memory", /* 1 */
        "invalid solid object type", /* 2 */
        "requires ega/vga graphics", /* 3 */
    };

        sprintf(&linenum_c[7], "%6d", linenum);
        perror((char *)strcat(strcat(strcat(message
            [msg_index], message[0]), filename),
            linenum_c));
        exit(msg_index);
}
