path.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _TOOLKIT_PATH_H_
  2. #define _TOOLKIT_PATH_H_
  3. #define SLASH '/'
  4. #define BACK_SLASH '\\'
  5. #define MB_SLASH_STR "/"
  6. #define MB_BACK_SLASH_STR "\\"
  7. #define W_SLASH_STR L"/"
  8. #define W_BACK_SLASH_STR L"\\"
  9. #if defined(UNICODE) || defined(_UNICODE)
  10. #define SLASH_STR W_SLASH_STR
  11. #define BACK_SLASH_STR W_BACK_SLASH_STR
  12. #else
  13. #define SLASH_STR MB_SLASH_STR
  14. #define BACK_SLASH_STR MB_BACK_SLASH_STR
  15. #endif
  16. #ifdef _WIN32
  17. #define SPLIT_SLASH BACK_SLASH
  18. #define SPLIT_SLASH_STR BACK_SLASH_STR
  19. #define MB_SPLIT_SLASH_STR MB_BACK_SLASH_STR
  20. #define W_SPLIT_SLASH_STR W_BACK_SLASH_STR
  21. #define LINE_BREAK_STR "\r\n"
  22. #else
  23. #define SPLIT_SLASH SLASH
  24. #define SPLIT_SLASH_STR SLASH_STR
  25. #define MB_SPLIT_SLASH_STR MB_SLASH_STR
  26. #define W_SPLIT_SLASH_STR W_SLASH_STR
  27. #define LINE_BREAK_STR "\n"
  28. #endif
  29. #ifndef _WIN32
  30. #ifndef _MAX_DRIVE
  31. #ifdef PATH_MAX
  32. #define _MAX_PATH PATH_MAX
  33. #else
  34. #define _MAX_PATH 260
  35. #endif //PATH_MAX
  36. #define _MAX_DRIVE 32 /*default is /opt at linux*/
  37. #define _MAX_DIR 256
  38. #define _MAX_FNAME 256
  39. #define _MAX_EXT 256
  40. #endif
  41. #endif //NOT _WIN32
  42. #endif //_TOOLKIT_PATH_H_