utilvfs.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #include "path.h"
  12. /*** typedefs(not structures) and defined constants **********************************************/
  13. /*** enums ***************************************************************************************/
  14. /** Bit flags for vfs_url_split()
  15. *
  16. * Modify parsing parameters according to flag meaning.
  17. * @see vfs_url_split()
  18. */
  19. typedef enum
  20. {
  21. URL_FLAGS_NONE = 0,
  22. URL_USE_ANONYMOUS = 1, /**< if set, empty *user will contain NULL instead of current */
  23. URL_NOSLASH = 2 /**< if set, 'proto://' part in url is not searched */
  24. } vfs_url_flags_t;
  25. /*** structures declarations (and typedefs of structures)*****************************************/
  26. /*** global variables defined in .c file *********************************************************/
  27. /*** declarations of public functions ************************************************************/
  28. int vfs_finduid (const char *name);
  29. int vfs_findgid (const char *name);
  30. vfs_path_element_t *vfs_url_split (const char *path, int default_port, vfs_url_flags_t flags);
  31. int vfs_split_text (char *p);
  32. int vfs_mkstemps (vfs_path_t ** pname_vpath, const char *prefix, const char *basename);
  33. void vfs_die (const char *msg);
  34. char *vfs_get_password (const char *msg);
  35. char *vfs_get_local_username (void);
  36. gboolean vfs_parse_filetype (const char *s, size_t * ret_skipped, mode_t * ret_type);
  37. gboolean vfs_parse_fileperms (const char *s, size_t * ret_skipped, mode_t * ret_perms);
  38. gboolean vfs_parse_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode);
  39. gboolean vfs_parse_raw_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode);
  40. void vfs_parse_ls_lga_init (void);
  41. gboolean vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linkname,
  42. size_t * filename_pos);
  43. size_t vfs_parse_ls_lga_get_final_spaces (void);
  44. int vfs_parse_filedate (int idx, time_t * t);
  45. /*** inline functions ****************************************************************************/
  46. #endif