# # Patch name: Ansi %-Substituion Codes # Patch version: 1.0 # Author's name: Michael R. Rudel # Author's email: mrr@dodds.net # Version of PennMUSH: 1.7.2p12 # Date patch made: 7/1/98 # Author is willing to support (yes/no): yes # Patch format: Context Diff # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # *** src/parse.c Wed Jul 1 16:02:01 1998 --- src/parse.c.ansisubs Wed Jul 1 16:04:02 1998 *************** *** 499,504 **** --- 499,585 ---- if (attrib) safe_str(uncompress(attrib->value), buff, bp); break; + #ifdef TFB /* Mike 7/1/98 */ + case 'z': + case 'Z': + nextc = **str; + (*str)++; + if (!nextc) + { + goto exit_sequence; + } + else + { + + switch (nextc) + { + case 'h': /* hilite */ + safe_str (ANSI_HILITE, buff, bp); + break; + case 'i': /* inverse */ + safe_str (ANSI_INVERSE, buff, bp); + break; + case 'f': /* flash */ + safe_str (ANSI_BLINK, buff, bp); + break; + case 'u': /* underscore */ + safe_str (ANSI_UNDERSCORE, buff, bp); + break; + case 'n': /* normal */ + safe_str (ANSI_NORMAL, buff, bp); + break; + case 'x': /* black fg */ + safe_str (ANSI_BLACK, buff, bp); + break; + case 'r': /* red fg */ + safe_str (ANSI_RED, buff, bp); + break; + case 'g': /* green fg */ + safe_str (ANSI_GREEN, buff, bp); + break; + case 'y': /* yellow fg */ + safe_str (ANSI_YELLOW, buff, bp); + break; + case 'b': /* blue fg */ + safe_str (ANSI_BLUE, buff, bp); + break; + case 'm': /* magenta fg */ + safe_str (ANSI_MAGENTA, buff, bp); + break; + case 'c': /* cyan fg */ + safe_str (ANSI_CYAN, buff, bp); + break; + case 'w': /* white fg */ + safe_str (ANSI_WHITE, buff, bp); + break; + case 'X': /* black bg */ + safe_str (ANSI_BBLACK, buff, bp); + break; + case 'R': /* red bg */ + safe_str (ANSI_BRED, buff, bp); + break; + case 'G': /* green bg */ + safe_str (ANSI_BGREEN, buff, bp); + break; + case 'Y': /* yellow bg */ + safe_str (ANSI_BYELLOW, buff, bp); + break; + case 'B': /* blue bg */ + safe_str (ANSI_BBLUE, buff, bp); + break; + case 'M': /* magenta bg */ + safe_str (ANSI_BMAGENTA, buff, bp); + break; + case 'C': /* cyan bg */ + safe_str (ANSI_BCYAN, buff, bp); + break; + case 'W': /* white bg */ + safe_str (ANSI_BWHITE, buff, bp); + break; + } + break; + } + #endif /* TFB */ default: /* just copy */ safe_chr(savec, buff, bp); }