824ce20ed2b232a9dd99832b0704a93e766453de
[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_malloc.h"
29
30 #include "assert.h"
31 #define YBUG() assert(0)
32 //#define YBUG() do { *((int *)0) =1;} while(0)
33
34
35 #define YCHAR char
36 #define YUCHAR unsigned char
37 #define _Y(x) x
38 #define yaffs_strcat(a,b)    strcat(a,b)
39 #define yaffs_strcpy(a,b)    strcpy(a,b)
40 #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
41 #define yaffs_strncmp(a,b,c) strncmp(a,b,c)
42 #define yaffs_strnlen(s,m)           strnlen(s,m)
43 #define yaffs_sprintf        sprintf
44 #define yaffs_toupper(a)     toupper(a)
45
46 #define YAFFS_PATH_DIVIDERS  "/"
47
48 #ifdef NO_Y_INLINE
49 #define Y_INLINE
50 #else
51 #define Y_INLINE __inline__
52 #endif
53
54 #define YMALLOC(x) yaffs_malloc(x)
55 #define YFREE(x)   free(x)
56 #define YMALLOC_ALT(x) yaffs_malloc(x)
57 #define YFREE_ALT(x)   free(x)
58
59 #define YMALLOC_DMA(x) yaffs_malloc(x)
60
61 #define YYIELD()  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 #define yaffs_sum_cmp(x,y) ((x) == (y))
88 #define yaffs_strcmp(a,b) strcmp(a,b)
89
90 #include "yaffsfs.h"
91
92 #endif
93
94