forked from dis-org/magioco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.c
More file actions
56 lines (51 loc) · 1.35 KB
/
error.c
File metadata and controls
56 lines (51 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "universal.h"
#include <stdlib.h>
void arg_error(int n)
{
switch(n)
{
case 2:
fprintf(stderr,
"\nImmesse troppe specifiche di esecuzione\n"
"Inserire massimo una specifica\n"
);
break;
case 1:
fprintf(stderr,"\nSpecifica non riconosciuta\n");
break;
}
fprintf(stderr,
"\nPossibili specifiche di esecuzione:\n"
" (h) help : Mostra questo messaggio\n"
" (t) test : Esegue controllo completo dei file di testo\n"
//" (m) man : Mostra il manuale del programma\n"
"\n"
);
exit(EXIT_FAILURE);
}
void folders_error()
{
fprintf(stderr,
"\nFile o cartelle mancanti\n"
"Per funzionare il programma richiede:\n"
"una cartella \"saves\" vuota\n"
"una cartella \"custom\" contenente i seguenti file:\n"
" events.txt enemy.txt item.txt\n\n"
);
exit(EXIT_FAILURE);
}
void alloc_error(const char* func)
{
fprintf(stderr,"Errore: allocazione non riuscita in %s\n", func);
exit(EXIT_FAILURE);
}
void fopen_error(const char* func)
{
fprintf(stderr,"Errore: apertura file non riuscita in %s\n", func);
exit(EXIT_FAILURE);
}
void eof_error(const char* func, char c)
{
fprintf(stderr,"Errore: raggiunto EOF in %s, %c mancante\n", func, c);
exit(EXIT_FAILURE);
}