Move mprintf to libaux
This commit is contained in:
2
ce/ce.c
2
ce/ce.c
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
27
ce/mprintf.c
27
ce/mprintf.c
@@ -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);
|
||||
}
|
||||
10
ce/mprintf.h
10
ce/mprintf.h
@@ -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
|
||||
@@ -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[] = {
|
||||
|
||||
Reference in New Issue
Block a user