-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlists.h
More file actions
37 lines (31 loc) · 763 Bytes
/
lists.h
File metadata and controls
37 lines (31 loc) · 763 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
#ifndef _SINGLY_LINKED_LISTS
#define _SINGLY_LINKED_LISTS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <malloc.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);
/*Helper functions*/
char *strdup(const char *s);
int _strlen(const char *s);
#endif