SILC Runtime Toolkit 1.2 Beta 1
[runtime.git] / lib / silcutil / silcdir.h
index 2868d2033a7174f86d0c9ec38e189e0140d467d9..739d94a68dec3b6ae8f98a47ddfe48bd91ffac58 100644 (file)
@@ -17,7 +17,7 @@
 
 */
 
-/****h* silcutil/SILC Directory Interface
+/****h* silcutil/Directory Interface
  *
  * DESCRIPTION
  *
@@ -32,7 +32,7 @@
  * dir = silc_dir_open("foodir");
  *
  * while ((entry = silc_dir_read(dir, NULL)))
- *   printf("File name: %s", silc_dir_entry_name(entry));
+ *   printf("File name: %s\n", silc_dir_entry_name(entry));
  *
  * silc_dir_close(dir);
  *
@@ -41,7 +41,7 @@
 #ifndef SILCDIR_H
 #define SILCDIR_H
 
-/****s* silcutil/SilcDirAPI/SilcDir
+/****s* silcutil/SilcDir
  *
  * NAME
  *
@@ -55,7 +55,7 @@
  ***/
 typedef struct SilcDirStruct *SilcDir;
 
-/****s* silcutil/SilcDirAPI/SilcDirEntry
+/****s* silcutil/SilcDirEntry
  *
  * NAME
  *
@@ -69,67 +69,7 @@ typedef struct SilcDirStruct *SilcDir;
  ***/
 typedef struct SilcDirEntryStruct *SilcDirEntry;
 
-/****d* silcutil/SilcDirAPI/SilcDirEntryMode
- *
- * NAME
- *
- *    typedef enum { ... } SilcDirEntryMode;
- *
- * DESCRIPTION
- *
- *    The directory entry mode bits.  These bits specify the entry mode,
- *    type and protection.
- *
- ***/
-typedef enum {
-  /* Type */
-  SILC_DIR_ENTRY_IFDIR     = 0x00000001,  /* Entry is directory */
-  SILC_DIR_ENTRY_IFCHR     = 0x00000002,  /* Entry is character device */
-  SILC_DIR_ENTRY_IFBLK     = 0x00000004,  /* Entry is block device */
-  SILC_DIR_ENTRY_IFREG     = 0x00000008,  /* Entry is regular file */
-  SILC_DIR_ENTRY_IFIFO     = 0x00000010,  /* Entry is FIFO */
-  SILC_DIR_ENTRY_IFLNK     = 0x00000020,  /* Entry is symbolic link */
-  SILC_DIR_ENTRY_IFSOCK    = 0x00000040,  /* Entry is socket */
-
-  /* Protection */
-  SILC_DIR_ENTRY_IRUSR     = 0x00000080,  /* Owner has read permission */
-  SILC_DIR_ENTRY_IWUSR     = 0x00000100,  /* Owner has write permission */
-  SILC_DIR_ENTRY_IXUSR     = 0x00000200,  /* Owner has execute permission */
-  SILC_DIR_ENTRY_IRGRP     = 0x00000400,  /* Group has read permission */
-  SILC_DIR_ENTRY_IWGRP     = 0x00000800,  /* Group has write permission */
-  SILC_DIR_ENTRY_IXGRP     = 0x00001000,  /* Group has execute permission */
-  SILC_DIR_ENTRY_IROTH     = 0x00002000,  /* Others have read permission */
-  SILC_DIR_ENTRY_IWOTH     = 0x00004000,  /* Others have write permission */
-  SILC_DIR_ENTRY_IXOTH     = 0x00008000,  /* Others have execute permission */
-} SilcDirEntryMode;
-
-/****s* silcutil/SilcDirAPI/SilcDirEntryStat
- *
- * NAME
- *
- *    typedef struct SilcDirEntryObject { ... } *SilcDirEntryStat,
- *                                               SilcDirEntryStatStruct;
- *
- * DESCRIPTION
- *
- *    The directory entry status information structure.  The structure
- *    contains various information about the entry in the directory.
- *    This context is returned by silc_dir_read or silc_dir_entry_stat.
- *
- ***/
-typedef struct SilcDirEntryStatObject {
-  SilcTimeStruct last_access;          /* Time of last access */
-  SilcTimeStruct last_mod;             /* Time of last modification */
-  SilcTimeStruct last_change;          /* Time of last status change */
-  SilcUInt64 size;                     /* Entry size in bytes */
-  SilcUInt32 uid;                      /* Owner ID of the entry */
-  SilcUInt32 gid;                      /* Group owner ID of the entry */
-  SilcUInt32 dev;                      /* Entry device number */
-  SilcUInt32 nlink;                    /* Number of hard links */
-  SilcDirEntryMode mode;               /* Entry mode */
-} *SilcDirEntryStat, SilcDirEntryStatStruct;
-
-/****f* silcutil/SilcDirAPI/silc_dir_open
+/****f* silcutil/silc_dir_open
  *
  * SYNOPSIS
  *
@@ -144,7 +84,7 @@ typedef struct SilcDirEntryStatObject {
  ***/
 SilcDir silc_dir_open(const char *name);
 
-/****f* silcutil/SilcDirAPI/silc_dir_close
+/****f* silcutil/silc_dir_close
  *
  * SYNOPSIS
  *
@@ -157,11 +97,11 @@ SilcDir silc_dir_open(const char *name);
  ***/
 void silc_dir_close(SilcDir dir);
 
-/****f* silcutil/SilcDirAPI/silc_dir_read
+/****f* silcutil/silc_dir_read
  *
  * SYNOPSIS
  *
- *    SilcDirEntry silc_dir_read(SilcDir dir, SilcDirEntryStat *status);
+ *    SilcDirEntry silc_dir_read(SilcDir dir, SilcFileStat status);
  *
  * DESCRIPTION
  *
@@ -170,16 +110,16 @@ void silc_dir_close(SilcDir dir);
  *    next entry context or NULL if there are no more entries or error occurs.
  *    In case of error the silc_errno is also set.
  *
- *    If the `status' is non-NULL this will also call silc_dir_entry_stat
- *    and returns the status into the `status' pointer.
+ *    If the `status' is non-NULL this will also call silc_file_stat and
+ *    returns the status into the `status' pointer.
  *
  *    The returned context remains valid until the silc_dir_read is called
  *    again.
  *
  ***/
-SilcDirEntry silc_dir_read(SilcDir dir, SilcDirEntryStat *status);
+SilcDirEntry silc_dir_read(SilcDir dir, SilcFileStat status);
 
-/****f* silcutil/SilcDirAPI/silc_dir_rewind
+/****f* silcutil/silc_dir_rewind
  *
  * SYNOPSIS
  *
@@ -193,7 +133,7 @@ SilcDirEntry silc_dir_read(SilcDir dir, SilcDirEntryStat *status);
  ***/
 void silc_dir_rewind(SilcDir dir);
 
-/****f* silcutil/SilcDirAPI/silc_dir_name
+/****f* silcutil/silc_dir_name
  *
  * SYNOPSIS
  *
@@ -206,7 +146,7 @@ void silc_dir_rewind(SilcDir dir);
  ***/
 const char *silc_dir_name(SilcDir dir);
 
-/****f* silcutil/SilcDirAPI/silc_dir_entry_name
+/****f* silcutil/silc_dir_entry_name
  *
  * SYNOPSIS
  *
@@ -220,21 +160,4 @@ const char *silc_dir_name(SilcDir dir);
  ***/
 const char *silc_dir_entry_name(SilcDirEntry entry);
 
-/****f* silcutil/SilcDirAPI/silc_dir_entry_stat
- *
- * SYNOPSIS
- *
- *    SilcDirEntryStat silc_dir_entry_stat(SilcDir dir, SilcDirEntry entry);
- *
- * DESCRIPTION
- *
- *    Returns the status of the entry.  The status context contains details
- *    of the entry (file) in the directory.  Returns NULL on error and sets
- *    the silc_errno.
- *
- *    The returned contest is valid until the silc_dir_read is called again.
- *
- ***/
-SilcDirEntryStat silc_dir_entry_stat(SilcDir dir, SilcDirEntry entry);
-
 #endif /* SILCDIR_H */