data_structures
src
data_structures
list
list_peek_first.c
Go to the documentation of this file.
1
/* ************************************************************************** */
3
/* */
4
/* ::: :::::::: */
5
/* list_peek_first.c :+: :+: :+: */
6
/* +:+ +:+ +:+ */
7
/* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8
/* +#+#+#+#+#+ +#+ */
9
/* Created: 2020/07/16 23:07:06 by unite #+# #+# */
10
/* Updated: 2020/07/18 16:36:47 by unite ### ########.fr */
11
/* */
12
/* ************************************************************************** */
13
14
#include "
list.h
"
15
16
void
*
list_peek_first
(
const
t_list
*alst)
17
{
18
if
(alst->
size
== 0)
19
return
(NULL);
20
return
(alst->
head
->
content
);
21
}
s_link::content
void * content
The content.
Definition:
list.h:36
s_list::head
t_link * head
The first link.
Definition:
list.h:56
list_peek_first
void * list_peek_first(const t_list *alst)
Returns the first item in the list.
Definition:
list_peek_first.c:16
s_list
Doubly-linked list of generic items.
Definition:
list.h:54
s_list::size
size_t size
The number of items in the list.
Definition:
list.h:58
list.h
Generated by
1.8.16