⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 string.h

📁 HID汽车大灯安定器,应用现在的安定器上,有多种保护功能
💻 H
📖 第 1 页 / 共 3 页
字号:
 *
 * ``The first call in the sequence searches the string pointed to
 * by {\bf s1} for the first character that is {\it not} contained in
 * the current separator string {\bf s2}. If no such character is found,
 * then there are no tokens in the string pointed to by {\bf s1} and the
 * {\bf strtok} function returns a null pointer. If such a character is
 * found, it is the start of the first token.
 *
 * ``The {\bf strtok} function then searches from there for a character
 * that {\it is} contained in the current separator string. If no such
 * character is found, the current token extends to the end of the
 * string pointed to by {\bf s1}, and subsequent searches for a token
 * will return a null pointer. If such a character is found, it is
 * overwritten by a null character, which terminates the current token.
 * The {\bf strtok} function saves a pointer to the following character,
 * from which the next search for a token will start.
 *
 * ``Each subsequent call, with a null pointer as the first argument, 
 * starts searching from the saved pointer and behaves as described
 * above.
 *
 * ``The implementation shall behave as if no library function calls the
 * {\bf strtok} function.
 *
 * ``This function is implemented in C, is not re-entrant and calls the
 * functions: strspn, strpbrk, memchr.''
 *
 * @param s1 pointer to a string to begin searching, or null to continue
 * searching a prior string
 * @param s2 pointer to a string containing the set of separator characters
 * @return ``The {\bf strtok} function returns a pointer to the first
 * character of a token, or a null pointer if there is no token.'' 
 */
char *strtok (auto char *s1, auto const char *s2);

/** @name memset
 * ``The {\bf memset} function copies the value of {\bf c} [...] into
 * each of the first {\bf n} characters of the object pointed to by
 * {\bf s}.''
 *
 * The MPLAB-C18 version of the {\bf memset} function differs from the ANSI
 * specified function in that {\bf c} is defined as an {\bf unsigned char}
 * parameter rather than an {\bf int} parameter.
 * Stack usage: 5 bytes. Re-entrant.
 * @param s pointer to object
 * @param c character to copy into object
 * @param n number of bytes of object to copy {\bf c} into
 * @return ``The {\bf memset} function returns the value of {\bf s}.''
 */
void *memset (auto void *s, auto unsigned char c, auto size_t n);

/** @name strerror
 * ``The {\bf strerror} function maps the error number in {\bf errnum} to
 * an error message string.
 *
 * ``The implementation shall behave as if no library function calls the
 * {\bf strerror} function.''
 *
 * MPLAB-C18 currently defines the {\bf strerror} function to return
 * an empty string for all values of {\bf errnum}. Future versions may
 * implement this function in a more meaningful manner.
 * @param errnum error number
 * @return ``The {\bf strerror} function returns a pointer to the string,
 * the contents of which are implmentation defined. The array pointed to
 * shall not be modified by the program, but may be overwritten by a
 * subsequent call to the {\bf strerror} function.''
 */
#define strerror(n) ((n),"")

/** @name strlen
 * ``The {\bf strlen} function computes the length of the string pointed
 * to by {\bf s}.''
 * Stack usage: 2 bytes. Re-entrant.
 * @param s pointer to the string
 * @return ``The {\bf strlen} function returns the number of characters
 * that precede the terminating null character.''
 */
size_t strlen (auto const char *s);

/** @name strupr
 * The {\bf strupr} function converts each lower case character in the
 * string pointed to by {\bf s} to the corresponding upper case character.
 * Stack usage: 2 bytes. Re-entrant.
 * @param s pointer to string
 * @return The {\bf strupr} function returns the value of {\bf s}.
 */
char *strupr (auto char *s);

/** @name strlwr
 * The {\bf strlwr} function converts each upper case character in the
 * string pointed to by {\bf s} to the corresponding lower case character.
 * Stack usage: 2 bytes. Re-entrant.
 * @param s pointer to string
 * @return The {\bf strlwr} function returns the value of {\bf s}.
 */
char *strlwr (auto char *s);



/* The versions which deal with program memory data */
/** @name memcpypgm
 * The {\bf memcpypgm} function performs a {\bf memcpy} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in program memory
 * @param n number of characters to copy
 */
MEM_MODEL rom void *memcpypgm (auto MEM_MODEL rom void *s1, auto const MEM_MODEL rom void *s2, auto sizerom_t n);

/** @name memcpypgm2ram
 * The {\bf memcpypgm2ram} function performs a {\bf memcpy} where
 * {\bf s1} points to data memory and {\bf s2} points to program
 * memory.
 * @param s1 pointer to destination in data memory
 * @param s2 pointer to source in program memory
 * @param n number of characters to copy
 */
void *memcpypgm2ram (auto void *s1, auto const MEM_MODEL rom void *s2, auto sizeram_t n);

/** @name memcpyram2pgm
 * The {\bf memcpyram2pgm} function performs a {\bf memcpy} where {\bf s1} 
 * points to program memory and {\bf s2} point to data memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in data memory
 * @param n number of characters to copy
 */
MEM_MODEL rom void *memcpyram2pgm (auto MEM_MODEL rom void *s1, auto const void *s2, auto sizeram_t n);

/** @name memmovepgm
 * The {\bf memmovepgm} function performs a {\bf memmove} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in program memory
 * @param n number of characters to copy
 */
MEM_MODEL rom void *memmovepgm (auto MEM_MODEL rom void *s1, auto const MEM_MODEL rom void *s2, auto sizerom_t n);

/** @name memmovepgm2ram
 * The {\bf memmovepgm2ram} function performs a {\bf memmove} where
 * {\bf s1} points to data memory and {\bf s2} points to program
 * memory.
 * @param s1 pointer to destination in data memory
 * @param s2 pointer to source in program memory
 * @param n number of characters to copy
 */
void *memmovepgm2ram (auto void *s1, auto const MEM_MODEL rom void *s2, auto sizeram_t n);

/** @name memmoveram2pgm
 * The {\bf memmoveram2pgm} function performs a {\bf memmove} where {\bf s1} 
 * points to program memory and {\bf s2} point to data memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in data memory
 * @param n number of characters to copy
 */
MEM_MODEL rom void *memmoveram2pgm (auto MEM_MODEL rom void *s1, auto const void *s2, auto sizeram_t n);

/** @name strcpypgm
 * The {\bf strcpypgm} function performs a {\bf strcpy} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in program memory
 */
MEM_MODEL rom char *strcpypgm (auto MEM_MODEL rom char *s1, auto const MEM_MODEL rom char *s2);

/** @name strcpypgm2ram
 * The {\bf strcpypgm2ram} function performs a {\bf strcpy} where
 * {\bf s1} points to data memory and {\bf s2} points to program
 * memory.
 * @param s1 pointer to destination in data memory
 * @param s2 pointer to source in program memory
 */
char *strcpypgm2ram (auto char *s1, auto const MEM_MODEL rom char *s2);

/** @name strcpyram2pgm
 * The {\bf strcpyram2pgm} function performs a {\bf strcpy} where {\bf s1} 
 * points to program memory and {\bf s2} point to data memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in data memory
 */
MEM_MODEL rom char *strcpyram2pgm (auto MEM_MODEL rom char *s1, auto const char *s2);

/** @name strncpypgm
 * The {\bf strncpypgm} function performs a {\bf strncpy} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in program memory
 * @param n maximum number of characters to copy
 */
MEM_MODEL rom char *strncpypgm (auto MEM_MODEL rom char *s1, auto const MEM_MODEL rom char *s2, auto sizerom_t n);

/** @name strncpypgm2ram
 * The {\bf strncpypgm2ram} function performs a {\bf strncpy} where
 * {\bf s1} points to data memory and {\bf s2} points to program
 * memory.
 * @param s1 pointer to destination in data memory
 * @param s2 pointer to source in program memory
 * @param n maximum number of characters to copy
 */
char *strncpypgm2ram (auto char *s1, auto const MEM_MODEL rom char *s2, auto sizeram_t n);

/** @name strncpyram2pgm
 * The {\bf strncpyram2pgm} function performs a {\bf strncpy} where {\bf s1} 
 * points to program memory and {\bf s2} point to data memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in data memory
 * @param n maximum number of characters to copy
 */
MEM_MODEL rom char *strncpyram2pgm (auto MEM_MODEL rom char *s1, auto const char *s2, auto sizeram_t n);

/** @name strcatpgm
 * The {\bf strcatpgm} function performs a {\bf strcat} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in program memory
 */
MEM_MODEL rom char *strcatpgm (auto MEM_MODEL rom char *s1, auto const MEM_MODEL rom char *s2);

/** @name strcatpgm2ram
 * The {\bf strcatpgm2ram} function performs a {\bf strcat} where
 * {\bf s1} points to data memory and {\bf s2} points to program
 * memory.
 * @param s1 pointer to destination in data memory
 * @param s2 pointer to source in program memory
 */
char *strcatpgm2ram (auto char *s1, auto const MEM_MODEL rom char *s2);

/** @name strcatram2pgm
 * The {\bf strcatram2pgm} function performs a {\bf strcat} where {\bf s1} 
 * points to program memory and {\bf s2} point to data memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in data memory
 */
MEM_MODEL rom char *strcatram2pgm (auto MEM_MODEL rom char *s1, auto const char *s2);

/** @name strncatpgm
 * The {\bf strncatpgm} function performs a {\bf strncat} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in program memory
 * @param n maximum number of characters to copy
 */
MEM_MODEL rom char *strncatpgm (auto MEM_MODEL rom char *s1, auto const MEM_MODEL rom char *s2, auto sizerom_t n);

/** @name strncatpgm2ram
 * The {\bf strncatpgm2ram} function performs a {\bf strncat} where
 * {\bf s1} points to data memory and {\bf s2} points to program
 * memory.
 * @param s1 pointer to destination in data memory
 * @param s2 pointer to source in program memory
 * @param n maximum number of characters to copy
 */
char *strncatpgm2ram (auto char *s1, auto const MEM_MODEL rom char *s2, auto sizeram_t n);

/** @name strncatram2pgm
 * The {\bf strncatram2pgm} function performs a {\bf strncat} where {\bf s1} 
 * points to program memory and {\bf s2} point to data memory.
 * @param s1 pointer to destination in program memory
 * @param s2 pointer to source in data memory
 * @param n maximum number of characters to copy
 */
MEM_MODEL rom char *strncatram2pgm (auto MEM_MODEL rom char *s1, auto const char *s2, auto sizeram_t n);

/** @name memcmppgm
 * The {\bf memcmppgm} function performs a {\bf memcmp} where both
 * {\bf s1} and {\bf s2} point to program memory.
 * @param s1 pointer to string in program memory
 * @param s2 pointer to string in program memory
 * @param n number of characters to compare
 */
signed char memcmppgm (auto MEM_MODEL rom void *s1, auto const MEM_MODEL rom void *s2, auto sizerom_t n);

/** @name memcmppgm2ram

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -