-
Notifications
You must be signed in to change notification settings - Fork 486
Expand file tree
/
Copy pathlists.h
More file actions
35 lines (30 loc) · 805 Bytes
/
lists.h
File metadata and controls
35 lines (30 loc) · 805 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
#ifndef LISTS_H
#define LISTS_H
/*
* File: lists.h
* Auth: Brennan D Baraban
* Desc: Header file containing prototypes and definitions for all functions
* and types written in the 0x11-singly_linked_lists directory.
*/
#include <stdlib.h>
/**
* struct list_s - singly linked list
* @str: string - (malloc'ed string)
* @len: length of the string
* @next: points to the next node
*
* Description: singly linked list node structure
* for Holberton project
*/
typedef struct list_s
{
char *str;
unsigned int len;
struct list_s *next;
} list_t;
size_t print_list(const list_t *h);
size_t list_len(const list_t *h);
list_t *add_node(list_t **head, const char *str);
list_t *add_node_end(list_t **head, const char *str);
void free_list(list_t *head);
#endif /* LISTS_H */