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
|
|
@ -17,31 +17,25 @@
|
|||
#include "me/types.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
void me_printf_write(t_const_str to_write, t_usize to_write_len, void *p_args);
|
||||
|
||||
t_usize me_vprintf_fd(t_fd *fd, t_const_str fmt, va_list *args)
|
||||
{
|
||||
t_fprintf_arg passthru;
|
||||
|
||||
passthru = (t_fprintf_arg){
|
||||
.fd = fd->fd,
|
||||
.total_print = 0,
|
||||
};
|
||||
if (fd == NULL || fmt == NULL || args == NULL)
|
||||
return (0);
|
||||
passthru.fd = fd;
|
||||
passthru.total_print = 0;
|
||||
me_printf_str_inner(fmt, &me_printf_write, args, (void *)&passthru);
|
||||
return (passthru.total_print);
|
||||
}
|
||||
|
||||
t_usize me_printf_fd(t_fd *fd, t_const_str fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
t_fprintf_arg passthru;
|
||||
va_list args;
|
||||
t_usize res;
|
||||
|
||||
passthru = (t_fprintf_arg){
|
||||
.fd = fd->fd,
|
||||
.total_print = 0,
|
||||
};
|
||||
va_start(args, fmt);
|
||||
me_printf_str_inner(fmt, &me_printf_write, &args, (void *)&passthru);
|
||||
res = me_vprintf_fd(fd, fmt, &args);
|
||||
va_end(args);
|
||||
return (passthru.total_print);
|
||||
return (res);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue