ydirectenv.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  3. *
  4. * Copyright (C) 2002-2011 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. #include <common.h>
  21. #include <malloc.h>
  22. #include <linux/compat.h>
  23. #include "yaffs_osglue.h"
  24. void yaffs_bug_fn(const char *file_name, int line_no);
  25. #define YCHAR char
  26. #define YUCHAR unsigned char
  27. #define _Y(x) x
  28. #define yaffs_strcat(a, b) strcat(a, b)
  29. #define yaffs_strcpy(a, b) strcpy(a, b)
  30. #define yaffs_strncpy(a, b, c) strncpy(a, b, c)
  31. #define yaffs_strnlen(s, m) strnlen(s, m)
  32. #ifdef CONFIG_YAFFS_CASE_INSENSITIVE
  33. #define yaffs_strcmp(a, b) strcasecmp(a, b)
  34. #define yaffs_strncmp(a, b, c) strncasecmp(a, b, c)
  35. #else
  36. #define yaffs_strcmp(a, b) strcmp(a, b)
  37. #define yaffs_strncmp(a, b, c) strncmp(a, b, c)
  38. #endif
  39. void yaffs_qsort(void *aa, size_t n, size_t es,
  40. int (*cmp)(const void *, const void *));
  41. #define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn)
  42. #define YAFFS_PATH_DIVIDERS "/"
  43. #ifdef NO_inline
  44. #define inline
  45. #endif
  46. #define yaffs_trace(msk, fmt, ...) do { \
  47. if (yaffs_trace_mask & (msk)) \
  48. printf("yaffs: " fmt "\n", ##__VA_ARGS__); \
  49. } while (0)
  50. #define YAFFS_LOSTNFOUND_NAME "lost+found"
  51. #define YAFFS_LOSTNFOUND_PREFIX "obj"
  52. #include "yaffscfg.h"
  53. #define Y_CURRENT_TIME yaffsfs_CurrentTime()
  54. #define Y_TIME_CONVERT(x) x
  55. #define YAFFS_ROOT_MODE 0666
  56. #define YAFFS_LOSTNFOUND_MODE 0666
  57. #include <linux/list.h>
  58. #include "yaffsfs.h"
  59. #endif