1 /**************************************************************************
3 **************************************************************************/
10 /**************************************************************************
12 **************************************************************************/
13 unsigned int sleep(unsigned int secs
)
17 for (tmo
= currticks()+secs
*TICKS_PER_SEC
; currticks() < tmo
; ) {
22 /**************************************************************************
23 INET_ATON - Convert an ascii x.x.x.x to binary form
24 **************************************************************************/
25 int inet_aton ( const char *cp
, struct in_addr
*inp
) {
27 const char *digits_start
;
31 for(j
= 0; j
<= 3; j
++) {
33 val
= strtoul(p
, ( char ** ) &p
, 10);
34 if ((p
== digits_start
) || (val
> 255)) return 0;
35 if ( ( j
< 3 ) && ( *(p
++) != '.' ) ) return 0;
39 inp
->s_addr
= htonl(ip
);
45 int isspace ( int c
) {
59 unsigned long strtoul ( const char *p
, char **endp
, int base
) {
60 unsigned long ret
= 0;
63 while ( isspace ( *p
) )
71 if ( ( *p
| 0x20 ) == 'x' ) {
80 if ( charval
>= 'a' ) {
81 charval
= ( charval
- 'a' + 10 );
82 } else if ( charval
>= 'A' ) {
83 charval
= ( charval
- 'A' + 10 );
85 charval
= ( charval
- '0' );
87 if ( charval
>= ( unsigned int ) base
)
89 ret
= ( ( ret
* base
) + charval
);