event/multiqueue.c: Rename "queue" to "multiqueue".

`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.

Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.

Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
This commit is contained in:
Justin M. Keyes
2016-09-29 17:09:37 +02:00
parent c8b6ec2e6a
commit 6186df3562
30 changed files with 191 additions and 188 deletions

View File

@@ -3,28 +3,28 @@ local helpers = require("test.unit.helpers")
local ffi = helpers.ffi
local eq = helpers.eq
local queue = helpers.cimport("./test/unit/fixtures/queue.h")
local multiqueue = helpers.cimport("./test/unit/fixtures/multiqueue.h")
describe('queue', function()
describe("multiqueue (multi-level event-queue)", function()
local parent, child1, child2, child3
local function put(q, str)
queue.ut_queue_put(q, str)
multiqueue.ut_multiqueue_put(q, str)
end
local function get(q)
return ffi.string(queue.ut_queue_get(q))
return ffi.string(multiqueue.ut_multiqueue_get(q))
end
local function free(q)
queue.queue_free(q)
multiqueue.multiqueue_free(q)
end
before_each(function()
parent = queue.queue_new_parent(ffi.NULL, ffi.NULL)
child1 = queue.queue_new_child(parent)
child2 = queue.queue_new_child(parent)
child3 = queue.queue_new_child(parent)
parent = multiqueue.multiqueue_new_parent(ffi.NULL, ffi.NULL)
child1 = multiqueue.multiqueue_new_child(parent)
child2 = multiqueue.multiqueue_new_child(parent)
child3 = multiqueue.multiqueue_new_child(parent)
put(child1, 'c1i1')
put(child1, 'c1i2')
put(child2, 'c2i1')