X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Ffmt_compile.c;h=1d03b21fce26d4ec933b84ad401188f05941a417;hb=90986dddba4b24b0449238f86f836581cfb93938;hp=239243fa53569e583d030714dff9352fbb241f9f;hpb=42340d0aa25e0d0ec9c53bc81a7c5bf14283fbd7;p=mmh diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 239243f..1d03b21 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -35,6 +35,8 @@ * * - Add the code in fmt_scan.c to handle your new function. * + * - Add code to fmtdump.c to display your new function. + * * - Document the new function in the mh-format(5) man page. * */ @@ -78,6 +80,7 @@ extern struct mailname fmt_mnull; #define TF_NOP 8 /* like expr but no result */ #define TF_MYNAME 9 /* special - get current name of user */ #define TF_MYHOST 10 /* special - get "local" hostname */ +#define TF_LMBOX 11 /* special - get full local mailbox */ /* ftable->flags */ /* NB that TFL_PUTS is also used to decide whether the test @@ -136,6 +139,7 @@ static struct ftable functable[] = { { "putnumf", TF_EXPR, FT_NUMF, 0, 0 }, { "putaddr", TF_STR, FT_PUTADDR, 0, 0 }, { "putlit", TF_STR, FT_STRLIT, 0, 0 }, + { "zputlit", TF_STR, FT_STRLITZ, 0, 0 }, { "void", TF_NOP, 0, 0, 0 }, { "comp", TF_COMP, FT_LS_COMP, 0, TFL_PUTS }, @@ -158,6 +162,7 @@ static struct ftable functable[] = { { "me", TF_MYBOX, FT_LS_LIT, 0, TFL_PUTS }, { "myname", TF_MYNAME, FT_LS_LIT, 0, TFL_PUTS }, { "myhost", TF_MYHOST, FT_LS_LIT, 0, TFL_PUTS }, + { "localmbox", TF_LMBOX, FT_LS_LIT, 0, TFL_PUTS }, { "plus", TF_NUM, FT_LV_PLUS_L, 0, TFL_PUTN }, { "minus", TF_NUM, FT_LV_MINUS_L, 0, TFL_PUTN }, { "divide", TF_NUM, FT_LV_DIVIDE_L, 0, TFL_PUTN }, @@ -244,7 +249,7 @@ static struct ftable functable[] = { #define PUTLIT(str) do { NEW(FT_LIT,0,0); fp->f_text = (str); } while (0) #define PUTC(c) do { NEW(FT_CHAR,0,0); fp->f_char = (c); } while (0) -static char *format_string; +char *format_string; static unsigned char *usr_fstring; /* for CERROR */ #define CERROR(str) compile_error (str, cp) @@ -601,6 +606,10 @@ do_func(char *sp) LS(t->f_type, LocalName(0)); break; + case TF_LMBOX: + LS(t->f_type, getlocalmbox()); + break; + case TF_NOW: LV(t->f_type, time((time_t *) 0)); break;