summaryrefslogtreecommitdiffstats
path: root/src/c_init.h
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-11-02 15:08:38 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-11-02 15:08:38 +0100
commite0a74558be8d71054ae3c8e6afe8774fc1890b84 (patch)
tree57bc32451216e00fac58bd8f79eee12543badf56 /src/c_init.h
parentNo more fixed int (diff)
download42-minishell-e0a74558be8d71054ae3c8e6afe8774fc1890b84.tar.gz
42-minishell-e0a74558be8d71054ae3c8e6afe8774fc1890b84.tar.bz2
42-minishell-e0a74558be8d71054ae3c8e6afe8774fc1890b84.tar.xz
42-minishell-e0a74558be8d71054ae3c8e6afe8774fc1890b84.tar.zst
42-minishell-e0a74558be8d71054ae3c8e6afe8774fc1890b84.zip
Caps files
Diffstat (limited to 'src/c_init.h')
-rw-r--r--src/c_init.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/c_init.h b/src/c_init.h
new file mode 100644
index 0000000..e723563
--- /dev/null
+++ b/src/c_init.h
@@ -0,0 +1,49 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* c_init.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef C_INIT_H
+# define C_INIT_H
+
+# include <termios.h>
+# include <sys/ioctl.h>
+
+# include "s_struct.h"
+
+# define LEFT_K 0x445b1b
+# define RIGHT_K 0x435b1b
+# define HOME_K 0x485b1b
+# define END_K 0x7e345b1b
+# define DEL_K 0x7f
+# define RET_K 0x0d
+
+# define CTRL_A 0x01
+# define CTRL_B 0x02
+# define CTRL_C 0x03
+# define CTRL_D 0x04
+# define CTRL_E 0x05
+# define CTRL_F 0x06
+# define CTRL_L 0x0c
+
+typedef struct s_caps
+{
+ struct termios tios;
+ struct winsize ws;
+ uint32_t cpos;
+ uint32_t lpos;
+ uint32_t nlines;
+ uint8_t psx;
+} t_caps;
+
+int16_t c_gnl(int32_t fd, char **line, uint8_t psx, t_msh *msh);
+int16_t c_set_term_raw(uint8_t mode);
+
+#endif