1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-24 10:06:30 -05:00

refactor main and basic out of efunc.

This commit is contained in:
Renaud 2013-05-19 08:13:48 +08:00
parent 0e9fc236f9
commit 4bba6e7417
7 changed files with 57 additions and 36 deletions

View File

@ -28,8 +28,8 @@ OBJ=basic.o bind.o buffer.o crypt.o display.o eval.o exec.o \
termio.o window.o word.o names.o globals.o \
wrapper.o utf8.o
HDR=crypt.h display.h ebind.h edef.h efunc.h estruct.h fileio.h input.h \
version.h window.h
HDR=basic.h crypt.h display.h ebind.h edef.h efunc.h estruct.h fileio.h \
input.h line.h main.h version.h window.h wrapper.h
# DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them
@ -132,7 +132,7 @@ depend: ${SRC}
# DO NOT DELETE THIS LINE -- make depend uses it
ansi.o: ansi.c estruct.h edef.h
basic.o: basic.c estruct.h edef.h
basic.o: basic.c basic.h estruct.h edef.h
bind.o: bind.c estruct.h edef.h fileio.h
buffer.o: buffer.c estruct.h edef.h
crypt.o: crypt.c crypt.h display.h estruct.h edef.h input.h
@ -146,7 +146,7 @@ input.o: input.c input.h estruct.h edef.h
isearch.o: isearch.c estruct.h edef.h
line.o: line.c estruct.h edef.h
lock.o: lock.c estruct.h edef.h
main.o: main.c estruct.h crypt.h efunc.h edef.h ebind.h version.h
main.o: main.c main.h estruct.h crypt.h efunc.h edef.h ebind.h version.h
names.o: names.c estruct.h crypt.h edef.h efunc.h line.h
pklock.o: pklock.c estruct.h
posix.o: posix.c estruct.h utf8.h
@ -159,7 +159,7 @@ termio.o: termio.c estruct.h edef.h
utf8.o: utf8.c utf8.h
vmsvt.o: vmsvt.c estruct.h edef.h
vt52.o: vt52.c estruct.h edef.h
window.o: window.c window.h estruct.h edef.h
window.o: window.c window.h estruct.h edef.h basic.h display.h main.h line.h wrapper.h
word.o: word.c estruct.h edef.h
wrapper.o: wrapper.c wrapper.h

View File

@ -1,3 +1,7 @@
/* basic.c -- implements basic.h */
#include "basic.h"
/* basic.c
*
* The routines in this file move the cursor around on the screen. They

20
basic.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef _BASIC_H_
#define _BASIC_H_
int gotobol( int f, int n) ;
int backchar( int f, int n) ;
int gotoeol( int f, int n) ;
int forwchar( int f, int n) ;
int gotoline( int f, int n) ;
int gotobob( int f, int n) ;
int gotoeob( int f, int n) ;
int forwline( int f, int n) ;
int backline( int f, int n) ;
int gotobop( int f, int n) ;
int gotoeop( int f, int n) ;
int forwpage( int f, int n) ;
int backpage( int f, int n) ;
int setmark( int f, int n) ;
int swapmark( int f, int n) ;
#endif

32
efunc.h
View File

@ -30,21 +30,7 @@ extern int wordcount(int f, int n);
#include "window.h"
/* basic.c */
extern int gotobol(int f, int n);
extern int backchar(int f, int n);
extern int gotoeol(int f, int n);
extern int forwchar(int f, int n);
extern int gotoline(int f, int n);
extern int gotobob(int f, int n);
extern int gotoeob(int f, int n);
extern int forwline(int f, int n);
extern int backline(int f, int n);
extern int gotobop(int f, int n);
extern int gotoeop(int f, int n);
extern int forwpage(int f, int n);
extern int backpage(int f, int n);
extern int setmark(int f, int n);
extern int swapmark(int f, int n);
#include "basic.h"
/* random.c */
extern int tabsize; /* Tab size (0: use real tabs). */
@ -82,21 +68,7 @@ extern int istring(int f, int n);
extern int ovstring(int f, int n);
/* main.c */
extern void edinit(char *bname);
extern int execute(int c, int f, int n);
extern int quickexit(int f, int n);
extern int quit(int f, int n);
extern int ctlxlp(int f, int n);
extern int ctlxrp(int f, int n);
extern int ctlxe(int f, int n);
extern int ctrlg(int f, int n);
extern int rdonly(void);
extern int resterr(void);
extern int nullproc(int f, int n);
extern int metafn(int f, int n);
extern int cex(int f, int n);
extern int unarg(int f, int n);
extern int cexit(int status);
#include "main.h"
/* display.c */
#include "display.h"

3
main.c
View File

@ -1,3 +1,6 @@
/* main.c -- implements main.h */
#include "main.h"
/*
* main.c

20
main.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef _MAIN_H_
#define _MAIN_H_
void edinit( char *bname) ;
int execute( int c, int f, int n) ;
int quickexit( int f, int n) ;
int quit( int f, int n) ;
int ctlxlp( int f, int n) ;
int ctlxrp( int f, int n) ;
int ctlxe( int f, int n) ;
int ctrlg( int f, int n) ;
int rdonly( void) ;
int resterr( void) ;
int nullproc( int f, int n) ;
int metafn( int f, int n) ;
int cex( int f, int n) ;
int unarg( int f, int n) ;
int cexit( int status) ;
#endif

View File

@ -11,10 +11,12 @@
#include <stdio.h>
#include "basic.h"
#include "display.h"
#include "estruct.h"
#include "edef.h"
#include "efunc.h"
#include "line.h"
#include "main.h"
#include "wrapper.h"
/*