projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed -mime for forw and repl.
[mmh]
/
sbr
/
fmt_compile.c
diff --git
a/sbr/fmt_compile.c
b/sbr/fmt_compile.c
index
9d8f41d
..
cf5c497
100644
(file)
--- a/
sbr/fmt_compile.c
+++ b/
sbr/fmt_compile.c
@@
-189,7
+189,7
@@
static struct ftable functable[] = {
static char *format_string;
static unsigned char *usr_fstring; /* for CERROR */
static char *format_string;
static unsigned char *usr_fstring; /* for CERROR */
-#define CERROR(str) compile_error (str, cp)
+#define CERROR(str) compile_error(str, cp)
/*
** external prototypes
/*
** external prototypes
@@
-201,11
+201,11
@@
extern char *getusername(void);
*/
static struct ftable *lookup(char *);
static void compile_error(char *, char *);
*/
static struct ftable *lookup(char *);
static void compile_error(char *, char *);
-static char *compile (char *);
+static char *compile(char *);
static char *do_spec(char *);
static char *do_name(char *, int);
static char *do_func(char *);
static char *do_spec(char *);
static char *do_name(char *, int);
static char *do_func(char *);
-static char *do_expr (char *, int);
+static char *do_expr(char *, int);
static char *do_loop(char *);
static char *do_if(char *);
static char *do_loop(char *);
static char *do_if(char *);
@@
-218,7
+218,7
@@
lookup(char *name)
register char c = *name;
while ((nm = t->name)) {
register char c = *name;
while ((nm = t->name)) {
- if (*nm == c && strcmp (nm, name) == 0)
+ if (*nm == c && strcmp(nm, name) == 0)
return (ftbl = t);
t++;
return (ftbl = t);
t++;
@@
-237,17
+237,13
@@
compile_error(char *str, char *cp)
usr_fstring[errpos] = '\0';
for (i = errpos-errctx; i < errpos; i++) {
usr_fstring[errpos] = '\0';
for (i = errpos-errctx; i < errpos; i++) {
-#ifdef LOCALE
if (iscntrl(usr_fstring[i]))
if (iscntrl(usr_fstring[i]))
-#else
- if (usr_fstring[i] < 32)
-#endif
usr_fstring[i] = '_';
}
advise(NULL, "\"%s\": format compile error - %s",
&usr_fstring[errpos-errctx], str);
usr_fstring[i] = '_';
}
advise(NULL, "\"%s\": format compile error - %s",
&usr_fstring[errpos-errctx], str);
- adios (NULL, "%*s", errctx+1, "^");
+ adios(NULL, "%*s", errctx+1, "^");
}
/*
}
/*
@@
-263,8
+259,8
@@
fmt_compile(char *fstring, struct format **fmt)
int i;
if (format_string)
int i;
if (format_string)
- free (format_string);
- format_string = getcpy (fstring);
+ free(format_string);
+ format_string = getcpy(fstring);
usr_fstring = fstring;
/* init the component hash table. */
usr_fstring = fstring;
/* init the component hash table. */
@@
-283,10
+279,10
@@
fmt_compile(char *fstring, struct format **fmt)
i = strlen(fstring)/2 + 1;
if (i == 1)
i++;
i = strlen(fstring)/2 + 1;
if (i == 1)
i++;
- next_fp = formatvec = (struct format *)calloc ((size_t) i,
+ next_fp = formatvec = (struct format *)calloc((size_t) i,
sizeof(struct format));
if (next_fp == NULL)
sizeof(struct format));
if (next_fp == NULL)
- adios (NULL, "unable to allocate format storage");
+ adios(NULL, "unable to allocate format storage");
ncomp = 0;
infunction = 0;
ncomp = 0;
infunction = 0;
@@
-302,7
+298,7
@@
fmt_compile(char *fstring, struct format **fmt)
}
static char *
}
static char *
-compile (char *sp)
+compile(char *sp)
{
register char *cp = sp;
register int c;
{
register char *cp = sp;
register int c;
@@
-327,7
+323,7
@@
compile (char *sp)
switch (c = *++cp) {
case '%':
switch (c = *++cp) {
case '%':
- PUTC (*cp);
+ PUTC(*cp);
cp++;
break;
cp++;
break;
@@
-437,7
+433,7
@@
do_name(char *sp, int preprocess)
case FT_MYMBOX:
if (!primed) {
case FT_MYMBOX:
if (!primed) {
- ismymbox ((struct mailname *) 0);
+ ismymbox((struct mailname *) 0);
primed++;
}
/* fall through */
primed++;
}
/* fall through */
@@
-478,7
+474,7
@@
do_func(char *sp)
CERROR("'(', '{', ' ' or ')' expected");
}
cp[-1] = '\0';
CERROR("'(', '{', ' ' or ')' expected");
}
cp[-1] = '\0';
- if ((t = lookup (sp)) == 0) {
+ if ((t = lookup(sp)) == 0) {
CERROR("unknown function");
}
if (isspace(c))
CERROR("unknown function");
}
if (isspace(c))
@@
-554,22
+550,22
@@
do_func(char *sp)
}
static char *
}
static char *
-do_expr (char *sp, int preprocess)
+do_expr(char *sp, int preprocess)
{
register char *cp = sp;
register int c;
if ((c = *cp++) == '{') {
{
register char *cp = sp;
register int c;
if ((c = *cp++) == '{') {
- cp = do_name (cp, preprocess);
+ cp = do_name(cp, preprocess);
fp->f_type = FT_LS_COMP;
} else if (c == '(') {
fp->f_type = FT_LS_COMP;
} else if (c == '(') {
- cp = do_func (cp);
+ cp = do_func(cp);
} else if (c == ')') {
return (--cp);
} else if (c == '%' && *cp == '<') {
} else if (c == ')') {
return (--cp);
} else if (c == '%' && *cp == '<') {
- cp = do_if (cp+1);
+ cp = do_if(cp+1);
} else {
} else {
- CERROR ("'(', '{', '%<' or ')' expected");
+ CERROR("'(', '{', '%<' or ')' expected");
}
return (cp);
}
}
return (cp);
}
@@
-581,9
+577,9
@@
do_loop(char *sp)
struct format *floop;
floop = next_fp;
struct format *floop;
floop = next_fp;
- cp = compile (cp);
+ cp = compile(cp);
if (*cp++ != ']')
if (*cp++ != ']')
- CERROR ("']' expected");
+ CERROR("']' expected");
LV(FT_DONE, 1); /* not yet done */
LV(FT_GOTO, 0);
LV(FT_DONE, 1); /* not yet done */
LV(FT_GOTO, 0);
@@
-604,7
+600,7
@@
do_if(char *sp)
if ((c = *cp++) == '{') /*}*/{
cp = do_name(cp, 0);
fp->f_type = FT_LS_COMP;
if ((c = *cp++) == '{') /*}*/{
cp = do_name(cp, 0);
fp->f_type = FT_LS_COMP;
- LV (FT_IF_S, 0);
+ LV(FT_IF_S, 0);
} else if (c == '(') {
cp = do_func(cp);
/* see if we can merge the load and the "if" */
} else if (c == '(') {
cp = do_func(cp);
/* see if we can merge the load and the "if" */
@@
-617,9
+613,9
@@
do_if(char *sp)
** function 's return type is.
*/
if (ftbl->flags & TFL_PUTS) {
** function 's return type is.
*/
if (ftbl->flags & TFL_PUTS) {
- LV (FT_IF_S, 0);
+ LV(FT_IF_S, 0);
} else {
} else {
- LV (FT_IF_V_NE, 0);
+ LV(FT_IF_V_NE, 0);
}
}
} else {
}
}
} else {
@@
-628,7
+624,7
@@
do_if(char *sp)
}
fexpr = fp; /* loc of [ELS]IF */
}
fexpr = fp; /* loc of [ELS]IF */
- cp = compile (cp); /* compile IF TRUE stmts */
+ cp = compile(cp); /* compile IF TRUE stmts */
if (fif)
fif->f_skip = next_fp - fif;
if (fif)
fif->f_skip = next_fp - fif;
@@
-639,7
+635,7
@@
do_if(char *sp)
fexpr = (struct format *)NULL;/* no extra ENDIF */
fexpr = (struct format *)NULL;/* no extra ENDIF */
- cp = compile (cp); /* compile ELSE stmts */
+ cp = compile(cp); /* compile ELSE stmts */
fif->f_skip = next_fp - fif;
c = *cp++;
} else if (c == '?') { /* another ELSIF */
fif->f_skip = next_fp - fif;
c = *cp++;
} else if (c == '?') { /* another ELSIF */