Added SILC Thread Queue API
[runtime.git] / lib / silcsftp / silcsftp_fs.h
index 6144dc0d9e3d8120aba1e3e5bd263bcdd03f0819..d3aede6597beb74d4f5f5b053e7cedb6f562d4af 100644 (file)
@@ -1,10 +1,10 @@
 /*
 
-  silcsftp_fs.h 
+  silcsftp_fs.h
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 Pekka Riikonen
+  Copyright (C) 2001 - 2007 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 #ifndef SILCSFTP_FS_H
 #define SILCSFTP_FS_H
 
-/****h* silcsftp/SilcSFTPFSAPI
+/****h* silcsftp/SFTP Filesystems Interface
  *
  * DESCRIPTION
  *
@@ -55,7 +55,7 @@
  *
  *    The directories cannot be removed from remote access using the
  *    filesystem access function sftp_rmdir.  This is because the filesystem
- *    is one-user filesystem and differentiating between users is not 
+ *    is one-user filesystem and differentiating between users is not
  *    possible.  Thus, it would allow anyone to remove directories and
  *    their contents.  Removing directories is possible only locally using
  *    the silc_sftp_fs_memory_del_dir function.  The same thing is with
@@ -63,7 +63,7 @@
  *    the silc_sftp_fs_memory_del_file function.  Also, files can not ever
  *    be executed from remote access.
  *
- *    Also some of the file operation flags are not supported, such as 
+ *    Also some of the file operation flags are not supported, such as
  *    SILC_SFTP_FXF_CREAT, SILC_SFTP_FXF_TRUNC and SILC_SFTP_FXF_EXCL
  *    since they would require access to a real filesystem file which does
  *    not exist yet, or would mean destroying the file.  However, the
@@ -76,8 +76,8 @@
 /****s* silcsftp/SilcSFTPFSAPI/SilcSFTPFilesystemOps
  *
  * NAME
- * 
- *    typedef struct SilcSFTPFilesystemOpsStruct { ... } 
+ *
+ *    typedef struct SilcSFTPFilesystemOpsStruct { ... }
  *                     *SilcSFTPFilesystemOps;
  *
  * DESCRIPTION
  * SOURCE
  */
 typedef struct SilcSFTPFilesystemOpsStruct {
-  /* Find a file handle by the file handle data indicated by the `data'. 
+  /* Find a file handle by the file handle data indicated by the `data'.
      If the handle is not found this returns NULL. */
   SilcSFTPHandle (*sftp_get_handle)(void *context, SilcSFTP sftp,
                                    const unsigned char *data,
-                                   uint32 data_len);
+                                   SilcUInt32 data_len);
 
   /* Return encoded handle of `handle' or NULL on error. The caller
      must free the returned buffer. */
   unsigned char *(*sftp_encode_handle)(void *context, SilcSFTP sftp,
                                       SilcSFTPHandle handle,
-                                      uint32 *handle_len);
+                                      SilcUInt32 *handle_len);
 
   /* Open a file indicated by the `filename' with flags indicated by the
      `pflags', and with attributes indicated by the `attr'.  Calls the
      `callback' to return the opened file handle. */
-  void (*sftp_open)(void *context, SilcSFTP sftp, 
-                   const char *filename, 
+  void (*sftp_open)(void *context, SilcSFTP sftp,
+                   const char *filename,
                    SilcSFTPFileOperation pflags,
                    SilcSFTPAttributes attr,
                    SilcSFTPHandleCallback callback,
@@ -115,7 +115,7 @@ typedef struct SilcSFTPFilesystemOpsStruct {
 
   /* Closes the file indicated by the file handle `handle'.  Calls the
      `callback' to indicate the status of the closing. */
-  void (*sftp_close)(void *context, SilcSFTP sftp, 
+  void (*sftp_close)(void *context, SilcSFTP sftp,
                     SilcSFTPHandle handle,
                     SilcSFTPStatusCallback callback,
                     void *callback_context);
@@ -124,20 +124,20 @@ typedef struct SilcSFTPFilesystemOpsStruct {
      from the offset of `offset' at most `len' bytes.  The `callback' is
      called to return the read data. */
   void (*sftp_read)(void *context, SilcSFTP sftp,
-                   SilcSFTPHandle handle, 
-                   uint64 offset, 
-                   uint32 len,
+                   SilcSFTPHandle handle,
+                   SilcUInt64 offset,
+                   SilcUInt32 len,
                    SilcSFTPDataCallback callback,
                    void *callback_context);
 
   /* Writes to a file indicated by the file handle `handle' starting from
-     offset of `offset' at most `data_len' bytes of `data'.  The `callback' 
+     offset of `offset' at most `data_len' bytes of `data'.  The `callback'
      is called to indicate the status of the writing. */
   void (*sftp_write)(void *context, SilcSFTP sftp,
                     SilcSFTPHandle handle,
-                    uint64 offset,
+                    SilcUInt64 offset,
                     const unsigned char *data,
-                    uint32 data_len,
+                    SilcUInt32 data_len,
                     SilcSFTPStatusCallback callback,
                     void *callback_context);
 
@@ -208,7 +208,7 @@ typedef struct SilcSFTPFilesystemOpsStruct {
                     SilcSFTPHandle handle,
                     SilcSFTPAttrCallback callback,
                     void *callback_context);
-  
+
   /* Sets a file attributes to a file indicated by the `path' with the
      attributes indicated by the `attrs'.  Calls the `callback' to indicate
      the status of the setting. */
@@ -250,13 +250,13 @@ typedef struct SilcSFTPFilesystemOpsStruct {
                        SilcSFTPNameCallback callback,
                        void *callback_context);
 
-  /* Performs an extended operation indicated by the `request' with 
+  /* Performs an extended operation indicated by the `request' with
      optional extended operation data indicated by the `data'.  The callback
      is called to return any data associated with the extended request. */
   void (*sftp_extended)(void *context, SilcSFTP sftp,
                        const char *request,
                        const unsigned char *data,
-                       uint32 data_len,
+                       SilcUInt32 data_len,
                        SilcSFTPExtendedCallback callback,
                        void *callback_context);
 } *SilcSFTPFilesystemOps;
@@ -265,7 +265,7 @@ typedef struct SilcSFTPFilesystemOpsStruct {
 /****s* silcsftp/SilcSFTPFSAPI/SilcSFTPFilesystem
  *
  * NAME
- * 
+ *
  *    typedef struct { ... } *SilcSFTPFilesystem;
  *
  * DESCRIPTION
@@ -277,7 +277,7 @@ typedef struct SilcSFTPFilesystemOpsStruct {
  *
  * SOURCE
  */
-typedef struct {
+typedef struct SilcSFTPFilesystemStruct {
   SilcSFTPFilesystemOps fs;
   void *fs_context;
 } *SilcSFTPFilesystem;
@@ -288,7 +288,7 @@ typedef struct {
 /****d* silcsftp/SilcSFTPFSAPI/SilcSFTPFSMemoryPerm
  *
  * NAME
- * 
+ *
  *    typedef enum { ... } SilcSFTPFSMemoryPerm;
  *
  * DESCRIPTION
@@ -340,7 +340,7 @@ void silc_sftp_fs_memory_free(SilcSFTPFilesystem fs);
  *
  * SYNOPSIS
  *
- *    void *silc_sftp_fs_memory_add_dir(void *context, void *dir,
+ *    void *silc_sftp_fs_memory_add_dir(SilcSFTPFilesystem fs, void *dir,
  *                                      SilcSFTPFSMemoryPerm perm,
  *                                      const char *name);
  *
@@ -351,9 +351,9 @@ void silc_sftp_fs_memory_free(SilcSFTPFilesystem fs);
  *    or new subdirectories under the directory. The `dir' is the parent
  *    directory of the directory to be added. If this directory is to be
  *    added to the root directory the `dir' is NULL.  The `name' is the name
- *    of the directory. If error occurs this returns NULL. The `perm' will 
+ *    of the directory. If error occurs this returns NULL. The `perm' will
  *    indicate the permissions for the directory and they work in POSIX
- *    style. 
+ *    style.
  *
  ***/
 void *silc_sftp_fs_memory_add_dir(SilcSFTPFilesystem fs, void *dir,
@@ -364,7 +364,7 @@ void *silc_sftp_fs_memory_add_dir(SilcSFTPFilesystem fs, void *dir,
  *
  * SYNOPSIS
  *
- *    bool silc_sftp_fs_memory_del_dir(SilcSFTPFilesystem fs, void *dir);
+ *    SilcBool silc_sftp_fs_memory_del_dir(SilcSFTPFilesystem fs, void *dir);
  *
  * DESCRIPTION
  *
@@ -377,16 +377,16 @@ void *silc_sftp_fs_memory_add_dir(SilcSFTPFilesystem fs, void *dir,
  *    access function sftp_rmdir.
  *
  ***/
-bool silc_sftp_fs_memory_del_dir(SilcSFTPFilesystem fs, void *dir);
+SilcBool silc_sftp_fs_memory_del_dir(SilcSFTPFilesystem fs, void *dir);
 
 /****f* silcsftp/SilcSFTPFSAPI/silc_sftp_fs_memory_add_file
  *
  * SYNOPSIS
  *
- *    bool silc_sftp_fs_memory_add_file(SilcSFTPFilesystem fs, void *dir,
- *                                      SilcSFTPFSMemoryPerm perm,
- *                                      const char *filename,
- *                                      const char *realpath);
+ *    SilcBool silc_sftp_fs_memory_add_file(SilcSFTPFilesystem fs, void *dir,
+ *                                          SilcSFTPFSMemoryPerm perm,
+ *                                          const char *filename,
+ *                                          const char *realpath);
  *
  * DESCRIPTION
  *
@@ -401,17 +401,17 @@ bool silc_sftp_fs_memory_del_dir(SilcSFTPFilesystem fs, void *dir);
  *    was added to the directory.
  *
  ***/
-bool silc_sftp_fs_memory_add_file(SilcSFTPFilesystem fs, void *dir,
-                                 SilcSFTPFSMemoryPerm perm,
-                                 const char *filename,
-                                 const char *realpath);
+SilcBool silc_sftp_fs_memory_add_file(SilcSFTPFilesystem fs, void *dir,
+                                     SilcSFTPFSMemoryPerm perm,
+                                     const char *filename,
+                                     const char *realpath);
 
 /****f* silcsftp/SilcSFTPFSAPI/silc_sftp_fs_memory_del_file
  *
  * SYNOPSIS
  *
- *    bool silc_sftp_fs_memory_del_file(SilcSFTPFilesystem fs, void *dir,
- *                                      const char *filename);
+ *    SilcBool silc_sftp_fs_memory_del_file(SilcSFTPFilesystem fs, void *dir,
+ *                                          const char *filename);
  *
  * DESCRIPTION
  *
@@ -422,7 +422,7 @@ bool silc_sftp_fs_memory_add_file(SilcSFTPFilesystem fs, void *dir,
  *    access function sftp_remove.
  *
  ***/
-bool silc_sftp_fs_memory_del_file(SilcSFTPFilesystem fs, void *dir,
-                                 const char *filename);
+SilcBool silc_sftp_fs_memory_del_file(SilcSFTPFilesystem fs, void *dir,
+                                     const char *filename);
 
 #endif /* SILCSFTP_FS_H */