aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-11-27 22:28:01 -0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-28 12:29:52 -0800
commitebd4f2f1eb6b0a032273b8adceacd1155dbc9c67 (patch)
treebe8953815f3821ced8c61844634e0c9869ef6bed
parente1b2f459e22d4d704ecb0cfed19df02a43e803a4 (diff)
downloaduemacs-ebd4f2f1eb6b0a032273b8adceacd1155dbc9c67.tar.gz
uemacs: convert typedef struct MC to struct magic.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--edef.h4
-rw-r--r--efunc.h2
-rw-r--r--estruct.h6
-rw-r--r--globals.c4
-rw-r--r--search.c26
5 files changed, 21 insertions, 21 deletions
diff --git a/edef.h b/edef.h
index 8183dd0..01813c5 100644
--- a/edef.h
+++ b/edef.h
@@ -118,8 +118,8 @@ extern int matchoff;
#if MAGIC
extern short int magical;
extern short int rmagical;
-extern MC mcpat[NPAT]; /* The magic pattern. */
-extern MC tapcm[NPAT]; /* The reversed magic patterni. */
+extern struct magic mcpat[NPAT]; /* The magic pattern. */
+extern struct magic tapcm[NPAT]; /* The reversed magic patterni. */
extern RMC rmcpat[NPAT]; /* The replacement magic array. */
#endif
diff --git a/efunc.h b/efunc.h
index af032d9..6d0ffbc 100644
--- a/efunc.h
+++ b/efunc.h
@@ -302,7 +302,7 @@ extern int forwsearch(int f, int n);
extern int forwhunt(int f, int n);
extern int backsearch(int f, int n);
extern int backhunt(int f, int n);
-extern int mcscanner(MC *mcpatrn, int direct, int beg_or_end);
+extern int mcscanner(struct magic *mcpatrn, int direct, int beg_or_end);
extern int scanner(const char *patrn, int direct, int beg_or_end);
extern int eq(unsigned char bc, unsigned char pc);
extern void savematch(void);
diff --git a/estruct.h b/estruct.h
index 6f84c15..e064147 100644
--- a/estruct.h
+++ b/estruct.h
@@ -666,15 +666,15 @@ struct while_block {
#define HIBYTE HICHAR >> 3
/* Typedefs that define the meta-character structure for MAGIC mode searching
- * (MC), and the meta-character structure for MAGIC mode replacment (RMC).
+ * (struct magic), and the meta-character structure for MAGIC mode replacment (RMC).
*/
-typedef struct {
+struct magic {
short int mc_type;
union {
int lchar;
char *cclmap;
} u;
-} MC;
+};
typedef struct {
short int mc_type;
diff --git a/globals.c b/globals.c
index d910a6d..8b64e70 100644
--- a/globals.c
+++ b/globals.c
@@ -128,8 +128,8 @@ int matchoff = 0;
*/
short int magical = FALSE;
short int rmagical = FALSE;
-MC mcpat[NPAT]; /* the magic pattern */
-MC tapcm[NPAT]; /* the reversed magic pattern */
+struct magic mcpat[NPAT]; /* the magic pattern */
+struct magic tapcm[NPAT]; /* the reversed magic pattern */
RMC rmcpat[NPAT]; /* the replacement magic array */
#endif
diff --git a/search.c b/search.c
index d86e5f4..2df1150 100644
--- a/search.c
+++ b/search.c
@@ -64,14 +64,14 @@
#include "efunc.h"
#include "line.h"
-static int amatch(MC *mcptr, int direct, struct line **pcwline, int *pcwoff);
+static int amatch(struct magic *mcptr, int direct, struct line **pcwline, int *pcwoff);
static int readpattern(char *prompt, char *apat, int srch);
static int replaces(int kind, int f, int n);
static int nextch(struct line **pcurline, int *pcuroff, int dir);
static int mcstr(void);
static int rmcstr(void);
-static int mceq(int bc, MC *mt);
-static int cclmake(char **ppatptr, MC *mcptr);
+static int mceq(int bc, struct magic *mt);
+static int cclmake(char **ppatptr, struct magic *mcptr);
static int biteq(int bc, char *cclmap);
static char *clearbits(void);
static void setbit(int bc, char *cclmap);
@@ -283,11 +283,11 @@ int backhunt(int f, int n)
* reset the "." to be at the start or just after the match string,
* and (perhaps) repaint the display.
*
- * MC *mcpatrn; pointer into pattern
+ * struct magic *mcpatrn; pointer into pattern
* int direct; which way to go.
* int beg_or_end; put point at beginning or end of pattern.
*/
-int mcscanner(MC *mcpatrn, int direct, int beg_or_end)
+int mcscanner(struct magic *mcpatrn, int direct, int beg_or_end)
{
struct line *curline; /* current line during scan */
int curoff; /* position within current line */
@@ -351,12 +351,12 @@ int mcscanner(MC *mcpatrn, int direct, int beg_or_end)
* recursive routine amatch() (for "anchored match") in
* Kernighan & Plauger's "Software Tools".
*
- * MC *mcptr; string to scan for
+ * struct magic *mcptr; string to scan for
* int direct; which way to go.
* struct line **pcwline; current line during scan
* int *pcwoff; position within current line
*/
-static int amatch(MC *mcptr, int direct, struct line **pcwline, int *pcwoff)
+static int amatch(struct magic *mcptr, int direct, struct line **pcwline, int *pcwoff)
{
int c; /* character at current position */
struct line *curline; /* current line during scan */
@@ -1085,14 +1085,14 @@ static int nextch(struct line **pcurline, int *pcuroff, int dir)
*/
static int mcstr(void)
{
- MC *mcptr, *rtpcm;
+ struct magic *mcptr, *rtpcm;
char *patptr;
int mj;
int pchr;
int status = TRUE;
int does_closure = FALSE;
- /* If we had metacharacters in the MC array previously,
+ /* If we had metacharacters in the struct magic array previously,
* free up any bitmaps that may have been allocated.
*/
if (magical)
@@ -1286,11 +1286,11 @@ static int rmcstr(void)
}
/*
- * mcclear -- Free up any CCL bitmaps, and MCNIL the MC search arrays.
+ * mcclear -- Free up any CCL bitmaps, and MCNIL the struct magic search arrays.
*/
void mcclear(void)
{
- MC *mcptr;
+ struct magic *mcptr;
mcptr = &mcpat[0];
@@ -1326,7 +1326,7 @@ void rmcclear(void)
* Software Tools, this is the function omatch(), but i felt there
* were too many functions with the 'match' name already.
*/
-static int mceq(int bc, MC *mt)
+static int mceq(int bc, struct magic *mt)
{
int result;
@@ -1377,7 +1377,7 @@ extern char *clearbits(void);
* ppatptr is left pointing to the end-of-character-class character,
* so that a loop may automatically increment with safety.
*/
-static int cclmake(char **ppatptr, MC *mcptr)
+static int cclmake(char **ppatptr, struct magic *mcptr)
{
char *bmap;
char *patptr;