File: msgdump.c

package info (click to toggle)
task-spooler 1.0.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 364 kB
  • sloc: ansic: 4,291; sh: 149; makefile: 105
file content (57 lines) | stat: -rw-r--r-- 1,724 bytes parent folder | download | duplicates (5)
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
/*
    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;
        default:
            fprintf(f, " Unknown message: %i\n", m->type);
    }
}