1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-19 07:46:24 -05:00

refactor epath into bind and util into eval.

This commit is contained in:
Renaud 2013-05-17 21:17:16 +08:00
parent 886402ccad
commit e86bdad4fc
5 changed files with 40 additions and 56 deletions

View File

@ -28,7 +28,7 @@ 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=ebind.h edef.h efunc.h epath.h estruct.h evar.h util.h version.h
HDR=ebind.h edef.h efunc.h estruct.h evar.h version.h
# DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them
@ -132,11 +132,11 @@ depend: ${SRC}
ansi.o: ansi.c estruct.h edef.h
basic.o: basic.c estruct.h edef.h
bind.o: bind.c estruct.h edef.h epath.h util.h
bind.o: bind.c estruct.h edef.h
buffer.o: buffer.c estruct.h edef.h
crypt.o: crypt.c estruct.h edef.h
display.o: display.c estruct.h edef.h utf8.h version.h
eval.o: eval.c estruct.h edef.h evar.h version.h util.h
eval.o: eval.c estruct.h edef.h evar.h version.h
exec.o: exec.c estruct.h edef.h
file.o: file.c estruct.h edef.h
fileio.o: fileio.c estruct.h edef.h

38
bind.c
View File

@ -12,9 +12,41 @@
#include "estruct.h"
#include "edef.h"
#include "efunc.h"
#include "epath.h"
#include "line.h"
#include "util.h"
/* possible names and paths of help files under different OSs */
static const char *pathname[] = {
#if MSDOS
"emacs.rc",
"emacs.hlp",
"\\sys\\public\\",
"\\usr\\bin\\",
"\\bin\\",
"\\",
""
#endif
#if V7 | BSD | USG
".emacsrc",
"emacs.hlp",
#if PKCODE
"/usr/global/lib/", "/usr/local/bin/", "/usr/local/lib/",
#endif
"/usr/local/", "/usr/lib/", ""
#endif
#if VMS
{
"emacs.rc", "emacs.hlp", "",
#if PKCODE
"sys$login:", "emacs_dir:",
#endif
"sys$sysdevice:[vmstools]"
#endif
};
#define PATHNAME_SIZE (sizeof pathname / sizeof pathname[ 0])
int help(int f, int n)
{ /* give me some help!!!!
@ -536,7 +568,7 @@ char *flook( const char *fname, int hflag)
#endif
/* look it up via the old table method */
for (i = 2; i < ARRAY_SIZE(pathname); i++) {
for( i = 2; i < PATHNAME_SIZE ; i++) {
strcpy(fspec, pathname[i]);
strcat(fspec, fname);

43
epath.h
View File

@ -1,43 +0,0 @@
/* EPATH.H
*
* This file contains certain info needed to locate the
* initialization (etc) files on a system dependent basis
*
* modified by Petri Kutvonen
*/
#ifndef EPATH_H_
#define EPATH_H_
/* possible names and paths of help files under different OSs */
static const char *pathname[] =
#if MSDOS
{
"emacs.rc",
"emacs.hlp",
"\\sys\\public\\",
"\\usr\\bin\\",
"\\bin\\",
"\\",
""
};
#endif
#if V7 | BSD | USG
{
".emacsrc", "emacs.hlp",
#if PKCODE
"/usr/global/lib/", "/usr/local/bin/", "/usr/local/lib/",
#endif
"/usr/local/", "/usr/lib/", ""};
#endif
#if VMS
{
"emacs.rc", "emacs.hlp", "",
#if PKCODE
"sys$login:", "emacs_dir:",
#endif
"sys$sysdevice:[vmstools]"};
#endif
#endif /* EPATH_H_ */

3
eval.c
View File

@ -13,11 +13,12 @@
#include "efunc.h"
#include "evar.h"
#include "line.h"
#include "util.h"
#include "version.h"
#define MAXVARS 255
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
/* User variables */
static struct user_variable uv[MAXVARS + 1];

6
util.h
View File

@ -1,6 +0,0 @@
#ifndef UTIL_H_
#define UTIL_H_
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#endif /* UTIL_H_ */