author | viric@llimona |
Sun, 25 Mar 2007 04:55:18 +0200 | |
changeset 23 | 96fcebb68510 |
parent 22 | afdc8410633f |
child 31 | 1a6c732b0b71 |
permissions | -rw-r--r-- |
1 | 1 |
extern int server_socket; |
2 |
||
3 | 3 |
enum |
4 |
{ |
|
5 | 5 |
CMD_LEN=500, |
4 | 6 |
LINE_LEN=500 |
3 | 7 |
}; |
8 |
||
1 | 9 |
enum msg_types |
10 |
{ |
|
3 | 11 |
KILL, |
12 |
NEWJOB, |
|
13 |
NEWJOB_OK, |
|
14 |
RUNJOB, |
|
22 | 15 |
RUNJOB_OK, |
3 | 16 |
ENDJOB, |
17 |
LIST, |
|
4 | 18 |
LIST_LINE, |
19
5efc347cca8d
The finished jobs store the errorlevel, and can be listed.
viric@llimona
parents:
18
diff
changeset
|
19 |
CLEAR_FINISHED |
1 | 20 |
}; |
21 |
||
22 |
struct msg |
|
23 |
{ |
|
2 | 24 |
enum msg_types type; |
1 | 25 |
|
2 | 26 |
union |
27 |
{ |
|
18 | 28 |
struct { |
29 |
int command_size; |
|
22 | 30 |
int store_output; |
18 | 31 |
} newjob; |
22 | 32 |
struct { |
33 |
int ofilename_size; |
|
34 |
int store_output; |
|
35 |
} runjob_ok; |
|
3 | 36 |
int jobid; |
37 |
int errorlevel; |
|
21 | 38 |
int line_size; |
2 | 39 |
} u; |
1 | 40 |
}; |
41 |
||
3 | 42 |
|
43 |
enum Jobstate |
|
44 |
{ |
|
45 |
QUEUED, |
|
46 |
RUNNING, |
|
47 |
FINISHED, |
|
48 |
}; |
|
49 |
||
18 | 50 |
void send_bytes(const int fd, const char *data, const int bytes); |
51 |
int recv_bytes(const int fd, char *data, const int bytes); |
|
52 |
void send_msg(const int fd, const struct msg *m); |
|
53 |
int recv_msg(const int fd, struct msg *m); |