yaffs Improve yaffs direct link following
[yaffs2.git] / devextras.h
1 /*
2  * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
3  *
4  * Copyright (C) 2002-2010 Aleph One Ltd.
5  *   for Toby Churchill Ltd and Brightstar Engineering
6  *
7  * Created by Charles Manning <charles@aleph1.co.uk>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License version 2.1 as
11  * published by the Free Software Foundation.
12  *
13  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
14  */
15
16 /*
17  * This file is just holds extra declarations of macros that would normally
18  * be providesd in the Linux kernel. These macros have been written from
19  * scratch but are functionally equivalent to the Linux ones.
20  *
21  */
22
23 #ifndef __EXTRAS_H__
24 #define __EXTRAS_H__
25
26
27 #include "yportenv.h"
28
29 #if !(defined __KERNEL__)
30
31 /* Definition of types */
32 typedef unsigned char __u8;
33 typedef unsigned short __u16;
34 typedef unsigned __u32;
35
36 #endif
37
38
39 #if !(defined __KERNEL__)
40
41
42 #ifndef WIN32
43 #include <sys/stat.h>
44 #endif
45
46
47 #ifdef CONFIG_YAFFS_PROVIDE_DEFS
48 /* File types */
49
50
51 #define DT_UNKNOWN      0
52 #define DT_FIFO         1
53 #define DT_CHR          2
54 #define DT_DIR          4
55 #define DT_BLK          6
56 #define DT_REG          8
57 #define DT_LNK          10
58 #define DT_SOCK         12
59 #define DT_WHT          14
60
61
62 #ifndef WIN32
63 #include <sys/stat.h>
64 #endif
65
66 /*
67  * Attribute flags.  These should be or-ed together to figure out what
68  * has been changed!
69  */
70 #define ATTR_MODE       1
71 #define ATTR_UID        2
72 #define ATTR_GID        4
73 #define ATTR_SIZE       8
74 #define ATTR_ATIME      16
75 #define ATTR_MTIME      32
76 #define ATTR_CTIME      64
77
78 struct iattr {
79         unsigned int ia_valid;
80         unsigned ia_mode;
81         unsigned ia_uid;
82         unsigned ia_gid;
83         unsigned ia_size;
84         unsigned ia_atime;
85         unsigned ia_mtime;
86         unsigned ia_ctime;
87         unsigned int ia_attr_flags;
88 };
89
90 #endif
91
92 #else
93
94 #include <linux/types.h>
95 #include <linux/fs.h>
96 #include <linux/stat.h>
97
98 #endif
99
100
101 #endif