コード例 #1
0
 protected int write(ref dll.args arg, byte[] src)
 {
     if (src.Length > arg.buffsz)
     {
         return(dll.OOM);
     }
     Marshal.Copy(src, 0, arg.buff, src.Length);
     return(src.Length);
 }
コード例 #2
0
 protected int read(ref dll.args arg, out int val)
 {
     val = 0;
     if (arg.buffsz < sizeof(int))
     {
         return(dll.ERROR);
     }
     val = BitConverter.ToInt32(read(ref arg), 0);
     return(arg.buffsz);
 }
コード例 #3
0
 protected int read(ref dll.args arg, out bool val)
 {
     val = false;
     if (arg.buffsz < 1)
     {
         return(dll.ERROR);
     }
     val = BitConverter.ToBoolean(read(ref arg), 0);
     return(arg.buffsz);
 }
コード例 #4
0
 protected int read(ref dll.args arg, out float val)
 {
     val = 0.0f;
     if (arg.buffsz < sizeof(float))
     {
         return(dll.ERROR);
     }
     val = BitConverter.ToSingle(read(ref arg), 0);
     return(arg.buffsz);
 }
コード例 #5
0
 protected int read(ref dll.args arg, out byte[] val)
 {
     val = read(ref arg);
     return(arg.buffsz);
 }
コード例 #6
0
 private byte[] read(ref dll.args arg)
 {
     byte[] ret = new byte[arg.buffsz];
     Marshal.Copy(arg.buff, ret, 0, ret.Length);
     return(ret);
 }
コード例 #7
0
 protected int write(ref dll.args arg, int val)
 {
     byte[] src = BitConverter.GetBytes(val);
     return(write(ref arg, src));
 }
コード例 #8
0
        private static int decode_cb(ref dll.args arg)
        {
            wire obj = uds[arg.ud];

            return(obj._decode_field(ref arg));
        }
コード例 #9
0
 protected abstract int _decode_field(ref dll.args arg);