private csllbc_Console_SafePrint ( bool toStdout, bool newLine, |
||
toStdout | bool | |
newLine | bool | |
value | ||
valueLen | int | |
return | void |
private static void _Write(bool toStdout, bool newLine, char value) { unsafe { byte *bytes = stackalloc byte[32]; int wrote = Encoding.UTF8.GetBytes(&value, 1, bytes, 32); LLBCNative.csllbc_Console_SafePrint(toStdout, newLine, new IntPtr(bytes), wrote); } }
private static void _SafeOutput(bool toStdout, bool newLine, string content) { byte[] bytes = Encoding.UTF8.GetBytes(content); if (bytes.Length == 0) { LLBCNative.csllbc_Console_SafePrint(toStdout, newLine, IntPtr.Zero, 0); return; } unsafe { fixed(byte *ptr = &bytes[0]) { LLBCNative.csllbc_Console_SafePrint(toStdout, newLine, new IntPtr(ptr), bytes.Length); } } }