Subversion Repositories Kolibri OS

Rev

Rev 5576 | Rev 5591 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5576 Rev 5582
Line 176... Line 176...
176
    $stosb
176
    $stosb
177
    $test al,al
177
    $test al,al
178
    $jnz L2
178
    $jnz L2
179
}
179
}
Line 180... Line 180...
180
 
180
 
181
:inline dword strncpy(dword text1, text2, signed len)
181
inline dword strncpy(dword text1, text2, signed len)
182
	signed o1,o2;
182
	signed o1,o2;
183
{
183
{
184
	if(!text1)||(!len) return text1;
184
	if(!text1)||(!len) return text1;
185
	if(len<4)
185
	if(len<4)
Line 235... Line 235...
235
    }while(AL!=0);
235
    }while(AL!=0);
236
    DSBYTE[ESI] = '\0';
236
    DSBYTE[ESI] = '\0';
237
}
237
}
238
*/
238
*/
Line 239... Line 239...
239
 
239
 
240
byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
240
inline byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
241
inline void strltrim(dword text){
241
inline void strltrim(dword text){
242
	int s;
242
	int s;
243
	dword back_text;
243
	dword back_text;
244
	back_text = text;
244
	back_text = text;
Line 449... Line 449...
449
LS2: XOR EAX, EAX
449
LS2: XOR EAX, EAX
450
LS3:
450
LS3:
451
  }
451
  }
452
}
452
}
Line 453... Line 453...
453
 
453
 
454
dword strcmpi(dword cmp1, cmp2)
454
inline dword strcmpi(dword cmp1, cmp2)
455
{
455
{
Line 456... Line 456...
456
    char si, ue;
456
    char si, ue;
457
 
457
 
Line 468... Line 468...
468
        if (DSBYTE[cmp1]=='\0') return -1;
468
        if (DSBYTE[cmp1]=='\0') return -1;
469
        if (DSBYTE[cmp2]=='\0') return 1;
469
        if (DSBYTE[cmp2]=='\0') return 1;
470
    }
470
    }
471
}
471
}
Line 472... Line 472...
472
 
472
 
473
dword strstri(dword searchin, usestr_s)
473
inline dword strstri(dword searchin, usestr_s)
474
{
474
{
475
    dword usestr_e = usestr_s;
475
    dword usestr_e = usestr_s;
Line 476... Line 476...
476
    char si, ue;
476
    char si, ue;
Line 487... Line 487...
487
    }
487
    }
488
    return 0;
488
    return 0;
489
}
489
}
Line 490... Line 490...
490
 
490
 
491
 
491
 
492
unsigned int strcpyb(dword search_in, copyin, startstr, endstr)
492
inline unsigned int strcpyb(dword search_in, copyin, startstr, endstr)
493
{
493
{
494
    dword startp, endp;
494
    dword startp, endp;
495
    dword copyin_start_off = copyin;
495
    dword copyin_start_off = copyin;
Line 660... Line 660...
660
	}
660
	}
661
	ESBYTE[p] = 0;
661
	ESBYTE[p] = 0;
662
	return ret;
662
	return ret;
663
}
663
}
Line 664... Line 664...
664
 
664
 
665
:inline fastcall itoa_(signed int EDI, ESI)
665
inline fastcall itoa_(signed int EDI, ESI)
666
{
666
{
667
    $pusha
667
    $pusha
668
    EBX = EDI;
668
    EBX = EDI;
669
    ECX = 10;
669
    ECX = 10;
Line 693... Line 693...
693
 
693
 
694
    $popa
694
    $popa
695
    return EBX;
695
    return EBX;
Line 696... Line 696...
696
} 
696
} 
697
 
697
 
698
:inline dword memchr(dword s,int c,signed len)
698
inline dword memchr(dword s,int c,signed len)
699
{
699
{
700
	if(!len) return NULL;
700
	if(!len) return NULL;
701
	do {
701
	do {
702
		if(DSBYTE[s] == c) return s;
702
		if(DSBYTE[s] == c) return s;
703
		$inc s
703
		$inc s
704
		$dec len
704
		$dec len
705
	} while(len);
705
	} while(len);
Line 706... Line 706...
706
	return NULL;
706
	return NULL;
707
}
707
}
708
 
708
 
709
:inline dword strdup(dword text)
709
inline dword strdup(dword text)
710
{
710
{
711
    dword l = strlen(text);
711
    dword l = strlen(text);
712
    dword ret = malloc(l+1);
712
    dword ret = malloc(l+1);
713
	if(!ret) return NULL;
713
	if(!ret) return NULL;
Line 714... Line 714...
714
    strncpy(ret,text,l);
714
    strncpy(ret,text,l);
715
    return ret;
715
    return ret;
716
}
716
}
Line 717... Line 717...
717
 
717
 
718
:inline dword strndup(dword str, signed maxlen)
718
inline dword strndup(dword str, signed maxlen)
Line 727... Line 727...
727
		DSBYTE[len+copy] = '\0';
727
		DSBYTE[len+copy] = '\0';
728
	}
728
	}
729
	return copy;
729
	return copy;
730
}
730
}
Line -... Line 731...
-
 
731
 
-
 
732
inline dword hexdec(dword text)
-
 
733
{
-
 
734
	char s;
-
 
735
	dword ret,l;
-
 
736
	//l = strlen(text);
-
 
737
	ret = 0;
-
 
738
	s = DSBYTE[text];
-
 
739
	//if(l==6) 
-
 
740
	while(s)
-
 
741
	{	
-
 
742
		ret <<= 4;
-
 
743
		if(s>='A')&&(s<='F')ret |= s-'A'+10;
-
 
744
		else if(s>='a')&&(s<='f')ret |= s-'a'+10;
-
 
745
		else if(s>='0')&&(s<='9')ret |= s-'a'+10;
-
 
746
		text++;
-
 
747
		s = DSBYTE[text];
-
 
748
	}
-
 
749
	/*else if(l==3) while(s)
-
 
750
	{	
-
 
751
		ret <<= 4;
-
 
752
		if(s>='A')&&(s<='F')ret |= s-'A'+10;
-
 
753
		else if(s>='a')&&(s<='f')ret |= s-'a'+10;
-
 
754
		else if(s>='0')&&(s<='9')ret |= s-'a'+10;
-
 
755
		text++;
-
 
756
		s = DSBYTE[text];
-
 
757
	}*/
-
 
758
	return ret;
-
 
759
}
731
 
760
 
732
:inline cdecl int sprintf(dword buf, format,...)
761
inline cdecl int sprintf(dword buf, format,...)
733
{
762
{
734
	byte s;
763
	byte s;
735
	char X[10];
764
	char X[10];
736
	dword ret, tmp, l;
765
	dword ret, tmp, l;
Line 811... Line 840...
811
	END_FUNC_SPRINTF:
840
	END_FUNC_SPRINTF:
812
	DSBYTE[buf] = 0;
841
	DSBYTE[buf] = 0;
813
	return buf-ret;
842
	return buf-ret;
814
}
843
}
Line 815... Line 844...
815
 
844
 
816
void debugi(dword d_int)
845
inline void debugi(dword d_int)
817
{
846
{
818
    char tmpch[12];
847
    char tmpch[12];
819
    itoa_(#tmpch, d_int);
848
    itoa_(#tmpch, d_int);
820
    debugln(#tmpch);
849
    debugln(#tmpch);