-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.c
65 lines (60 loc) · 1 KB
/
types.c
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
57
58
59
60
61
62
63
64
65
/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010-13 Edward Cree
See quirc.c for license information
types.c: enumerator names
*/
#include "types.h"
// TODO: The _name functions ought to be generated, really (SPOT and all that)
const char *mtype_name(mtype m)
{
switch(m)
{
case MSG:
return("MSG");
case NOTICE:
return("NOTICE");
case PREFORMAT:
return("PREFORMAT");
case ACT:
return("ACT");
case JOIN:
return("JOIN");
case PART:
return("PART");
case QUIT:
return("QUIT");
case QUIT_PREFORMAT:
return("QUIT_PREFORMAT");
case NICK:
return("NICK");
case MODE:
return("MODE");
case STA:
return("STA");
case ERR:
return("ERR");
case UNK:
return("UNK");
case UNK_NOTICE:
return("UNK_NOTICE");
case UNN:
return("UNN");
default:
return("?");
}
}
const char *prio_name(prio p)
{
switch(p)
{
case QUIET:
return("QUIET");
case NORMAL:
return("NORMAL");
case DEBUG:
return("DEBUG");
default:
return("?");
}
}