libnfs.h: add include guards
[deb_libnfs.git] / include / nfsc / libnfs.h
index e07506470c75afe2931b55f56b58e228c0fa0d8e..da03f440f4476782f5b44bf4fb7c3a2794fc4bd9 100644 (file)
 /*
  * This is the highlevel interface to access NFS resources using a posix-like interface
  */
+
+#ifndef _LIBNFS_H_
+#define _LIBNFS_H_
+
 #include <stdint.h>
 #if defined(ANDROID)
 #include <sys/time.h>
@@ -37,7 +41,7 @@ struct nfs_url {
 #if defined(WIN32)
 #define EXTERN __declspec( dllexport )
 #else
-#define EXTERN 
+#define EXTERN
 #endif
 
 #if defined(WIN32)
@@ -50,7 +54,7 @@ struct statvfs {
        uint32_t        f_files;
        uint32_t        f_ffree;
        uint32_t        f_favail;
-       uint32_t        f_fsid; 
+       uint32_t        f_fsid;
        uint32_t        f_flag;
        uint32_t        f_namemax;
 };
@@ -113,7 +117,7 @@ EXTERN void nfs_destroy_context(struct nfs_context *nfs);
 
 /*
  * URL parsing functions.
- * These functions all parse a URL of the form 
+ * These functions all parse a URL of the form
  * nfs://server/path/file?argv=val[&arg=val]*
  * and returns a nfs_url.
  *
@@ -167,7 +171,7 @@ EXTERN uint64_t nfs_get_readmax(struct nfs_context *nfs);
 EXTERN uint64_t nfs_get_writemax(struct nfs_context *nfs);
 
 /*
- *  MODIFY CONNECT PARAMTERS 
+ *  MODIFY CONNECT PARAMTERS
  */
 
 EXTERN void nfs_set_tcp_syncnt(struct nfs_context *nfs, int v);
@@ -272,6 +276,12 @@ 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
+ * O_TRUNC (Only valid with O_RDWR or O_WRONLY. Ignored otherwise.)
+ *
  * When the callback is invoked, status indicates the result:
  *      0 : Success.
  *          data is a struct *nfsfh;
@@ -279,14 +289,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 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);
 
 
 
@@ -1117,7 +1127,7 @@ EXTERN int mount_getexports_async(struct rpc_context *rpc, const char *server, r
  * Function returns
  *            NULL : something failed
  *  exports export : a linked list of exported directories
- * 
+ *
  * returned data must be freed by calling mount_free_export_list(exportnode);
  */
 EXTERN struct exportnode *mount_getexports(const char *server);
@@ -1146,8 +1156,10 @@ struct nfs_server_list {
  * NULL : something failed
  *
  * struct nfs_server_list : a linked list of all discovered servers
- * 
+ *
  * returned data must be freed by nfs_free_srvr_list(srv);
  */
 struct nfs_server_list *nfs_find_local_servers(void);
 void free_nfs_srvr_list(struct nfs_server_list *srv);
+
+#endif /* !_LIBNFS_H_ */