{nfs,rpc}_set_error: add __attribute__((format(printf))) annotations
[deb_libnfs.git] / include / libnfs-private.h
index a2f3e1a2a09bc8cebba77132ba1f8bdc6850c1d7..07ce9a8f96b2b9d3edf355cbbc56cb0a4994cee5 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
+
+#ifndef _LIBNFS_PRIVATE_H_
+#define _LIBNFS_PRIVATE_H_
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"  /* HAVE_SOCKADDR_STORAGE ? */
 #endif
@@ -24,6 +28,9 @@
 
 #include "libnfs-zdr.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #if !defined(HAVE_SOCKADDR_STORAGE) && !defined(WIN32)
 /*
@@ -94,7 +101,7 @@ struct rpc_context {
 
        /* fragment reassembly */
        struct rpc_fragment *fragments;
-       
+
        /* parameters passable via URL */
        int tcp_syncnt;
        int uid;
@@ -126,8 +133,17 @@ int rpc_get_pdu_size(char *buf);
 int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size);
 void rpc_error_all_pdus(struct rpc_context *rpc, char *error);
 
-void rpc_set_error(struct rpc_context *rpc, char *error_string, ...);
-void nfs_set_error(struct nfs_context *nfs, char *error_string, ...);
+void rpc_set_error(struct rpc_context *rpc, char *error_string, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+;
+
+void nfs_set_error(struct nfs_context *nfs, char *error_string, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+;
 
 const char *nfs_get_server(struct nfs_context *nfs);
 const char *nfs_get_export(struct nfs_context *nfs);
@@ -149,3 +165,9 @@ int rpc_add_fragment(struct rpc_context *rpc, char *data, uint64_t size);
 void rpc_free_all_fragments(struct rpc_context *rpc);
 
 const struct nfs_fh3 *nfs_get_rootfh(struct nfs_context *nfs);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_LIBNFS_PRIVATE_H_ */