8 typedef unsigned int UINT32;
9 typedef unsigned short UINT16;
10 typedef unsigned char UINT8;
53 #if defined(__USE_LARGEFILE64) || defined(_LARGEFILE64_SOURCE)
54 long long int fileoffset;
68 #if defined(__USE_LARGEFILE64) || defined(_LARGEFILE64_SOURCE)
87 int findEventNumber();
96 inline int seeksize(
int filesize)
98 return (filesize + 3) & 0xfffffffc;
101 inline int get_sfsFileSize(
SFS_File *file)
103 return seeksize(strlen(file->name)+1) +
sizeof(
SFS_File) - 4;
106 inline int get_sfsFileSize(
char *file)
108 return seeksize(strlen(file)+1) +
sizeof(
SFS_File) - 4;
112 void write_env(
char *var,
char *value);
113 char *read_env(
char *var);
114 void getFullPath(
char *out,
char *in);
115 int seeksize(
int filesize);
116 void striptofirst(
char *str);
117 char *striptofile(
char *str);
118 void stripfile(
char *str);
119 char *striptodir(
char *str);
121 char *SFS_getpayload(
char *buff);
126 long long int dataSize;
138 #if defined(__USE_LARGEFILE64) || defined(_LARGEFILE64_SOURCE)
139 int mountSingleDir(
char *fn,
long long int offset=0);
140 int getSingleDirSize(
char *fn,
long long int offset);
141 long long int singleDirOffset;
142 long long int nextSingleDirOffset;
143 int mountSingleDirMem(
char *buff,
int size,
long long int offset=0);
146 int mountSingleDir(
char *fn,
int offset=0);
147 int getSingleDirSize(
char *fn,
int offset);
150 int nextSingleDirOffset;
151 int mountSingleDirMem(
char *buff,
int size,
int offset=0);
155 int mountSingleDir();
162 if(singleDirIttr)
delete singleDirIttr;
167 void dump(
int) { dump(
"/",root); };
169 int getwritevsz(
fs_iovec *fsiovec,
int n);
170 int writev_call_retry(
int fd, iovec *iovec,
int vec);
171 int writev(
fs_iovec *fsiovec,
int n);
172 int writev_sticky(
fs_iovec *iovec,
int n,
int *sticky);
173 int write(
char *fn,
char *buff,
int sz);
175 static int getfileheadersz(
char *fn);
176 int putfileheader(
char *ptr,
char *fn,
int filesz,
int flags=SFS_ATTR_NOCD);
182 #if defined(__USE_LARGEFILE64) || defined(_LARGEFILE64_SOURCE)
183 fs_inode *add_inode(
fs_inode *parent,
char *name,
long long int offset,
int sz,
int overhead);
184 fs_inode *add_inode_from(
fs_inode *neighbor,
char *name,
long long int offset,
int sz,
int overhead=0);
186 fs_inode *add_inode(
fs_inode *parent,
char *name,
int offset,
int sz,
int overhead);
187 fs_inode *add_inode_from(
fs_inode *neighbor,
char *name,
int offset,
int sz,
int overhead=0);
190 fs_inode *find_last_lesser_child(
fs_inode *parent,
char *name,
int &first,
int &eq);
191 fs_inode *find_last_lesser_neighbor(
fs_inode *neighbor,
char *name,
int &eq);
192 void dump(
const char *path,
fs_inode *inode);