root/lib/vfs/utilvfs.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


   1 
   2 /**
   3  * \file
   4  * \brief Header: Utilities for VFS modules
   5  * \author Miguel de Icaza
   6  * \date 1995, 1996
   7  */
   8 
   9 #ifndef MC_VFS_UTILVFS_H
  10 #define MC_VFS_UTILVFS_H
  11 
  12 #include <sys/stat.h>
  13 
  14 #include "lib/global.h"
  15 #include "path.h"
  16 
  17 /*** typedefs(not structures) and defined constants **********************************************/
  18 
  19 /*** enums ***************************************************************************************/
  20 
  21 /** Bit flags for vfs_url_split()
  22  *
  23  *  Modify parsing parameters according to flag meaning.
  24  *  @see vfs_url_split()
  25  */
  26 typedef enum
  27 {
  28     URL_FLAGS_NONE = 0,
  29     URL_USE_ANONYMOUS = 1, /**< if set, empty *user will contain NULL instead of current */
  30     URL_NOSLASH = 2        /**< if set, 'proto://' part in url is not searched */
  31 } vfs_url_flags_t;
  32 
  33 /*** structures declarations (and typedefs of structures)*****************************************/
  34 
  35 /*** global variables defined in .c file *********************************************************/
  36 
  37 /*** declarations of public functions ************************************************************/
  38 
  39 int vfs_finduid (const char *name);
  40 int vfs_findgid (const char *name);
  41 
  42 vfs_path_element_t *vfs_url_split (const char *path, int default_port, vfs_url_flags_t flags);
  43 int vfs_split_text (char *p);
  44 
  45 int vfs_mkstemps (vfs_path_t ** pname_vpath, const char *prefix, const char *basename);
  46 MC_MOCKABLE void vfs_die (const char *msg);
  47 char *vfs_get_password (const char *msg);
  48 
  49 char *vfs_get_local_username (void);
  50 
  51 gboolean vfs_parse_filetype (const char *s, size_t *ret_skipped, mode_t * ret_type);
  52 gboolean vfs_parse_fileperms (const char *s, size_t *ret_skipped, mode_t * ret_perms);
  53 gboolean vfs_parse_filemode (const char *s, size_t *ret_skipped, mode_t * ret_mode);
  54 gboolean vfs_parse_raw_filemode (const char *s, size_t *ret_skipped, mode_t * ret_mode);
  55 
  56 void vfs_parse_ls_lga_init (void);
  57 gboolean vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linkname,
  58                            size_t *filename_pos);
  59 size_t vfs_parse_ls_lga_get_final_spaces (void);
  60 gboolean vfs_parse_month (const char *str, struct tm *tim);
  61 int vfs_parse_filedate (int idx, time_t * t);
  62 
  63 int vfs_utime (const char *path, mc_timesbuf_t *times);
  64 void vfs_get_timespecs_from_timesbuf (mc_timesbuf_t *times, mc_timespec_t *atime,
  65                                       mc_timespec_t *mtime);
  66 void vfs_get_timesbuf_from_stat (const struct stat *s, mc_timesbuf_t *times);
  67 void vfs_copy_stat_times (const struct stat *src, struct stat *dst);
  68 void vfs_zero_stat_times (struct stat *s);
  69 
  70 /*** inline functions ****************************************************************************/
  71 
  72 #endif

/* [previous][next][first][last][top][bottom][index][help]  */