summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/rfs/rtems-rfs-dir.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /cpukit/libfs/src/rfs/rtems-rfs-dir.h
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'cpukit/libfs/src/rfs/rtems-rfs-dir.h')
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-dir.h209
1 files changed, 0 insertions, 209 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-dir.h b/cpukit/libfs/src/rfs/rtems-rfs-dir.h
deleted file mode 100644
index ae3647d03c..0000000000
--- a/cpukit/libfs/src/rfs/rtems-rfs-dir.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/**
- * @file
- *
- * @brief RTEMS File System Directory Support
- *
- * @ingroup rtems_rfs
- *
- * RTEMS File System Directory Support
- *
- * This file provides the directory support functions.
- */
-
-/*
- * COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#if !defined (_RTEMS_RFS_DIR_H_)
-#define _RTEMS_RFS_DIR_H_
-
-#include <dirent.h>
-
-#include <rtems/libio_.h>
-
-#include <rtems/rfs/rtems-rfs-data.h>
-#include <rtems/rfs/rtems-rfs-file-system.h>
-#include <rtems/rfs/rtems-rfs-inode.h>
-
-/**
- * Define the offsets of the fields of a directory entry.
- */
-#define RTEMS_RFS_DIR_ENTRY_INO (0) /**< The ino offset in a directory
- * entry. */
-#define RTEMS_RFS_DIR_ENTRY_HASH (4) /**< The hash offset in a directory
- * entry. The hash is 32bits. We need at
- * least 16bits and given the length and
- * ino field are 4 the extra 2 bytes is
- * not a big overhead.*/
-#define RTEMS_RFS_DIR_ENTRY_LEN (8) /**< The length offset in a directory
- * entry. */
-
-/**
- * The length of the directory entry header.
- */
-#define RTEMS_RFS_DIR_ENTRY_SIZE (4 + 4 + 2)
-
-/**
- * The length when the remainder of the directory block is empty.
- */
-#define RTEMS_RFS_DIR_ENTRY_EMPTY (0xffff)
-
-/**
- * Return the hash of the entry.
- *
- * @param[in] _e is a pointer to the directory entry.
- *
- * @retval hash The uint32_t hash of the entry.
- */
-#define rtems_rfs_dir_entry_hash(_e) \
- rtems_rfs_read_u32 (_e + RTEMS_RFS_DIR_ENTRY_HASH)
-
-/**
- * Set the hash of the entry.
- *
- * @param[in] _e is a pointer to the directory entry.
- *
- * @param[in] _h is the hash of the entry.
- */
-#define rtems_rfs_dir_set_entry_hash(_e, _h) \
- rtems_rfs_write_u32 (_e + RTEMS_RFS_DIR_ENTRY_HASH, _h)
-
-/**
- * Return the ino of the entry.
- *
- * @param[in] _e is a pointer to the directory entry.
- *
- * @retval ino The ino of the entry.
- */
-#define rtems_rfs_dir_entry_ino(_e) \
- rtems_rfs_read_u32 (_e + RTEMS_RFS_DIR_ENTRY_INO)
-
-/**
- * Set the ino of the entry.
- *
- * @param[in] _e is a pointer to the directory entry.
- *
- * @param[in] _i is the ino of the entry.
- */
-#define rtems_rfs_dir_set_entry_ino(_e, _i) \
- rtems_rfs_write_u32 (_e + RTEMS_RFS_DIR_ENTRY_INO, _i)
-
-/**
- * Return the length of the entry.
- *
- * @param[in] _e Pointer to the directory entry.
- *
- * @retval length The length of the entry.
- */
-#define rtems_rfs_dir_entry_length(_e) \
- rtems_rfs_read_u16 (_e + RTEMS_RFS_DIR_ENTRY_LEN)
-
-/**
- * Set the length of the entry.
- *
- * @param[in] _e is a pointer to the directory entry.
- * @param[in] _l is the length.
- */
-#define rtems_rfs_dir_set_entry_length(_e, _l) \
- rtems_rfs_write_u16 (_e + RTEMS_RFS_DIR_ENTRY_LEN, _l)
-
-/**
- * Look up a directory entry in the directory pointed to by the inode. The look
- * up is local to this directory. No need to decend.
- *
- * @param[in] fs is the file system.
- * @param[in] inode is a pointer to the inode of the directory to search.
- * @param[in] name is a pointer to the name to look up. The name may not be
- * nul terminated.
- * @param[in] length is the length of the name.
- * @param[out] ino will be filled in with the inode number
- * if there is no error.
- * @param[in] offset is the offset in the directory for the entry.
- *
- * @retval 0 Successful operation.
- * @retval error_code An error occurred.
- */
-int rtems_rfs_dir_lookup_ino (rtems_rfs_file_system* fs,
- rtems_rfs_inode_handle* inode,
- const char* name,
- int length,
- rtems_rfs_ino* ino,
- uint32_t* offset);
-
-/**
- * Add an entry to the directory returing the inode number allocated to the
- * entry.
- *
- * @param[in] fs is the file system data.
- * @param[in] dir is a pointer to the directory inode the
- * entry is to be added too.
- * @param[in] name is a pointer to the name of the entry to be added.
- * @param[in] length is the length of the name excluding a terminating 0.
- * @param[in] ino is the ino of the entry.
- *
- * @retval 0 Successful operation.
- * @retval error_code An error occurred.
- */
-int rtems_rfs_dir_add_entry (rtems_rfs_file_system* fs,
- rtems_rfs_inode_handle* dir,
- const char* name,
- size_t length,
- rtems_rfs_ino ino);
-
-/**
- * Del an entry from the directory using an inode number as a key.
- *
- * @param[in] fs is the file system data.
- * @param[in] dir is a pointer to the directory inode the
- * entry is to be deleted from.
- * @param[in] ino is the ino of the entry.
- * @param[in] offset is the offset in the directory of the entry
- * to delete. If 0 search from the start for the ino.
- *
- * @retval 0 Successful operation.
- * @retval error_code An error occurred.
- */
-int rtems_rfs_dir_del_entry (rtems_rfs_file_system* fs,
- rtems_rfs_inode_handle* dir,
- rtems_rfs_ino ino,
- uint32_t offset);
-
-/**
- * Read the directory entry from offset into the directory entry buffer and
- * return the length of space this entry uses in the directory table.
- *
- * @param[in] fs is the file system data.
- * @param[in] dir is a pointer to the direct inode handler.
- * @param[in] offset is the offset in the directory to read from.
- * @param[in] dirent is a ointer to the dirent structure the entry
- * is written into.
- * @param[out] length will contain the length this entry
- * takes in the directory.
- *
- * @retval 0 Successful operation.
- * @retval error_code An error occurred.
- */
-int rtems_rfs_dir_read (rtems_rfs_file_system* fs,
- rtems_rfs_inode_handle* dir,
- rtems_rfs_pos_rel offset,
- struct dirent* dirent,
- size_t* length);
-
-/**
- * Check if the directory is empty. The current and parent directory entries
- * are ignored.
- *
- * @param[in] fs is the file system data
- * @param[in] dir is a pointer to the directory inode to check.
- *
- * @retval 0 Successful operation.
- * @retval error_code An error occurred.
- */
-int rtems_rfs_dir_empty (rtems_rfs_file_system* fs,
- rtems_rfs_inode_handle* dir);
-
-#endif