forked from sysprog21/lab0-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_sort.h
23 lines (19 loc) · 868 Bytes
/
list_sort.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_LIST_SORT_H
#define _LINUX_LIST_SORT_H
#include <stdint.h>
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
typedef uint8_t u8;
struct list_head;
typedef int
__attribute__((nonnull(2, 3))) (*list_cmp_func_t)(void *,
const struct list_head *,
const struct list_head *);
__attribute__((nonnull(2, 3))) int cmp(void *priv,
const struct list_head *a,
const struct list_head *b);
__attribute__((nonnull(2, 3))) void list_sort(void *priv,
struct list_head *head,
list_cmp_func_t cmp);
#endif