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.

67 lines
1.9 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. #pragma once
  15. #include <string>
  16. #include <vector>
  17. #include <map>
  18. namespace fs
  19. {
  20. namespace xattr
  21. {
  22. using std::string;
  23. using std::vector;
  24. using std::map;
  25. int list(const string &path,
  26. vector<char> *attrs);
  27. int list(const string &path,
  28. string *attrs);
  29. int list(const string &path,
  30. vector<string> *attrs);
  31. int get(const string &path,
  32. const string &attr,
  33. vector<char> *value);
  34. int get(const string &path,
  35. const string &attr,
  36. string *value);
  37. int get(const string &path,
  38. map<string,string> *attrs);
  39. int set(const string &path,
  40. const string &key,
  41. const string &value,
  42. const int flags);
  43. int set(const int fd,
  44. const string &key,
  45. const string &value,
  46. const int flags);
  47. int set(const string &path,
  48. const map<string,string> &attrs);
  49. int copy(const int fdin,
  50. const int fdout);
  51. int copy(const string &from,
  52. const string &to);
  53. }
  54. }