From: Uwe Hermann Date: Tue, 18 Sep 2018 21:39:56 +0000 (+0200) Subject: Make sr_packet_{copy,free} API calls public. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3bae09ab9fc3681e0ae3d2f16e862c831d43efc3;p=libsigrok.git Make sr_packet_{copy,free} API calls public. This fixes bug #1277. --- diff --git a/include/libsigrok/proto.h b/include/libsigrok/proto.h index b832cea2..41d9cfcc 100644 --- a/include/libsigrok/proto.h +++ b/include/libsigrok/proto.h @@ -154,6 +154,10 @@ SR_API int sr_session_is_running(struct sr_session *session); SR_API int sr_session_stopped_callback_set(struct sr_session *session, sr_session_stopped_callback cb, void *cb_data); +SR_API int sr_packet_copy(const struct sr_datafeed_packet *packet, + struct sr_datafeed_packet **copy); +SR_API void sr_packet_free(struct sr_datafeed_packet *packet); + /*--- input/input.c ---------------------------------------------------------*/ SR_API const struct sr_input_module **sr_input_list(void); diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 50f83bd1..a681abae 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -909,9 +909,6 @@ SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, SR_PRIV int sr_sessionfile_check(const char *filename); SR_PRIV struct sr_dev_inst *sr_session_prepare_sdi(const char *filename, struct sr_session **session); -SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, - struct sr_datafeed_packet **copy); -SR_PRIV void sr_packet_free(struct sr_datafeed_packet *packet); /*--- session_file.c --------------------------------------------------------*/ diff --git a/src/session.c b/src/session.c index 16fdfffa..b3fdfb54 100644 --- a/src/session.c +++ b/src/session.c @@ -1450,8 +1450,7 @@ static void copy_src(struct sr_config *src, struct sr_datafeed_meta *meta_copy) g_memdup(src, sizeof(struct sr_config))); } -/** @private */ -SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, +SR_API int sr_packet_copy(const struct sr_datafeed_packet *packet, struct sr_datafeed_packet **copy) { const struct sr_datafeed_meta *meta; @@ -1522,7 +1521,7 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, return SR_OK; } -void sr_packet_free(struct sr_datafeed_packet *packet) +SR_API void sr_packet_free(struct sr_datafeed_packet *packet) { const struct sr_datafeed_meta *meta; const struct sr_datafeed_logic *logic; @@ -1567,7 +1566,6 @@ void sr_packet_free(struct sr_datafeed_packet *packet) sr_err("Unknown packet type %d", packet->type); } g_free(packet); - } /** @} */