ydirectenv.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  3. *
  4. * Copyright (C) 2002-2007 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. * ydirectenv.h: Environment wrappers for YAFFS direct.
  17. */
  18. #ifndef __YDIRECTENV_H__
  19. #define __YDIRECTENV_H__
  20. // Direct interface
  21. #include "devextras.h"
  22. #include "stdlib.h"
  23. #include "stdio.h"
  24. #include "string.h"
  25. #include "yaffs_malloc.h"
  26. #include "assert.h"
  27. #define YBUG() assert(1)
  28. #define YCHAR char
  29. #define YUCHAR unsigned char
  30. #define _Y(x) x
  31. #define yaffs_strcpy(a,b) strcpy(a,b)
  32. #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
  33. #define yaffs_strncmp(a,b,c) strncmp(a,b,c)
  34. #define yaffs_strlen(s) strlen(s)
  35. #define yaffs_sprintf sprintf
  36. #define yaffs_toupper(a) toupper(a)
  37. #ifdef NO_Y_INLINE
  38. #define Y_INLINE
  39. #else
  40. #define Y_INLINE inline
  41. #endif
  42. #define YMALLOC(x) yaffs_malloc(x)
  43. #define YFREE(x) free(x)
  44. #define YMALLOC_ALT(x) yaffs_malloc(x)
  45. #define YFREE_ALT(x) free(x)
  46. #define YMALLOC_DMA(x) yaffs_malloc(x)
  47. #define YYIELD() do {} while(0)
  48. //#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
  49. //#define YALERT(s) YINFO(s)
  50. #define TENDSTR "\n"
  51. #define TSTR(x) x
  52. #define TOUT(p) printf p
  53. #define YAFFS_LOSTNFOUND_NAME "lost+found"
  54. #define YAFFS_LOSTNFOUND_PREFIX "obj"
  55. //#define YPRINTF(x) printf x
  56. #include "yaffscfg.h"
  57. #define Y_CURRENT_TIME yaffsfs_CurrentTime()
  58. #define Y_TIME_CONVERT(x) x
  59. #define YAFFS_ROOT_MODE 0666
  60. #define YAFFS_LOSTNFOUND_MODE 0666
  61. #define yaffs_SumCompare(x,y) ((x) == (y))
  62. #define yaffs_strcmp(a,b) strcmp(a,b)
  63. #endif