static public int ungetc(sbyte c, FILE *File) { var Stream = File->GetStream(); Stream.ungetc(c); return(c); }
static public int putc(int c, FILE *File) { var Stream = File->GetStream(); Stream.WriteByte((byte)c); return(c); }
static public int fclose(FILE *stream) { var Stream = stream->GetStream(); Stream.Close(); stream->FreeStream(); CAlloc.free(stream); return(0); }
static public int fwrite(sbyte *ptr, int size, int count, FILE *File) { var Stream = File->GetStream(); var DataToWrite = CLibUtils.GetBytesFromPointer(ptr, size * count); Stream.Write(DataToWrite, 0, DataToWrite.Length); return(DataToWrite.Length); }
static public int fread(sbyte *ptr, int size, int count, FILE *stream) { var Stream = stream->GetStream(); var DataToRead = new byte[size * count]; int ReadedCount = Stream.Read(DataToRead, 0, DataToRead.Length); CLibUtils.PutBytesToPointer(ptr, ReadedCount, DataToRead); return(ReadedCount); }
public override void on_key(int x, int y, uint key, uint flags) { if (key == ' ') { FILE *fd = fopen(full_file_name("coord"), "w"); fprintf(fd, "%.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f", m_curve1.x1(), m_curve1.y1(), m_curve1.x2(), m_curve1.y2(), m_curve1.x3(), m_curve1.y3(), m_curve1.x4(), m_curve1.y4()); fclose(fd); } }
static public int getc(FILE *File) { var Stream = File->GetStream(); return(Stream.ReadByte()); }
static public int fseek(FILE *stream, int offset, int origin) { var Stream = stream->GetStream(); return((int)Stream.Seek((long)offset, (SeekOrigin)origin)); }
static public int ftell(FILE *stream) { var Stream = stream->GetStream(); return((int)Stream.Position); }