1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-09 13:30:43 +00:00

uemacs: convert typedef struct VDESC to struct variable_description.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Thiago Farina 2010-11-06 14:09:44 -02:00 committed by Linus Torvalds
parent fa57a63d57
commit 6ceea8ba9b
3 changed files with 33 additions and 37 deletions

View File

@ -352,8 +352,8 @@ extern char *gtusr(char *vname);
extern char *gtenv(char *vname); extern char *gtenv(char *vname);
extern char *getkill(void); extern char *getkill(void);
extern int setvar(int f, int n); extern int setvar(int f, int n);
extern void findvar(char *var, VDESC *vd, int size); extern void findvar(char *var, struct variable_description *vd, int size);
extern int svar(VDESC *var, char *value); extern int svar(struct variable_description *var, char *value);
extern char *itoa(int i); extern char *itoa(int i);
extern int gettyp(char *token); extern int gettyp(char *token);
extern char *getval(char *token); extern char *getval(char *token);

View File

@ -594,35 +594,31 @@ struct name_bind {
int (*n_func)(int, int); /* function name is bound to */ int (*n_func)(int, int); /* function name is bound to */
}; };
/* The editor holds deleted text chunks in the struct kill buffer. The /* The editor holds deleted text chunks in the struct kill buffer. The
kill buffer is logically a stream of ascii characters, however * kill buffer is logically a stream of ascii characters, however
due to its unpredicatable size, it gets implemented as a linked * due to its unpredicatable size, it gets implemented as a linked
list of chunks. (The d_ prefix is for "deleted" text, as k_ * list of chunks. (The d_ prefix is for "deleted" text, as k_
was taken up by the keycode structure) * was taken up by the keycode structure).
*/ */
struct kill { struct kill {
struct kill *d_next; /* link to next chunk, NULL if last */ struct kill *d_next; /* Link to next chunk, NULL if last. */
char d_chunk[KBLOCK]; /* deleted text */ char d_chunk[KBLOCK]; /* Deleted text. */
}; };
/* When emacs' command interpetor needs to get a variable's name, /* When emacs' command interpetor needs to get a variable's name,
rather than it's value, it is passed back as a VDESC variable * rather than it's value, it is passed back as a variable description
description structure. The v_num field is a index into the * structure. The v_num field is a index into the appropriate variable table.
appropriate variable table. */
struct variable_description {
int v_type; /* Type of variable. */
int v_num; /* Ordinal pointer to variable in list. */
};
/* The !WHILE directive in the execution language needs to
* stack references to pending whiles. These are stored linked
* to each currently open procedure via a linked list of
* the following structure.
*/ */
typedef struct VDESC {
int v_type; /* type of variable */
int v_num; /* ordinal pointer to variable in list */
} VDESC;
/* The !WHILE directive in the execution language needs to
stack references to pending whiles. These are stored linked
to each currently open procedure via a linked list of
the following structure
*/
struct while_block { struct while_block {
struct line *w_begin; /* ptr to !while statement */ struct line *w_begin; /* ptr to !while statement */
struct line *w_end; /* ptr to the !endwhile statement */ struct line *w_end; /* ptr to the !endwhile statement */

20
eval.c
View File

@ -354,7 +354,7 @@ int setvar(int f, int n)
char *sp; /* temp string pointer */ char *sp; /* temp string pointer */
char *ep; /* ptr to end of outline */ char *ep; /* ptr to end of outline */
#endif #endif
VDESC vd; /* variable num/type */ struct variable_description vd; /* variable num/type */
char var[NVSIZE + 1]; /* name of variable to fetch */ char var[NVSIZE + 1]; /* name of variable to fetch */
char value[NSTRING]; /* value to set variable to */ char value[NSTRING]; /* value to set variable to */
@ -442,13 +442,13 @@ int setvar(int f, int n)
} }
/* /*
* find a variables type and name * Find a variables type and name.
* *
* char *var; name of var to get * @var: name of variable to get.
* VDESC *vd; structure to hold type and ptr * @vd: structure to hold type and pointer.
* int size; size of var array * @size: size of variable array.
*/ */
void findvar(char *var, VDESC *vd, int size) void findvar(char *var, struct variable_description *vd, int size)
{ {
int vnum; /* subscript in variable arrays */ int vnum; /* subscript in variable arrays */
int vtype; /* type to return */ int vtype; /* type to return */
@ -501,12 +501,12 @@ fvar:
} }
/* /*
* set a variable * Set a variable.
* *
* VDESC *var; variable to set * @var: variable to set.
* char *value; value to set to * @value: value to set to.
*/ */
int svar(VDESC *var, char *value) int svar(struct variable_description *var, char *value)
{ {
int vnum; /* ordinal number of var refrenced */ int vnum; /* ordinal number of var refrenced */
int vtype; /* type of variable to set */ int vtype; /* type of variable to set */