-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlinkedlist.h
More file actions
55 lines (38 loc) · 963 Bytes
/
Copy pathlinkedlist.h
File metadata and controls
55 lines (38 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright (c) 2019 Alan Skorkin
* https://github.com/skorks/c-linked-list
*
* I reformatted the code according to my coding style, made heavy tweeks
* and add my code as well
*
* Copyright (C) 2021 Edward LEI <edward_lei72@hotmail.com>
*
* license: MIT license
*/
#ifndef _LINKEDLIST_H_
#define _LINKEDLIST_H_
typedef struct _node node_t;
struct _node {
void *data;
long stamp; /* time stamp */
struct _node *next;
};
typedef struct _list list_t;
struct _list {
struct _node *head;
struct _node *current;
};
list_t *list_new();
void list_update(list_t *list,
void *data,
const long stamp);
void list_del(list_t *list,
const long stamp);
void list_reverse(list_t *list);
void list_sort(list_t *list,
const int asc);
void list_display(list_t *list);
void list_destroy(list_t *list);
node_t *list_first(list_t *list);
node_t *list_next(list_t *list);
#endif