"Fossies" - the Fresh Open Source Software Archive

Member "ntfs-3g_ntfsprogs-2017.3.23/src/ntfs-3g_common.h" (23 Mar 2017, 5386 Bytes) of package /linux/misc/ntfs-3g_ntfsprogs-2017.3.23.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ntfs-3g_common.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3g_ntfsprogs-2016.2.22_vs_3g_ntfsprogs-2017.3.23.

    1 /*
    2  * ntfs-3g_common.h - Common declarations for ntfs-3g and lowntfs-3g.
    3  *
    4  * Copyright (c) 2010-2011 Jean-Pierre Andre
    5  * Copyright (c) 2010      Erik Larsson
    6  *
    7  * This program/include file is free software; you can redistribute it and/or
    8  * modify it under the terms of the GNU General Public License as published
    9  * by the Free Software Foundation; either version 2 of the License, or
   10  * (at your option) any later version.
   11  *
   12  * This program/include file is distributed in the hope that it will be
   13  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
   14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15  * GNU General Public License for more details.
   16  *
   17  * You should have received a copy of the GNU General Public License
   18  * along with this program (in the main directory of the NTFS-3G
   19  * distribution in the file COPYING); if not, write to the Free Software
   20  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   21  */
   22 
   23 #ifndef _NTFS_3G_COMMON_H
   24 #define _NTFS_3G_COMMON_H
   25 
   26 #include "inode.h"
   27 
   28 struct ntfs_options {
   29         char    *mnt_point;     /* Mount point */    
   30         char    *options;       /* Mount options */  
   31         char    *device;        /* Device to mount */
   32     char    *arg_device;    /* Device requested in argv */
   33 } ;
   34 
   35 typedef enum {
   36     NF_STREAMS_INTERFACE_NONE,  /* No access to named data streams. */
   37     NF_STREAMS_INTERFACE_XATTR, /* Map named data streams to xattrs. */
   38     NF_STREAMS_INTERFACE_OPENXATTR, /* Same, not limited to "user." */
   39     NF_STREAMS_INTERFACE_WINDOWS,   /* "file:stream" interface. */
   40 } ntfs_fuse_streams_interface;
   41 
   42 struct DEFOPTION {
   43     const char *name;
   44     int type;
   45     int flags;
   46 } ;
   47             /* Options, order not significant */
   48 enum {
   49     OPT_RO,
   50     OPT_NOATIME,
   51     OPT_ATIME,
   52     OPT_RELATIME,
   53     OPT_DMTIME,
   54     OPT_FAKE_RW,
   55     OPT_FSNAME,
   56     OPT_NO_DEF_OPTS,
   57     OPT_DEFAULT_PERMISSIONS,
   58     OPT_PERMISSIONS,
   59     OPT_ACL,
   60     OPT_UMASK,
   61     OPT_FMASK,
   62     OPT_DMASK,
   63     OPT_UID,
   64     OPT_GID,
   65     OPT_SHOW_SYS_FILES,
   66     OPT_HIDE_HID_FILES,
   67     OPT_HIDE_DOT_FILES,
   68     OPT_IGNORE_CASE,
   69     OPT_WINDOWS_NAMES,
   70     OPT_COMPRESSION,
   71     OPT_NOCOMPRESSION,
   72     OPT_SILENT,
   73     OPT_RECOVER,
   74     OPT_NORECOVER,
   75     OPT_REMOVE_HIBERFILE,
   76     OPT_SYNC,
   77     OPT_BIG_WRITES,
   78     OPT_LOCALE,
   79     OPT_NFCONV,
   80     OPT_NONFCONV,
   81     OPT_STREAMS_INTERFACE,
   82     OPT_USER_XATTR,
   83     OPT_NOAUTO,
   84     OPT_DEBUG,
   85     OPT_NO_DETACH,
   86     OPT_REMOUNT,
   87     OPT_BLKSIZE,
   88     OPT_INHERIT,
   89     OPT_ADDSECURIDS,
   90     OPT_STATICGRPS,
   91     OPT_USERMAPPING,
   92     OPT_XATTRMAPPING,
   93     OPT_EFS_RAW,
   94 } ;
   95 
   96             /* Option flags */
   97 enum {
   98     FLGOPT_BOGUS = 1,
   99     FLGOPT_STRING = 2,
  100     FLGOPT_OCTAL = 4,
  101     FLGOPT_DECIMAL = 8,
  102     FLGOPT_APPEND = 16,
  103     FLGOPT_NOSUPPORT = 32,
  104     FLGOPT_OPTIONAL = 64
  105 } ;
  106 
  107 typedef enum {
  108     ATIME_ENABLED,
  109     ATIME_DISABLED,
  110     ATIME_RELATIVE
  111 } ntfs_atime_t;
  112 
  113 typedef enum {
  114     ERR_PLUGIN = 1
  115 } single_log_t;
  116 
  117 #ifndef DISABLE_PLUGINS
  118 
  119 typedef struct plugin_list {
  120     struct plugin_list *next;
  121     void *handle;
  122     const plugin_operations_t *ops;
  123     le32 tag;
  124 } plugin_list_t;
  125 
  126 #endif /* DISABLE_PLUGINS */
  127 
  128 typedef struct {
  129     ntfs_volume *vol;
  130     unsigned int uid;
  131     unsigned int gid;
  132     unsigned int fmask;
  133     unsigned int dmask;
  134     ntfs_fuse_streams_interface streams;
  135     ntfs_atime_t atime;
  136     s64 dmtime;
  137     BOOL ro;
  138     BOOL show_sys_files;
  139     BOOL hide_hid_files;
  140     BOOL hide_dot_files;
  141     BOOL windows_names;
  142     BOOL ignore_case;
  143     BOOL compression;
  144     BOOL acl;
  145     BOOL silent;
  146     BOOL recover;
  147     BOOL hiberfile;
  148     BOOL sync;
  149     BOOL big_writes;
  150     BOOL debug;
  151     BOOL no_detach;
  152     BOOL blkdev;
  153     BOOL mounted;
  154 #ifdef HAVE_SETXATTR    /* extended attributes interface required */
  155     BOOL efs_raw;
  156 #ifdef XATTR_MAPPINGS
  157     char *xattrmap_path;
  158 #endif /* XATTR_MAPPINGS */
  159 #endif /* HAVE_SETXATTR */
  160     struct fuse_chan *fc;
  161     BOOL inherit;
  162     unsigned int secure_flags;
  163     single_log_t errors_logged;
  164     char *usermap_path;
  165     char *abs_mnt_point;
  166 #ifndef DISABLE_PLUGINS
  167     plugin_list_t *plugins;
  168 #endif /* DISABLE_PLUGINS */
  169     struct PERMISSIONS_CACHE *seccache;
  170     struct SECURITY_CONTEXT security;
  171     struct open_file *open_files; /* only defined in lowntfs-3g */
  172     u64 latest_ghost;
  173 } ntfs_fuse_context_t;
  174 
  175 extern const char *EXEC_NAME;
  176 
  177 #ifdef FUSE_INTERNAL
  178 #define FUSE_TYPE   "integrated FUSE"
  179 #else
  180 #define FUSE_TYPE   "external FUSE"
  181 #endif
  182 
  183 extern const char xattr_ntfs_3g[];
  184 
  185 extern const char nf_ns_user_prefix[];
  186 extern const int nf_ns_user_prefix_len;
  187 extern const char nf_ns_system_prefix[];
  188 extern const int nf_ns_system_prefix_len;
  189 extern const char nf_ns_security_prefix[];
  190 extern const int nf_ns_security_prefix_len;
  191 extern const char nf_ns_trusted_prefix[];
  192 extern const int nf_ns_trusted_prefix_len;
  193 
  194 int ntfs_strappend(char **dest, const char *append);
  195 int ntfs_strinsert(char **dest, const char *append);
  196 char *parse_mount_options(ntfs_fuse_context_t *ctx,
  197             const struct ntfs_options *popts, BOOL low_fuse);
  198 int ntfs_parse_options(struct ntfs_options *popts, void (*usage)(void),
  199             int argc, char *argv[]);
  200 
  201 int ntfs_fuse_listxattr_common(ntfs_inode *ni, ntfs_attr_search_ctx *actx,
  202             char *list, size_t size, BOOL prefixing);
  203 BOOL user_xattrs_allowed(ntfs_fuse_context_t *ctx, ntfs_inode *ni);
  204 
  205 #ifndef DISABLE_PLUGINS
  206 
  207 void close_reparse_plugins(ntfs_fuse_context_t *ctx);
  208 const struct plugin_operations *select_reparse_plugin(ntfs_fuse_context_t *ctx,
  209                 ntfs_inode *ni, REPARSE_POINT **reparse);
  210 int register_reparse_plugin(ntfs_fuse_context_t *ctx, le32 tag,
  211                                 const plugin_operations_t *ops, void *handle);
  212 
  213 #endif /* DISABLE_PLUGINS */
  214 
  215 #endif /* _NTFS_3G_COMMON_H */