yaffs: Remove a whole lot of function wrappers and forward declarations
[yaffs2.git] / direct / ydirectenv.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  * ydirectenv.h: Environment wrappers for YAFFS direct.
18  */
19
20 #ifndef __YDIRECTENV_H__
21 #define __YDIRECTENV_H__
22
23 // Direct interface
24
25 #include "stdlib.h"
26 #include "stdio.h"
27 #include "string.h"
28 #include "yaffs_osglue.h"
29 #include "yaffs_hweight.h"
30
31 #include "assert.h"
32 #define YBUG() assert(0)
33 //#define YBUG() do { *((int *)0) =1;} while(0)
34
35
36 #define YCHAR char
37 #define YUCHAR unsigned char
38 #define _Y(x) x
39
40 #define hweight8(x)     yaffs_hweight8(x)
41 #define hweight32(x)    yaffs_hweight32(x)
42
43 void yaffs_qsort(void *aa, size_t n, size_t es,
44         int (*cmp)(const void *, const void *));
45
46 #define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn)
47         
48 #define YAFFS_PATH_DIVIDERS  "/"
49
50 #ifdef NO_Y_INLINE
51 #define Y_INLINE
52 #else
53 #define Y_INLINE __inline__
54 #endif
55
56 #define kmalloc(x,flags) yaffs_malloc(x)
57 #define kfree(x)   yaffs_free(x)
58 #define vmalloc(x) yaffs_malloc(x)
59 #define vfree(x) yaffs_free(x)
60
61 #define cond_resched()  do {} while(0)
62
63
64
65 //#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
66 //#define YALERT(s) YINFO(s)
67
68
69 #define TENDSTR "\n"
70 #define TSTR(x) x
71 #define TCONT(x) x
72 #define TOUT(p) printf p
73
74
75 #define YAFFS_LOSTNFOUND_NAME           "lost+found"
76 #define YAFFS_LOSTNFOUND_PREFIX         "obj"
77 //#define YPRINTF(x) printf x
78
79 #include "yaffscfg.h"
80
81 #define Y_CURRENT_TIME yaffsfs_CurrentTime()
82 #define Y_TIME_CONVERT(x) x
83
84 #define YAFFS_ROOT_MODE                         0666
85 #define YAFFS_LOSTNFOUND_MODE           0666
86
87 #include "yaffs_list.h"
88
89 #include "yaffsfs.h"
90
91 #endif
92
93