| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef _STRFUNC_H
- #define _STRFUNC_H
- /*
- 把输入的字符串转换成小写。
- 该函数会转换str中的所有大写字母为小写,非大写字母保持不变。
- 遇到'\0'会结束转换,达到了缓冲区长度count也会结束转换
- 输入参数:
- str, 需要转换的字符串指针,
- count, str的缓冲区长度。
- 返回
- str的值
- */
- extern char * otp_strtolower (char *str, int count);
- /*
- 把输入的字符串转换成大写。
- 该函数会转换str中的所有小写字母为大写,非小写字母保持不变。
- 遇到'\0'会结束转换,达到了缓冲区长度count也会结束转换
- 输入参数:
- str, 需要转换的字符串指针,
- count, str的缓冲区长度。
- 返回
- str的值
- */
- extern char * otp_strtoupper (char *str, int count);
- /*
- 向str中打印字符串,最多只打印count-1个字符。
- 如果打印了count-1个字符,则第count个字符为'\0'。
- */
- extern unsigned int otp_snprintf (char *str,unsigned int count, const char *fmt, ...)
- __attribute__((__format__(__printf__,3,4)));
- /*
- 王炯从snprintf.c拷贝过来
- */
- unsigned int otp_vsnprintf (char *str, size_t count, const char *fmt, va_list args);
- #endif
|