/****************************************************************** v.1 ez functions, for varible args on most common ewtoo stuffs Licences: freely distributable and modifiable, as long as this full header kept with any distributions and any modifications to original marked plainly so. Warrenty: non, the author is in no way responsible for use, misuse, abuse, or any other actions misactions, reactions of this code, its provided as is. Author: phypor "if it breaks you get to keep both pieces" ~old linux proverb;) ********************************************************************/ /** prototypes, for proto.h or any files calling these functions **/ extern void ez_log ( char *, char *, ... ); extern void ez_tell_player ( player *, char *, ... ); extern void ez_su_wall ( char *, ... ); extern void ez_su_wall_but ( player *, char *, ... ); extern void ez_tell_room ( room *, char *, ... ); extern void ez_tell_room_but ( player *, room *, char *, ... ); /** end prototypes **/ #include #include #include #include #include "config.h" #include "proto.h" #include "fix.h" void ez_log ( char * filename, char * format, ... ) { va_list thingy; char *oldstack; oldstack = stack; va_start (thingy, format); vsprintf (stack, format, thingy); va_end (thingy); stack = end_string (stack); log (filename, oldstack); stack = oldstack; } void ez_tell_player ( player * p, char * format, ... ) { va_list thingy; char *oldstack; oldstack = stack; va_start (thingy, format); vsprintf (stack, format, thingy); va_end (thingy); stack = end_string (stack); tell_player (p, oldstack); stack = oldstack; } void ez_su_wall ( char * format, ... ) { va_list thingy; char *oldstack; oldstack = stack; va_start (thingy, format); vsprintf (stack, format, thingy); va_end (thingy); stack = end_string (stack); su_wall (oldstack); stack = oldstack; } void ez_su_wall_but ( player * p, char * format, ... ) { va_list thingy; char *oldstack; oldstack = stack; va_start (thingy, format); vsprintf (stack, format, thingy); va_end (thingy); stack = end_string (stack); su_wall_but (p, oldstack); stack = oldstack; } void ez_tell_room ( room * location, char * format, ... ) { va_list thingy; char *oldstack; oldstack = stack; va_start (thingy, format); vsprintf (stack, format, thingy); va_end (thingy); stack = end_string (stack); tell_room (location, oldstack); stack = oldstack; } void ez_tell_room_but ( player * p, room * location, char * format, ... ) { va_list thingy; char *oldstack; oldstack = stack; va_start (thingy, format); vsprintf (stack, format, thingy); va_end (thingy); stack = end_string (stack); tell_room_but (p, location, oldstack); stack = oldstack; }