mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-19 15:56:24 -05:00
uemacs: evar.h: Add enum function_type.
Replace four macros used to define integer constants with a enum. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
54966da9f0
commit
c206895b9e
29
evar.h
29
evar.h
@ -5,14 +5,13 @@
|
||||
* written 1986 by Daniel Lawrence
|
||||
* modified by Petri Kutvonen
|
||||
*/
|
||||
|
||||
#ifndef EVAR_H_
|
||||
#define EVAR_H_
|
||||
|
||||
/* Max #chars in a var name */
|
||||
/* Max #chars in a var name. */
|
||||
#define NVSIZE 10
|
||||
|
||||
/* Structure to hold user variables and their definitions */
|
||||
/* Structure to hold user variables and their definitions. */
|
||||
struct user_variable {
|
||||
char u_name[NVSIZE + 1]; /* name of user variable */
|
||||
char *u_value; /* value (string) */
|
||||
@ -23,7 +22,7 @@ struct user_variable {
|
||||
/* User variables */
|
||||
static struct user_variable uv[MAXVARS + 1];
|
||||
|
||||
/* List of recognized environment variables */
|
||||
/* List of recognized environment variables. */
|
||||
|
||||
static char *envars[] = {
|
||||
"fillcol", /* current fill column */
|
||||
@ -71,7 +70,7 @@ static char *envars[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
/* and its preprocesor definitions */
|
||||
/* And its preprocesor definitions. */
|
||||
|
||||
#define EVFILLCOL 0
|
||||
#define EVPAGELEN 1
|
||||
@ -115,16 +114,18 @@ static char *envars[] = {
|
||||
#define EVSCROLLCOUNT 39
|
||||
#define EVSCROLL 40
|
||||
|
||||
/* List of recognized user functions */
|
||||
struct user_function {
|
||||
char *f_name; /* name of function */
|
||||
int f_type; /* 1 = monamic, 2 = dynamic */
|
||||
enum function_type {
|
||||
NILNAMIC = 0,
|
||||
MONAMIC,
|
||||
DYNAMIC,
|
||||
TRINAMIC,
|
||||
};
|
||||
|
||||
#define NILNAMIC 0
|
||||
#define MONAMIC 1
|
||||
#define DYNAMIC 2
|
||||
#define TRINAMIC 3
|
||||
/* List of recognized user functions. */
|
||||
struct user_function {
|
||||
char *f_name;
|
||||
enum function_type f_type;
|
||||
};
|
||||
|
||||
static struct user_function funcs[] = {
|
||||
{ "add", DYNAMIC }, /* add two numbers together */
|
||||
@ -168,7 +169,7 @@ static struct user_function funcs[] = {
|
||||
{ "xla", TRINAMIC }, /* XLATE character string translation */
|
||||
};
|
||||
|
||||
/* and its preprocesor definitions */
|
||||
/* And its preprocesor definitions. */
|
||||
|
||||
#define UFADD 0
|
||||
#define UFSUB 1
|
||||
|
Loading…
Reference in New Issue
Block a user