Browse Source

[enh] add ft_isvisible() for 21sh.

Moul 4 years ago
parent
commit
6d6f222cb8
4 changed files with 23 additions and 3 deletions
  1. 2 1
      Makefile
  2. 2 1
      libft.h
  3. 1 1
      src/ft_isprint.c
  4. 18 0
      src/ft_isvisible.c

+ 2 - 1
Makefile

@@ -6,7 +6,7 @@
 #    By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+         #
 #                                                 +#+#+#+#+#+   +#+            #
 #    Created: 2014/11/05 11:09:24 by mazimi            #+#    #+#              #
-#    Updated: 2016/02/27 18:50:29 by mazimi           ###   ########.fr        #
+#    Updated: 2016/03/25 14:38:53 by mazimi           ###   ########.fr        #
 #                                                                              #
 # **************************************************************************** #
 
@@ -40,6 +40,7 @@ ft_isdigit.c \
 ft_isalnum.c \
 ft_isascii.c \
 ft_isprint.c \
+ft_isvisible.c \
 ft_toupper.c \
 ft_tolower.c \
 ft_memalloc.c \

+ 2 - 1
libft.h

@@ -6,7 +6,7 @@
 /*   By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2014/11/23 19:50:04 by mazimi            #+#    #+#             */
-/*   Updated: 2016/02/27 18:47:33 by mazimi           ###   ########.fr       */
+/*   Updated: 2016/03/25 14:39:11 by mazimi           ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -55,6 +55,7 @@ int					ft_isdigit(int c);
 int					ft_isalnum(int c);
 int					ft_isascii(int c);
 int					ft_isprint(int c);
+int					ft_isvisible(int c);
 int					ft_toupper(int c);
 int					ft_tolower(int c);
 void				*ft_memalloc(size_t size);

+ 1 - 1
src/ft_isprint.c

@@ -6,7 +6,7 @@
 /*   By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2014/11/05 18:52:25 by mazimi            #+#    #+#             */
-/*   Updated: 2015/02/18 21:55:55 by mazimi           ###   ########.fr       */
+/*   Updated: 2016/03/25 14:37:31 by mazimi           ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 

+ 18 - 0
src/ft_isvisible.c

@@ -0,0 +1,18 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ft_isvisible.c                                     :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: mazimi <marvin@42.fr>                      +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2016/03/25 14:38:03 by mazimi            #+#    #+#             */
+/*   Updated: 2016/03/25 14:38:32 by mazimi           ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "../libft.h"
+
+int		ft_isvisible(int c)
+{
+	return (32 < c && c <= 126 ? 1 : 0);
+}