main.h
author viric@llimona
Fri, 13 Apr 2007 20:52:28 +0200
changeset 127 c620eacd7630
parent 120 790bc4cecd3b
child 134 5a6b8bb1f7a8
permissions -rw-r--r--
Fixed the versions in the code.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     1
enum
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     2
{
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     3
    CMD_LEN=500
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     4
};
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     5
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     6
enum msg_types
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     7
{
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     8
    KILL_SERVER,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
     9
    NEWJOB,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    10
    NEWJOB_OK,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    11
    RUNJOB,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    12
    RUNJOB_OK,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    13
    ENDJOB,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    14
    LIST,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    15
    LIST_LINE,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    16
    CLEAR_FINISHED,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    17
    ASK_OUTPUT,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    18
    ANSWER_OUTPUT,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    19
    REMOVEJOB,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    20
    REMOVEJOB_OK,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    21
    WAITJOB,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    22
    WAITJOB_OK,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    23
    URGENT,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    24
    URGENT_OK,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    25
    GET_STATE,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    26
    ANSWER_STATE,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    27
    SWAP_JOBS,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    28
    SWAP_JOBS_OK
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    29
};
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    30
31
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    31
enum Request
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    32
{
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    33
    c_QUEUE,
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    34
    c_TAIL,
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    35
    c_KILL_SERVER,
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    36
    c_LIST,
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    37
    c_CLEAR_FINISHED,
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    38
    c_SHOW_HELP,
37
f2f6c6f0e86f Added version.
viric@llimona
parents: 35
diff changeset
    39
    c_SHOW_VERSION,
33
5c2d981f2f8e Added 'cat' and 'show output filename'
viric@llimona
parents: 32
diff changeset
    40
    c_CAT,
5c2d981f2f8e Added 'cat' and 'show output filename'
viric@llimona
parents: 32
diff changeset
    41
    c_SHOW_OUTPUT_FILE,
35
83d0da612dc4 Kill the running job works fine.
viric@llimona
parents: 33
diff changeset
    42
    c_SHOW_PID,
42
f093d0964cf5 Added wait for jobs.
viric@llimona
parents: 41
diff changeset
    43
    c_REMOVEJOB,
53
731c41817842 '-u' (urgency) implemented.
viric@llimona
parents: 51
diff changeset
    44
    c_WAITJOB,
63
47be318f4cbc Added "-s" for querying the job state.
viric@llimona
parents: 62
diff changeset
    45
    c_URGENT,
66
f70a27afd92e Adding "swap jobs" with -U. Fixed a big problem with fds 0, 1, 2.
viric@mandarina
parents: 65
diff changeset
    46
    c_GET_STATE,
f70a27afd92e Adding "swap jobs" with -U. Fixed a big problem with fds 0, 1, 2.
viric@mandarina
parents: 65
diff changeset
    47
    c_SWAP_JOBS
31
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    48
};
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    49
30
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 28
diff changeset
    50
struct Command_line {
31
1a6c732b0b71 The command line parsing has been simplified.
viric@llimona
parents: 30
diff changeset
    51
    enum Request request;
30
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 28
diff changeset
    52
    int need_server;
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 28
diff changeset
    53
    int store_output;
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 28
diff changeset
    54
    int should_go_background;
55
678ca291d545 Now the '-nf' doesn't leave a job in 'finished' state.
viric@llimona
parents: 53
diff changeset
    55
    int should_keep_finished;
71
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
    56
    int send_output_by_mail;
65
dced0efccc19 Added gzip output.
viric@llimona
parents: 63
diff changeset
    57
    int gzip;
71
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
    58
    int jobid; /* When queuing a job, main.c will fill it automatically from
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
    59
                  the server answer to NEWJOB */
66
f70a27afd92e Adding "swap jobs" with -U. Fixed a big problem with fds 0, 1, 2.
viric@mandarina
parents: 65
diff changeset
    60
    int jobid2;
68
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
    61
    struct {
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
    62
        char **array;
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
    63
        int num;
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
    64
    } command;
30
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 28
diff changeset
    65
};
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
    66
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
    67
enum Process_type {
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
    68
    CLIENT,
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
    69
    SERVER
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
    70
};
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
    71
30
ab88478a7e9b The commandline parameters are centered in a struct.
viric@llimona
parents: 28
diff changeset
    72
extern struct Command_line command_line;
32
3531439f2770 Tail works.
viric@llimona
parents: 31
diff changeset
    73
extern int server_socket;
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
    74
extern enum Process_type process_type;
117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    75
extern int server_socket; /* Used in the client */
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
    76
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
    77
struct msg;
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
    78
117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    79
enum Jobstate
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    80
{
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    81
    QUEUED,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    82
    RUNNING,
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    83
    FINISHED
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    84
};
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    85
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    86
struct msg
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    87
{
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    88
    enum msg_types type;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    89
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    90
    union
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    91
    {
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    92
        struct {
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    93
            int command_size;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    94
            int store_output;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    95
            int should_keep_finished;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    96
        } newjob;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    97
        struct {
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    98
            int ofilename_size;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
    99
            int store_output;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   100
            int pid;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   101
        } output;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   102
        int jobid;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   103
        struct Result {
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   104
            int errorlevel;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   105
            float user_ms;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   106
            float system_ms;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   107
            float real_ms;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   108
        } result;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   109
        int line_size;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   110
        enum Jobstate state;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   111
        struct {
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   112
            int jobid1;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   113
            int jobid2;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   114
        } swap;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   115
    } u;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   116
};
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   118
struct Job
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   119
{
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   120
    struct Job *next;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   121
    int jobid;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   122
    char *command;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   123
    enum Jobstate state;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   124
    struct Result result; /* Defined in msg.h */
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   125
    char *output_filename;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   126
    int store_output;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   127
    int pid;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   128
    int should_keep_finished;
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   129
};
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   130
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   131
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   132
/* client.c */
68
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
   133
void c_new_job();
8
03339adb7014 Some more code for execution.
viric@llimona
parents: 5
diff changeset
   134
void c_list_jobs();
44
4dcf05746ece Better include files.
viric@llimona
parents: 42
diff changeset
   135
void c_shutdown_server();
5
bc5e251418f3 The LIST_LINEs are outputed by the client.
viric@llimona
parents: 3
diff changeset
   136
void c_wait_server_lines();
44
4dcf05746ece Better include files.
viric@llimona
parents: 42
diff changeset
   137
void c_clear_finished();
68
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
   138
int c_wait_server_commands();
35
83d0da612dc4 Kill the running job works fine.
viric@llimona
parents: 33
diff changeset
   139
void c_send_runjob_ok(const char *ofname, int pid);
32
3531439f2770 Tail works.
viric@llimona
parents: 31
diff changeset
   140
void c_tail();
33
5c2d981f2f8e Added 'cat' and 'show output filename'
viric@llimona
parents: 32
diff changeset
   141
void c_cat();
5c2d981f2f8e Added 'cat' and 'show output filename'
viric@llimona
parents: 32
diff changeset
   142
void c_show_output_file();
41
cad41574feda Added 'remove job'.
viric@llimona
parents: 38
diff changeset
   143
void c_remove_job();
44
4dcf05746ece Better include files.
viric@llimona
parents: 42
diff changeset
   144
void c_show_pid();
51
aa6e05d77537 '-w' returns the waited errorlevel. Added a testbench.
viric@llimona
parents: 44
diff changeset
   145
int c_wait_job();
53
731c41817842 '-u' (urgency) implemented.
viric@llimona
parents: 51
diff changeset
   146
void c_move_urgent();
62
2b29d4666f6c Return the jobid in stdout.
viric@llimona
parents: 55
diff changeset
   147
int c_wait_newjob_ok();
63
47be318f4cbc Added "-s" for querying the job state.
viric@llimona
parents: 62
diff changeset
   148
void c_get_state();
66
f70a27afd92e Adding "swap jobs" with -U. Fixed a big problem with fds 0, 1, 2.
viric@mandarina
parents: 65
diff changeset
   149
void c_swap_jobs();
71
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
   150
char *build_command_string();
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   151
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   152
/* jobs.c */
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   153
void s_list(int s);
18
af4898956964 Now commands of any-length are accepted.
viric@llimona
parents: 8
diff changeset
   154
int s_newjob(int s, struct msg *m);
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   155
void s_removejob(int jobid);
114
bd123730295d times() reporting finished.
viric@mandarina
parents: 111
diff changeset
   156
void job_finished(const struct Result *result);
8
03339adb7014 Some more code for execution.
viric@llimona
parents: 5
diff changeset
   157
int next_run_job();
19
5efc347cca8d The finished jobs store the errorlevel, and can be listed.
viric@llimona
parents: 18
diff changeset
   158
void s_mark_job_running();
20
d85b4c0745fa "-c" added, for clearing the finished tasks' list.
viric@llimona
parents: 19
diff changeset
   159
void s_clear_finished();
35
83d0da612dc4 Kill the running job works fine.
viric@llimona
parents: 33
diff changeset
   160
void s_process_runjob_ok(int jobid, char *oname, int pid);
32
3531439f2770 Tail works.
viric@llimona
parents: 31
diff changeset
   161
void s_send_output(int socket, int jobid);
41
cad41574feda Added 'remove job'.
viric@llimona
parents: 38
diff changeset
   162
void s_remove_job(int s, int jobid);
42
f093d0964cf5 Added wait for jobs.
viric@llimona
parents: 41
diff changeset
   163
void s_remove_notification(int s);
44
4dcf05746ece Better include files.
viric@llimona
parents: 42
diff changeset
   164
void check_notify_list(int jobid);
4dcf05746ece Better include files.
viric@llimona
parents: 42
diff changeset
   165
void s_wait_job(int s, int jobid);
53
731c41817842 '-u' (urgency) implemented.
viric@llimona
parents: 51
diff changeset
   166
void s_move_urgent(int s, int jobid);
63
47be318f4cbc Added "-s" for querying the job state.
viric@llimona
parents: 62
diff changeset
   167
void s_send_state(int s, int jobid);
66
f70a27afd92e Adding "swap jobs" with -U. Fixed a big problem with fds 0, 1, 2.
viric@mandarina
parents: 65
diff changeset
   168
void s_swap_jobs(int s, int jobid1, int jobid2);
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
   169
void dump_jobs_struct(FILE *out);
120
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 117
diff changeset
   170
void joblist_dump(int fd);
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 117
diff changeset
   171
const char * jstate2string(enum Jobstate s);
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   172
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   173
/* server.c */
28
107abb4ec98a Unified socket path, depending on the username and $TMPDIR.
viric@llimona
parents: 27
diff changeset
   174
void server_main(int notify_fd, char *_path);
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
   175
void dump_conns_struct(FILE *out);
3
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   176
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   177
/* server_start.c */
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   178
int try_connect(int s);
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   179
void wait_server_up();
2fb8a6bdd024 More code.
viric@llimona
parents:
diff changeset
   180
int ensure_server_up();
25
e9e4babe6262 Now the server is quicly started.
viric@llimona
parents: 22
diff changeset
   181
void notify_parent(int fd);
8
03339adb7014 Some more code for execution.
viric@llimona
parents: 5
diff changeset
   182
03339adb7014 Some more code for execution.
viric@llimona
parents: 5
diff changeset
   183
/* execute.c */
68
3ae9b38d7d30 Now the orders don't run under 'bash'. They run as is.
viric@llimona
parents: 65
diff changeset
   184
int run_job();
32
3531439f2770 Tail works.
viric@llimona
parents: 31
diff changeset
   185
33
5c2d981f2f8e Added 'cat' and 'show output filename'
viric@llimona
parents: 32
diff changeset
   186
/* client_run.c */
32
3531439f2770 Tail works.
viric@llimona
parents: 31
diff changeset
   187
void c_run_tail(const char *filename);
33
5c2d981f2f8e Added 'cat' and 'show output filename'
viric@llimona
parents: 32
diff changeset
   188
void c_run_cat(const char *filename);
71
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
   189
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
   190
/* mail.c */
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
   191
void send_mail(int jobid, int errorlevel, const char *ofname,
531666e297d7 Send e-letter implemented.
viric@llimona
parents: 69
diff changeset
   192
    const char *command);
73
0c03786ff927 Added TS_ONFINISH.
viric@llimona
parents: 71
diff changeset
   193
void hook_on_finish(int jobid, int errorlevel, const char *ofname,
0c03786ff927 Added TS_ONFINISH.
viric@llimona
parents: 71
diff changeset
   194
    const char *command);
92
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
   195
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
   196
/* error.c */
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
   197
void error(const char *str, ...);
05004c52ecff Better error reports on internal handled errors.
viric@llimona
parents: 73
diff changeset
   198
void warning(const char *str, ...);
95
d31aaee661d1 Protection against SIGPIPE. Block it.
viric@llimona
parents: 92
diff changeset
   199
d31aaee661d1 Protection against SIGPIPE. Block it.
viric@llimona
parents: 92
diff changeset
   200
/* signals.c */
d31aaee661d1 Protection against SIGPIPE. Block it.
viric@llimona
parents: 92
diff changeset
   201
void ignore_sigpipe();
d31aaee661d1 Protection against SIGPIPE. Block it.
viric@llimona
parents: 92
diff changeset
   202
void restore_sigmask();
117
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   203
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   204
/* msg.c */
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   205
void send_bytes(const int fd, const char *data, const int bytes);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   206
int recv_bytes(const int fd, char *data, const int bytes);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   207
void send_msg(const int fd, const struct msg *m);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   208
int recv_msg(const int fd, struct msg *m);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   209
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   210
/* msgdump.c */
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   211
void msgdump(FILE *, const struct msg *m);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   212
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   213
/* error.c */
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   214
void error_msg(const struct msg *m, const char *str, ...);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   215
void warning_msg(const struct msg *m, const char *str, ...);
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   216
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   217
/* list.c */
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   218
char * joblist_headers();
db479ef293d3 Making "-l" not to trunc the commands.
viric@llimona
parents: 114
diff changeset
   219
char * joblist_line(const struct Job *p);
120
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 117
diff changeset
   220
char * joblistdump_torun(const struct Job *p);
790bc4cecd3b Added TS_SAVELIST.
viric@llimona
parents: 117
diff changeset
   221
char * joblistdump_headers();