-
Notifications
You must be signed in to change notification settings - Fork 24
/
msgdump.c
executable file
·60 lines (58 loc) · 1.8 KB
/
msgdump.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
/*
Task Spooler - a task queue system for the unix user
Copyright (C) 2007-2009 Lluís Batlle i Rossell
Please find the license in the provided COPYING file.
*/
#include <stdio.h>
#include <sys/time.h>
#include "main.h"
void msgdump(FILE *f, const struct Msg *m)
{
fprintf(f, "msgdump:\n");
switch(m->type)
{
case KILL_SERVER:
fprintf(f, " KILL SERVER\n");
break;
case NEWJOB:
fprintf(f, " NEWJOB\n");
fprintf(f, " Commandsize: %i\n", m->u.newjob.command_size);
break;
case NEWJOB_OK:
fprintf(f, " NEWJOB_OK\n");
fprintf(f, " JobID: '%i'\n", m->u.jobid);
break;
case RUNJOB:
fprintf(f, " RUNJOB\n");
break;
case RUNJOB_OK:
fprintf(f, " RUNJOB_OK\n");
fprintf(f, " Outputsize: %i\n", m->u.output.ofilename_size);
fprintf(f, " pid: %i\n", m->u.output.pid);
break;
case ENDJOB:
fprintf(f, " ENDJOB\n");
break;
case LIST:
fprintf(f, " LIST\n");
break;
case LIST_LINE:
fprintf(f, " LIST_LINE\n");
fprintf(f, " Linesize: %i\n", m->u.size);
break;
case ASK_OUTPUT:
fprintf(f, " ASK_OUTPUT\n");
fprintf(f, " Jobid: %i\n", m->u.jobid);
break;
case ANSWER_OUTPUT:
fprintf(f, " ANSWER_OUTPUT\n");
fprintf(f, " Outputsize: %i\n", m->u.output.ofilename_size);
fprintf(f, " PID: %i\n", m->u.output.pid);
break;
case GET_LABEL:
fprintf(f, "GET_LABEL\n");
fprintf(f, " Jobid: %i\n", m->u.jobid);
default:
fprintf(f, " Unknown message: %i\n", m->type);
}
}