Exemple #1
0
 private static void DumpBlock(CharPtr b, uint size, DumpState D)
 {
     if (D.status==0)
      {
       LuaUnlock(D.L);
       D.status=D.writer(D.L,b,size,D.data);
       LuaLock(D.L);
      }
 }
Exemple #2
0
 private static void DumpBlock(CharPtr b, uint size, DumpState D)
 {
     if (D.status == 0)
     {
         LinyeeUnlock(D.L);
         D.status = D.writer(D.L, b, size, D.data);
         LinyeeLock(D.L);
     }
 }
Exemple #3
0
		private static void DumpBlock(CharPtr b, uint size, DumpState D)
		{
		 if (D.status==0)
		 {
		  lua_unlock(D.L);
		  D.status=D.writer(D.L,b,size,D.data);
		  lua_lock(D.L);
		 }
		}
Exemple #4
0
        private static void DumpBlock(object b, uint size, DumpState D)           //FIXME:b as array
        {
            Array array = b as Array;

            Debug.Assert(array.Length == size);
            List <char[]> arrB    = new List <char[]>();
            int           arrBLen = 0;

            for (int i = 0; i < size; i++)
            {
                object b_    = array.GetValue(i);
                int    size_ = Marshal.SizeOf(b_);
                IntPtr ptr   = Marshal.AllocHGlobal(size_);
                Marshal.StructureToPtr(b_, ptr, false);
                byte[] bytes = new byte[size_];
                Marshal.Copy(ptr, bytes, 0, size_);
                char[] ch = new char[bytes.Length];
                for (int i_ = 0; i_ < bytes.Length; i_++)
                {
                    ch[i_] = (char)bytes[i_];
                }
                arrB.Add(ch);
                arrBLen += ch.Length;
            }
            char[] strB = new char[arrBLen];
            int    pos  = 0;

            for (int i = 0; i < arrB.Count; ++i)
            {
                for (int i_ = 0; i_ < arrB[i].Length; i_++)
                {
                    strB[pos + i_] = (char)arrB[i][i_];
                }
                pos += arrB[i].Length;
            }
            CharPtr b__    = strB;
            uint    size__ = (uint)strB.Length;

            if (D.status == 0 && size > 0)
            {
                lua_unlock(D.L);
                D.status = D.writer(D.L, b__, size__, D.data);
                lua_lock(D.L);
            }
        }
Exemple #5
0
        private static void DumpBlock(object b, DumpState D)           //FIXME:b as not array
        {
            object b_    = b;
            int    size_ = Marshal.SizeOf(b_);
            IntPtr ptr   = Marshal.AllocHGlobal(size_);

            Marshal.StructureToPtr(b_, ptr, false);
            byte[] bytes = new byte[size_];
            Marshal.Copy(ptr, bytes, 0, size_);
            char[] ch = new char[bytes.Length];
            for (int i_ = 0; i_ < bytes.Length; i_++)
            {
                ch[i_] = (char)bytes[i_];
            }
            CharPtr b__    = ch;
            uint    size__ = (uint)ch.Length;

            if (D.status == 0 && size__ > 0)
            {
                lua_unlock(D.L);
                D.status = D.writer(D.L, b__, size__, D.data);
                lua_lock(D.L);
            }
        }