1 /*
2  * Copyright (c) 2005 STanda Opichal
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17  *
18  */
19 
20 #ifndef ___bosmeta_h__
21 #define ___bosmeta_h__
22 
23 
24 #include "list.h"
25 #include "metados.h"
26 
27 
28 typedef struct {
29 	LINKABLE	item;
30 	char		*name;
31 	short		attr;
32 	LIST		*folder;
33 
34 	/* BOS device entries */
35 	short		bos_dev;
36 	unsigned long	bos_info_flags;
37 } FCOOKIE;
38 
39 /* old stat structure */
40 struct xattr
41 {
42 	unsigned short	mode;
43 	long		index;
44 	unsigned short	dev;
45 	unsigned short	rdev;
46 	unsigned short	nlink;
47 	unsigned short	uid;
48 	unsigned short	gid;
49 	long		size;
50 	long		blksize;
51 	long		nblocks;
52 	unsigned short	mtime, mdate;
53 	unsigned short	atime, adate;
54 	unsigned short	ctime, cdate;
55 	short		attr;
56 	short		reserved2;
57 	long		reserved3[2];
58 };
59 
60 static inline long
is_terminal(FCOOKIE * fc)61 is_terminal( FCOOKIE *fc) {
62 	return fc->bos_info_flags & BOS_INFO_ISTTY;
63 }
64 
65 long bosfs_initialize(void);
66 
67 long getxattr (FCOOKIE *fc, struct xattr *res);
68 long name2cookie (LIST *folder, const char *name, FCOOKIE **res);
69 long relpath2cookie (FCOOKIE *dir, const char *path, char *lastname, FCOOKIE **res);
70 long path2cookie (const char *path, char *lastname, FCOOKIE **res);
71 
72 
73 #endif /* ___bosmeta_h__ */
74 
75