>From 2ed29aa675607103bd521103fe3d5adab85bd236 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 11 Jan 2014 15:42:01 +0100 Subject: [PATCH 5/7] REFARRAY: Move declaration of ref_array_debug to public header file --- ini/ini_valueobj.c | 2 -- ini/ini_valueobj_ut.c | 3 --- refarray/ref_array.h | 16 ++++++++++++++++ refarray/ref_array_ut.c | 2 -- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ini/ini_valueobj.c b/ini/ini_valueobj.c index 20e61cd3f291aea076a16f35bec1bcd143656356..02d064323f84a18f274c1f95f0f975c51fda63de 100644 --- a/ini/ini_valueobj.c +++ b/ini/ini_valueobj.c @@ -1063,8 +1063,6 @@ int value_serialize(struct value_obj *vo, #ifdef HAVE_TRACE -extern void ref_array_debug(struct ref_array *ra, int num); - ref_array_debug(vo->raw_lines, 0); ref_array_debug(vo->raw_lengths, 1); #endif diff --git a/ini/ini_valueobj_ut.c b/ini/ini_valueobj_ut.c index 62ee9846a6be6cf4ea83b974576005170cb7c2fb..0a61069d50cecd430551539ddd4a9e07981fe2c8 100644 --- a/ini/ini_valueobj_ut.c +++ b/ini/ini_valueobj_ut.c @@ -42,9 +42,6 @@ int verbose = 0; typedef int (*test_fn)(void); - -extern void ref_array_debug(struct ref_array *ra); - static int create_comment(int i, struct ini_comment **ic) { int error = EOK; diff --git a/refarray/ref_array.h b/refarray/ref_array.h index d271d38b48b458ebf469f1387ef8e0679c8fa757..48e43075781f91107ef3f1489609b0166410fadd 100644 --- a/refarray/ref_array.h +++ b/refarray/ref_array.h @@ -363,6 +363,22 @@ int ref_array_copy(struct ref_array *ra, struct ref_array **copy_ra); + +/** + * @brief Print array for debugging purposes. + * + * Prints array internals. + * + * @param[in] ra Existing array object. + * @param[in] num If num is 0 elements will be printed as strings. + * If num is greater than 0 elements will be printed as + * decimal numbers. Otherwise element will not be + * interpreted in concrete way. + * + * No return value. + */ +void ref_array_debug(struct ref_array *ra, int num); + /** * @} */ diff --git a/refarray/ref_array_ut.c b/refarray/ref_array_ut.c index 5df089fbf878150dcb0812af800417f6abc114a2..5ce81a72c3c6d4e8c92d1b1ab72716a83b65cc34 100644 --- a/refarray/ref_array_ut.c +++ b/refarray/ref_array_ut.c @@ -35,8 +35,6 @@ int verbose = 0; if (verbose) foo; \ } while(0) -extern void ref_array_debug(struct ref_array *ra, int num); - typedef int (*test_fn)(void); /* Basic test */ -- 1.8.5.3