utilvfs.h 2.0 KB

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