3 * Copyright (C) Igor Sysoev
7 #ifndef _NGX_LIST_H_INCLUDED_
8 #define _NGX_LIST_H_INCLUDED_
11 #include <ngx_config.h>
15 typedef struct ngx_list_part_s ngx_list_part_t;
17 struct ngx_list_part_s {
20 ngx_list_part_t *next;
25 ngx_list_part_t *last;
33 ngx_list_t *ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size);
35 static ngx_inline ngx_int_t
36 ngx_list_init(ngx_list_t *list, ngx_pool_t *pool, ngx_uint_t n, size_t size)
38 list->part.elts = ngx_palloc(pool, n * size);
39 if (list->part.elts == NULL) {
44 list->part.next = NULL;
45 list->last = &list->part;
56 * the iteration through the list:
61 * for (i = 0 ;; i++) {
63 * if (i >= part->nelts) {
64 * if (part->next == NULL) {
79 void *ngx_list_push(ngx_list_t *list);
82 #endif /* _NGX_LIST_H_INCLUDED_ */