Exemplo n.º 1
0
 private static unsafe byte AttConvert_gui(runattinf *b1, runattinf *b2, byte lenth1, byte lenth2)
 {
     if ((b1->attlei != attshulei.Sstr.typevalue) && (b2->attlei == attshulei.Sstr.typevalue))
     {
         if (b2->datafrom != 0xfe)
         {
             myapp.errcode = 0x1b;
             return(0);
         }
         if (lenth1 == 0)
         {
             lenth1 = Strmake.Strmake_GetS32strlen(b1->val);
         }
         if (b2->att.merrylenth <= lenth1)
         {
             lenth1 = (byte)(b2->att.merrylenth - 1);
         }
         Strmake.Strmake_S32ToStr(b1->val, b2->Pz, lenth1, 1);
     }
     else
     {
         if ((b1->attlei == attshulei.Sstr.typevalue) && (b2->attlei != attshulei.Sstr.typevalue))
         {
             b2->val = Strmake.Strmake_StrToS32(b1->Pz, lenth1);
             return(Attmake_SetAtt(b2, b2, 0));
         }
         myapp.errcode = 0x1b;
         return(0);
     }
     return(1);
 }
Exemplo n.º 2
0
    public static unsafe ushort Attmake_GetstrAtt(byte *buf, PosLaction *bufpos, runattinf *att)
    {
        ushort     star    = bufpos->star;
        ushort     num3    = 0;
        ushort     index   = 0;
        PosLaction laction = new PosLaction();

        att->datafrom = 0xff;
        att->isref    = 0;
        if (bufpos->end < bufpos->star)
        {
            myapp.errcode = 0x1a;
            return(0xffff);
        }
        if (buf[star] != 0x22)
        {
            if ((((buf[star] >= 9) || (buf[star] <= 1)) && (buf[star] != 0x2d)) && ((buf[star] <= 0x2f) || (buf[star] >= 0x3a)))
            {
                laction.star = bufpos->star;
                if (Strmake.Strmake_IsAttendbyte(buf[star]) == 1)
                {
                    myapp.errcode = 0x1a;
                    return(0xffff);
                }
                int num = 0;
                while (star <= bufpos->end)
                {
                    num3 = 0;
                    while (star <= bufpos->end)
                    {
                        if (buf[star] < 9)
                        {
                            num3 = (ushort)(num3 + 5);
                            star = (ushort)(star + 5);
                        }
                        if ((num == 0) && (Strmake.Strmake_IsAttendbyte(buf[star]) == 1))
                        {
                            star = (ushort)(star - 1);
                            break;
                        }
                        if (buf[star] == 0x5b)
                        {
                            num++;
                        }
                        else if (buf[star] == 0x5d)
                        {
                            num--;
                        }
                        if (num3 == 0x31)
                        {
                            myapp.errcode = 0x23;
                            return(0xffff);
                        }
                        num3 = (ushort)(num3 + 1);
                        star = (ushort)(star + 1);
                    }
                    if (star > bufpos->end)
                    {
                        star = bufpos->end;
                    }
                    laction.end = star;
                    Attmake_GetAtt(buf, &laction, att);
                    if (att->datafrom == 0xff)
                    {
                        myapp.errcode = 0x1a;
                        return(0xffff);
                    }
                    return(star);
                }
                myapp.errcode = 0x1a;
                return(0xffff);
            }
            if (buf[star] < 9)
            {
                if (buf[star] == 3)
                {
                    Kuozhan.memcpy((byte *)&att->val, buf + (star + 1), 4);
                    att->datafrom       = 0xfd;
                    att->att.merrylenth = 4;
                    att->attlei         = attshulei.SS32.typevalue;
                    att->isxiugai       = 0;
                }
                else if (buf[bufpos->star] == 2)
                {
                    att->datafrom = 0xfc;
                    Kuozhan.memcpy((byte *)&att->att.pos, buf + (bufpos->star + 1), 4);
                    att->att.state = attshulei.Sstr.typevalue;
                    att->isxiugai  = 0;
                }
                else if (buf[bufpos->star] == 4)
                {
                    Sysatt.Sysatt_GetXitongval(buf[bufpos->star + 1], buf[bufpos->star + 2], att);
                }
                return((ushort)(star + 4));
            }
            if (buf[star] == 0x2d)
            {
                star = (ushort)(star + 1);
            }
            while (star <= bufpos->end)
            {
                if ((buf[star] < 0x30) || (buf[star] > 0x39))
                {
                    star = (ushort)(star - 1);
                    break;
                }
                if (star == bufpos->end)
                {
                    break;
                }
                star = (ushort)(star + 1);
            }
        }
        else
        {
            buf[star] = 0;
            star      = (ushort)(star + 1);
            num3      = 0xffff;
            index     = star;
            while (star <= bufpos->end)
            {
                if (buf[star] == 0x5c)
                {
                    if (star == bufpos->end)
                    {
                        myapp.errcode = 0x20;
                        return(0xffff);
                    }
                    star = (ushort)(star + 1);
                    if ((buf[star] == 0x5c) || (buf[star] == 0x22))
                    {
                        buf[index] = buf[star];
                    }
                    else if (buf[star] == 0x72)
                    {
                        buf[index] = 13;
                        index      = (ushort)(index + 1);
                        buf[index] = 10;
                    }
                    else
                    {
                        myapp.errcode = 0x20;
                        return(0xffff);
                    }
                    if (star == bufpos->end)
                    {
                        myapp.errcode = 0x20;
                        return(0xffff);
                    }
                    star  = (ushort)(star + 1);
                    index = (ushort)(index + 1);
                }
                else
                {
                    buf[index] = buf[star];
                    if (buf[star] == 0x22)
                    {
                        buf[index] = 0;
                        num3       = star;
                        break;
                    }
                    star  = (ushort)(star + 1);
                    index = (ushort)(index + 1);
                }
            }
            if (num3 != 0xffff)
            {
                att->att.pos          = (ushort)(bufpos->star + 1);
                att->attlei           = attshulei.Sstr.typevalue;
                att->att.merrylenth   = (ushort)(index - bufpos->star);
                att->datafrom         = 0xfd;
                att->isxiugai         = 0;
                att->Pz               = buf + att->att.pos;
                att->att.encodeh_star = myapp.encodeh_star;
                return(num3);
            }
            myapp.errcode = 0x1a;
            return(0xffff);
        }
        att->val            = Strmake.Strmake_StrToS32(buf + bufpos->star, (byte)((star - bufpos->star) + 1));
        att->datafrom       = 0xfd;
        att->att.merrylenth = 4;
        att->attlei         = attshulei.SS32.typevalue;
        att->isxiugai       = 0;
        return(star);
    }