2009-02-07 14:54:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* \brief Header: Utilities for VFS modules
|
|
|
|
* \author Miguel de Icaza
|
|
|
|
* \date 1995, 1996
|
|
|
|
*/
|
|
|
|
|
2005-02-18 21:15:37 +00:00
|
|
|
#ifndef MC_VFS_UTILVFS_H
|
|
|
|
#define MC_VFS_UTILVFS_H
|
2003-10-16 16:50:09 +00:00
|
|
|
|
2005-02-19 16:36:38 +00:00
|
|
|
#include <sys/stat.h>
|
2009-02-05 23:09:37 +01:00
|
|
|
|
2010-01-20 17:11:52 +02:00
|
|
|
#include "lib/global.h"
|
2011-06-07 13:18:08 +03:00
|
|
|
#include "path.h"
|
2009-10-28 15:51:36 +01:00
|
|
|
|
2010-11-08 12:21:45 +02:00
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
|
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
|
2011-03-29 10:20:34 +03:00
|
|
|
/** Bit flags for vfs_url_split()
|
2009-12-25 16:03:23 +01:00
|
|
|
*
|
|
|
|
* Modify parsing parameters according to flag meaning.
|
2011-03-29 10:20:34 +03:00
|
|
|
* @see vfs_url_split()
|
2009-12-25 16:03:23 +01:00
|
|
|
*/
|
2011-03-29 10:20:34 +03:00
|
|
|
typedef enum
|
2010-11-08 12:21:45 +02:00
|
|
|
{
|
2011-03-29 10:20:34 +03:00
|
|
|
URL_FLAGS_NONE = 0,
|
2009-12-25 16:03:23 +01:00
|
|
|
URL_USE_ANONYMOUS = 1, /**< if set, empty *user will contain NULL instead of current */
|
2010-11-08 12:21:45 +02:00
|
|
|
URL_NOSLASH = 2 /**< if set, 'proto://' part in url is not searched */
|
2011-03-29 10:20:34 +03:00
|
|
|
} vfs_url_flags_t;
|
2003-10-16 16:50:09 +00:00
|
|
|
|
2010-11-08 12:21:45 +02:00
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
2004-08-17 09:48:15 +00:00
|
|
|
int vfs_finduid (const char *name);
|
|
|
|
int vfs_findgid (const char *name);
|
2003-11-05 06:08:16 +00:00
|
|
|
|
2011-06-07 13:18:08 +03:00
|
|
|
vfs_path_element_t *vfs_url_split (const char *path, int default_port, vfs_url_flags_t flags);
|
2003-11-05 06:08:16 +00:00
|
|
|
int vfs_split_text (char *p);
|
2003-10-16 16:50:09 +00:00
|
|
|
|
2012-01-04 15:34:05 +03:00
|
|
|
int vfs_mkstemps (vfs_path_t ** pname_vpath, const char *prefix, const char *basename);
|
2003-11-05 06:08:16 +00:00
|
|
|
void vfs_die (const char *msg);
|
2004-08-16 15:45:05 +00:00
|
|
|
char *vfs_get_password (const char *msg);
|
2003-11-05 06:08:16 +00:00
|
|
|
|
2010-11-08 12:21:45 +02:00
|
|
|
char *vfs_get_local_username (void);
|
2009-12-25 16:03:23 +01:00
|
|
|
|
2010-11-08 12:21:45 +02:00
|
|
|
gboolean vfs_parse_filetype (const char *s, size_t * ret_skipped, mode_t * ret_type);
|
|
|
|
gboolean vfs_parse_fileperms (const char *s, size_t * ret_skipped, mode_t * ret_perms);
|
|
|
|
gboolean vfs_parse_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode);
|
|
|
|
gboolean vfs_parse_raw_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode);
|
2005-09-26 11:10:24 +00:00
|
|
|
|
2011-08-27 20:22:41 +03:00
|
|
|
void vfs_parse_ls_lga_init (void);
|
|
|
|
gboolean vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linkname,
|
|
|
|
size_t * filename_pos);
|
|
|
|
size_t vfs_parse_ls_lga_get_final_spaces (void);
|
2013-10-03 14:18:16 +04:00
|
|
|
gboolean vfs_parse_month (const char *str, struct tm *tim);
|
2010-11-08 12:21:45 +02:00
|
|
|
int vfs_parse_filedate (int idx, time_t * t);
|
2003-10-16 16:50:09 +00:00
|
|
|
|
2010-11-08 12:21:45 +02:00
|
|
|
/*** inline functions ****************************************************************************/
|
2005-02-18 21:15:37 +00:00
|
|
|
#endif
|