strfunc.h 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _STRFUNC_H
  2. #define _STRFUNC_H
  3. /*
  4. 把输入的字符串转换成小写。
  5. 该函数会转换str中的所有大写字母为小写,非大写字母保持不变。
  6. 遇到'\0'会结束转换,达到了缓冲区长度count也会结束转换
  7. 输入参数:
  8. str, 需要转换的字符串指针,
  9. count, str的缓冲区长度。
  10. 返回
  11. str的值
  12. */
  13. extern char * otp_strtolower (char *str, int count);
  14. /*
  15. 把输入的字符串转换成大写。
  16. 该函数会转换str中的所有小写字母为大写,非小写字母保持不变。
  17. 遇到'\0'会结束转换,达到了缓冲区长度count也会结束转换
  18. 输入参数:
  19. str, 需要转换的字符串指针,
  20. count, str的缓冲区长度。
  21. 返回
  22. str的值
  23. */
  24. extern char * otp_strtoupper (char *str, int count);
  25. /*
  26. 向str中打印字符串,最多只打印count-1个字符。
  27. 如果打印了count-1个字符,则第count个字符为'\0'。
  28. */
  29. extern unsigned int otp_snprintf (char *str,unsigned int count, const char *fmt, ...)
  30. __attribute__((__format__(__printf__,3,4)));
  31. /*
  32. 王炯从snprintf.c拷贝过来
  33. */
  34. unsigned int otp_vsnprintf (char *str, size_t count, const char *fmt, va_list args);
  35. #endif