utilvfs.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * \file
  3. * \brief Header: Utilities for VFS modules
  4. * \author Miguel de Icaza
  5. * \date 1995, 1996
  6. */
  7. #ifndef MC_VFS_UTILVFS_H
  8. #define MC_VFS_UTILVFS_H
  9. #include <sys/stat.h>
  10. #include "lib/global.h"
  11. /** Bit flags for vfs_split_url()
  12. *
  13. * Modify parsing parameters according to flag meaning.
  14. * @see vfs_split_url()
  15. */
  16. enum VFS_URL_FLAGS {
  17. URL_USE_ANONYMOUS = 1, /**< if set, empty *user will contain NULL instead of current */
  18. URL_NOSLASH = 2 /**< if set, 'proto://' part in url is not searched */
  19. };
  20. int vfs_finduid (const char *name);
  21. int vfs_findgid (const char *name);
  22. char *vfs_split_url (const char *path, char **host, char **user, int *port,
  23. char **pass, int default_port, enum VFS_URL_FLAGS flags);
  24. int vfs_split_text (char *p);
  25. int vfs_mkstemps (char **pname, const char *prefix, const char *basename);
  26. void vfs_die (const char *msg);
  27. char *vfs_get_password (const char *msg);
  28. char * vfs_get_local_username(void);
  29. gboolean vfs_parse_filetype (const char *s, size_t *ret_skipped,
  30. mode_t *ret_type);
  31. gboolean vfs_parse_fileperms (const char *s, size_t *ret_skipped,
  32. mode_t *ret_perms);
  33. gboolean vfs_parse_filemode (const char *s, size_t *ret_skipped,
  34. mode_t *ret_mode);
  35. gboolean vfs_parse_raw_filemode (const char *s, size_t *ret_skipped,
  36. mode_t *ret_mode);
  37. int vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
  38. char **linkname);
  39. int vfs_parse_filedate (int idx, time_t *t);
  40. #endif