Make char* parameters const
[samba.git] / source / include / libsmbclient.h
index 575bef691c4067f910cce2ccb95220a564d51678..869aeb6a032336512c101f528e61f07041cc95c5 100644 (file)
@@ -75,6 +75,7 @@ extern "C" {
 /* Make sure we have the following includes for now ... */
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/statvfs.h>
 #include <fcntl.h>
 #include <utime.h>
 
@@ -179,16 +180,16 @@ typedef enum smbc_smb_encrypt_level
  * smbc_statvfs(). These may be OR-ed together to reflect a full set of
  * available capabilities.
  */
-typedef enum smbc_vfs_capability
+typedef enum smbc_vfs_feature
 {
     /* Defined by POSIX or in Linux include files (low-order bits) */
-    SMBC_VFS_CAP_RDONLY         = (1 << 0),
+    SMBC_VFS_FEATURE_RDONLY         = (1 << 0),
 
     /* Specific to libsmbclient (high-order bits) */
-    SMBC_VFS_CAP_DFS            = (1 << 29),
-    SMBC_VFS_CAP_CASE_SENSITIVE = (1 << 30),
-    SMBC_VFS_CAP_UNIXCIFS       = (1 << 31)
-} smbc_vfs_capability;
+    SMBC_VFS_FEATURE_DFS              = (1 << 28),
+    SMBC_VFS_FEATURE_CASE_INSENSITIVE = (1 << 29),
+    SMBC_VFS_FEATURE_NO_UNIXCIFS      = (1 << 30)
+} smbc_vfs_feature;
 
 typedef int smbc_bool;
 
@@ -869,6 +870,12 @@ typedef int (*smbc_fstat_fn)(SMBCCTX *c,
 smbc_fstat_fn smbc_getFunctionFstat(SMBCCTX *c);
 void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn);
 
+typedef int (*smbc_statvfs_fn)(SMBCCTX *c,
+                               char *path,
+                               struct statvfs *st);
+smbc_statvfs_fn smbc_getFunctionStatVFS(SMBCCTX *c);
+void smbc_setFunctionStatVFS(SMBCCTX *c, smbc_statvfs_fn fn);
+
 typedef int (*smbc_fstatvfs_fn)(SMBCCTX *c,
                                 SMBCFILE *file,
                                 struct statvfs *st);
@@ -1613,6 +1620,28 @@ int smbc_stat(const char *url, struct stat *st);
 int smbc_fstat(int fd, struct stat *st);
 
 
+/**@ingroup attribute
+ * Get file system information for a specified path.
+ * 
+ * @param url       The smb url to get information for
+ *
+ * @param st        pointer to a buffer that will be filled with 
+ *                  standard Unix struct statvfs information.
+ * 
+ * @return          EBADF  filedes is bad.
+ *                  - EACCES Permission denied.
+ *                  - EBADF fd is not a valid file descriptor
+ *                  - EINVAL Problems occurred in the underlying routines
+ *                   or smbc_init not called.
+ *                  - ENOMEM Out of memory
+ *
+ * @see             Unix fstatvfs()
+ *
+ */
+int
+smbc_statvfs(char *url,
+             struct statvfs *st);
+
 /**@ingroup attribute
  * Get file system information via an file descriptor.
  * 
@@ -1636,6 +1665,7 @@ int
 smbc_fstatvfs(int fd,
               struct statvfs *st);
 
+
 /**@ingroup attribute
  * Truncate a file given a file descriptor
  * 
@@ -2647,12 +2677,24 @@ smbc_version(void);
  */
 
 void
-smbc_set_credentials(char *workgroup,
-                     char *user,
-                     char *password,
+smbc_set_credentials(const char *workgroup,
+                     const char *user,
+                     const char *password,
                      smbc_bool use_kerberos,
-                     char *signing_state);
+                     const char *signing_state);
+
+/*
+ * Wrapper around smbc_set_credentials.
+ * Used to set correct credentials that will
+ * be used to connect to DFS target share 
+ * in libsmbclient
+ */
 
+void
+smbc_set_credentials_with_fallback(SMBCCTX *ctx,
+                                  const char *workgroup,
+                                  const char *user,
+                                  const char *password);
 
 /**
  * @ingroup structure