/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> static void ngx_queue_merge(ngx_queue_t *queue, ngx_queue_t *tail, ngx_int_t (*cmp)(const ngx_queue_t *, const ngx_queue_t *)); /* * find the middle queue element if the queue has odd number of elements * or the first element of the queue's second part otherwise */ ngx_queue_t * ngx_queue_middle(ngx_queue_t *queue) { … } /* the stable merge sort */ void ngx_queue_sort(ngx_queue_t *queue, ngx_int_t (*cmp)(const ngx_queue_t *, const ngx_queue_t *)) { … } static void ngx_queue_merge(ngx_queue_t *queue, ngx_queue_t *tail, ngx_int_t (*cmp)(const ngx_queue_t *, const ngx_queue_t *)) { … }