2009-02-07 15:54:58 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* \brief Header: Utilities for VFS modules
|
|
|
|
* \author Miguel de Icaza
|
|
|
|
* \date 1995, 1996
|
|
|
|
*/
|
|
|
|
|
2005-02-19 00:15:37 +03:00
|
|
|
#ifndef MC_VFS_UTILVFS_H
|
|
|
|
#define MC_VFS_UTILVFS_H
|
2003-10-16 20:50:09 +04:00
|
|
|
|
2005-02-19 19:36:38 +03:00
|
|
|
#include <sys/stat.h>
|
2009-02-06 01:09:37 +03:00
|
|
|
|
2010-01-20 18:11:52 +03:00
|
|
|
#include "lib/global.h"
|
2009-10-28 17:51:36 +03:00
|
|
|
|
2009-12-25 18:03:23 +03:00
|
|
|
/** Bit flags for vfs_split_url()
|
|
|
|
*
|
|
|
|
* Modify parsing parameters according to flag meaning.
|
|
|
|
* @see vfs_split_url()
|
|
|
|
*/
|
|
|
|
enum VFS_URL_FLAGS {
|
|
|
|
URL_USE_ANONYMOUS = 1, /**< if set, empty *user will contain NULL instead of current */
|
|
|
|
URL_NOSLASH = 2 /**< if set, 'proto://' part in url is not searched */
|
|
|
|
};
|
2003-10-16 20:50:09 +04:00
|
|
|
|
2004-08-17 13:48:15 +04:00
|
|
|
int vfs_finduid (const char *name);
|
|
|
|
int vfs_findgid (const char *name);
|
2003-11-05 09:08:16 +03:00
|
|
|
|
2003-10-16 20:50:09 +04:00
|
|
|
char *vfs_split_url (const char *path, char **host, char **user, int *port,
|
2009-12-25 18:03:23 +03:00
|
|
|
char **pass, int default_port, enum VFS_URL_FLAGS flags);
|
2003-11-05 09:08:16 +03:00
|
|
|
int vfs_split_text (char *p);
|
2003-10-16 20:50:09 +04:00
|
|
|
|
2003-10-29 03:50:36 +03:00
|
|
|
int vfs_mkstemps (char **pname, const char *prefix, const char *basename);
|
2003-11-05 09:08:16 +03:00
|
|
|
void vfs_die (const char *msg);
|
2004-08-16 19:45:05 +04:00
|
|
|
char *vfs_get_password (const char *msg);
|
2003-11-05 09:08:16 +03:00
|
|
|
|
2009-12-25 18:03:23 +03:00
|
|
|
char * vfs_get_local_username(void);
|
|
|
|
|
2009-02-06 01:46:07 +03:00
|
|
|
gboolean vfs_parse_filetype (const char *s, size_t *ret_skipped,
|
2005-09-26 15:10:24 +04:00
|
|
|
mode_t *ret_type);
|
2009-02-06 01:46:07 +03:00
|
|
|
gboolean vfs_parse_fileperms (const char *s, size_t *ret_skipped,
|
2005-09-26 15:10:24 +04:00
|
|
|
mode_t *ret_perms);
|
2009-02-06 01:46:07 +03:00
|
|
|
gboolean vfs_parse_filemode (const char *s, size_t *ret_skipped,
|
2005-09-26 15:10:24 +04:00
|
|
|
mode_t *ret_mode);
|
2009-02-06 01:46:07 +03:00
|
|
|
gboolean vfs_parse_raw_filemode (const char *s, size_t *ret_skipped,
|
2009-01-25 18:10:27 +03:00
|
|
|
mode_t *ret_mode);
|
2005-09-26 15:10:24 +04:00
|
|
|
|
2003-11-05 09:08:16 +03:00
|
|
|
int vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
|
|
|
|
char **linkname);
|
|
|
|
int vfs_parse_filedate (int idx, time_t *t);
|
2003-10-16 20:50:09 +04:00
|
|
|
|
2005-02-19 00:15:37 +03:00
|
|
|
#endif
|