-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib_next.c
More file actions
66 lines (58 loc) · 1.03 KB
/
lib_next.c
File metadata and controls
66 lines (58 loc) · 1.03 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
** lib_next.c for lem-in in /home/blackbird/work/Lem-In
**
** Made by romaric
** Login <fave_r@epitech.net>
**
** Started on Thu Apr 17 16:32:15 2014 romaric
** Last update Thu Apr 17 16:43:21 2014 romaric
*/
#include "lem_in.h"
int get_max_sommet(t_graphe *graphe)
{
t_list *cur;
int max;
max = -1;
cur = graphe->next;
while (cur != NULL)
{
if (cur->numero_sommet > max)
max = cur->numero_sommet;
cur = cur->next;
}
return (max);
}
t_list *get_sommet(t_graphe *graphe, int nb)
{
t_list *cur;
cur = graphe->next;
while (cur != NULL)
{
if (cur->numero_sommet == nb)
return (cur);
cur = cur->next;
}
return (NULL);
}
int my_isdigit(char c)
{
if (c >= '0' && c <= '9')
return (1);
return (0);
}
int rmv_adjacent(t_list *cur, int s2)
{
int i;
int j;
i = 0;
j = 0;
while (j < cur->nb_sommet_adjacent)
{
if (cur->adjacents[j] == s2)
j++;
cur->adjacents[i] = cur->adjacents[j];
i++;
j++;
}
return (0);
}