Back to index

avfs  1.0.1
cmd.h
Go to the documentation of this file.
00001 /*
00002     AVFS: A Virtual File System Library
00003     Copyright (C) 1998-2001  Miklos Szeredi <miklos@szeredi.hu>
00004 
00005     This program can be distributed either under the terms of the GNU
00006     GPL or under the terms of the GNU LGPL.  See the files COPYING and
00007     COPYING.LIB.
00008 */
00009 
00010 #include "avfs.h"
00011 #include <limits.h>
00012 #include <dirent.h>
00013 #include <sys/types.h>
00014 
00015 enum avfs_cmd_type {
00016     CMD_GETATTR,
00017     CMD_OPEN,
00018     CMD_CLOSE,
00019     CMD_FSTAT,
00020     CMD_READDIR,
00021     CMD_LSEEK,
00022     CMD_READ,
00023     CMD_WRITE,
00024     CMD_RESOLVE,
00025     CMD_READLINK,
00026     CMD_ACCESS
00027 };
00028 
00029 struct avfs_cmd {
00030     enum avfs_cmd_type type;
00031     union {
00032         struct {
00033             int flags;
00034             int attrmask;
00035         } getattr;
00036 
00037         struct {
00038             int flags;
00039             avmode_t mode;
00040         } open;
00041 
00042         struct {
00043             int serverfh;
00044         } fdops;
00045 
00046         struct {
00047             int serverfh;
00048             avoff_t offset;
00049             int whence;
00050         } lseek;
00051 
00052         struct {
00053             int serverfh;
00054             avsize_t nbyte;
00055         } readwrite;
00056 
00057         struct {
00058             avsize_t bufsize;
00059         } readlink;
00060 
00061         struct {
00062             int amode;
00063         } access;
00064     } u;
00065 };
00066 
00067 struct avfs_result {
00068     int result;
00069     union {
00070         struct {
00071             avoff_t offset;
00072         } lseek;
00073         struct {
00074             int isvirtual;
00075         } resolve;
00076     } u;    
00077 };
00078 
00079 struct avfs_direntry {
00080     avino_t ino;
00081     int type;
00082     int n;
00083 };
00084 
00085 #define PATHBUF_LEN (PATH_MAX + 1)
00086 
00087 #ifndef NAME_MAX
00088 #define NAME_MAX 255
00089 #endif