-
Notifications
You must be signed in to change notification settings - Fork 0
/
sortsfct.c
43 lines (36 loc) · 1.36 KB
/
sortsfct.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* sortsfct.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dmoureu- <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/02/07 19:34:00 by dmoureu- #+# #+# */
/* Updated: 2016/02/07 19:34:18 by dmoureu- ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_ls.h"
int ft_strasc(char *s1, char *s2)
{
int x;
x = 0;
while (s1[x] == s2[x] && s1[x] != '\0' && s2[x] != '\0')
x++;
return ((unsigned char)s1[x] - (unsigned char)s2[x]);
}
int ft_strdec(char *s1, char *s2)
{
int x;
x = 0;
while (s1[x] == s2[x] && s1[x] != '\0' && s2[x] != '\0')
x++;
return ((unsigned char)s2[x] - (unsigned char)s1[x]);
}
int ft_timeasc(time_t s1, time_t s2)
{
return (s1 - s2);
}
int ft_timedec(time_t s1, time_t s2)
{
return (s2 - s1);
}