diff --git a/Makefile b/Makefile index b1f3f6f..21a0dd2 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -# makefile for emacs, updated Tue, Jun 11, 2013 11:00:52 AM +# makefile for emacs, updated Fri, Jun 14, 2013 5:12:57 PM -SRC=ansi.c basic.c bind.c bindable.c buffer.c crypt.c display.c ebind.c eval.c exec.c execute.c file.c fileio.c flook.c globals.c ibmpc.c input.c isearch.c line.c lock.c main.c names.c pklock.c posix.c random.c region.c search.c spawn.c tcap.c termio.c utf8.c vmsvt.c vt52.c window.c word.c wrapper.c -OBJ=ansi.o basic.o bind.o bindable.o buffer.o crypt.o display.o ebind.o eval.o exec.o execute.o file.o fileio.o flook.o globals.o ibmpc.o input.o isearch.o line.o lock.o main.o names.o pklock.o posix.o random.o region.o search.o spawn.o tcap.o termio.o utf8.o vmsvt.o vt52.o window.o word.o wrapper.o -HDR=basic.h bind.h bindable.h buffer.h crypt.h display.h ebind.h edef.h efunc.h estruct.h eval.h exec.h execute.h file.h fileio.h flook.h input.h isearch.h line.h lock.h names.h pklock.h random.h region.h search.h spawn.h termio.h utf8.h version.h window.h word.h wrapper.h +SRC=ansi.c basic.c bind.c bindable.c buffer.c crypt.c display.c ebind.c eval.c exec.c execute.c file.c fileio.c flook.c globals.c ibmpc.c input.c isearch.c line.c lock.c log.c main.c names.c pklock.c posix.c random.c region.c search.c spawn.c tcap.c termio.c utf8.c vmsvt.c vt52.c window.c word.c wrapper.c +OBJ=ansi.o basic.o bind.o bindable.o buffer.o crypt.o display.o ebind.o eval.o exec.o execute.o file.o fileio.o flook.o globals.o ibmpc.o input.o isearch.o line.o lock.o log.o main.o names.o pklock.o posix.o random.o region.o search.o spawn.o tcap.o termio.o utf8.o vmsvt.o vt52.o window.o word.o wrapper.o +HDR=basic.h bind.h bindable.h buffer.h crypt.h display.h ebind.h edef.h efunc.h estruct.h eval.h exec.h execute.h file.h fileio.h flook.h input.h isearch.h line.h lock.h log.h names.h pklock.h random.h region.h search.h spawn.h termio.h utf8.h version.h window.h word.h wrapper.h # DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them @@ -155,11 +155,12 @@ input.o: input.c input.h edef.h estruct.h line.h utf8.h bind.h bindable.h \ display.h exec.h names.h wrapper.h isearch.o: isearch.c isearch.h basic.h display.h estruct.h line.h utf8.h \ edef.h input.h search.h -line.o: line.c line.h utf8.h display.h estruct.h edef.h +line.o: line.c line.h utf8.h display.h estruct.h edef.h log.h lock.o: lock.c lock.h estruct.h line.h utf8.h display.h edef.h input.h +log.o: log.c log.h main.o: main.c basic.h bind.h edef.h estruct.h line.h utf8.h bindable.h \ - buffer.h display.h eval.h execute.h file.h input.h lock.h random.h \ - search.h termio.h version.h + buffer.h display.h eval.h execute.h file.h input.h lock.h log.h \ + random.h search.h termio.h version.h names.o: names.c names.h basic.h bind.h edef.h estruct.h line.h utf8.h \ bindable.h buffer.h display.h eval.h exec.h file.h isearch.h region.h \ random.h search.h spawn.h window.h word.h diff --git a/line.c b/line.c index 556f6f4..4ec2c0b 100644 --- a/line.c +++ b/line.c @@ -20,6 +20,7 @@ #include "display.h" #include "estruct.h" #include "edef.h" +#include "log.h" #include "utf8.h" #define BLOCK_SIZE 16 /* Line block chunk size. */ @@ -104,7 +105,7 @@ struct line *lalloc(int used) if (size == 0) /* Assume that is an empty. */ size = BLOCK_SIZE; /* Line is for type-in. */ if ((lp = (struct line *)malloc(sizeof(struct line) + size)) == NULL) { - mlwrite("(OUT OF MEMORY)"); + logwrite( "(OUT OF MEMORY)") ; return NULL; } lp->l_size = size; @@ -209,7 +210,7 @@ int linstr(char *instr) /* Insertion error? */ if (status != TRUE) { - mlwrite("%%Out of memory while inserting"); + logwrite( "%%Out of memory while inserting") ; break; } instr++; @@ -244,7 +245,7 @@ static int linsert_byte(int n, int c) lp1 = curwp->w_dotp; /* Current line */ if (lp1 == curbp->b_linep) { /* At the end: special */ if (curwp->w_doto != 0) { - mlwrite("bug: linsert"); + logwrite( "bug: linsert") ; return FALSE; } if ((lp2 = lalloc(n)) == NULL) /* Allocate new line */ @@ -352,8 +353,7 @@ int lover(char *ostr) /* Insertion error? */ if (status != TRUE) { - mlwrite - ("%%Out of memory while overwriting"); + logwrite( "%%Out of memory while overwriting") ; break; } ostr++; diff --git a/log.c b/log.c new file mode 100644 index 0000000..f918e37 --- /dev/null +++ b/log.c @@ -0,0 +1,6 @@ +#include "log.h" + +void logdump( const char *buf, ...) { +} + +void (*logwrite)( const char *, ...) = logdump ; diff --git a/log.h b/log.h new file mode 100644 index 0000000..eab0e46 --- /dev/null +++ b/log.h @@ -0,0 +1,2 @@ +extern void (*logwrite)( const char *, ...) ; + diff --git a/main.c b/main.c index e6bd8eb..743f9a8 100644 --- a/main.c +++ b/main.c @@ -69,6 +69,7 @@ #include "file.h" #include "input.h" #include "lock.h" +#include "log.h" #include "random.h" #include "search.h" #include "termio.h" @@ -175,6 +176,7 @@ int main(int argc, char **argv) /* Initialize the editor. */ vtinit(); /* Display */ + logwrite = mlwrite ; edinit("main"); /* Buffers, windows */ varinit(); /* user variables */