Updated linenoise and printf to better work
This commit is contained in:
parent
0e18e20181
commit
8808f81221
28 changed files with 657 additions and 579 deletions
|
|
@ -6,46 +6,38 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/09 14:57:28 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/02/09 15:00:39 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/07/07 18:00:14 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/string/string.h"
|
||||
#include "me/fs/write.h"
|
||||
#include "me/printf/formatter/formatter.h"
|
||||
#include "me/fs/fs.h"
|
||||
#include "me/printf/formatter/utils.h"
|
||||
#include "me/printf/matchers/matchers.h"
|
||||
#include "me/printf/printf.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/types.h"
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void me_printf_write(t_const_str to_write, t_usize to_write_len,
|
||||
void *p_args);
|
||||
void me_printf_write(t_const_str to_write, t_usize to_write_len, void *p_args);
|
||||
|
||||
t_usize me_vprintf(t_const_str fmt, va_list *args)
|
||||
t_usize me_vprintf(t_const_str fmt, va_list *args)
|
||||
{
|
||||
t_fprintf_arg passthru;
|
||||
t_fprintf_arg passthru;
|
||||
|
||||
passthru = (t_fprintf_arg){
|
||||
.fd = 1,
|
||||
.total_print = 0,
|
||||
};
|
||||
if (fmt == NULL || args == NULL)
|
||||
return (0);
|
||||
passthru.fd = get_stdout();
|
||||
passthru.total_print = 0;
|
||||
me_printf_str_inner(fmt, &me_printf_write, args, (void *)&passthru);
|
||||
return (passthru.total_print);
|
||||
}
|
||||
|
||||
t_usize me_veprintf(t_const_str fmt, va_list *args)
|
||||
t_usize me_veprintf(t_const_str fmt, va_list *args)
|
||||
{
|
||||
t_fprintf_arg passthru;
|
||||
t_fprintf_arg passthru;
|
||||
|
||||
passthru = (t_fprintf_arg){
|
||||
.fd = 2,
|
||||
.total_print = 0,
|
||||
};
|
||||
if (fmt == NULL || args == NULL)
|
||||
return (0);
|
||||
passthru.fd = get_stderr();
|
||||
passthru.total_print = 0;
|
||||
me_printf_str_inner(fmt, &me_printf_write, args, (void *)&passthru);
|
||||
return (passthru.total_print);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue