Include | #include <string.h> |
---|---|
Header | {z88dk}/include/_DEVELOPMENT/sccz80/string.h |
{z88dk}/include/_DEVELOPMENT/sdcc/string.h |
Other references:
NULL | ((void*)(0)) | pointer to nothing |
---|
size_t | unsigned int |
---|
Same as memmove(dst, src, n)
Copy at most n bytes from memory area src to memory area dst stopping early after the first occurrence of char c is copied.
Returns 0 if char c not seen or a pointer in dst to the char following copied c.
Copy n bytes from memory area src to memory area dst. Behaviour is undefined if the src and dst areas overlap (see memmove for this case). Returns dst.
Copy n bytes from memory area src to memory area dst. The copy completes correctly even if the areas overlap. Returns dst.
At most n chars from string s are copied to memory area p. The terminating NUL in s is not copied to p. Returns pointer to the first char in s not copied to p.
Swap the n bytes in memory areas s1 and s2. Return s1.
Copy string src to string dst and return a pointer to the terminating NUL in dst.
Copy at most n chars from string src to string dst and return a pointer to the first copied NUL in dst or &dst[n] if n was exhausted first. Pad dst with zeroes so that n chars are always written to dst.
Note that dst is not NUL terminated if strlen(src) > = n.
Copy string src to string dst. Return dst.
Allocate sufficient memory from the heap to hold a copy of string s and then copy s into the allocated block. Return a pointer to the allocated memory. This memory must be released with free().
If the allocation fails, 0 is returned, carry flag is set and errno is set to:
Copy at most n chars from string src to string dst where n includes space for a terminating NUL. String dst is always NUL terminated except when n is 0, in which case dst is not modified. Returns strlen(src).
Copy at most n chars from string src to string dst. Pad dst with zeroes so that n bytes are always written to dst. Note that if strlen(src) > = n, dst will not be NUL terminated. Return dst.
Allocate min(n+1, strlen(s)+1) bytes from the heap and then copy at most n chars from string s to the allocated block along with a terminating NUL. Return a pointer to the allocated memory. This memory must be released with free().
If the allocation fails, 0 is returned, carry flag is set and errno is set to:
Append string src to string dst. Returns dst.
Append string src to string dst such that the total length of dst is no more than n chars including terminating NUL. Strinh dst is unaltered if its length is already > = n. Returns strlen(src)+strlen(original dst); this is the total buffer size required of dst to store the entire result of concatenation not including terminating NUL.
Append at most n chars from string src to string dst. String dst is always NUL terminated. Returns dst.
Same as memcmp(s1, s2, n)
Compare at most n bytes of memory area s1 to memory area s2. Return when first differing byte is found with result holding same sign as (*s1-*s2).
Perform caseless compare of string s1 to string s2. Return when first differing char is found with result holding the same sign as (tolower(*s1)-tolower(*s2)).
Compare string s1 to string s2. Return when first differing char is found with result holding the same sign as (*s1-*s2).
Compare string s1 to string s2. Return when first differing char is found with result holding the same sign as (*s1-*s2). Use alternate locale's comparison function to perform the comparison.
Same as strcasecmp(s1, s2)
Perform caseless compare of at most n chars of string s1 to string s2. Return when first differing char is found with result holding the same sign as (tolower(*s1)-tolower(*s2)).
Compare at most n chars of string s1 to string s2. Return when first differing char is found with result holding the same sign as (*s1-*s2).
Same as strncasecmp(s1, s2)
Transform at most n-1 chars from string src according to the alternate locale and write the resulting chars into string dst. If n > 0 string dst is always NUL terminated. Following transformation string dst can be used with C library functions for comparison purposes without having to consider locale. Returns length of resulting string dst.
If dst = 0 the transformation is run but the result string is not written. The return value reflects the length of the would-be result less the terminating NUL char.
Same as strchr(s, c)
Return a pointer to the first occurrence of byte c in the first n bytes of memory area s. Returns 0 if byte c is not found.
Returns pointer to the first occurrence of memory block needle in memory area haystack. If needle_len = 0 returns haystack. If memory area needle is not found or haystack_len < needle_len returns 0.
Return a pointer to the last occurrence of byte c in the first n bytes of memory area s. Returns 0 if byte c is not found.
Returns pointer to the first occurrence of byte c in memory beginning at address mem. The search will examine the entire 64k memory space if needed.
Same as strrchr(s, c)
Return pointer to first occurrence of char c in string s or 0 if char c is not found.
Return pointer to first occurrence of char c in string s or a pointer to the terminating NUL in s if char c is not found.
Return length of prefix of string s1 not containing any chars from string s2.
Return pointer to first occurrence of char c among the first n chars of string s or 0 if char c is not found.
Return pointer to first occurrence of any char from string s2 in string s1. Return 0 if no chars from string s2 can be found in string s1.
Return pointer to last occurrence of char c in string s or 0 if char c is not found.
Returns the number of leading chars in s up to and including the last occurrence in s of a char from set. If set is the empty string, strlen(s) is returned. If no chars from s are found in s, 0 is returned.
Returns the number of leading chars in s up to and including the last occurrence of a char not in set. If set is the empty string, strlen(s) is returned. If all chars of s are in set, returns 0.
If *s is 0, returns 0 and does nothing else. Otherwise finds the first token in the string *s where tokens are delimited by symbols in the string delim. This token is terminated by overwriting the delimiter with a NUL byte and *s is updated to point past the token. In case no delimiter was found the token is taken to be the entire string *s, and *s is made 0.
Note that the empty token (“”) will be returned if two delimiter chars appear in sequence in *s.
Return length of prefix of string s1 containing chars from string s2.
Return pointer in s1 to the first occurrence of string s2. Returns 0 if substring s2 is not found.
Return the next token from the string being traversed using string delim as a list of delimiter chars. If s is not 0 store its address in internal static storage as the string being traversed, otherwise continue using the last stored string.
When looking for the next token first skip over any leading delimiter chars and then take that point as the start of the token. Find the end of the token by looking for the next delimiter char. Overwrite that char with NUL to terminate the token and then store the next address after the NUL in internal storage as the start of the string to use in the next call.
If the end of the internal string is reached so that there are no more tokens, 0 is returned.
Note that this function is not reentrant.
A reentrant version of strtok(). Instead of using an internal static variable to hold the string being scanned, it uses the user-supplied static variable *last_s.
Same as memset(mem, 0, n)
Return bit position of the least significant set bit in i. Bits are numbered from 1 to 16 from the right. If i = 0, return 0.
Return bit position of the least significant set bit in i. Bits are numbered from 1 to 32 from the right. If i = 0, return 0.
(nightly build, sdcc)
Return bit position of the least significant set bit in i. Bits are numbered from 1 to 64 from the right. If i = 0, return 0.
Apply tolower() to the n bytes at address p. Return p.
Fill memory from address s to s+n-1 with char c. Return s.
Apply toupper() to the n bytes at address p. Return p.
Return a string message corresponding to errnum. The string is owned by the library.
Return the length of string s not including its terminating NUL.
Apply tolower() to each char in string s. Return s.
Return min(n, strlen(s)). Does not examine more than n chars in s.
Replace at most the first n chars of string s with c. Return s.
Reverse string s in place. Return s.
Return pointer to first whitespace char of the trailing whitespace chars in s. If s consists entirely of whitespace, return s.
Remove trailing whitespace of s by writing a NUL over the first whitespace char of the trailing whitespace chars in s. If s consists entirely of whitespace, s[0]=0. Return s.
Replace all chars in s with c. Return s.
Return pointer to first non-whitespace char in s.
Apply toupper() to each char in s. Return s.