Skip to content

Commit

Permalink
Latest Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Aymen Kh committed Jun 7, 2019
1 parent be9198b commit 15fd38e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Includes/libft.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/17 16:20:29 by akharrou #+# #+# */
/* Updated: 2019/05/27 11:26:43 by akharrou ### ########.fr */
/* Updated: 2019/06/07 02:25:48 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -68,6 +68,7 @@
# include <fcntl.h>
# include <sys/types.h>
# include <sys/uio.h>
# include <sys/dirent.h>

/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
Expand Down
7 changes: 6 additions & 1 deletion Includes/macros_42.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/04 09:07:32 by akharrou #+# #+# */
/* Updated: 2019/06/01 15:48:00 by akharrou ### ########.fr */
/* Updated: 2019/06/07 02:26:33 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -20,6 +20,7 @@

# include <limits.h>
# include <float.h>
# include <dirent.h>

/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
Expand Down Expand Up @@ -177,6 +178,10 @@
** Convenient Macro(s).
*/

# ifndef PASS
# define PASS (1)
# endif

# ifndef INT
# define INT(c, base) (ft_strchr(base, c) - base)
# endif
Expand Down
3 changes: 2 additions & 1 deletion Includes/unistd_42.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/27 10:12:47 by akharrou #+# #+# */
/* Updated: 2019/06/05 17:04:23 by akharrou ### ########.fr */
/* Updated: 2019/06/07 02:26:57 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -37,6 +37,7 @@

t_vector ft_getdirents(DIR *dirdes);
t_vector ft_getdirentries(const char dirname[MAX_PATHLEN + 1]);
void ft_basename(const char *path, char *basename);

/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/02/17 16:23:01 by akharrou #+# #+# #
# Updated: 2019/06/05 18:19:09 by akharrou ### ########.fr #
# Updated: 2019/06/07 02:27:09 by akharrou ### ########.fr #
# #
# **************************************************************************** #

Expand Down Expand Up @@ -262,6 +262,7 @@ STRING = String/ft_strlen.c \

UNISTD = Unistd/ft_getdirentries.c \
Unistd/ft_getdirents.c \
Unistd/ft_basename.c \

# — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Expand Down
24 changes: 24 additions & 0 deletions Unistd/ft_basename.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_basename.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/06/07 02:23:57 by akharrou #+# #+# */
/* Updated: 2019/06/07 02:26:36 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */

#include "../Includes/string_42.h"
#include "../Includes/macros_42.h"

void ft_basename(const char *path, char *basename)
{
char **strtab;

strtab = ft_strsplit(path, "/");
ft_strncpy(
basename, strtab[ft_strtablen((const char**)strtab) - 1], MAX_NAMELEN);
freestrtab(&strtab);
}
2 changes: 1 addition & 1 deletion Vector/vector_from.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: akharrou <akharrou@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/06/05 17:40:15 by akharrou #+# #+# */
/* Updated: 2019/06/06 23:18:10 by akharrou ### ########.fr */
/* Updated: 2019/06/07 02:27:20 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down

0 comments on commit 15fd38e

Please sign in to comment.