www.pudn.com > AliTools.zip > ColorStdio.c, change:2009-05-01,size:475b


#include <stdio.h> 
#include <stdarg.h> 
#include "ConUtil.h" 
 
int Puts(COLOR color, const char *s) 
{ 
  COLOR color_save; 
  int r; 
 
  color_save = GetColor(); 
  SetColor(color); 
  r = puts(s); 
  SetColor(color_save); 
  return r; 
} 
 
void Printf(COLOR color, const char *fmt, ...) 
{ 
  COLOR color_save; 
  va_list args; 
  va_start(args, fmt); 
  color_save = GetColor(); 
  SetColor(color); 
  vprintf(fmt, args); 
  SetColor(color_save); 
  va_end(args); 
}