/usr/include/ntfs-3g/plugin.h is in ntfs-3g-dev 1:2017.3.23-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | /*
* plugin.h : define interface for plugin development
*
* Copyright (c) 2015 Jean-Pierre Andre
*
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in the main directory of the NTFS-3G
* distribution in the file COPYING); if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* This file defines the interface to ntfs-3g plugins which
* add support for processing some type of reparse points.
*/
#ifndef _NTFS_PLUGIN_H
#define _NTFS_PLUGIN_H
#include "inode.h"
#include "layout.h"
struct fuse_file_info;
struct stat;
/*
* The plugin operations currently defined.
* These functions should return a non-negative value when they
* succeed, or a negative errno value when they fail.
* They must not close or free their arguments.
* The file system must be left in a consistent state after
* each individual call.
* If an operation is not defined, an EOPNOTSUPP error is
* returned to caller.
*/
typedef struct plugin_operations {
/*
* Set the attributes st_size, st_blocks and st_mode
* into a struct stat. The returned st_mode must at least
* define the file type. Depending on the permissions options
* used for mounting, the umask will be applied to the returned
* permissions, or the permissions will be changed according
* to the ACL set on the file.
*/
int (*getattr)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct stat *stbuf);
/*
* Open a file for reading or writing
* The field fi->flags indicates the kind of opening.
* The field fi->fh may be used to store some information which
* will be available to subsequent reads and writes. When used
* this field must be non-null.
* The returned value is zero for success and a negative errno
* value for failure.
*/
int (*open)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct fuse_file_info *fi);
/*
* Release an open file
* This is only called if fi->fh has been set to a non-null
* value while opening. It may be used to free some context
* specific to the open file.
* The returned value is zero for success or a negative errno
* value for failure.
*/
int (*release)(ntfs_inode *ni, const REPARSE_POINT *reparse,
struct fuse_file_info *fi);
/*
* Read from an open file
* The returned value is the count of bytes which were read
* or a negative errno value for failure.
* If the returned value is positive, the access time stamp
* will be updated after the call.
*/
int (*read)(ntfs_inode *ni, const REPARSE_POINT *reparse,
char *buf, size_t size,
off_t offset, struct fuse_file_info *fi);
/*
* Write to an open file
* The file system must be left consistent after each write call,
* the file itself must be at least deletable if the application
* writing to it is killed for some reason.
* The returned value is the count of bytes which were written
* or a negative errno value for failure.
* If the returned value is positive, the modified time stamp
* will be updated after the call.
*/
int (*write)(ntfs_inode *ni, const REPARSE_POINT *reparse,
const char *buf, size_t size,
off_t offset, struct fuse_file_info *fi);
/*
* Get a symbolic link
* The symbolic link must be returned in an allocated buffer,
* encoded in a zero terminated multibyte string compatible
* which the locale mount option.
* The returned value is zero for success or a negative errno
* value for failure.
*/
int (*readlink)(ntfs_inode *ni, const REPARSE_POINT *reparse,
char **pbuf);
/*
* Truncate a file (shorten or append zeroes)
* The returned value is zero for success or a negative errno
* value for failure.
* If the returned value is zero, the modified time stamp
* will be updated after the call.
*/
int (*truncate)(ntfs_inode *ni, const REPARSE_POINT *reparse,
off_t size);
} plugin_operations_t;
/*
* Plugin initialization routine
* Returns the entry table if successful, otherwise returns NULL
* and sets errno (e.g. to EINVAL if the tag is not supported by
* the plugin.)
*/
typedef const struct plugin_operations *(*plugin_init_t)(le32 tag);
const struct plugin_operations *init(le32 tag);
#endif /* _NTFS_PLUGIN_H */
|