blob: 790f8512f74232376c58dda0b7754d046e4b18e7 [file] [log] [blame]
William Juul0e8cc8b2007-11-15 11:13:05 +01001/*
Wolfgang Denk4b070802008-08-14 14:41:06 +02002 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
William Juul0e8cc8b2007-11-15 11:13:05 +01003 *
Charles Manning753ac612012-05-09 16:55:17 +00004 * Copyright (C) 2002-2011 Aleph One Ltd.
William Juul0e8cc8b2007-11-15 11:13:05 +01005 * 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
Charles Manning74f45b72012-08-14 18:26:10 +000023#include <malloc.h>
24#include <linux/compat.h>
25
Charles Manning753ac612012-05-09 16:55:17 +000026#include "yaffs_osglue.h"
William Juul0e8cc8b2007-11-15 11:13:05 +010027
Charles Manning753ac612012-05-09 16:55:17 +000028void yaffs_bug_fn(const char *file_name, int line_no);
29
Charles Manning753ac612012-05-09 16:55:17 +000030
William Juul0e8cc8b2007-11-15 11:13:05 +010031
32#define YCHAR char
33#define YUCHAR unsigned char
34#define _Y(x) x
William Juul0e8cc8b2007-11-15 11:13:05 +010035
Charles Manning753ac612012-05-09 16:55:17 +000036#define yaffs_strcat(a, b) strcat(a, b)
37#define yaffs_strcpy(a, b) strcpy(a, b)
38#define yaffs_strncpy(a, b, c) strncpy(a, b, c)
39#define yaffs_strnlen(s, m) strnlen(s, m)
40#ifdef CONFIG_YAFFS_CASE_INSENSITIVE
41#define yaffs_strcmp(a, b) strcasecmp(a, b)
42#define yaffs_strncmp(a, b, c) strncasecmp(a, b, c)
William Juul0e8cc8b2007-11-15 11:13:05 +010043#else
Charles Manning753ac612012-05-09 16:55:17 +000044#define yaffs_strcmp(a, b) strcmp(a, b)
45#define yaffs_strncmp(a, b, c) strncmp(a, b, c)
William Juul0e8cc8b2007-11-15 11:13:05 +010046#endif
47
William Juul0e8cc8b2007-11-15 11:13:05 +010048
Charles Manning753ac612012-05-09 16:55:17 +000049void yaffs_qsort(void *aa, size_t n, size_t es,
50 int (*cmp)(const void *, const void *));
William Juul0e8cc8b2007-11-15 11:13:05 +010051
Charles Manning753ac612012-05-09 16:55:17 +000052#define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn)
William Juul0e8cc8b2007-11-15 11:13:05 +010053
Charles Manning753ac612012-05-09 16:55:17 +000054#define YAFFS_PATH_DIVIDERS "/"
William Juul0e8cc8b2007-11-15 11:13:05 +010055
Charles Manning753ac612012-05-09 16:55:17 +000056#ifdef NO_inline
57#define inline
Charles Manning753ac612012-05-09 16:55:17 +000058#endif
William Juul0e8cc8b2007-11-15 11:13:05 +010059
Charles Manning753ac612012-05-09 16:55:17 +000060#define yaffs_trace(msk, fmt, ...) do { \
61 if (yaffs_trace_mask & (msk)) \
62 printf("yaffs: " fmt "\n", ##__VA_ARGS__); \
63} while (0)
William Juul0e8cc8b2007-11-15 11:13:05 +010064
65
66#define YAFFS_LOSTNFOUND_NAME "lost+found"
67#define YAFFS_LOSTNFOUND_PREFIX "obj"
William Juul0e8cc8b2007-11-15 11:13:05 +010068
69#include "yaffscfg.h"
70
71#define Y_CURRENT_TIME yaffsfs_CurrentTime()
72#define Y_TIME_CONVERT(x) x
73
Charles Manning753ac612012-05-09 16:55:17 +000074#define YAFFS_ROOT_MODE 0666
William Juul0e8cc8b2007-11-15 11:13:05 +010075#define YAFFS_LOSTNFOUND_MODE 0666
76
Masahiro Yamadab5bf5cb2016-09-21 11:28:53 +090077#include <linux/list.h>
Charles Manning753ac612012-05-09 16:55:17 +000078
79#include "yaffsfs.h"
William Juul0e8cc8b2007-11-15 11:13:05 +010080
81#endif