-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_id.c
executable file
·29 lines (26 loc) · 1.13 KB
/
find_id.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* find_id.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/08/15 20:12:28 by ioleksiu #+# #+# */
/* Updated: 2017/08/15 20:12:34 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "lem_in.h"
int find_id(t_rooms *a, char *str)
{
t_rooms *temp;
temp = a;
if (!ft_strcmp(temp->r_name, str))
return (temp->id);
while (temp->next)
{
temp = temp->next;
if (!ft_strcmp(temp->r_name, str))
return (temp->id);
}
return (-1);
}