1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-21 08:36:23 -05:00

Recompile on linux; Clean up lock prototypes.

This commit is contained in:
Renaud 2013-09-21 10:24:45 +08:00
parent 947c4e7ef4
commit 263834b7d9
6 changed files with 35 additions and 34 deletions

View File

@ -1,4 +1,4 @@
# makefile for emacs, updated Fri, Sep 20, 2013 3:09:46 PM # Makefile for emacs, updated Fri, Sep 20, 2013 3:09:46 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 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 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 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
@ -65,7 +65,7 @@ sparse:
clean: clean:
$(E) " CLEAN" $(E) " CLEAN"
$(Q) rm -f $(PROGRAM) core lintout makeout tags makefile.bak *.o $(Q) rm -f $(PROGRAM) core lintout makeout tags Makefile.bak *.o
install: $(PROGRAM) install: $(PROGRAM)
strip $(PROGRAM) strip $(PROGRAM)
@ -89,14 +89,14 @@ tags: ${SRC}
ctags ${SRC} ctags ${SRC}
source: source:
@mv makefile makefile.bak @mv Makefile Makefile.bak
@echo "# makefile for emacs, updated `date`" >makefile @echo "# Makefile for emacs, updated `date`" >Makefile
@echo '' >>makefile @echo '' >>Makefile
@echo SRC=`ls *.c` >>makefile @echo SRC=`ls *.c` >>Makefile
@echo OBJ=`ls *.c | sed s/c$$/o/` >>makefile @echo OBJ=`ls *.c | sed s/c$$/o/` >>Makefile
@echo HDR=`ls *.h` >>makefile @echo HDR=`ls *.h` >>Makefile
@echo '' >>makefile @echo '' >>Makefile
@sed -n -e '/^# DO NOT ADD OR MODIFY/,$$p' <makefile.bak >>makefile @sed -n -e '/^# DO NOT ADD OR MODIFY/,$$p' <Makefile.bak >>Makefile
depend: ${SRC} depend: ${SRC}
@for i in ${SRC}; do\ @for i in ${SRC}; do\
@ -104,13 +104,13 @@ depend: ${SRC}
@echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep @echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
@echo '$$r ./makedep' >>eddep @echo '$$r ./makedep' >>eddep
@echo 'w' >>eddep @echo 'w' >>eddep
@cp makefile makefile.bak @cp Makefile Makefile.bak
@ed - makefile <eddep @ed - Makefile <eddep
@rm eddep makedep @rm eddep makedep
@echo '' >>makefile @echo '' >>Makefile
@echo '# DEPENDENCIES MUST END AT END OF FILE' >>makefile @echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile
@echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >>makefile @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >>Makefile
@echo '# see make depend above' >>makefile @echo '# see make depend above' >>Makefile
# @for i in ${SRC}; do\ # @for i in ${SRC}; do\
# cc ${DEFINES} -M $$i | sed -e 's, \./, ,' | grep -v '/usr/include' | \ # cc ${DEFINES} -M $$i | sed -e 's, \./, ,' | grep -v '/usr/include' | \
@ -133,7 +133,7 @@ bind.o: bind.c bind.h edef.h buffer.h crypt.h line.h utf8.h estruct.h \
retcode.h bindable.h display.h ebind.h exec.h file.h flook.h input.h \ retcode.h bindable.h display.h ebind.h exec.h file.h flook.h input.h \
names.h window.h defines.h names.h window.h defines.h
bindable.o: bindable.c bindable.h defines.h buffer.h crypt.h line.h \ bindable.o: bindable.c bindable.h defines.h buffer.h crypt.h line.h \
utf8.h display.h edef.h estruct.h retcode.h file.h input.h utf8.h display.h edef.h estruct.h retcode.h file.h input.h lock.h
buffer.o: buffer.c buffer.h crypt.h line.h utf8.h defines.h display.h \ buffer.o: buffer.c buffer.h crypt.h line.h utf8.h defines.h display.h \
edef.h estruct.h retcode.h file.h input.h window.h edef.h estruct.h retcode.h file.h input.h window.h
crypt.o: crypt.c crypt.h crypt.o: crypt.c crypt.h
@ -164,7 +164,7 @@ isearch.o: isearch.c isearch.h basic.h buffer.h crypt.h line.h utf8.h \
line.o: line.c line.h utf8.h buffer.h crypt.h edef.h estruct.h retcode.h \ line.o: line.c line.h utf8.h buffer.h crypt.h edef.h estruct.h retcode.h \
log.h window.h defines.h log.h window.h defines.h
lock.o: lock.c lock.h estruct.h line.h utf8.h retcode.h display.h edef.h \ lock.o: lock.c lock.h estruct.h line.h utf8.h retcode.h display.h edef.h \
buffer.h crypt.h input.h buffer.h crypt.h input.h pklock.h
log.o: log.c log.h retcode.h log.o: log.c log.h retcode.h
main.o: main.c basic.h bind.h edef.h buffer.h crypt.h line.h utf8.h \ main.o: main.c basic.h bind.h edef.h buffer.h crypt.h line.h utf8.h \
estruct.h retcode.h bindable.h display.h eval.h execute.h file.h input.h \ estruct.h retcode.h bindable.h display.h eval.h execute.h file.h input.h \
@ -174,7 +174,8 @@ names.o: names.c names.h basic.h bind.h edef.h buffer.h crypt.h line.h \
isearch.h region.h random.h search.h spawn.h window.h defines.h word.h isearch.h region.h random.h search.h spawn.h window.h defines.h word.h
pklock.o: pklock.c pklock.h estruct.h line.h utf8.h retcode.h edef.h \ pklock.o: pklock.c pklock.h estruct.h line.h utf8.h retcode.h edef.h \
buffer.h crypt.h buffer.h crypt.h
posix.o: posix.c termio.h posix.o: posix.c termio.h estruct.h line.h utf8.h retcode.h edef.h \
buffer.h crypt.h
random.o: random.c random.h basic.h buffer.h crypt.h line.h utf8.h \ random.o: random.c random.h basic.h buffer.h crypt.h line.h utf8.h \
display.h estruct.h retcode.h edef.h execute.h input.h log.h search.h \ display.h estruct.h retcode.h edef.h execute.h input.h log.h search.h \
window.h defines.h window.h defines.h
@ -187,8 +188,7 @@ spawn.o: spawn.c spawn.h defines.h buffer.h crypt.h line.h utf8.h \
window.h window.h
tcap.o: tcap.c display.h estruct.h line.h utf8.h retcode.h edef.h \ tcap.o: tcap.c display.h estruct.h line.h utf8.h retcode.h edef.h \
buffer.h crypt.h termio.h buffer.h crypt.h termio.h
termio.o: termio.c termio.h estruct.h line.h utf8.h retcode.h edef.h \ termio.o: termio.c termio.h
buffer.h crypt.h
utf8.o: utf8.c utf8.h utf8.o: utf8.c utf8.h
vmsvt.o: vmsvt.c estruct.h line.h utf8.h retcode.h edef.h buffer.h \ vmsvt.o: vmsvt.c estruct.h line.h utf8.h retcode.h edef.h buffer.h \
crypt.h crypt.h

View File

@ -7,6 +7,7 @@
#include "edef.h" #include "edef.h"
#include "file.h" #include "file.h"
#include "input.h" #include "input.h"
#include "lock.h"
#if VMS #if VMS
#include <ssdef.h> #include <ssdef.h>

12
lock.c
View File

@ -30,9 +30,9 @@ static void lckerror(char *errstr) ;
* lockchk: * lockchk:
* check a file for locking and add it to the list * check a file for locking and add it to the list
* *
* char *fname; file to check for a lock * const char *fname; file to check for a lock
*/ */
int lockchk(char *fname) int lockchk( const char *fname)
{ {
int i; /* loop indexes */ int i; /* loop indexes */
int status; /* return status */ int status; /* return status */
@ -98,9 +98,9 @@ int lockrel(void)
* FALSE = file was locked and overridden * FALSE = file was locked and overridden
* ABORT = file was locked, abort command * ABORT = file was locked, abort command
* *
* char *fname; file name to lock * const char *fname; file name to lock
*/ */
int lock(char *fname) int lock( const char *fname)
{ {
char *locker; /* lock error message */ char *locker; /* lock error message */
int status; /* return status */ int status; /* return status */
@ -133,9 +133,9 @@ int lock(char *fname)
* Unlock a file * Unlock a file
* this only warns the user if it fails * this only warns the user if it fails
* *
* char *fname; file to unlock * const char *fname; file to unlock
*/ */
int unlock(char *fname) int unlock( const char *fname)
{ {
char *locker; /* undolock return string */ char *locker; /* undolock return string */

6
lock.h
View File

@ -5,10 +5,10 @@
#if BSD | SVR4 #if BSD | SVR4
int lockchk( char *fname) ; int lockchk( const char *fname) ;
int lockrel( void) ; int lockrel( void) ;
int lock( char *fname) ; int lock( const char *fname) ;
int unlock( char *fname) ; int unlock( const char *fname) ;
#endif #endif

View File

@ -42,7 +42,7 @@ int gethostname(char *name, int namelen)
* if other error, returns "LOCK ERROR: explanation" * if other error, returns "LOCK ERROR: explanation"
* *
*********************/ *********************/
char *dolock(char *fname) char *dolock( const char *fname)
{ {
int fd, n; int fd, n;
static char lname[MAXLOCK], locker[MAXNAME + 1]; static char lname[MAXLOCK], locker[MAXNAME + 1];
@ -103,7 +103,7 @@ char *dolock(char *fname)
* *
*********************/ *********************/
char *undolock(char *fname) char *undolock( const char *fname)
{ {
static char lname[MAXLOCK]; static char lname[MAXLOCK];

View File

@ -3,8 +3,8 @@
#if (FILOCK && BSD) || SVR4 #if (FILOCK && BSD) || SVR4
char *dolock( char *fname) ; char *dolock( const char *fname) ;
char *undolock( char *fname) ; char *undolock( const char *fname) ;
#endif #endif