Advertisement
Kitomas

fstr.h

Jul 21st, 2023
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | Source Code | 0 0
  1. //calling outside main thread is not recommended
  2. #ifndef _FSTR_H
  3. #define _FSTR_H
  4.  
  5.  
  6.  
  7. #ifndef FSTR_LEN
  8. # define FSTR_LEN 2048
  9. #endif
  10. #if FSTR_LEN < 2
  11. #  error "length of fstr_ cannot be less than 2"
  12. #endif
  13.  
  14. #include <stdarg.h>
  15. #include <stdio.h>
  16. extern char fstr_[FSTR_LEN];
  17. extern char* fstr(const char* fmt, ...);
  18.  
  19.  
  20. #ifndef FSTR_NO_WCHAR
  21. #ifndef FSTRW_LEN
  22. # define FSTRW_LEN 1024
  23. #endif
  24. #if FSTRW_LEN < 2
  25. #  error "length of fstrw_ cannot be less than 2"
  26. #endif
  27.  
  28. #include <wchar.h>
  29. wchar_t fstrw_[FSTRW_LEN];
  30. wchar_t* fstrw(const wchar_t* fmt, ...);
  31. #endif /* FSTR_NO_WCHAR */
  32.  
  33.  
  34.  
  35. #endif /* _FSTR_H */
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement