Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.4.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
2.79 Mб
Скачать

Miscellaneous Library Functions

11.10strilib.c

There are three functions, stricmp(), strnicmp(), and stristr(), that are implemented in strilib.c. They each perform case-independent string comparisons. They behave just like strcmp(), strncmp(), and strstr(), taking the same arguments and returning the same results, with the exception that each character of each string is converted to lowercase before being compared. The strings passed to these functions are not modified.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

11-31

Miscellaneous Library Functions

11.11strlib.c

The strlib.c file contains implementations of the following standard C string functions:

strcat()

strchr()

strcmp()

strcpy()

strlen()

strncmp()

strncpy()

strstr().

If your C libraries do not include these functions, they may be included from the strlib.c file by defining the macro INICHE_LIBS in your ipport.h file, and configuring which particular functions you require in the in_utils.h file.

11-32

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B

Miscellaneous Library Functions

11.12tcp_echo.c

The functions within the tcp_echo.c file implement a menus interface to the TCP echo mechanism, which is useful for testing purposes.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

11-33

Miscellaneous Library Functions

11.13ttyio.c

This file contains an implementation of the dprintf() function that can be used to send debug output by way of a UART driver. The dprintf() function supports the following formatting characters:

%x

unsigned hex

%d

signed decimal

%u

unsigned decimal

%c

character

%s

null-terminated string

%p

unsigned pointer (same as %x)

%lx

unsigned long hex

%ld

unsigned long decimal

%lu

unsigned long decimal.

If this file is compiled with FIELDWIDTH defined, %[[-]w][.][p]f formats are understood, where w is the minimum field width and p is the precision, indicating the minimum number of digits to be printed. If w is negative, the field is left adjusted. If w starts with a leading zero, the field is padded using zeros instead of spaces.

This function uses dputchar() to perform output.

11-34

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B