示例#1
0
文件: Glk.cs 项目: hackerlank/zlr
        public static void glk_put_string_stream_uni(strid_t str, string s)
        {
            IntPtr buf = StrToUTF32(s);

            try { glk_put_string_stream_uni(str, buf); }
            finally { Marshal.FreeHGlobal(buf); }
        }
示例#2
0
文件: GlkIO.cs 项目: hackerlank/zlr
 protected override void Dispose(bool disposing)
 {
     if (!gstr.IsNull)
     {
         stream_result_t dummy;
         Glk.glk_stream_close(gstr, out dummy);
         gstr = strid_t.Null;
     }
 }
示例#3
0
文件: GlkIO.cs 项目: hackerlank/zlr
        public GlkStream(strid_t gstr)
        {
            if (gstr.IsNull)
            {
                throw new ArgumentNullException("gstr");
            }

            this.gstr = gstr;
        }
示例#4
0
文件: Glk.cs 项目: hackerlank/zlr
        public static uint glk_get_line_stream_uni(strid_t str, StringBuilder sb)
        {
            int    len = sb.Capacity;
            IntPtr buf = Marshal.AllocHGlobal(len * 4);

            try
            {
                uint result = glk_get_line_stream_uni(str, buf, (uint)len * 4);
                StrFromUTF32(buf, sb);
                return(result);
            }
            finally
            {
                Marshal.FreeHGlobal(buf);
            }
        }
示例#5
0
文件: GlkIO.cs 项目: hackerlank/zlr
        private Stream OpenStream(frefid_t fileref, FileMode mode)
        {
            if (fileref.IsNull)
            {
                return(null);
            }

            strid_t gstr = Glk.glk_stream_open_file(fileref, mode, 0);

            if (gstr.IsNull)
            {
                return(null);
            }

            return(new GlkStream(gstr));
        }
示例#6
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_put_buffer_stream(strid_t str, [In] byte[] buf, uint len);
示例#7
0
文件: Glk.cs 项目: hackerlank/zlr
 private static extern void glk_put_string_stream_uni(strid_t str, IntPtr s);
示例#8
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern uint glk_get_buffer_stream_uni(strid_t str, [Out] uint[] buf, uint len);
示例#9
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern int glk_get_char_stream_uni(strid_t str);
示例#10
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_stream_set_position(strid_t str, int pos, SeekMode seekmode);
示例#11
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern uint glk_stream_get_rock(strid_t str);
示例#12
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern strid_t glk_stream_iterate(strid_t str, out uint rockptr);
示例#13
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_stream_close(strid_t str, out stream_result_t result);
示例#14
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_window_set_echo_stream(winid_t win, strid_t str);
示例#15
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_put_buffer_stream_uni(strid_t str, [In] uint[] buf, uint len);
示例#16
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_set_style_stream(strid_t str, Style styl);
示例#17
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern uint glk_stream_get_position(strid_t str);
示例#18
0
文件: Glk.cs 项目: hackerlank/zlr
 private static extern uint glk_get_line_stream_uni(strid_t str, IntPtr buf, uint len);
示例#19
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_stream_set_current(strid_t str);
示例#20
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern uint glk_get_buffer_stream(strid_t str, [Out] byte[] buf, uint len);
示例#21
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_put_char_stream(strid_t str, byte ch);
示例#22
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern BlorbError giblorb_set_resource_map(strid_t file);
示例#23
0
文件: Glk.cs 项目: hackerlank/zlr
 public static extern void glk_put_char_stream_uni(strid_t str, uint ch);