summaryrefslogtreecommitdiff
path: root/lib.h
diff options
context:
space:
mode:
authorSergiu Ivanov <unlimitedscolobb@gmail.com>2008-11-21 23:54:40 +0200
committerSergiu Ivanov <unlimitedscolobb@gmail.com>2008-11-21 23:54:40 +0200
commita54273639f6afd659c15326cb997922fcecfe89a (patch)
tree3f240fed8fcfd7f14cbc5b7d059f48f6eb9707cb /lib.h
parent59f4d4d2b67028c01f41ea0de0f12934b4fad07b (diff)
Moved the code to GCS
Now the code is (hopefully) compliant with GNU Coding Standards.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h95
1 files changed, 46 insertions, 49 deletions
diff --git a/lib.h b/lib.h
index 776d475e2..2b7f49a90 100644
--- a/lib.h
+++ b/lib.h
@@ -1,10 +1,10 @@
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*lib.h*/
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*Declarations of basic routines for filesystem manipulations*/
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*Based on the code of unionfs translator.*/
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*Copyright (C) 2001, 2002, 2005, 2008 Free Software Foundation, Inc.
Written by Sergiu Ivanov <unlimitedscolobb@gmail.com>.
@@ -22,72 +22,69 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.*/
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
#ifndef __LIB_H__
#define __LIB_H__
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
#define __USE_FILE_OFFSET64
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
#include <hurd.h>
#include <dirent.h>
#include <stddef.h>
#include <hurd/iohelp.h>
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------*/
-/*--------Macros--------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
+/*--------Macros-------------------------------------------------------------*/
/*Alignment of directory entries*/
#define DIRENT_ALIGN 4
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*The offset of the directory name in the directory entry structure*/
#define DIRENT_NAME_OFFS offsetof(struct dirent, d_name)
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*Computes the length of the structure before the name + the name + 0,
- all padded to DIRENT_ALIGN*/
+ all padded to DIRENT_ALIGN*/
#define DIRENT_LEN(name_len)\
((DIRENT_NAME_OFFS + (name_len) + 1 + DIRENT_ALIGN - 1) &\
~(DIRENT_ALIGN - 1))
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
/*Deallocate the given port for the current task*/
#define PORT_DEALLOC(p) (mach_port_deallocate(mach_task_self(), (p)))
-/*----------------------------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------*/
-/*--------Functions-----------------------------------------------------------*/
+/*---------------------------------------------------------------------------*/
+/*--------Functions----------------------------------------------------------*/
/*Fetches directory entries for `dir`*/
-error_t
-dir_entries_get
- (
- file_t dir,
- char ** dirent_data, /*the list of directory entries as returned
- by dir_readdir*/
- size_t * dirent_data_size, /*the size of `dirent_data`*/
- struct dirent *** dirent_list /*the array of pointers to beginnings of
- dirents in dirent_data*/
- );
-/*----------------------------------------------------------------------------*/
+error_t dir_entries_get (file_t dir,
+ char **dirent_data, /*the list of directory
+ entries as returned by
+ dir_readdir */
+ size_t * dirent_data_size,/*the size of
+ `dirent_data` */
+ struct dirent ***dirent_list/*the array of
+ pointers to
+ beginnings of
+ dirents in
+ dirent_data */
+ );
+/*---------------------------------------------------------------------------*/
/*Lookup `name` under `dir` (or cwd, if `dir` is invalid)*/
+error_t file_lookup (file_t dir, char *name,
+ int flags0, /*try to open with these flags first */
+ int flags1, /*try to open with these flags, if
+ `flags0` fail */
+ int mode, /*if the file is to be created, create
+ it with this mode */
+ file_t * port, /*store the port to the looked up
+ file here */
+ io_statbuf_t * stat /*store the stat information here */
+ );
+/*---------------------------------------------------------------------------*/
+/*Checks whether `user` has the right to open the node described by
+ `stat` with `flags`*/
error_t
-file_lookup
- (
- file_t dir,
- char * name,
- int flags0, /*try to open with these flags first*/
- int flags1, /*try to open with these flags, if `flags0` fail*/
- int mode, /*if the file is to be created, create it with this mode*/
- file_t * port, /*store the port to the looked up file here*/
- io_statbuf_t * stat /*store the stat information here*/
- );
-/*----------------------------------------------------------------------------*/
-/*Checks whether `user` has the right to open the node described by `stat` with
- `flags`*/
-error_t
-check_open_permissions
- (
- struct iouser * user,
- io_statbuf_t * stat,
- int flags
- );
-/*----------------------------------------------------------------------------*/
+ check_open_permissions
+ (struct iouser *user, io_statbuf_t * stat, int flags);
+/*---------------------------------------------------------------------------*/
#endif /*__LIB_H__*/