errors.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void error_message (short error_type, int line_number, int file, char *message,...)
void warning_message (short error_type, int line_number, int file, char *message,...)

Function Documentation

void error_message ( short  error_type,
int  line_number,
int  file,
char *  message,
  ... 
)

Definition at line 36 of file errors.c.

00037 {
00038         va_list ap;
00039 
00040         printf("--------------\nOdin has decided you have failed ;)\n\n");
00041 
00042         printf("ERROR:");
00043         if (file != -1)
00044                 printf(" (File: %s)", configuration.list_of_file_names[file]);
00045         if (line_number != 0)
00046                 printf(" (Line number: %d)", line_number);
00047         if (message != NULL)
00048         {
00049                 printf(" ");
00050                 va_start(ap, message);
00051                 vprintf(message, ap);   
00052                 va_end(ap); 
00053         }
00054 
00055         printf("\n");
00056 
00057         exit(error_type);
00058 }

Here is the caller graph for this function:

void warning_message ( short  error_type,
int  line_number,
int  file,
char *  message,
  ... 
)

Definition at line 63 of file errors.c.

00064 {
00065         va_list ap;
00066         static short is_warned = FALSE;
00067         static long warning_count = 0;
00068         warning_count++;
00069 
00070         if (is_warned == FALSE)
00071         {
00072                 printf("-------------------------\nOdin has decided you may fail ... WARNINGS:\n\n");
00073                 is_warned = TRUE;
00074         }
00075 
00076         printf("WARNING (%ld):", warning_count);
00077         if (file != -1)
00078                 printf(" (File: %s)", configuration.list_of_file_names[file]);
00079         if (line_number != 0)
00080                 printf(" (Line number: %d)", line_number);
00081         if (message != NULL)
00082         {
00083                 printf(" ");
00084 
00085                 va_start(ap, message);
00086                 vprintf(message, ap);   
00087                 va_end(ap); 
00088         }
00089 
00090         printf("\n");
00091 }

Here is the caller graph for this function:

Generated on Tue Aug 2 10:43:15 2011 for ODIN_II by  doxygen 1.6.3