Add first-cut Linux kernel patch-in mechanism
[yaffs/.git] / wince / ywinceenv.h
1 /*
2  * YAFFS: Yet another FFS. A NAND-flash specific file system. 
3  * ywinceenv.h: Port of functions to WinCE
4  *
5  * Copyright (C) 2002 Aleph One Ltd.
6  *   for Toby Churchill Ltd and Brightstar Engineering
7  *
8  * Created by Charles Manning <charles@aleph1.co.uk>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License version 2.1 as
12  * published by the Free Software Foundation.
13  *
14  *
15  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
16  *
17  * $Id: ywinceenv.h,v 1.3 2004-10-10 18:03:35 charles Exp $
18  *
19  */
20  
21 #ifndef __YWINCEENV_H__
22 #define __YWINCEENV_H__
23
24 // CONFIG_YAFFS_WINCE
25 #include "stdlib.h"
26 #include "stdio.h"
27 #include "string.h"
28
29 #include "devextras.h"
30
31 #define CONFIG_YAFFS_CASE_INSENSITIVE
32
33 #define YMALLOC(x) malloc(x)
34 #define YFREE(x)   free(x)
35
36
37 #define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
38 #define YALERT(s) YINFO(s)
39
40 #include <windows.h>
41
42 #define YAFFS_LOSTNFOUND_NAME           "Lost Clusters"
43 #define YAFFS_LOSTNFOUND_PREFIX         "OBJ"
44
45 #define YPRINTF(x)      RETAILMSG(1,x)
46
47 // Always pass the sum compare to overcome the case insensitivity issue
48 #define yaffs_SumCompare(x,y) ((x) == (y))
49 #define yaffs_strcmp(a,b) _stricmp(a,b)
50
51
52 #define u_char unsigned char
53 #define loff_t int
54 #define S_IFDIR                                         04000
55
56 #define S_ISFIFO(x) 0
57 #define S_ISCHR(x) 0
58 #define S_ISBLK(x) 0
59 #define S_ISSOCK(x) 0
60
61 extern unsigned yfsd_U32FileTimeNow(void);
62
63 #define Y_CURRENT_TIME                           yfsd_U32FileTimeNow()
64 #define Y_TIME_CONVERT(x) (x)
65
66 #define YAFFS_ROOT_MODE                         FILE_ATTRIBUTE_ARCHIVE
67 #define YAFFS_LOSTNFOUND_MODE           FILE_ATTRIBUTE_HIDDEN
68
69
70 #define TENDSTR L"\r\n"
71 #define TSTR(x) TEXT(x)
72 #define TOUT(x) RETAILMSG(1, x)
73
74 #define YBUG() T(YAFFS_TRACE_BUG,(TSTR("==>> yaffs bug: %s %d" TENDSTR),TEXT(__FILE__),__LINE__))
75
76 #endif
77
78