1N/A/*
1N/A * types.h - Misc type definitions not related to on-disk structure. Part of
1N/A * the Linux-NTFS project.
1N/A *
1N/A * Copyright (c) 2000-2004 Anton Altaparmakov
1N/A * Copyright (c) 2006 Szabolcs Szakacsits
1N/A * Copyright (c) 2007 Yura Pakhuchiy
1N/A *
1N/A * This program/include file is free software; you can redistribute it and/or
1N/A * modify it under the terms of the GNU General Public License as published
1N/A * by the Free Software Foundation; either version 2 of the License, or
1N/A * (at your option) any later version.
1N/A *
1N/A * This program/include file is distributed in the hope that it will be
1N/A * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
1N/A * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A * GNU General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU General Public License
1N/A * along with this program (in the main directory of the Linux-NTFS
1N/A * distribution in the file COPYING); if not, write to the Free Software
1N/A * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1N/A */
1N/A
1N/A#ifndef _NTFS_TYPES_H
1N/A#define _NTFS_TYPES_H
1N/A
1N/A#ifdef HAVE_CONFIG_H
1N/A#include "config.h"
1N/A#endif
1N/A
1N/A#if HAVE_STDINT_H || !HAVE_CONFIG_H
1N/A#include <stdint.h>
1N/A#endif
1N/A#ifdef HAVE_SYS_TYPES_H
1N/A#include <sys/types.h>
1N/A#endif
1N/A
1N/Atypedef uint8_t u8; /* Unsigned types of an exact size */
1N/Atypedef uint16_t u16;
1N/Atypedef uint32_t u32;
1N/Atypedef uint64_t u64;
1N/A
1N/Atypedef int8_t s8; /* Signed types of an exact size */
1N/Atypedef int16_t s16;
1N/Atypedef int32_t s32;
1N/Atypedef int64_t s64;
1N/A
1N/A#if defined(__CHECKER__) && !defined(NTFS_DO_NOT_CHECK_ENDIANS)
1N/A #undef __bitwise
1N/A #undef __force
1N/A #define __bitwise __attribute__((bitwise))
1N/A #define __force __attribute__((force))
1N/A#else
1N/A #undef __bitwise
1N/A #undef __force
1N/A #define __bitwise
1N/A #define __force
1N/A#endif
1N/A
1N/Atypedef u16 __bitwise le16;
1N/Atypedef u32 __bitwise le32;
1N/Atypedef u64 __bitwise le64;
1N/A
1N/A/*
1N/A * Declare sle{16,32,64} to be unsigned because we do not want sign extension
1N/A * on BE architectures.
1N/A */
1N/Atypedef u16 __bitwise sle16;
1N/Atypedef u32 __bitwise sle32;
1N/Atypedef u64 __bitwise sle64;
1N/A
1N/Atypedef u16 __bitwise be16;
1N/Atypedef u32 __bitwise be32;
1N/Atypedef u64 __bitwise be64;
1N/A
1N/Atypedef le16 ntfschar; /* 2-byte Unicode character type. */
1N/A#define UCHAR_T_SIZE_BITS 1
1N/A
1N/A/*
1N/A * Clusters are signed 64-bit values on NTFS volumes. We define two types, LCN
1N/A * and VCN, to allow for type checking and better code readability.
1N/A */
1N/Atypedef s64 VCN;
1N/Atypedef sle64 leVCN;
1N/Atypedef s64 LCN;
1N/Atypedef sle64 leLCN;
1N/A
1N/A/*
1N/A * The NTFS journal $LogFile uses log sequence numbers which are signed 64-bit
1N/A * values. We define our own type LSN, to allow for type checking and better
1N/A * code readability.
1N/A */
1N/Atypedef s64 LSN;
1N/Atypedef sle64 leLSN;
1N/A
1N/A/*
1N/A * Cygwin has a collision between our BOOL and <windef.h>'s
1N/A * As long as this file will be included after <windows.h> we're fine.
1N/A */
1N/A#ifndef _WINDEF_H
1N/A/**
1N/A * enum BOOL - These are just to make the code more readable...
1N/A */
1N/Atypedef enum {
1N/A#ifndef FALSE
1N/A FALSE = 0,
1N/A#endif
1N/A#ifndef NO
1N/A NO = 0,
1N/A#endif
1N/A#ifndef ZERO
1N/A ZERO = 0,
1N/A#endif
1N/A#ifndef TRUE
1N/A TRUE = 1,
1N/A#endif
1N/A#ifndef YES
1N/A YES = 1,
1N/A#endif
1N/A#ifndef ONE
1N/A ONE = 1,
1N/A#endif
1N/A} BOOL;
1N/A#endif /* defined _WINDEF_H */
1N/A
1N/A/**
1N/A * enum IGNORE_CASE_BOOL -
1N/A */
1N/Atypedef enum {
1N/A CASE_SENSITIVE = 0,
1N/A IGNORE_CASE = 1,
1N/A} IGNORE_CASE_BOOL;
1N/A
1N/A#define STATUS_OK (0)
1N/A#define STATUS_ERROR (-1)
1N/A#define STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT (-2)
1N/A#define STATUS_KEEP_SEARCHING (-3)
1N/A#define STATUS_NOT_FOUND (-4)
1N/A
1N/A#endif /* defined _NTFS_TYPES_H */
1N/A