aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/run_queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/run_queue.c')
-rw-r--r--src/run_queue.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/run_queue.c b/src/run_queue.c
index a00f986..8bfa816 100644
--- a/src/run_queue.c
+++ b/src/run_queue.c
@@ -16,10 +16,11 @@
struct run {
char *url;
char *rev;
+ int id;
SIMPLEQ_ENTRY(run) entries;
};
-int run_create(struct run **_entry, const char *_url, const char *_rev)
+int run_create(struct run **_entry, const char *_url, const char *_rev, int id)
{
struct run *entry = malloc(sizeof(struct run));
if (!entry) {
@@ -41,6 +42,7 @@ int run_create(struct run **_entry, const char *_url, const char *_rev)
entry->url = url;
entry->rev = rev;
+ entry->id = id;
*_entry = entry;
return 0;
@@ -66,7 +68,8 @@ int run_from_msg(struct run **run, const struct msg *msg)
}
const char **argv = msg_get_strings(msg);
- return run_create(run, argv[1], argv[2]);
+ /* We don't know the ID yet. */
+ return run_create(run, argv[1], argv[2], 0);
}
void run_destroy(struct run *entry)
@@ -86,6 +89,16 @@ const char *run_get_rev(const struct run *entry)
return entry->rev;
}
+int run_get_id(const struct run *entry)
+{
+ return entry->id;
+}
+
+void run_set_id(struct run *entry, int id)
+{
+ entry->id = id;
+}
+
void run_queue_create(struct run_queue *queue)
{
SIMPLEQ_INIT(queue);