Ejemplo n.º 1
0
        static public int ungetc(sbyte c, FILE *File)
        {
            var Stream = File->GetStream();

            Stream.ungetc(c);
            return(c);
        }
Ejemplo n.º 2
0
        static public int putc(int c, FILE *File)
        {
            var Stream = File->GetStream();

            Stream.WriteByte((byte)c);
            return(c);
        }
Ejemplo n.º 3
0
        static public int fclose(FILE *stream)
        {
            var Stream = stream->GetStream();

            Stream.Close();
            stream->FreeStream();
            CAlloc.free(stream);

            return(0);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
        static public int getc(FILE *File)
        {
            var Stream = File->GetStream();

            return(Stream.ReadByte());
        }
Ejemplo n.º 8
0
        static public int fseek(FILE *stream, int offset, int origin)
        {
            var Stream = stream->GetStream();

            return((int)Stream.Seek((long)offset, (SeekOrigin)origin));
        }
Ejemplo n.º 9
0
        static public int ftell(FILE *stream)
        {
            var Stream = stream->GetStream();

            return((int)Stream.Position);
        }