diff --git a/include/spdk/bdev.h b/include/spdk/bdev.h index 8f1f866132..d4da408b20 100644 --- a/include/spdk/bdev.h +++ b/include/spdk/bdev.h @@ -44,6 +44,10 @@ #include "spdk/scsi_spec.h" #include "spdk/nvme_spec.h" +#ifdef __cplusplus +extern "C" { +#endif + #define SPDK_BDEV_SMALL_BUF_MAX_SIZE 8192 #define SPDK_BDEV_LARGE_BUF_MAX_SIZE (64 * 1024) @@ -751,4 +755,8 @@ void spdk_bdev_io_get_scsi_status(const struct spdk_bdev_io *bdev_io, */ void spdk_bdev_io_get_iovec(struct spdk_bdev_io *bdev_io, struct iovec **iovp, int *iovcntp); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_BDEV_H_ */ diff --git a/include/spdk/blob.h b/include/spdk/blob.h index 0fe2633588..b4800c2c9d 100644 --- a/include/spdk/blob.h +++ b/include/spdk/blob.h @@ -68,6 +68,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint64_t spdk_blob_id; #define SPDK_BLOBID_INVALID (uint64_t)-1 #define SPDK_BLOBSTORE_TYPE_LENGTH 16 @@ -305,4 +309,8 @@ void spdk_xattr_names_free(struct spdk_xattr_names *names); struct spdk_bs_type spdk_bs_get_bstype(struct spdk_blob_store *bs); void spdk_bs_set_bstype(struct spdk_blob_store *bs, struct spdk_bs_type bstype); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_BLOB_H_ */ diff --git a/include/spdk/blobfs.h b/include/spdk/blobfs.h index ee595fbb87..b166486c87 100644 --- a/include/spdk/blobfs.h +++ b/include/spdk/blobfs.h @@ -42,6 +42,10 @@ #include "spdk/blob.h" +#ifdef __cplusplus +extern "C" { +#endif + #define SPDK_FILE_NAME_MAX 255 struct spdk_file; @@ -129,4 +133,8 @@ void spdk_file_set_priority(struct spdk_file *file, uint32_t priority); int spdk_file_sync(struct spdk_file *file, struct spdk_io_channel *channel); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_FS_H_ */ diff --git a/include/spdk/conf.h b/include/spdk/conf.h index 586b4660d3..bd7e64ed3f 100644 --- a/include/spdk/conf.h +++ b/include/spdk/conf.h @@ -41,6 +41,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + struct spdk_conf_value; struct spdk_conf_item; struct spdk_conf_section; @@ -67,4 +71,8 @@ bool spdk_conf_section_get_boolval(struct spdk_conf_section *sp, const char *key void spdk_conf_set_as_default(struct spdk_conf *cp); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/copy_engine.h b/include/spdk/copy_engine.h index d6534bc7c5..94100ff8a5 100644 --- a/include/spdk/copy_engine.h +++ b/include/spdk/copy_engine.h @@ -40,6 +40,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*spdk_copy_completion_cb)(void *ref, int status); typedef void (*spdk_copy_fini_cb)(void *cb_arg); @@ -58,4 +62,8 @@ int spdk_copy_submit_fill(struct spdk_copy_task *copy_req, struct spdk_io_channe void *dst, uint8_t fill, uint64_t nbytes, spdk_copy_completion_cb cb); size_t spdk_copy_task_size(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/crc32.h b/include/spdk/crc32.h index cb0254e7c1..39b5573754 100644 --- a/include/spdk/crc32.h +++ b/include/spdk/crc32.h @@ -42,6 +42,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * IEEE CRC-32 polynomial (bit reflected) */ @@ -98,4 +102,8 @@ uint32_t spdk_crc32_ieee_update(const void *buf, size_t len, uint32_t crc); */ uint32_t spdk_crc32c_update(const void *buf, size_t len, uint32_t crc); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_CRC32_H */ diff --git a/include/spdk/event.h b/include/spdk/event.h index 15debebfe7..fd3e4f5473 100644 --- a/include/spdk/event.h +++ b/include/spdk/event.h @@ -46,6 +46,10 @@ #include "spdk/queue.h" #include "spdk/log.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*spdk_event_fn)(void *arg1, void *arg2); /** @@ -193,4 +197,8 @@ void spdk_reactor_enable_context_switch_monitor(bool enabled); */ bool spdk_reactor_context_switch_monitor_enabled(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/io_channel.h b/include/spdk/io_channel.h index 3b9af61f5e..eb55f375da 100644 --- a/include/spdk/io_channel.h +++ b/include/spdk/io_channel.h @@ -42,6 +42,10 @@ #include "spdk/queue.h" +#ifdef __cplusplus +extern "C" { +#endif + struct spdk_thread; struct spdk_io_channel; struct spdk_poller; @@ -220,4 +224,8 @@ struct spdk_thread *spdk_io_channel_get_thread(struct spdk_io_channel *ch); void spdk_for_each_channel(void *io_device, spdk_channel_msg fn, void *ctx, spdk_channel_for_each_cpl cpl); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_IO_CHANNEL_H_ */ diff --git a/include/spdk/json.h b/include/spdk/json.h index 8ec7726d23..6c21d1f564 100644 --- a/include/spdk/json.h +++ b/include/spdk/json.h @@ -41,6 +41,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + enum spdk_json_val_type { SPDK_JSON_VAL_INVALID, SPDK_JSON_VAL_NULL, @@ -237,4 +241,8 @@ int spdk_json_write_val(struct spdk_json_write_ctx *w, const struct spdk_json_va */ int spdk_json_write_val_raw(struct spdk_json_write_ctx *w, const void *data, size_t len); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/jsonrpc.h b/include/spdk/jsonrpc.h index 77dcb66ce7..0ca85ea5fd 100644 --- a/include/spdk/jsonrpc.h +++ b/include/spdk/jsonrpc.h @@ -43,6 +43,10 @@ #include "spdk/json.h" +#ifdef __cplusplus +extern "C" { +#endif + #define SPDK_JSONRPC_ERROR_PARSE_ERROR -32700 #define SPDK_JSONRPC_ERROR_INVALID_REQUEST -32600 #define SPDK_JSONRPC_ERROR_METHOD_NOT_FOUND -32601 @@ -103,4 +107,8 @@ void spdk_jsonrpc_end_result(struct spdk_jsonrpc_request *request, struct spdk_j void spdk_jsonrpc_send_error_response(struct spdk_jsonrpc_request *request, int error_code, const char *msg); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/log.h b/include/spdk/log.h index 2b9cf8e225..6f8de562bd 100644 --- a/include/spdk/log.h +++ b/include/spdk/log.h @@ -41,6 +41,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Initialize the logging module. Messages prior * to this call will be dropped. @@ -102,4 +106,8 @@ int spdk_log_clear_trace_flag(const char *flag); void spdk_tracelog_usage(FILE *f, const char *trace_arg); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_LOG_H */ diff --git a/include/spdk/lvol.h b/include/spdk/lvol.h index e3df90965a..85cd4d228f 100644 --- a/include/spdk/lvol.h +++ b/include/spdk/lvol.h @@ -40,6 +40,10 @@ #include "spdk/stdinc.h" +#ifdef __cplusplus +extern "C" { +#endif + struct spdk_bs_dev; struct spdk_lvol_store; struct spdk_lvol; @@ -173,5 +177,8 @@ void spdk_lvs_load(struct spdk_bs_dev *bs_dev, spdk_lvs_op_with_handle_complete void *cb_arg); void spdk_lvol_open(struct spdk_lvol *lvol, spdk_lvol_op_with_handle_complete cb_fn, void *cb_arg); +#ifdef __cplusplus +} +#endif #endif /* SPDK_LVOL_H */ diff --git a/include/spdk/nbd.h b/include/spdk/nbd.h index d823e559b9..f4d6dfc887 100644 --- a/include/spdk/nbd.h +++ b/include/spdk/nbd.h @@ -34,6 +34,10 @@ #ifndef SPDK_NBD_H_ #define SPDK_NBD_H_ +#ifdef __cplusplus +extern "C" { +#endif + struct spdk_bdev; struct spdk_nbd_disk; @@ -45,4 +49,8 @@ struct spdk_nbd_disk *spdk_nbd_start(const char *bdev_name, const char *nbd_path void spdk_nbd_stop(struct spdk_nbd_disk *nbd); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/net.h b/include/spdk/net.h index 9673238186..39f29c1b68 100644 --- a/include/spdk/net.h +++ b/include/spdk/net.h @@ -42,6 +42,10 @@ #include "spdk/queue.h" +#ifdef __cplusplus +extern "C" { +#endif + #define IDLE_INTERVAL_TIME_IN_US 5000 int spdk_interface_init(void); @@ -83,4 +87,8 @@ int spdk_sock_set_sendbuf(int sock, int sz); bool spdk_sock_is_ipv6(int sock); bool spdk_sock_is_ipv4(int sock); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_NET_FRAMEWORK_H */ diff --git a/include/spdk/nvmf.h b/include/spdk/nvmf.h index 13273fc978..13b78cdefb 100644 --- a/include/spdk/nvmf.h +++ b/include/spdk/nvmf.h @@ -45,6 +45,10 @@ #include "spdk/nvmf_spec.h" #include "spdk/queue.h" +#ifdef __cplusplus +extern "C" { +#endif + struct spdk_nvmf_tgt; struct spdk_nvmf_subsystem; struct spdk_nvmf_ctrlr; @@ -322,4 +326,8 @@ void spdk_nvmf_handle_connect(struct spdk_nvmf_request *req); void spdk_nvmf_ctrlr_disconnect(struct spdk_nvmf_qpair *qpair); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/rpc.h b/include/spdk/rpc.h index e7cef4746f..1ef3066c1d 100644 --- a/include/spdk/rpc.h +++ b/include/spdk/rpc.h @@ -38,6 +38,10 @@ #include "spdk/jsonrpc.h" +#ifdef __cplusplus +extern "C" { +#endif + int spdk_rpc_listen(const char *listen_addr); void spdk_rpc_accept(void); void spdk_rpc_close(void); @@ -53,4 +57,8 @@ static void __attribute__((constructor)) rpc_register_##func(void) \ spdk_rpc_register_method(method, func); \ } +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/spdk/scsi.h b/include/spdk/scsi.h index d025e0a4b7..0ea9a8d055 100644 --- a/include/spdk/scsi.h +++ b/include/spdk/scsi.h @@ -43,6 +43,10 @@ #include "spdk/queue.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Defines for SPDK tracing framework */ #define OWNER_SCSI_DEV 0x10 #define OBJECT_SCSI_TASK 0x10 @@ -266,4 +270,8 @@ spdk_scsi_task_get_primary(struct spdk_scsi_task *task) } } +#ifdef __cplusplus +} +#endif + #endif /* SPDK_SCSI_H */ diff --git a/include/spdk/vhost.h b/include/spdk/vhost.h index 2834478fb7..f920699503 100644 --- a/include/spdk/vhost.h +++ b/include/spdk/vhost.h @@ -43,6 +43,10 @@ #include "spdk/event.h" +#ifdef __cplusplus +extern "C" { +#endif + int spdk_vhost_init(void); void spdk_vhost_fini(void); @@ -291,4 +295,8 @@ void spdk_vhost_call_external_event(const char *vdev_name, spdk_vhost_event_fn f */ void spdk_vhost_call_external_event_foreach(spdk_vhost_event_fn fn, void *arg); +#ifdef __cplusplus +} +#endif + #endif /* SPDK_VHOST_H */