mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 23:36:23 -05:00
Move mlwrite calls from fileio to file to avoid dependencies of fileio towards display.
This commit is contained in:
parent
0071ce8f5b
commit
423c45f2cc
65
Makefile
65
Makefile
@ -1,8 +1,8 @@
|
|||||||
# makefile for emacs, updated Tue Jun 11 09:36:56 CST 2013
|
# makefile for emacs, updated Tue, Jun 11, 2013 11:00:52 AM
|
||||||
|
|
||||||
SRC=ansi.c basic.c bindable.c bind.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
|
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 bindable.o bind.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
|
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 bindable.h bind.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
|
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
|
||||||
|
|
||||||
# DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them
|
# DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them
|
||||||
|
|
||||||
@ -125,63 +125,62 @@ depend: ${SRC}
|
|||||||
|
|
||||||
ansi.o: ansi.c estruct.h line.h utf8.h edef.h
|
ansi.o: ansi.c estruct.h line.h utf8.h edef.h
|
||||||
basic.o: basic.c basic.h display.h estruct.h line.h utf8.h edef.h input.h \
|
basic.o: basic.c basic.h display.h estruct.h line.h utf8.h edef.h input.h \
|
||||||
random.h word.h
|
random.h word.h
|
||||||
bindable.o: bindable.c bindable.h buffer.h estruct.h line.h utf8.h \
|
|
||||||
display.h edef.h file.h input.h
|
|
||||||
bind.o: bind.c bind.h edef.h estruct.h line.h utf8.h bindable.h buffer.h \
|
bind.o: bind.c bind.h edef.h estruct.h line.h utf8.h bindable.h buffer.h \
|
||||||
display.h ebind.h exec.h file.h flook.h input.h names.h window.h
|
display.h ebind.h exec.h file.h flook.h input.h names.h window.h
|
||||||
|
bindable.o: bindable.c bindable.h buffer.h estruct.h line.h utf8.h \
|
||||||
|
display.h edef.h file.h input.h
|
||||||
buffer.o: buffer.c buffer.h estruct.h line.h utf8.h display.h edef.h \
|
buffer.o: buffer.c buffer.h estruct.h line.h utf8.h display.h edef.h \
|
||||||
file.h input.h window.h
|
file.h input.h window.h
|
||||||
crypt.o: crypt.c crypt.h estruct.h line.h utf8.h
|
crypt.o: crypt.c crypt.h estruct.h line.h utf8.h
|
||||||
display.o: display.c display.h estruct.h line.h utf8.h edef.h termio.h \
|
display.o: display.c display.h estruct.h line.h utf8.h edef.h termio.h \
|
||||||
version.h wrapper.h window.h
|
version.h wrapper.h window.h
|
||||||
ebind.o: ebind.c ebind.h basic.h bind.h edef.h estruct.h line.h utf8.h \
|
ebind.o: ebind.c ebind.h basic.h bind.h edef.h estruct.h line.h utf8.h \
|
||||||
bindable.h buffer.h eval.h exec.h file.h isearch.h random.h region.h \
|
bindable.h buffer.h eval.h exec.h file.h isearch.h random.h region.h \
|
||||||
search.h spawn.h window.h word.h
|
search.h spawn.h window.h word.h
|
||||||
eval.o: eval.c eval.h estruct.h line.h utf8.h basic.h bind.h edef.h \
|
eval.o: eval.c eval.h estruct.h line.h utf8.h basic.h bind.h edef.h \
|
||||||
buffer.h display.h exec.h flook.h input.h random.h search.h termio.h \
|
buffer.h display.h exec.h flook.h input.h random.h search.h termio.h \
|
||||||
version.h window.h
|
version.h window.h
|
||||||
exec.o: exec.c exec.h estruct.h line.h utf8.h buffer.h bind.h edef.h \
|
exec.o: exec.c exec.h estruct.h line.h utf8.h buffer.h bind.h edef.h \
|
||||||
display.h eval.h file.h flook.h input.h
|
display.h eval.h file.h flook.h input.h
|
||||||
execute.o: execute.c edef.h estruct.h line.h utf8.h bind.h random.h \
|
execute.o: execute.c edef.h estruct.h line.h utf8.h bind.h random.h \
|
||||||
display.h file.h
|
display.h file.h
|
||||||
file.o: file.c file.h buffer.h estruct.h line.h utf8.h crypt.h display.h \
|
file.o: file.c file.h buffer.h estruct.h line.h utf8.h crypt.h display.h \
|
||||||
edef.h execute.h fileio.h input.h lock.h window.h
|
edef.h execute.h fileio.h input.h lock.h window.h
|
||||||
fileio.o: fileio.c fileio.h estruct.h line.h utf8.h display.h crypt.h
|
fileio.o: fileio.c fileio.h estruct.h line.h utf8.h crypt.h
|
||||||
flook.o: flook.c flook.h estruct.h line.h utf8.h fileio.h
|
flook.o: flook.c flook.h estruct.h line.h utf8.h fileio.h
|
||||||
globals.o: globals.c estruct.h line.h utf8.h edef.h
|
globals.o: globals.c estruct.h line.h utf8.h edef.h
|
||||||
ibmpc.o: ibmpc.c estruct.h line.h utf8.h edef.h
|
ibmpc.o: ibmpc.c estruct.h line.h utf8.h edef.h
|
||||||
input.o: input.c input.h edef.h estruct.h line.h utf8.h bind.h bindable.h \
|
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
|
display.h exec.h names.h wrapper.h
|
||||||
isearch.o: isearch.c isearch.h basic.h display.h estruct.h line.h utf8.h \
|
isearch.o: isearch.c isearch.h basic.h display.h estruct.h line.h utf8.h \
|
||||||
edef.h input.h search.h
|
edef.h input.h search.h
|
||||||
line.o: line.c line.h utf8.h basic.h display.h estruct.h edef.h random.h
|
line.o: line.c line.h utf8.h basic.h display.h estruct.h edef.h random.h
|
||||||
lock.o: lock.c lock.h estruct.h line.h utf8.h display.h edef.h input.h \
|
lock.o: lock.c lock.h estruct.h line.h utf8.h display.h edef.h input.h
|
||||||
pklock.h
|
|
||||||
main.o: main.c basic.h bind.h edef.h estruct.h line.h utf8.h bindable.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 \
|
buffer.h display.h eval.h execute.h file.h input.h lock.h random.h \
|
||||||
search.h termio.h version.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 \
|
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 \
|
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
|
random.h search.h spawn.h window.h word.h
|
||||||
pklock.o: pklock.c pklock.h estruct.h line.h utf8.h edef.h
|
pklock.o: pklock.c pklock.h estruct.h line.h utf8.h edef.h
|
||||||
posix.o: posix.c termio.h estruct.h line.h utf8.h edef.h
|
posix.o: posix.c termio.h
|
||||||
random.o: random.c random.h basic.h display.h estruct.h line.h utf8.h \
|
random.o: random.c random.h basic.h display.h estruct.h line.h utf8.h \
|
||||||
edef.h execute.h input.h search.h
|
edef.h execute.h input.h search.h
|
||||||
region.o: region.c region.h estruct.h line.h utf8.h display.h edef.h
|
region.o: region.c region.h estruct.h line.h utf8.h display.h edef.h
|
||||||
search.o: search.c search.h estruct.h line.h utf8.h basic.h display.h \
|
search.o: search.c search.h estruct.h line.h utf8.h basic.h display.h \
|
||||||
edef.h input.h
|
edef.h input.h
|
||||||
spawn.o: spawn.c spawn.h buffer.h estruct.h line.h utf8.h display.h \
|
spawn.o: spawn.c spawn.h buffer.h estruct.h line.h utf8.h display.h \
|
||||||
edef.h file.h input.h window.h
|
edef.h file.h input.h window.h
|
||||||
tcap.o: tcap.c display.h estruct.h line.h utf8.h edef.h termio.h
|
tcap.o: tcap.c display.h estruct.h line.h utf8.h edef.h termio.h
|
||||||
termio.o: termio.c termio.h
|
termio.o: termio.c termio.h estruct.h line.h utf8.h edef.h
|
||||||
utf8.o: utf8.c utf8.h
|
utf8.o: utf8.c utf8.h
|
||||||
vmsvt.o: vmsvt.c estruct.h line.h utf8.h edef.h
|
vmsvt.o: vmsvt.c estruct.h line.h utf8.h edef.h
|
||||||
vt52.o: vt52.c estruct.h line.h utf8.h edef.h
|
vt52.o: vt52.c estruct.h line.h utf8.h edef.h
|
||||||
window.o: window.c window.h estruct.h line.h utf8.h basic.h display.h \
|
window.o: window.c window.h estruct.h line.h utf8.h basic.h display.h \
|
||||||
edef.h execute.h wrapper.h
|
edef.h execute.h wrapper.h
|
||||||
word.o: word.c word.h basic.h display.h estruct.h line.h utf8.h edef.h \
|
word.o: word.c word.h basic.h display.h estruct.h line.h utf8.h edef.h \
|
||||||
random.h region.h
|
random.h region.h
|
||||||
wrapper.o: wrapper.c wrapper.h
|
wrapper.o: wrapper.c wrapper.h
|
||||||
|
|
||||||
# DEPENDENCIES MUST END AT END OF FILE
|
# DEPENDENCIES MUST END AT END OF FILE
|
||||||
|
13
file.c
13
file.c
@ -326,6 +326,10 @@ int readin(char *fname, int lockfl)
|
|||||||
memcpy( lp1->l_text, fline, nbytes) ;
|
memcpy( lp1->l_text, fline, nbytes) ;
|
||||||
++nline;
|
++nline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( s == FIOERR)
|
||||||
|
mlwrite( "File read error") ;
|
||||||
|
|
||||||
eoltype = ftype ;
|
eoltype = ftype ;
|
||||||
if( ftype == FTYPE_DOS)
|
if( ftype == FTYPE_DOS)
|
||||||
curbp->b_mode |= MDDOS ;
|
curbp->b_mode |= MDDOS ;
|
||||||
@ -540,6 +544,7 @@ int writeout(char *fn)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((s = ffwopen(fn)) != FIOSUC) { /* Open writes message. */
|
if ((s = ffwopen(fn)) != FIOSUC) { /* Open writes message. */
|
||||||
|
mlwrite( "Cannot open file for writing") ;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
mlwrite("(Writing...)"); /* tell us were writing */
|
mlwrite("(Writing...)"); /* tell us were writing */
|
||||||
@ -547,8 +552,11 @@ int writeout(char *fn)
|
|||||||
nline = 0; /* Number of lines. */
|
nline = 0; /* Number of lines. */
|
||||||
while (lp != curbp->b_linep) {
|
while (lp != curbp->b_linep) {
|
||||||
s = ffputline( &lp->l_text[0], llength(lp), curbp->b_mode & MDDOS) ;
|
s = ffputline( &lp->l_text[0], llength(lp), curbp->b_mode & MDDOS) ;
|
||||||
if( s != FIOSUC)
|
if( s != FIOSUC) {
|
||||||
|
mlwrite( "Write I/O error") ;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
++nline;
|
++nline;
|
||||||
lp = lforw(lp);
|
lp = lforw(lp);
|
||||||
}
|
}
|
||||||
@ -559,7 +567,8 @@ int writeout(char *fn)
|
|||||||
mlwrite("(Wrote 1 line)");
|
mlwrite("(Wrote 1 line)");
|
||||||
else
|
else
|
||||||
mlwrite("(Wrote %d lines)", nline);
|
mlwrite("(Wrote %d lines)", nline);
|
||||||
}
|
} else
|
||||||
|
mlwrite( "Error closing file") ;
|
||||||
} else /* Ignore close error */
|
} else /* Ignore close error */
|
||||||
ffclose(); /* if a write error. */
|
ffclose(); /* if a write error. */
|
||||||
if (s != FIOSUC) /* Some sort of error. */
|
if (s != FIOSUC) /* Some sort of error. */
|
||||||
|
23
fileio.c
23
fileio.c
@ -15,7 +15,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "display.h"
|
|
||||||
|
|
||||||
|
|
||||||
#if CRYPT
|
#if CRYPT
|
||||||
@ -56,13 +55,12 @@ fio_code ffwopen( const char *fn)
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ((fd = creat(fn, 0666, "rfm=var", "rat=cr")) < 0
|
if ((fd = creat(fn, 0666, "rfm=var", "rat=cr")) < 0
|
||||||
|| (ffp = fdopen(fd, "w")) == NULL) {
|
|| (ffp = fdopen(fd, "w")) == NULL)
|
||||||
#else
|
#else
|
||||||
if ((ffp = fopen(fn, "w")) == NULL) {
|
if ((ffp = fopen(fn, "w")) == NULL)
|
||||||
#endif
|
#endif
|
||||||
mlwrite("Cannot open file for writing");
|
|
||||||
return FIOERR;
|
return FIOERR;
|
||||||
}
|
|
||||||
return FIOSUC;
|
return FIOSUC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,10 +82,9 @@ fio_code ffclose(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if V7 | USG | BSD | (MSDOS & (MSC | TURBO))
|
#if V7 | USG | BSD | (MSDOS & (MSC | TURBO))
|
||||||
if (fclose(ffp) != FALSE) {
|
if (fclose(ffp) != FALSE)
|
||||||
mlwrite("Error closing file");
|
|
||||||
return FIOERR;
|
return FIOERR;
|
||||||
}
|
|
||||||
return FIOSUC;
|
return FIOSUC;
|
||||||
#else
|
#else
|
||||||
fclose(ffp);
|
fclose(ffp);
|
||||||
@ -122,10 +119,8 @@ fio_code ffputline( char *buf, int nbuf, int dosflag) {
|
|||||||
|
|
||||||
fputc( '\n', ffp) ;
|
fputc( '\n', ffp) ;
|
||||||
|
|
||||||
if( ferror( ffp)) {
|
if( ferror( ffp))
|
||||||
mlwrite( "Write I/O error") ;
|
|
||||||
return FIOERR ;
|
return FIOERR ;
|
||||||
}
|
|
||||||
|
|
||||||
return FIOSUC ;
|
return FIOSUC ;
|
||||||
}
|
}
|
||||||
@ -180,10 +175,8 @@ fio_code ffgetline(void)
|
|||||||
|
|
||||||
/* test for any errors that may have occured */
|
/* test for any errors that may have occured */
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
if (ferror(ffp)) {
|
if( ferror( ffp))
|
||||||
mlwrite("File read error");
|
return FIOERR ;
|
||||||
return FIOERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
eofflag = TRUE;
|
eofflag = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user