Normed the line/src
This commit is contained in:
parent
c2dec0e9f7
commit
9b1574b9c4
5 changed files with 24 additions and 22 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/07 16:53:27 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/07/20 14:00:06 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/07/30 17:06:59 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -22,7 +22,6 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
|
||||
|
||||
/* This just implements a blocking loop for the multiplexed API.
|
||||
* In many applications that are not event-drivern, we can just call
|
||||
* the blocking linenoise API, wait for the user to complete the editing
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/11 18:26:32 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/07/23 22:24:59 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/07/30 17:13:36 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -45,7 +45,9 @@
|
|||
* fails. If stdin_fd or stdout_fd are set to -1, the default is to use
|
||||
* STDIN_FILENO and STDOUT_FILENO.
|
||||
*/
|
||||
t_error line_edit_start(t_line_state *state, t_fd *stdin_fd, t_fd *stdout_fd, t_const_str prompt)
|
||||
t_error line_edit_start( \
|
||||
t_line_state *state, t_fd *stdin_fd, t_fd *stdout_fd, \
|
||||
t_const_str prompt)
|
||||
{
|
||||
if (stdin_fd == NULL)
|
||||
stdin_fd = get_stdin();
|
||||
|
|
@ -206,7 +208,7 @@ void line_edit_stop(t_line_state *state)
|
|||
{
|
||||
string_free(state->buf);
|
||||
if (!isatty(state->input_fd->fd))
|
||||
return;
|
||||
return ;
|
||||
line_disable_raw_mode(state->input_fd);
|
||||
me_printf_fd(state->output_fd, "\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/11 18:21:45 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/07/20 15:33:01 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/07/30 17:07:59 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/11 18:18:46 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/07/20 15:02:53 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/07/30 17:08:24 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
/* Use the ESC [6n escape sequence to query the horizontal cursor position
|
||||
* and return it. On error -1 is returned, on success the position of the
|
||||
* cursor. */
|
||||
/*t_error line_get_cursor_position(t_fd *input, t_fd *output, t_u32 *column_out)
|
||||
/*t_error line_get_cursor_position( \
|
||||
t_fd *input, t_fd *output, t_u32 *column_out)
|
||||
{
|
||||
char buf[32];
|
||||
t_u32 i;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/11 18:10:24 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/07/20 13:51:27 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/07/30 17:14:18 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue