C Standard String Library. More...
Defines | |
#define | wsize sizeof(word) |
#define | wmask (wsize - 1) |
Typedefs | |
typedef long | word |
Copy a string. | |
typedef unsigned char | uint8_t |
Functions | |
char * | strdup (const char *str) |
Create a copy of a string. | |
void * | memchr (const void *s, int c, size_t n) |
Locate byte in a memory region. | |
int | memcmp (const void *s1, const void *s2, size_t n) |
Compare memory regions. | |
void * | memcpy (void *dst0, const void *src0, size_t length) |
void * | memset (void *dst, int c, size_t n) |
Fill memory region with a specific byte value. | |
char * | strcat (char *dst, const char *src) |
Concatenate two strings. | |
char * | strchr (const char *p, int ch) |
Locate the first occurrence of a character in a string. | |
int | strcmp (const char *s1, const char *s2) |
Compare two strings. | |
char * | strcpy (char *dst, const char *src) |
Copy a string. | |
int | stricmp (const char *s1, const char *s2) |
Compare two strings, ignoring case. | |
int | strnicmp (const char *s1, const char *s2, size_t n) |
Compare two strings up to a given number of characters and ignoring case. | |
size_t | strlen (const char *str) |
Compute the length of a NUL terminated string. | |
char * | strncat (char *dst, const char *src, size_t n) |
Concatenate two strings up to a given number of characters. | |
int | strncmp (const char *s1, const char *s2, size_t n) |
Compare two strings up to a given number of characters. | |
char * | strncpy (char *dst, const char *src, size_t n) |
Copy a string up to a given number of characters. | |
char * | strrchr (const char *p, int ch) |
Locate the last occurrence of a character in a NUL terminated string. | |
char * | strstr (const char *s, const char *find) |
Locate a substring in a string. | |
char * | strtok (char *s, const char *delim) |
Isolate sequential tokens in a NUL terminated string. | |
char * | strtok_r (char *s, const char *delim, char **last) |
Isolate sequential tokens in a NUL terminated string. |
C Standard String Library.
#define wsize sizeof(word) |
Referenced by memcpy(), and SpiAt45dConfigWrite().
#define wmask (wsize - 1) |
Referenced by memcpy().
typedef long word |
Copy a string.
Copies a source string including the terminating zero character to a destination string.
dst | Pointer to the destination string. |
src | Pointer to the source string. |
typedef unsigned char uint8_t |
char* strdup | ( | const char * | str | ) |
Create a copy of a string.
Allocates sufficient memory from heap for a copy of the string does the copy.
str | Pointer to the string to copy. |
References malloc(), memcpy(), NULL, and strlen().
Referenced by EditHistoryInsert(), EditHistorySet(), emulation_options_parse(), EnvRegisterVariable(), HttpArgParseNext(), HttpArgReadNext(), HttpAuthBasicValidate(), HttpParseHeader(), HttpParseMultipartHeader(), HttpRegisterAuthBasic(), HttpRegisterCgiFunction(), HttpRegisterRedir(), HttpRegisterRootPath(), HttpSessionInfo(), ISC_LIST(), LiLiCreateStringItemCopy(), NutChat(), NutDnsConfig2(), NutFtpProcessCwd(), NutFtpRenamePrepare(), NutHttpProcessRequest(), NutRegisterAuth(), NutRegisterCgi(), NutRegisterCgiBinPath(), NutRegisterFtpUser(), putenv(), setenv(), StreamInfo(), UxmlNodeAddAttrib(), and UxmlParseStream().
void* memchr | ( | const void * | s, |
int | c, | ||
size_t | n | ||
) |
Locate byte in a memory region.
This function locates the first occurrence of a byte in a memory region.
s | Pointer to the start of the memory region. |
c | The byte to search for, converted to an unsigned character. |
n | Number of bytes to search. |
Referenced by _putf().
int memcmp | ( | const void * | s1, |
const void * | s2, | ||
size_t | n | ||
) |
Compare memory regions.
Both memory regions are assumed to be of equal length.
s1 | Pointer to first memory region. |
s2 | Pointer to second memory region. |
n | Number of bytes to compare. |
Referenced by At45dbParamWrite(), At49bvParamWrite(), At91EfcParamWrite(), Avr32FlashcParamWrite(), FLASH_EraseAllPages(), HttpSsiExecHandler(), HttpSsiIncludeHandler(), Lpc17xxIapParamWrite(), NutLoadConfig(), PhatDirRemove(), SnmpOidEquals(), SpiAt45dConfigWrite(), and StreamReadUntilString().
void* memcpy | ( | void * | dst0, |
const void * | src0, | ||
size_t | length | ||
) |
References TLOOP, TLOOP1, wmask, and wsize.
Referenced by AhdlcRx(), AsnBitStringBuild(), AsnBitStringParse(), AsnOctetStringBuild(), AsnOctetStringParse(), At45dbParamRead(), At45dbParamWrite(), At49bvParamWrite(), At49bvSectorRead(), At91EfcParamWrite(), At91EfcSectorRead(), AtCanSetAccCode(), AtCanSetAccMask(), Avr32FlashcParamWrite(), Avr32FlashcSectorRead(), cs8900Init(), CSNicInit(), DiscoveryResponder(), DS1307RamWrite(), EditHistoryGet(), FATFileRead(), FeederThread(), FLASH_EraseAllPages(), GetParentPath(), HttpArgParseNext(), HttpSsiEchoHandler(), HttpSsiExecHandler(), LcpTxProtRej(), Lpc17xxIapParamWrite(), Lpc17xxIapSectorRead(), main(), Mma745xInit(), NicInit(), NutArpAllocNetBuf(), NutArpCacheUpdate(), NutArpOutput(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutEtherOutput(), NutHeapRootRealloc(), NutIcmpResponse(), NutIpRouteList(), NutMD5Final(), NutMD5Update(), NutNetBufClonePart(), NutNetBufCollect(), NutNetIfConfig2(), NutNetIfSetup(), NutNetLoadConfig(), NutSaveConfig(), NutSmtpLogin(), NutTcpDeviceWrite(), NutTcpOutput(), NutTcpReceive(), NutThreadCreate(), NutUdpReceiveFrom(), NutUdpSendTo(), PapTxAuthReq(), PerCiRead(), PerCiWrite(), PhatDirEntryUpdate(), PhatFileOpen(), PhatFileRead(), PhatFileWrite(), PhatVolMount(), RawFsFileRead(), RawFsFileWrite(), resolve(), SJASetAccCode(), SJASetAccMask(), SnmpMibFind(), SnmpMibRegister(), SnmpPduAddVariable(), SnmpPduCreate(), SnmpSessionOpen(), SpiAt45dConfigRead(), SpiAt45dConfigWrite(), strdup(), StreamClientAccept(), StreamReadUntilString(), Tlv320DacWrite(), UxmlNodeCreate(), VsCodecRead(), VsCodecWrite(), wlandrv_IOCTL(), wlandrv_PutPacket(), X12EepromWrite(), XTeaCryptStr(), and XTeaDecryptStr().
void* memset | ( | void * | dst, |
int | c, | ||
size_t | n | ||
) |
Fill memory region with a specific byte value.
dst | Pointer to the memory region. |
c | Byte value. |
n | Number of bytes. |
Referenced by AceInit(), AhdlcAt91Init(), AhdlcAvrInit(), AsixInit(), AsnOctetStringBuild(), At45dbSendCmd(), AtCanInit(), calloc(), cs8900Init(), CSNicInit(), dbg_calloc(), DmInit(), DS1307RtcSetClock(), EmacInit(), ether_aton(), findenv(), GpioRegisterIrqHandler(), HttpParseHeader(), IDEInit(), IOExpInit(), LancInit(), Lpc17xxEmacInit(), MakePhatName(), NicInit(), NutArpAllocNetBuf(), NutChatCreate(), NutClockSet(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutEtherOutput(), NutFtpOpenSession(), NutHeapRootAllocClear(), NutHttpProcessPostQuery(), NutIpOutput(), NutMD5Final(), NutNetLoadConfig(), NutRegisterCanBus(), NutRegisterLed(), NutRegisterTwiBus(), NutTcpDestroySocket(), NutWinsNameQuery(), opendir(), PcfRtcSetClock(), PhatDirCreate(), PhatDirEntryStatus(), PhatDirOpen(), PhatDirRead(), PhatFileOpen(), PhatVolMount(), RawFsFileOpen(), RawFsMount(), setenv(), SJAInit(), SnmpAgent(), SnmpCommunityCreate(), SnmpViewCreate(), Spi7segInit(), Spi7segPutc(), SpiMmcInit(), StreamClientAccept(), UartAvrInit(), UxmlNodeCreate(), wlandrv_Init(), wlandrv_IOCTL(), wlandrv_PutPacket(), WlanInit(), X12RtcGetAlarm(), X12RtcSetAlarm(), and X12RtcSetClock().
char* strcat | ( | char * | dst, |
const char * | src | ||
) |
Concatenate two strings.
Append a copy of a NUL terminated string to the end of another NUL terminated string.
dst | Pointer to the destination string. |
src | Pointer to the source string. |
Referenced by AllocConcatStrings(), CreateFilePath(), HttpSendRedirection(), MibRegisterSysVars(), NutFtpTransferDirectoryOptions(), and s_vputs().
char* strchr | ( | const char * | p, |
int | ch | ||
) |
Locate the first occurrence of a character in a string.
The terminating NUL character is considered part of the string.
p | Pointer to the string. |
ch | Character to locate. |
References NULL.
Referenced by HttpArgParseNext(), HttpArgReadNext(), HttpArgValueSub(), HttpParseHeader(), HttpSsiExecHandler(), main(), MakePhatName(), NutFtpProcessRequest(), NutHttpProcessRequest(), NutRegisterFtpRoot(), NutSmtpReceiveResponse(), ProcessRequests(), putenv(), and StreamReadUntilChars().
int strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Compare two strings.
The strings are compared lexicographically.
s1 | Pointer to the first string. |
s2 | Pointer to the second string. |
Referenced by EditHistoryInsert(), emulation_options_parse(), findenv(), GetThreadByName(), HttpRegisterAuthBasic(), HttpSsiExecHandler(), LiLiCompareStringItems(), MmCardMount(), NutChatExpect(), NutDeviceLookup(), NutFtpProcessCwd(), NutFtpProcessPass(), NutFtpProcessUser(), NutHttpGetParameter(), NutNetLoadConfig(), NutRegisterCgi(), NutWinsNameQuery(), rename(), RfcTimeParse(), setenv(), SnmpCommunityCreate(), SnmpCommunityFind(), SnmpViewCreate(), SnmpViewFind(), SpiMmcMount(), and VsCodecOpen().
char* strcpy | ( | char * | dst, |
const char * | src | ||
) |
Copy a string.
Copies a source string including the terminating zero character to a destination string.
dst | Pointer to the destination string. |
src | Pointer to the source string. |
Referenced by _putf(), AllocConcatStringLen(), AllocConcatStrings(), AsixInit(), basename(), CreateFilePath(), CreateFullPathName(), dirname(), findenv(), main(), MibRegisterIfVars(), MibRegisterSysVars(), NutFtpTransferDirectoryOptions(), NutLoadConfig(), NutRegisterFtpRoot(), NutRegisterHttpRoot(), opendir(), openlog(), PhatDirRead(), SnmpCommunityCreate(), SnmpViewCreate(), and syslog_header().
int stricmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Compare two strings, ignoring case.
The strings are compared lexicographically. The comparison is done using unsigned characters,
s1 | Pointer to the first string. |
s2 | Pointer to the second string. |
int strnicmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | n | ||
) |
Compare two strings up to a given number of characters and ignoring case.
The strings are compared lexicographically. The comparison is done using unsigned characters,
s1 | Pointer to the first string. |
s2 | Pointer to the second string. |
n | Number of bytes to compare. |
size_t strlen | ( | const char * | str | ) |
Compute the length of a NUL terminated string.
str | Pointer to the string. |
Referenced by _putf(), AllocConcatStringLen(), AllocConcatStrings(), basename(), CreateFilePath(), CreateFullPathName(), dirname(), EditHistoryGet(), EdLineRead(), fputs(), GetParentPath(), HttpArgValueSub(), HttpCgiFunctionHandler(), HttpParseMultipartHeader(), HttpSendError(), HttpSendRedirection(), main(), MibRegisterIfVars(), NutChatSend(), NutDiscoveryAnnTele(), NutEncodeBase64(), NutFtpProcessCwd(), NutFtpProcessRequest(), NutFtpServerSession(), NutFtpTransferDirectoryOptions(), NutHttpURLEncode(), NutLoadConfig(), NutRegisterFtpRoot(), NutRegisterHttpRoot(), NutSaveConfig(), NutSmtpLogin(), NutWinsNameQuery(), opendir(), openlog(), PapTxAuthReq(), PerCiWriteVarList(), PhatDirRead(), ProcessRequests(), s_puts(), s_vputs(), SnmpCommunityCreate(), SnmpViewCreate(), strdup(), StreamReadUntilString(), strstr(), syslog_header(), UxmlNodeCreate(), UxmlParseStream(), vsyslog(), wlandrv_IOCTL(), XTeaCryptStr(), and XTeaDecryptStr().
char* strncat | ( | char * | dst, |
const char * | src, | ||
size_t | n | ||
) |
Concatenate two strings up to a given number of characters.
Append a copy of a NUL terminated string to the end of another NUL terminated string. Appends a copy of the source string including the terminating NUL character, if its length is lower than the given number of characters. Otherwise the destination string is left unterminated.
dst | Pointer to the destination string. |
src | Pointer to the source string. |
n | Number of bytes appended at most. |
int strncmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | n | ||
) |
Compare two strings up to a given number of characters.
The strings are compared lexicographically. The comparison is done using unsigned characters,
s1 | Pointer to the first string. |
s2 | Pointer to the second string. |
n | Number of bytes to compare. |
Referenced by emulation_options_parse(), HttpParseMultipartHeader(), NutHttpAuthValidate(), NutSmtpLogin(), ProcessRequests(), and strstr().
char* strncpy | ( | char * | dst, |
const char * | src, | ||
size_t | n | ||
) |
Copy a string up to a given number of characters.
Copies a source string including the terminating NUL character, if its length is lower than the given number of characters. Otherwise the destination string is left unterminated.
dst | Pointer to the destination string. |
src | Pointer to the source string. |
n | Maximum number of characters to copy. |
Referenced by AllocConcatStringLen(), dirname(), ISC_LIST(), and NutDiscoveryAppConf().
char* strrchr | ( | const char * | p, |
int | ch | ||
) |
Locate the last occurrence of a character in a NUL terminated string.
The terminating NUL character is considered part of the string.
p | Pointer to the string. |
ch | Character to locate. |
References NULL.
Referenced by GetMediaTypeEntry(), GetParentPath(), HttpSessionInfo(), NutHttpAuthValidate(), and NutHttpSendError().
char* strstr | ( | const char * | s, |
const char * | find | ||
) |
Locate a substring in a string.
Finds the first occurrence of a NUL terminated string in another NUL terminated string.
s | Pointer to the string to be searched. |
find | Pointer to the string to look for. |
References NULL, strlen(), and strncmp().
Referenced by HttpSsiProcessFile(), NutSmtpLogin(), and SSDPTask().
char* strtok | ( | char * | s, |
const char * | delim | ||
) |
Isolate sequential tokens in a NUL terminated string.
The tokens are separated in the string by at least one of the characters in the given separator string.
The first time this function is called, the string should be specified. Subsequent calls, wishing to obtain further tokens from the same string, should pass a null pointer instead.
The separator string must be supplied each time, and may change between calls.
s | Pointer to the string to separate. |
delim | Pointer to the separator string. |
References strtok_r().
char* strtok_r | ( | char * | s, |
const char * | delim, | ||
char ** | last | ||
) |
Isolate sequential tokens in a NUL terminated string.
Similar to strtok(), but takes an explicit context argument and thus is reentrant.
s | Pointer to the string to separate. |
delim | Pointer to the separator string. |
last | Used to store the current search context. |
References NULL.
Referenced by strtok().