linux/fs/hfsplus/hfsplus_raw.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  linux/include/linux/hfsplus_raw.h
 *
 * Copyright (C) 1999
 * Brad Boyer ([email protected])
 * (C) 2003 Ardis Technologies <[email protected]>
 *
 * Format of structures on disk
 * Information taken from Apple Technote #1150 (HFS Plus Volume Format)
 *
 */

#ifndef _LINUX_HFSPLUS_RAW_H
#define _LINUX_HFSPLUS_RAW_H

#include <linux/types.h>

/* Some constants */
#define HFSPLUS_SECTOR_SIZE
#define HFSPLUS_SECTOR_SHIFT
#define HFSPLUS_VOLHEAD_SECTOR
#define HFSPLUS_VOLHEAD_SIG
#define HFSPLUS_VOLHEAD_SIGX
#define HFSPLUS_SUPER_MAGIC
#define HFSPLUS_MIN_VERSION
#define HFSPLUS_CURRENT_VERSION

#define HFSP_WRAP_MAGIC
#define HFSP_WRAP_ATTRIB_SLOCK
#define HFSP_WRAP_ATTRIB_SPARED

#define HFSP_WRAPOFF_SIG
#define HFSP_WRAPOFF_ATTRIB
#define HFSP_WRAPOFF_ABLKSIZE
#define HFSP_WRAPOFF_ABLKSTART
#define HFSP_WRAPOFF_EMBEDSIG
#define HFSP_WRAPOFF_EMBEDEXT

#define HFSP_HIDDENDIR_NAME

#define HFSP_HARDLINK_TYPE
#define HFSP_HFSPLUS_CREATOR

#define HFSP_SYMLINK_TYPE
#define HFSP_SYMLINK_CREATOR

#define HFSP_MOUNT_VERSION

/* Structures used on disk */

hfsplus_cnid;
hfsplus_unichr;

#define HFSPLUS_MAX_STRLEN
#define HFSPLUS_ATTR_MAX_STRLEN

/* A "string" as used in filenames, etc. */
struct hfsplus_unistr {} __packed;

/*
 * A "string" is used in attributes file
 * for name of extended attribute
 */
struct hfsplus_attr_unistr {} __packed;

/* POSIX permissions */
struct hfsplus_perm {} __packed;

#define HFSPLUS_FLG_NODUMP
#define HFSPLUS_FLG_IMMUTABLE
#define HFSPLUS_FLG_APPEND

/* A single contiguous area of a file */
struct hfsplus_extent {} __packed;
hfsplus_extent_rec;

/* Information for a "Fork" in a file */
struct hfsplus_fork_raw {} __packed;

/* HFS+ Volume Header */
struct hfsplus_vh {} __packed;

/* HFS+ volume attributes */
#define HFSPLUS_VOL_UNMNT
#define HFSPLUS_VOL_SPARE_BLK
#define HFSPLUS_VOL_NOCACHE
#define HFSPLUS_VOL_INCNSTNT
#define HFSPLUS_VOL_NODEID_REUSED
#define HFSPLUS_VOL_JOURNALED
#define HFSPLUS_VOL_SOFTLOCK
#define HFSPLUS_VOL_UNUSED_NODE_FIX

/* HFS+ BTree node descriptor */
struct hfs_bnode_desc {} __packed;

/* HFS+ BTree node types */
#define HFS_NODE_INDEX
#define HFS_NODE_HEADER
#define HFS_NODE_MAP
#define HFS_NODE_LEAF

/* HFS+ BTree header */
struct hfs_btree_header_rec {} __packed;

/* BTree attributes */
#define HFS_TREE_BIGKEYS
#define HFS_TREE_VARIDXKEYS

/* HFS+ BTree misc info */
#define HFSPLUS_TREE_HEAD
#define HFSPLUS_NODE_MXSZ
#define HFSPLUS_ATTR_TREE_NODE_SIZE
#define HFSPLUS_BTREE_HDR_NODE_RECS_COUNT
#define HFSPLUS_BTREE_HDR_USER_BYTES

/* Some special File ID numbers (stolen from hfs.h) */
#define HFSPLUS_POR_CNID
#define HFSPLUS_ROOT_CNID
#define HFSPLUS_EXT_CNID
#define HFSPLUS_CAT_CNID
#define HFSPLUS_BAD_CNID
#define HFSPLUS_ALLOC_CNID
#define HFSPLUS_START_CNID
#define HFSPLUS_ATTR_CNID
#define HFSPLUS_EXCH_CNID
#define HFSPLUS_FIRSTUSER_CNID

/* btree key type */
#define HFSPLUS_KEY_CASEFOLDING
#define HFSPLUS_KEY_BINARY

/* HFS+ catalog entry key */
struct hfsplus_cat_key {} __packed;

#define HFSPLUS_CAT_KEYLEN

/* Structs from hfs.h */
struct hfsp_point {} __packed;

struct hfsp_rect {} __packed;


/* HFS directory info (stolen from hfs.h */
struct DInfo {} __packed;

struct DXInfo {} __packed;

/* HFS+ folder data (part of an hfsplus_cat_entry) */
struct hfsplus_cat_folder {} __packed;

/* HFS file info (stolen from hfs.h) */
struct FInfo {} __packed;

struct FXInfo {} __packed;

/* HFS+ file data (part of a cat_entry) */
struct hfsplus_cat_file {} __packed;

/* File and folder flag bits */
#define HFSPLUS_FILE_LOCKED
#define HFSPLUS_FILE_THREAD_EXISTS
#define HFSPLUS_XATTR_EXISTS
#define HFSPLUS_ACL_EXISTS
#define HFSPLUS_HAS_FOLDER_COUNT

/* HFS+ catalog thread (part of a cat_entry) */
struct hfsplus_cat_thread {} __packed;

#define HFSPLUS_MIN_THREAD_SZ

/* A data record in the catalog tree */
hfsplus_cat_entry;

/* HFS+ catalog entry type */
#define HFSPLUS_FOLDER
#define HFSPLUS_FILE
#define HFSPLUS_FOLDER_THREAD
#define HFSPLUS_FILE_THREAD

/* HFS+ extents tree key */
struct hfsplus_ext_key {} __packed;

#define HFSPLUS_EXT_KEYLEN

#define HFSPLUS_XATTR_FINDER_INFO_NAME
#define HFSPLUS_XATTR_ACL_NAME

#define HFSPLUS_ATTR_INLINE_DATA
#define HFSPLUS_ATTR_FORK_DATA
#define HFSPLUS_ATTR_EXTENTS

/* HFS+ attributes tree key */
struct hfsplus_attr_key {} __packed;

#define HFSPLUS_ATTR_KEYLEN

/* HFS+ fork data attribute */
struct hfsplus_attr_fork_data {} __packed;

/* HFS+ extension attribute */
struct hfsplus_attr_extents {} __packed;

#define HFSPLUS_MAX_INLINE_DATA_SIZE

/* HFS+ attribute inline data */
struct hfsplus_attr_inline_data {} __packed;

/* A data record in the attributes tree */
hfsplus_attr_entry;

/* HFS+ generic BTree key */
hfsplus_btree_key;

#endif