4 * \brief Header: Utilities for VFS modules
5 * \author Miguel de Icaza
9 #ifndef MC_VFS_UTILVFS_H
10 #define MC_VFS_UTILVFS_H
14 #include "lib/global.h"
16 /** Bit flags for vfs_split_url()
18 * Modify parsing parameters according to flag meaning.
19 * @see vfs_split_url()
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 */
26 int vfs_finduid (const char *name
);
27 int vfs_findgid (const char *name
);
29 char *vfs_split_url (const char *path
, char **host
, char **user
, int *port
,
30 char **pass
, int default_port
, enum VFS_URL_FLAGS flags
);
31 int vfs_split_text (char *p
);
33 int vfs_mkstemps (char **pname
, const char *prefix
, const char *basename
);
34 void vfs_die (const char *msg
);
35 char *vfs_get_password (const char *msg
);
37 char * vfs_get_local_username(void);
39 gboolean
vfs_parse_filetype (const char *s
, size_t *ret_skipped
,
41 gboolean
vfs_parse_fileperms (const char *s
, size_t *ret_skipped
,
43 gboolean
vfs_parse_filemode (const char *s
, size_t *ret_skipped
,
45 gboolean
vfs_parse_raw_filemode (const char *s
, size_t *ret_skipped
,
48 int vfs_parse_ls_lga (const char *p
, struct stat
*s
, char **filename
,
50 int vfs_parse_filedate (int idx
, time_t *t
);