From 301ea46f29e70c910ffd5b7c8bdcd83ee5835e3f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 14 Apr 2023 12:03:45 +0200 Subject: [PATCH] edid: make di_edid_destroy() public We'll allow users to create their own EDIDs, so they'll need to cleanup. Signed-off-by: Simon Ser --- edid.c | 8 ++++---- include/edid.h | 6 ------ include/libdisplay-info/edid.h | 6 ++++++ info.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/edid.c b/edid.c index af4685e..1975705 100644 --- a/edid.c +++ b/edid.c @@ -1256,7 +1256,7 @@ _di_edid_parse(const void *data, size_t size, FILE *failure_msg_file) + 0x26 + i * EDID_STANDARD_TIMING_SIZE; if (!parse_standard_timing(edid, standard_timing_data, &standard_timing)) { - _di_edid_destroy(edid); + di_edid_destroy(edid); return NULL; } if (standard_timing) { @@ -1269,7 +1269,7 @@ _di_edid_parse(const void *data, size_t size, FILE *failure_msg_file) byte_desc_data = (const uint8_t *) data + 0x36 + i * EDID_BYTE_DESCRIPTOR_SIZE; if (!parse_byte_descriptor(edid, byte_desc_data)) { - _di_edid_destroy(edid); + di_edid_destroy(edid); return NULL; } } @@ -1277,7 +1277,7 @@ _di_edid_parse(const void *data, size_t size, FILE *failure_msg_file) for (i = 0; i < exts_len; i++) { ext_data = (const uint8_t *) data + (i + 1) * EDID_BLOCK_SIZE; if (!parse_ext(edid, ext_data)) { - _di_edid_destroy(edid); + di_edid_destroy(edid); return NULL; } } @@ -1314,7 +1314,7 @@ destroy_display_descriptor(struct di_edid_display_descriptor *desc) } void -_di_edid_destroy(struct di_edid *edid) +di_edid_destroy(struct di_edid *edid) { size_t i; struct di_edid_ext *ext; diff --git a/include/edid.h b/include/edid.h index bd6803f..677a73a 100644 --- a/include/edid.h +++ b/include/edid.h @@ -143,12 +143,6 @@ struct di_edid_ext { struct di_edid * _di_edid_parse(const void *data, size_t size, FILE *failure_msg_file); -/** - * Destroy an EDID data structure. - */ -void -_di_edid_destroy(struct di_edid *edid); - /** * Parse an EDID detailed timing definition. */ diff --git a/include/libdisplay-info/edid.h b/include/libdisplay-info/edid.h index ec11ed0..dfbfb71 100644 --- a/include/libdisplay-info/edid.h +++ b/include/libdisplay-info/edid.h @@ -18,6 +18,12 @@ */ struct di_edid; +/** + * Destroy an EDID. + */ +void +di_edid_destroy(struct di_edid *edid); + /** * Get the EDID version. */ diff --git a/info.c b/info.c index af68bb5..935acb1 100644 --- a/info.c +++ b/info.c @@ -43,7 +43,7 @@ di_info_parse_edid(const void *data, size_t size) return info; err_edid: - _di_edid_destroy(edid); + di_edid_destroy(edid); err_failure_msg_file: memory_stream_cleanup(&failure_msg); return NULL; @@ -52,7 +52,7 @@ err_failure_msg_file: void di_info_destroy(struct di_info *info) { - _di_edid_destroy(info->edid); + di_edid_destroy(info->edid); free(info->failure_msg); free(info); }