Move mprintf to libaux

This commit is contained in:
2026-03-17 22:19:23 +01:00
parent 7bcd40151d
commit 76b1533ad0
10 changed files with 20 additions and 19 deletions

View File

@@ -2,13 +2,13 @@
#include "context.h"
#include "gapbuffer.h"
#include "interp.h"
#include "mprintf.h"
#include "strbuf.h"
#include <arena.h>
#include <debugconsole.h>
#include <kb.h>
#include <list.h>
#include <malloc.h>
#include <mprintf.h>
#include <printf.h>
#include <process_self.h>
#include <stdbool.h>

View File

@@ -1,13 +1,13 @@
#include "edit.h"
#include "arena_alloc.h"
#include "gapbuffer.h"
#include "mprintf.h"
#include "walloc.h"
#include <arena.h>
#include <filewriter.h>
#include <kb.h>
#include <list.h>
#include <malloc.h>
#include <mprintf.h>
#include <path.h>
#include <printf.h>
#include <process_self.h>

View File

@@ -2,7 +2,6 @@
#include "arena_alloc.h"
#include "context.h"
#include "edit.h"
#include "mprintf.h"
#include "parser.h"
#include <debugconsole.h>
#include <desc.h>
@@ -12,6 +11,7 @@
#include <kb.h>
#include <libfat.h>
#include <malloc.h>
#include <mprintf.h>
#include <path.h>
#include <printf.h>
#include <process.h>

View File

@@ -1,27 +0,0 @@
#include "mprintf.h"
#include <malloc.h>
#include <printf.h>
#include <process_self.h>
#include <stdarg.h>
#include <string.h>
#include <system.h>
void mprintf (const char* fmt, ...) {
va_list args;
va_start (args, fmt);
char* buf = malloc (MPRINTF_BUF_MAX);
if (buf == NULL) {
va_end (args);
return;
}
memset (buf, 0, MPRINTF_BUF_MAX);
int len = vsnprintf (buf, MPRINTF_BUF_MAX, fmt, args);
va_end (args);
mail_send (process_get_exec_pgid (), buf, len);
free (buf);
}

View File

@@ -1,10 +0,0 @@
#ifndef _MPRINTF_H
#define _MPRINTF_H
#include "context.h"
#define MPRINTF_BUF_MAX CPRINTF_BUF_MAX
void mprintf (const char* fmt, ...);
#endif // _MPRINTF_H

View File

@@ -2,9 +2,9 @@
#include "arena_alloc.h"
#include "context.h"
#include "interp.h"
#include "mprintf.h"
#include <arena.h>
#include <list.h>
#include <mprintf.h>
#include <string.h>
static struct parse_rule parse_rules[] = {

View File

@@ -4,7 +4,6 @@ c += ce.c \
context.c \
parser.c \
interp.c \
mprintf.c \
gapbuffer.c \
edit.c
@@ -14,6 +13,5 @@ o += ce.o \
context.o \
parser.o \
interp.o \
mprintf.o \
gapbuffer.o \
edit.o