You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.0 KiB

  1. /*
  2. Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
  3. Permission to use, copy, modify, and/or distribute this software for any
  4. purpose with or without fee is hereby granted, provided that the above
  5. copyright notice and this permission notice appear in all copies.
  6. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  7. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  8. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  9. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  10. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  11. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  12. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  13. */
  14. #ifndef __FS_XATTR_HPP__
  15. #define __FS_XATTR_HPP__
  16. #include <string>
  17. #include <vector>
  18. #include <map>
  19. namespace fs
  20. {
  21. namespace xattr
  22. {
  23. using std::size_t;
  24. using std::string;
  25. using std::vector;
  26. using std::map;
  27. int list(const string &path,
  28. vector<char> &attrs);
  29. int list(const string &path,
  30. string &attrs);
  31. int list(const string &path,
  32. vector<string> &attrs);
  33. int get(const string &path,
  34. const string &attr,
  35. vector<char> &value);
  36. int get(const string &path,
  37. const string &attr,
  38. string &value);
  39. int get(const string &path,
  40. map<string,string> &attrs);
  41. int set(const string &path,
  42. const string &key,
  43. const string &value,
  44. const int flags);
  45. int set(const int fd,
  46. const string &key,
  47. const string &value,
  48. const int flags);
  49. int set(const string &path,
  50. const map<string,string> &attrs);
  51. int copy(const int fdin,
  52. const int fdout);
  53. int copy(const string &from,
  54. const string &to);
  55. }
  56. }
  57. #endif // __FS_HPP__