28 lines
541 B
C
28 lines
541 B
C
// error.c
|
|
// Řešení IJC-DU1, příklad a), 22.3.2024
|
|
// Autor: Roman Nečas, FIT
|
|
// Přeloženo: gcc 13.2.1
|
|
|
|
#include "error.h"
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
void warning(const char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
fprintf(stderr, "Warning: ");
|
|
vfprintf(stderr, fmt, args);
|
|
va_end(args);
|
|
}
|
|
|
|
void error_exit(const char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
fprintf(stderr, "Error: ");
|
|
vfprintf(stderr, fmt, args);
|
|
va_end(args);
|
|
exit(1);
|
|
}
|