forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: replace ngx-queue.h with queue.h
No functional changes, just one less entry in the LICENSE file.
- Loading branch information
1 parent
72b92e9
commit a7820a1
Showing
8 changed files
with
110 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl> | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
#ifndef QUEUE_H_ | ||
#define QUEUE_H_ | ||
|
||
typedef void *QUEUE[2]; | ||
|
||
/* Private macros. */ | ||
#define QUEUE_NEXT(q) ((*(q))[0]) | ||
#define QUEUE_PREV(q) ((*(q))[1]) | ||
#define QUEUE_PREV_NEXT(q) (QUEUE_NEXT((QUEUE *) QUEUE_PREV(q))) | ||
#define QUEUE_NEXT_PREV(q) (QUEUE_PREV((QUEUE *) QUEUE_NEXT(q))) | ||
|
||
/* Public macros. */ | ||
#define QUEUE_DATA(ptr, type, field) \ | ||
((type *) ((char *) (ptr) - ((long) &((type *) 0)->field))) | ||
|
||
#define QUEUE_FOREACH(q, h) \ | ||
for ((q) = (QUEUE *) (*(h))[0]; (q) != (h); (q) = (QUEUE *) (*(q))[0]) | ||
|
||
#define QUEUE_EMPTY(q) \ | ||
(QUEUE_NEXT(q) == (q)) | ||
|
||
#define QUEUE_HEAD(q) \ | ||
(QUEUE_NEXT(q)) | ||
|
||
#define QUEUE_INIT(q) \ | ||
do { \ | ||
QUEUE_NEXT(q) = (q); \ | ||
QUEUE_PREV(q) = (q); \ | ||
} \ | ||
while (0) | ||
|
||
#define QUEUE_ADD(h, n) \ | ||
do { \ | ||
QUEUE_PREV_NEXT(h) = QUEUE_NEXT(n); \ | ||
QUEUE_NEXT_PREV(n) = QUEUE_PREV(h); \ | ||
QUEUE_PREV(h) = QUEUE_PREV(n); \ | ||
QUEUE_PREV_NEXT(h) = (h); \ | ||
} \ | ||
while (0) | ||
|
||
#define QUEUE_SPLIT(h, q, n) \ | ||
do { \ | ||
QUEUE_PREV(n) = QUEUE_PREV(h); \ | ||
QUEUE_PREV_NEXT(n) = (n); \ | ||
QUEUE_NEXT(n) = (q); \ | ||
QUEUE_PREV(h) = QUEUE_PREV(q); \ | ||
QUEUE_PREV_NEXT(h) = (h); \ | ||
QUEUE_PREV(q) = (n); \ | ||
} \ | ||
while (0) | ||
|
||
#define QUEUE_INSERT_HEAD(h, q) \ | ||
do { \ | ||
QUEUE_NEXT(q) = QUEUE_NEXT(h); \ | ||
QUEUE_PREV(q) = (h); \ | ||
QUEUE_NEXT_PREV(q) = (q); \ | ||
QUEUE_NEXT(h) = (q); \ | ||
} \ | ||
while (0) | ||
|
||
#define QUEUE_INSERT_TAIL(h, q) \ | ||
do { \ | ||
QUEUE_NEXT(q) = (h); \ | ||
QUEUE_PREV(q) = QUEUE_PREV(h); \ | ||
QUEUE_PREV_NEXT(q) = (q); \ | ||
QUEUE_PREV(h) = (q); \ | ||
} \ | ||
while (0) | ||
|
||
#define QUEUE_REMOVE(q) \ | ||
do { \ | ||
QUEUE_PREV_NEXT(q) = QUEUE_NEXT(q); \ | ||
QUEUE_NEXT_PREV(q) = QUEUE_PREV(q); \ | ||
} \ | ||
while (0) | ||
|
||
#endif /* QUEUE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters