chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(Slightly scrappy) new playlist box
[disorder]
/
lib
/
queue.c
diff --git
a/lib/queue.c
b/lib/queue.c
index 1486ebfc17d4042d82a1a90e45cfd8b58e4e65c1..69a798696737e9f2d2efe629cffc62e3839d444b 100644
(file)
--- a/
lib/queue.c
+++ b/
lib/queue.c
@@
-1,6
+1,6
@@
/*
* This file is part of DisOrder.
/*
* This file is part of DisOrder.
- * Copyright (C) 2004-200
8
Richard Kettlewell
+ * Copyright (C) 2004-200
9
Richard Kettlewell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-55,7
+55,10
@@
const char *const track_origins[] = {
#define VALUE(q, offset, type) *(type *)((char *)q + offset)
#define VALUE(q, offset, type) *(type *)((char *)q + offset)
-/* add new entry @n@ to a doubly linked list just after @b@ */
+/** @brief Insert queue entry @p n just after @p b
+ * @param b Insert after this entry
+ * @param n New entry to insert
+ */
void queue_insert_entry(struct queue_entry *b, struct queue_entry *n) {
n->prev = b;
n->next = b->next;
void queue_insert_entry(struct queue_entry *b, struct queue_entry *n) {
n->prev = b;
n->next = b->next;
@@
-86,9
+89,9
@@
static const char *marshall_long(const struct queue_entry *q, size_t offset) {
n = byte_snprintf(buffer, sizeof buffer, "%ld", VALUE(q, offset, long));
if(n < 0)
n = byte_snprintf(buffer, sizeof buffer, "%ld", VALUE(q, offset, long));
if(n < 0)
- fatal(errno, "error converting int");
+
disorder_
fatal(errno, "error converting int");
else if((size_t)n >= sizeof buffer)
else if((size_t)n >= sizeof buffer)
- fatal(0, "long converted to decimal is too long");
+
disorder_
fatal(0, "long converted to decimal is too long");
return xstrdup(buffer);
}
return xstrdup(buffer);
}
@@
-125,9
+128,9
@@
static const char *marshall_time_t(const struct queue_entry *q, size_t offset) {
n = byte_snprintf(buffer, sizeof buffer,
"%"PRIdMAX, (intmax_t)VALUE(q, offset, time_t));
if(n < 0)
n = byte_snprintf(buffer, sizeof buffer,
"%"PRIdMAX, (intmax_t)VALUE(q, offset, time_t));
if(n < 0)
- fatal(errno, "error converting time");
+
disorder_
fatal(errno, "error converting time");
else if((size_t)n >= sizeof buffer)
else if((size_t)n >= sizeof buffer)
- fatal(0, "time converted to decimal is too long");
+
disorder_
fatal(0, "time converted to decimal is too long");
return xstrdup(buffer);
}
return xstrdup(buffer);
}