@SuppressWarnings("unused")
public StructFuseOperations(final FuseFilesystem filesystem)
{
switch (Platform.platform()) {
case LINUX_X86_64:
getattr = new Callback()
{
public final int callback(final String path, final StructStat.X86_64.ByReference stat)
{
return filesystem._getattr(path, stat);
}
};
fgetattr = new Callback()
{
public final int callback(final String path, final StructStat.X86_64.ByReference stat,
final StructFuseFileInfo.ByReference info)
{
return filesystem._fgetattr(path, stat, info);
}
};
break;
case LINUX_I686:
getattr = new Callback()
{
public final int callback(final String path, final StructStat.I686.ByReference stat)
{
return filesystem._getattr(path, stat);
}
};
fgetattr = new Callback()
{
public final int callback(final String path, final StructStat.I686.ByReference stat,
final StructFuseFileInfo.ByReference info)
{
return filesystem._fgetattr(path, stat, info);
}
};
break;
case LINUX_PPC:
getattr = new Callback()
{
public final int callback(final String path, final StructStat.PowerPC.ByReference stat)
{
return filesystem._getattr(path, stat);
}
};
fgetattr = new Callback()
{
public final int callback(final String path, final StructStat.PowerPC.ByReference stat,
final StructFuseFileInfo.ByReference info)
{
return filesystem._fgetattr(path, stat, info);
}
};
break;
case MAC:
getattr = new Callback()
{
public final int callback(final String path, final StructStat.Mac.ByReference stat)
{
return filesystem._getattr(path, stat);
}
};
fgetattr = new Callback()
{
public final int callback(final String path, final StructStat.Mac.ByReference stat,
final StructFuseFileInfo.ByReference info)
{
return filesystem._fgetattr(path, stat, info);
}
};
break;
case FREEBSD:
case MAC_MACFUSE:
getattr = new Callback()
{
public final int callback(final String path, final StructStat.BSD.ByReference stat)
{
return filesystem._getattr(path, stat);
}
};
fgetattr = new Callback()
{
public final int callback(final String path, final StructStat.BSD.ByReference stat,
final StructFuseFileInfo.ByReference info)
{
return filesystem._fgetattr(path, stat, info);
}
};
break;
}
readlink = new Callback()
{
public final int callback(final String path, final Pointer buffer, final TypeSize size)
{
return filesystem._readlink(path, buffer, size);
}
};
mknod = new Callback()
{
public final int callback(final String path, final TypeMode mode, final TypeDev dev)
{
return filesystem._mknod(path, mode, dev);
}
};
mkdir = new Callback()
{
public final int callback(final String path, final TypeMode mode)
{
return filesystem._mkdir(path, mode);
}
};
unlink = new Callback()
{
public final int callback(final String path)
{
return filesystem._unlink(path);
}
};
rmdir = new Callback()
{
public final int callback(final String path)
{
return filesystem._rmdir(path);
}
};
symlink = new Callback()
{
public final int callback(final String path, final String target)
{
return filesystem._symlink(path, target);
}
};
rename = new Callback()
{
public final int callback(final String path, final String newName)
{
return filesystem._rename(path, newName);
}
};
link = new Callback()
{
public final int callback(final String path, final String target)
{
return filesystem._link(path, target);
}
};
chmod = new Callback()
{
public final int callback(final String path, final TypeMode mode)
{
return filesystem._chmod(path, mode);
}
};
chown = new Callback()
{
public final int callback(final String path, final TypeUid uid, final TypeGid gid)
{
return filesystem._chown(path, uid, gid);
}
};
truncate = new Callback()
{
public final int callback(final String path, final TypeOff offset)
{
return filesystem._truncate(path, offset);
}
};
open = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info)
{
return filesystem._open(path, info);
}
};
read = new Callback()
{
public final int callback(final String path, final Pointer buffer, final TypeSize size, final TypeOff offset,
final StructFuseFileInfo.ByReference info)
{
return filesystem._read(path, buffer, size, offset, info);
}
};
write = new Callback()
{
public final int callback(final String path, final Pointer buffer, final TypeSize size, final TypeOff offset,
final StructFuseFileInfo.ByReference info)
{
return filesystem._write(path, buffer, size, offset, info);
}
};
switch (Platform.platform()) {
case FREEBSD:
statfs = new Callback()
{
public final int callback(final String path, final StructStatvfs.FreeBSD.ByReference statsvfs)
{
return filesystem._statfs(path, statsvfs);
}
};
break;
default:
statfs = new Callback()
{
public final int callback(final String path, final StructStatvfs.NotFreeBSD.ByReference statsvfs)
{
return filesystem._statfs(path, statsvfs);
}
};
break;
}
flush = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info)
{
return filesystem._flush(path, info);
}
};
release = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info)
{
return filesystem._release(path, info);
}
};
fsync = new Callback()
{
public final int callback(final String path, final int datasync, final StructFuseFileInfo.ByReference info)
{
return filesystem._fsync(path, datasync, info);
}
};
switch (Platform.platform()) {
case MAC:
case MAC_MACFUSE:
setxattr = new Callback()
{
public final int callback(final String path, final String xattr, final Pointer value, final TypeSize size,
final int flags, final int position)
{
return filesystem._setxattr(path, xattr, value, size, flags, position);
}
};
getxattr = new Callback()
{
public final int callback(final String path, final String xattr, final Pointer buffer, final TypeSize size,
final TypeUInt32 position)
{
return filesystem._getxattr(path, xattr, buffer, size, position);
}
};
break;
default:
setxattr = new Callback()
{
public final int callback(final String path, final String xattr, final Pointer value, final TypeSize size,
final int flags)
{
return filesystem._setxattr(path, xattr, value, size, flags, 0);
}
};
getxattr = new Callback()
{
public final int callback(final String path, final String xattr, final Pointer buffer, final TypeSize size)
{
return filesystem._getxattr(path, xattr, buffer, size, null);
}
};
}
listxattr = new Callback()
{
public final int callback(final String path, final Pointer buffer, final TypeSize size)
{
return filesystem._listxattr(path, buffer, size);
}
};
removexattr = new Callback()
{
public final int callback(final String path, final String xattr)
{
return filesystem._removexattr(path, xattr);
}
};
opendir = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info)
{
return filesystem._opendir(path, info);
}
};
readdir = new Callback()
{
public final int callback(final String path, final Pointer buf, final Pointer fillFunction, final TypeOff offset,
final StructFuseFileInfo.ByReference info)
{
return filesystem._readdir(path, buf, fillFunction, offset, info);
}
};
releasedir = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info)
{
return filesystem._releasedir(path, info);
}
};
fsyncdir = new Callback()
{
public final int callback(final String path, final int datasync, final StructFuseFileInfo.ByReference info)
{
return filesystem._fsyncdir(path, datasync, info);
}
};
init = new Callback()
{
public final Pointer callback(final StructFuseConnInfo.ByReference conn)
{
filesystem._init(conn);
return null;
}
};
destroy = new Callback()
{
public final void callback(final Pointer user_data)
{
filesystem._destroy();
}
};
access = new Callback()
{
public final int callback(final String path, final int access)
{
return filesystem._access(path, access);
}
};
create = new Callback()
{
public final int callback(final String path, final TypeMode mode, final StructFuseFileInfo.ByReference info)
{
return filesystem._create(path, mode, info);
}
};
ftruncate = new Callback()
{
public final int callback(final String path, final TypeOff offset, final StructFuseFileInfo.ByReference info)
{
return filesystem._ftruncate(path, offset, info);
}
};
switch (Platform.platform()) {
case FREEBSD:
case MAC:
case MAC_MACFUSE:
lock = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info, final int cmd,
final StructFlock.FreeBSD.ByReference flock)
{
return filesystem._lock(path, info, cmd, flock);
}
};
break;
default:
lock = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info, final int cmd,
final StructFlock.NotFreeBSD.ByReference flock)
{
return filesystem._lock(path, info, cmd, flock);
}
};
}
utimens = new Callback()
{
public final int callback(final String path, final StructTimeBuffer.ByReference timebuffer)
{
return filesystem._utimens(path, timebuffer);
}
};
bmap = new Callback()
{
public final int callback(final String path, final StructFuseFileInfo.ByReference info)
{
return filesystem._bmap(path, info);
}