static void secret_function(struct ParseState *Parser,
		struct Value *ReturnValue, struct Value **Param, int NumArgs)
{

	(void) ReturnValue;
	(void) NumArgs;
	(void) Param;
	char * p = script_buffer;
	size_t counter = 0;

//self while loop with reading lines.... until another secret sequence or eof
	PlatformPrintf(Parser->pc,
			"disabling shell and starting write raw data to buffer\n");
	char c = PlatformGetCharacter(Parser->pc);

	while ((c != 0x3) && (c != 0x1a))
	{
		*p = c;
		p++;
		counter++;
		c = PlatformGetCharacter(Parser->pc);
	}
	*p = 0;

	PlatformPrintf(Parser->pc, "memory usage: %d percent (%d of %d bytes)\n",
			100*counter / sizeof(script_buffer), counter, sizeof(script_buffer));
	PlatformPrintf(Parser->pc, "data reading finished, returning to shell\n");

}
示例#2
0
文件: clibrary.c 项目: fjrti/remix
void LibGetc(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
{
    ReturnValue->Val->Integer = PlatformGetCharacter();
}