---
lib/internal.h | 75 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 50 insertions(+), 25 deletions(-)
diff --git a/lib/internal.h b/lib/internal.h
index 7896b1d5ca..fb15ada1c3 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -384,20 +384,27 @@ struct command {
} while (0)
/* aio.c */
-extern void nbd_internal_retire_and_free_command (struct command *);
+extern void nbd_internal_retire_and_free_command (struct command *)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
/* connect.c */
-extern int nbd_internal_wait_until_connected (struct nbd_handle *h);
+extern int nbd_internal_wait_until_connected (struct nbd_handle *h)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
/* crypto.c */
-extern struct socket *nbd_internal_crypto_create_session (struct nbd_handle *, struct
socket *oldsock);
-extern bool nbd_internal_crypto_is_reading (struct nbd_handle *);
-extern int nbd_internal_crypto_handshake (struct nbd_handle *);
-extern void nbd_internal_crypto_debug_tls_enabled (struct nbd_handle *);
+extern struct socket *nbd_internal_crypto_create_session (struct nbd_handle *, struct
socket *oldsock)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern bool nbd_internal_crypto_is_reading (struct nbd_handle *)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
+extern int nbd_internal_crypto_handshake (struct nbd_handle *)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
+extern void nbd_internal_crypto_debug_tls_enabled (struct nbd_handle *)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
/* debug.c */
extern void nbd_internal_debug (struct nbd_handle *h, const char *context,
- const char *fs, ...);
+ const char *fs, ...)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 3));
#define debug(h, fs, ...) \
do { \
if_debug ((h)) \
@@ -410,9 +417,11 @@ extern void nbd_internal_debug (struct nbd_handle *h, const char
*context,
} while (0)
/* errors.c */
-extern void nbd_internal_set_error_context (const char *context);
+extern void nbd_internal_set_error_context (const char *context)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
extern const char *nbd_internal_get_error_context (void);
-extern void nbd_internal_set_last_error (int errnum, char *error);
+extern void nbd_internal_set_last_error (int errnum, char *error)
+ LIBNBD_ATTRIBUTE_NONNULL((2));
#define set_error(errnum, fs, ...) \
do { \
int _e = (errnum); \
@@ -430,12 +439,15 @@ extern void nbd_internal_set_last_error (int errnum, char *error);
} while (0)
/* flags.c */
-extern void nbd_internal_reset_size_and_flags (struct nbd_handle *h);
+extern void nbd_internal_reset_size_and_flags (struct nbd_handle *h)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
extern int nbd_internal_set_size_and_flags (struct nbd_handle *h,
uint64_t exportsize,
- uint16_t eflags);
+ uint16_t eflags)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
extern int nbd_internal_set_block_size (struct nbd_handle *h, uint32_t min,
- uint32_t pref, uint32_t max);
+ uint32_t pref, uint32_t max)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
/* is-state.c */
extern bool nbd_internal_is_state_created (enum state state);
@@ -447,7 +459,8 @@ extern bool nbd_internal_is_state_dead (enum state state);
extern bool nbd_internal_is_state_closed (enum state state);
/* opt.c */
-extern void nbd_internal_free_option (struct nbd_handle *h);
+extern void nbd_internal_free_option (struct nbd_handle *h)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
/* protocol.c */
extern int nbd_internal_errno_of_nbd_error (uint32_t error);
@@ -458,15 +471,18 @@ extern int64_t nbd_internal_command_common (struct nbd_handle *h,
uint16_t flags, uint16_t type,
uint64_t offset, uint64_t count,
int count_err, void *data,
- struct command_cb *cb);
+ struct command_cb *cb)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
/* socket.c */
struct socket *nbd_internal_socket_create (int fd);
/* states.c */
extern void nbd_internal_abort_commands (struct nbd_handle *h,
- struct command **list);
-extern int nbd_internal_run (struct nbd_handle *h, enum external_event ev);
+ struct command **list)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern int nbd_internal_run (struct nbd_handle *h, enum external_event ev)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
extern const char *nbd_internal_state_short_string (enum state state);
extern enum state_group nbd_internal_state_group (enum state state);
extern enum state_group nbd_internal_state_group_parent (enum state_group group);
@@ -477,14 +493,22 @@ extern int nbd_internal_aio_get_direction (enum state state);
#define get_public_state(h) ((h)->public_state)
/* utils.c */
-extern void nbd_internal_hexdump (const void *data, size_t len, FILE *fp);
-extern int nbd_internal_copy_string_list (string_vector *v, char **in);
-extern int nbd_internal_set_argv (struct nbd_handle *h, char **argv);
-extern int nbd_internal_set_querylist (struct nbd_handle *h, char **queries);
-extern const char *nbd_internal_fork_safe_itoa (long v, char *buf, size_t len);
-extern void nbd_internal_fork_safe_perror (const char *s);
-extern char *nbd_internal_printable_buffer (const void *buf, size_t count);
-extern char *nbd_internal_printable_string (const char *str);
+extern void nbd_internal_hexdump (const void *data, size_t len, FILE *fp)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 3));
+extern int nbd_internal_copy_string_list (string_vector *v, char **in)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern int nbd_internal_set_argv (struct nbd_handle *h, char **argv)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern int nbd_internal_set_querylist (struct nbd_handle *h, char **queries)
+ LIBNBD_ATTRIBUTE_NONNULL((1, 2));
+extern const char *nbd_internal_fork_safe_itoa (long v, char *buf, size_t len)
+ LIBNBD_ATTRIBUTE_NONNULL((2));
+extern void nbd_internal_fork_safe_perror (const char *s)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
+extern char *nbd_internal_printable_buffer (const void *buf, size_t count)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
+extern char *nbd_internal_printable_string (const char *str)
+ LIBNBD_ATTRIBUTE_NONNULL((1));
extern char *nbd_internal_printable_string_list (char **list);
/* These are wrappers around socket(2) and socketpair(2). They
@@ -494,6 +518,7 @@ extern char *nbd_internal_printable_string_list (char **list);
extern int nbd_internal_socket (int domain, int type, int protocol,
bool nonblock);
extern int nbd_internal_socketpair (int domain, int type, int protocol,
- int *fds);
+ int *fds)
+ LIBNBD_ATTRIBUTE_NONNULL((4));
#endif /* LIBNBD_INTERNAL_H */
--
2.37.0.rc2