/* printf(): print to console output */ void LibPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { struct OutputStream ConsoleStream; ConsoleStream.Putch = &PlatformPutc; GenericPrintf(Parser, ReturnValue, Param, NumArgs, &ConsoleStream); }
void StdioPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { char buf[512]; GenericPrintf(Parser, ReturnValue, Param, NumArgs,buf); dConsolePut (buf); ReturnValue->Val->Integer = strlen(buf); }
void StdioSprintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { char * buf; buf = Param[0]->Val->Pointer; GenericPrintf(Parser, ReturnValue, Param+1, NumArgs-1,buf); ReturnValue->Val->Integer = strlen(buf); }
/* sprintf(): print to a string */ void LibSPrintf(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { struct OutputStream StrStream; StrStream.Putch = &SPutc; StrStream.i.Str.Parser = Parser; StrStream.i.Str.WritePos = Param[0]->Val->Pointer; GenericPrintf(Parser, ReturnValue, Param+1, NumArgs-1, &StrStream); PrintCh(0, &StrStream); ReturnValue->Val->Pointer = *Param; }