comparison job.h @ 1:5afdb14df924

sci: add support for storing results
author David Demelier <markand@malikania.fr>
date Tue, 08 Jun 2021 08:40:01 +0200
parents f1de39079243
children
comparison
equal deleted inserted replaced
0:f1de39079243 1:5afdb14df924
1 /* 1 /*
2 * job.h -- main scid(8) program file 2 * job.h -- job description and result
3 * 3 *
4 * Copyright (c) 2021 David Demelier <markand@malikania.fr> 4 * Copyright (c) 2021 David Demelier <markand@malikania.fr>
5 * 5 *
6 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
21 21
22 #include <stdint.h> 22 #include <stdint.h>
23 23
24 #define JOB_TAG_MAX 128 24 #define JOB_TAG_MAX 128
25 25
26 #include "project.h"
27 #include "worker.h"
28
29 enum job_status {
30 JOB_STATUS_TODO,
31 JOB_STATUS_SUCCESS,
32 JOB_STATUS_FAIL
33 };
34
26 struct job { 35 struct job {
27 int64_t id; 36 int64_t id;
28 int64_t project_id; 37 struct project project;
29 char tag[JOB_TAG_MAX]; 38 char tag[JOB_TAG_MAX];
30 }; 39 };
31 40
32 struct job_result { 41 struct job_result {
33 int64_t id; 42 int64_t id;
34 int status; 43 struct job job;
44 struct worker worker;
45 enum job_status status;
46 int retcode;
35 char *console; 47 char *console;
36 }; 48 };
37 49
38 void 50 void
39 job_result_finish(struct job_result *); 51 job_result_finish(struct job_result *);