-
Notifications
You must be signed in to change notification settings - Fork 0
/
dll.h
36 lines (25 loc) · 752 Bytes
/
dll.h
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
#ifndef _DLL_H_
#define _DLL_H_
#include "headers.h"
typedef struct dll* DLL;
typedef struct dll_node* DLLNode;
struct dll{
size_t size;
DLLNode start_node;
DLLNode last_node;
};
struct dll_node{
DLLNode prev_node;
ProcessPtr element;
DLLNode next_node;
};
void insert_dll(DLL, pid_t, char*); // pushes a new node with given parameters into dll
void deque_dll(DLL); // removes the first node from dll
void pop_dll(DLL); // rmeoves last node from dll
void delete_from_dll(DLL, pid_t); // removes a particular node from dll
void delete_node(DLL, DLLNode); // removed a particular node from dll given pointer
DLLNode make_node(pid_t, char*);
DLL make_dll();
void free_node(DLLNode);
DLLNode find_node(DLL, pid_t);
#endif