Rename the nfs_open() argument from mode to flags
[deb_libnfs.git] / include / nfsc / libnfs.h
index 388ea78e6293685ebe5ad028fe063c8f55e33cc0..b9138c9066409ea3fab16053a4ebca4c9a2d793d 100644 (file)
@@ -166,6 +166,13 @@ EXTERN uint64_t nfs_get_readmax(struct nfs_context *nfs);
  */
 EXTERN uint64_t nfs_get_writemax(struct nfs_context *nfs);
 
+/*
+ *  MODIFY CONNECT PARAMTERS 
+ */
+
+EXTERN void nfs_set_tcp_syncnt(struct nfs_context *nfs, int v);
+EXTERN void nfs_set_uid(struct nfs_context *nfs, int uid);
+EXTERN void nfs_set_gid(struct nfs_context *nfs, int gid);
 
 /*
  * MOUNT THE EXPORT
@@ -265,6 +272,11 @@ EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *
  *  0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
  * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
  *
+ * Supported flags are
+ * O_RDONLY
+ * O_WRONLY
+ * O_RDWR
+ *
  * When the callback is invoked, status indicates the result:
  *      0 : Success.
  *          data is a struct *nfsfh;
@@ -272,14 +284,14 @@ EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *
  * -errno : An error occured.
  *          data is the error string.
  */
-EXTERN int nfs_open_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data);
+EXTERN int nfs_open_async(struct nfs_context *nfs, const char *path, int flags, nfs_cb cb, void *private_data);
 /*
- * Sync stat(<filename>)
+ * Sync open(<filename>)
  * Function returns
  *      0 : The operation was successfull. *nfsfh is filled in.
  * -errno : The command failed.
  */
-EXTERN int nfs_open(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh);
+EXTERN int nfs_open(struct nfs_context *nfs, const char *path, int flags, struct nfsfh **nfsfh);
 
 
 
@@ -716,7 +728,7 @@ EXTERN struct nfsdirent *nfs_readdir(struct nfs_context *nfs, struct nfsdir *nfs
 
 
 /*
- * READDIR()
+ * CLOSEDIR()
  */
 /*
  * nfs_closedir() never blocks, so no special sync/async versions are available
@@ -724,6 +736,49 @@ EXTERN struct nfsdirent *nfs_readdir(struct nfs_context *nfs, struct nfsdir *nfs
 EXTERN void nfs_closedir(struct nfs_context *nfs, struct nfsdir *nfsdir);
 
 
+/*
+ * CHDIR()
+ */
+/*
+ * Async chdir(<path>)
+ *
+ * Function returns
+ *  0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
+ * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
+ *
+ * When the callback is invoked, status indicates the result:
+ *      0 : Success.
+ *          data is NULL;
+ * -errno : An error occured.
+ *          data is the error string.
+ */
+EXTERN int nfs_chdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data);
+/*
+ * Sync chdir(<path>)
+ * Function returns
+ *      0 : The operation was successfull.
+ * -errno : The command failed.
+ */
+EXTERN int nfs_chdir(struct nfs_context *nfs, const char *path);
+
+/*
+ * GETCWD()
+ */
+/*
+ * nfs_getcwd() never blocks, so no special sync/async versions are available
+ */
+/*
+ * Sync getcwd()
+ * This function returns a pointer to the current working directory.
+ * This pointer is only stable until the next [f]chdir or when the
+ * context is destroyed.
+ *
+ * Function returns
+ *      0 : The operation was successfull and *cwd is filled in.
+ * -errno : The command failed.
+ */
+EXTERN void nfs_getcwd(struct nfs_context *nfs, const char **cwd);
+
 
 /*
  * STATVFS()