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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
# libft [](https://travis-ci.com/HappyTramp/libft)
libft is an extension/remake of the standard library.
## Getting Started
```
git clone https://github.com/HappyTramp/libft libft
cd libft
make all
```
This will produce a `libft.a` library which you can link to your project.
## Unit Test
```
make test
```
## Dependencies
* [Unity](https://github.com/ThrowTheSwitch/Unity) - unit testing lib
## .libftignore
Much like the `.gitignore` file, you can put the files/directory to ignore when compiling.
## Documentation
### mem
| Name | Prototype | Description | Tested |
|--------------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|--------|
| ft_bzero | `void ft_bzero(void *s, size_t n)` | fill `n` bytes of `s` with 0 | [x] |
| ft_calloc | `void *ft_calloc(size_t count, size_t size)` | allocate `count` element of `size` and initialize them to 0 | [x] |
| ft_memccpy | `void *ft_memccpy(void *dest, const void *src, int c, size_t n)` | copy `n` byte from `src` to `dest` until `c` is reached | [x] |
| ft_memchr | `void *ft_memchr(const void *s, int c, size_t n)` | return the address of the first occurance of `c` in `s` or NULL if `c` isn't found | [x] |
| ft_memcmp | `int ft_memcmp(const void *s1, const void *s2, size_t n)` | compare `n` byte of `s1` and `s2` | [x] |
| ft_memcpy | `void *ft_memcpy(void *dest, const void *src, size_t n)` | copy `n` byte from `src` to `dest` | [x] |
| ft_memmem | `void *ft_memmem(const void *big, size_t big_len, const void *little, size_t little_len)` | search `little` in `big` | [x] |
| ft_memmove | `void *ft_memmove(void *dst, const void *src, size_t len)` | copy `len` byte from `src` to `dst` and the copied memory can overlap | [x] |
| ft_memset | `void *ft_memset(void *s, int c, size_t n)` | set `n` byte of `s` to `c` | [x] |
| ft_memset_pattern4 | `void ft_memset_pattern4(void *b, const void *pattern4, size_t len)` | set `len` byte of `b` to a reapeated pattern of 4 bytes | [x] |
| ft_memswap | `void ft_memswap(void *a, void *b, size_t size)` | swap `a` and `b` memory | [x] |
### algo
| Name | Prototype | Description | Tested |
|---------------|-----------|-------------|--------|
| ft_bsearch | | | [ ] |
| ft_compar_int | | | [ ] |
| ft_heapsort | | | [ ] |
| ft_is_set | | | [ ] |
| ft_lfind | | | [ ] |
| ft_lsearch | | | [ ] |
| ft_mergesort | | | [ ] |
| ft_qsort | | | [ ] |
| ft_reverse | | | [ ] |
### bt
| Name | Prototype | Description | Tested |
|--------------|-----------|-------------|--------|
| ft_btdestroy | | | |
| ft_btnew | | | |
### ctype
| Name | Prototype | Description | Tested |
|------------|-------------------------|----------------------------------------------------|--------|
| ft_isalnum | `int ft_isalnum(int c)` | c is alphanumeric | [x] |
| ft_isalpha | `int ft_isalpha(int c)` | c is alphabetic | [x] |
| ft_isascii | `int ft_isascii(int c)` | c is ascii | [x] |
| ft_isblank | `int ft_isblank(int c)` | c is `\t` ` ` | [x] |
| ft_isdigit | `int ft_isdigit(int c)` | c is a digit | [x] |
| ft_isprint | `int ft_isprint(int c)` | c is a printable character | [x] |
| ft_isspace | `int ft_isspace(int c)` | c is `\t` `\n` `\v` `\f` `\r` ` ` | [x] |
| ft_todigit | `int ft_todigit(int c)` | convert lower case to upper case | [x] |
| ft_tolower | `int ft_tolower(int c)` | convert upper case to lower case | [x] |
| ft_toupper | `int ft_toupper(int c)` | convert digit character to int (-1 if not a digit) | [x] |
### ht
| Name | Prototype | Description | Tested |
|------------------|-----------|-------------|--------|
| ft_htcontent_new | | | |
| ft_htdelone | | | |
| ft_htdelone_key | | | |
| ft_htdestroy | | | |
| ft_htdestroy_all | | | |
| ft_htdestroy_key | | | |
| ft_htget | | | |
| ft_hthash | | | |
| ft_htnew | | | |
| ft_htset | | | |
### io
| Name | Prototype | Description | Tested |
|---------------|-----------|-------------|--------|
| ft_getchar | | | |
| ft_next_line | | | |
| ft_asprintf | | | |
| ft_dprintf | | | |
| ft_printf | | | |
| ft_snprintf | | | |
| ft_sprintf | | | |
| ft_vasprintf | | | |
| ft_vdprintf | | | |
| ft_vprintf | | | |
| ft_vsnprintf | | | |
| ft_vsprintf | | | |
| ft_putchar | | | |
| ft_putchar_fd | | | |
| ft_putendl | | | |
| ft_putendl_fd | | | |
| ft_putnbr | | | |
| ft_putnbr_fd | | | |
| ft_putstr | | | |
| ft_putstr_fd | | | |
### lst
| Name | Prototype | Description | Tested |
|------|-----------|-------------|--------|
| ft_lstadd_back | | | |
| ft_lstadd_front | | | |
| ft_lstbsearch | | | |
| ft_lstclear | | | |
| ft_lstdelone | | | |
| ft_lstiter | | | |
| ft_lstlast | | | |
| ft_lstmap | | | |
| ft_lstnew | | | |
| ft_lstpop_front | | | |
| ft_lstremove_if | | | |
| ft_lstreverse | | | |
| ft_lstreverse_ret | | | |
| ft_lstsize | | | |
| ft_lstsort | | | |
| ft_lstsorted_merge | | | |
### str
| Name | Prototype | Description | Tested |
|------|-----------|-------------|--------|
| ft_atoi | | | | |
| ft_atoi_strict | | | | |
| ft_itoa | | | | |
| ft_split | | | | |
| ft_strcasecmp | | | | |
| ft_strcat | | | | |
| ft_strchr | | | | |
| ft_strclr | | | | |
| ft_strcmp | | | | |
| ft_strcount | | | | |
| ft_strcpy | | | | |
| ft_strcspn | | | | |
| ft_strdel | | | | |
| ft_strdup | | | | |
| ft_strequ | | | | |
| ft_striter | | | | |
| ft_striteri | | | | |
| ft_strjoin | | | | |
| ft_strjoin_free | | | | |
| ft_strjoin_free_snd | | | | |
| ft_strlcat | | | | |
| ft_strlcpy | | | | |
| ft_strlen | | | | |
| ft_strmap | | | | |
| ft_strmapi | | | | |
| ft_strncasecmp | | | | |
| ft_strncat | | | | |
| ft_strncmp | | | | |
| ft_strncpy | | | | |
| ft_strndup | | | | |
| ft_strnequ | | | | |
| ft_strnew | | | | |
| ft_strnlen | | | | |
| ft_strnstr | | | | |
| ft_strpbrk | | | | |
| ft_strrchr | | | | |
| ft_strsep | | | | |
| ft_strspn | | | | |
| ft_strstr | | | | |
| ft_strtol | | | | |
| ft_strtolower | | | | |
| ft_strtoupper | | | | |
| ft_strtrim | | | | |
| ft_substr | | | | |
## School correction state
The state of this project when I turned it in for correction is [here](http://github.com/HappyTramp/libft/tree/raw).
|