?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* platform.h - declarations for "platform.c".
  2.  
  3.    This is free and unencumbered software released into the public domain.
  4.    For more information, please refer to <http://unlicense.org>. */
  5.  
  6. #ifndef _PLATFORM_H_INCLUDED
  7. #define _PLATFORM_H_INCLUDED
  8.  
  9. #include "defs.h"
  10.  
  11. #include <stdbool.h>
  12.  
  13. #if defined (_WIN32) || defined(_WIN64)
  14. # define PATHSEP '\\'
  15. # define PATHSEPSTR "\\"
  16. #else
  17. # define PATHSEP '/'
  18. # define PATHSEPSTR "/"
  19. #endif
  20.  
  21. // Returns "true" on success.
  22. bool check_path_abs (const char *path);
  23.  
  24. // Returns string on success and "NULL" on fail. Check "errno" on fail.
  25. // Result must be freed by caller.
  26. char *resolve_full_path (const char *path);
  27.  
  28. // Returns "true" on success. Check "errno" on fail.
  29. bool check_path_exists (const char *path);
  30.  
  31. // Returns "true" on success. Check "errno" on fail.
  32. bool check_file_exists (const char *path);
  33.  
  34. // Returns string on success and "NULL" on fail. Check "errno" on fail.
  35. // Result must be freed by caller.
  36. char *get_current_dir (void);
  37.  
  38. // Returns string on success and "NULL" on fail. Check "errno" on fail.
  39. // Result must be freed by caller.
  40. char *get_dir_name (const char *path);
  41.  
  42. #endif  // !_PLATFORM_H_INCLUDED
  43.