mirror of
https://github.com/Hizenberg469/C1-Linux_SYS_Prog-AS-.git
synced 2026-04-20 02:42:23 +03:00
More Organised
This commit is contained in:
56
Quick_Compilation/dll.h
Normal file
56
Quick_Compilation/dll.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: dll.h
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 28/01/24 07:58:51 PM IST
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: YOUR NAME (),
|
||||
* Organization:
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*Header file for Doubly Linked List*/
|
||||
|
||||
typedef struct dll_node_{
|
||||
|
||||
void *data;
|
||||
struct dll_node_ *left;
|
||||
struct dll_node_ *right;
|
||||
} dll_node_t;
|
||||
|
||||
typedef struct dll_{
|
||||
dll_node_t *head;
|
||||
} dll_t;
|
||||
|
||||
|
||||
/* Public Function declaration to create and return
|
||||
* a new empty doubly linked list*/
|
||||
dll_t *
|
||||
get_new_dll();
|
||||
|
||||
/* Public Function declaration to add the application
|
||||
* data to DLL*/
|
||||
int
|
||||
add_data_to_dll(dll_t *dll, void *app_data);
|
||||
|
||||
|
||||
/*More functions*/
|
||||
int /*return 0 on success and -1 on failure*/
|
||||
remove_data_from_dll_by_data_ptr (dll_t *dll, void *data);
|
||||
|
||||
/*return 0 if empty, -1 if not empty*/
|
||||
int
|
||||
is_dll_empty (dll_t *dll);
|
||||
|
||||
/* delete all nodes from a dll, but do not free appln data*/
|
||||
void
|
||||
drain_dll (dll_t *dll);
|
||||
|
||||
Reference in New Issue
Block a user