Exemplo n.º 1
0
        public virtual int strcat(TPointer destAddr, TPointer srcAddr)
        {
            if (destAddr.Null || srcAddr.Null)
            {
                return(0);
            }

            int dstLength = AbstractNativeCodeSequence.getStrlen(destAddr.Address);
            int srcLength = AbstractNativeCodeSequence.getStrlen(srcAddr.Address);

            destAddr.memcpy(dstLength, srcAddr.Address, srcLength + 1);

            return(destAddr.Address);
        }
Exemplo n.º 2
0
        public virtual int strncpy(TPointer destAddr, TPointer srcAddr, int size)
        {
            int srcLength = AbstractNativeCodeSequence.getStrlen(srcAddr.Address);

            if (srcLength < size)
            {
                destAddr.memcpy(srcAddr.Address, srcLength + 1);
                destAddr.clear(srcLength + 1, size - srcLength - 1);
            }
            else
            {
                destAddr.memcpy(srcAddr.Address, size);
            }

            return(destAddr.Address);
        }
Exemplo n.º 3
0
 public virtual int strlen(TPointer srcAddr)
 {
     return(AbstractNativeCodeSequence.getStrlen(srcAddr.Address));
 }