>From 54d29bce700a8ad4d76a4bdf733aa52eef412276 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 11 Jan 2014 15:42:01 +0100 Subject: [PATCH 4/5] REFARRAY: Move declaration of ref_array_debug to private header file --- Makefile.am | 1 + ini/ini_valueobj.c | 3 +-- ini/ini_valueobj_ut.c | 3 --- refarray/ref_array.c | 1 + refarray/ref_array_priv.h | 30 ++++++++++++++++++++++++++++++ refarray/ref_array_ut.c | 3 +-- 6 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 refarray/ref_array_priv.h diff --git a/Makefile.am b/Makefile.am index e931e2a6dee44c5413cad6c87d6ef0339c57ead1..b83ca802345194d5ad6de879f6ac96300de44f03 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,6 +164,7 @@ dist_include_HEADERS += refarray/ref_array.h libref_array_la_SOURCES = \ refarray/ref_array.c \ + refarray/ref_array_priv.h \ trace/trace.h libref_array_la_LDFLAGS = \ -version-info 2:0:1 diff --git a/ini/ini_valueobj.c b/ini/ini_valueobj.c index 20e61cd3f291aea076a16f35bec1bcd143656356..81c16d02dfa4f16af75a8917b06fa1cc7ef97b53 100644 --- a/ini/ini_valueobj.c +++ b/ini/ini_valueobj.c @@ -26,6 +26,7 @@ #include #include "simplebuffer.h" #include "ref_array.h" +#include "ref_array_priv.h" #include "ini_comment.h" #include "ini_defines.h" #include "ini_valueobj.h" @@ -1063,8 +1064,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.c b/refarray/ref_array.c index 273ac4fa6bc7c9ef4b1219f1c536fbc05eca6611..0e2fe02219a2e2621d6b6d1d550be8daac3ed196 100644 --- a/refarray/ref_array.c +++ b/refarray/ref_array.c @@ -25,6 +25,7 @@ #include #include "ref_array.h" +#include "ref_array_priv.h" #include "trace.h" /* The structure used in referenced array */ diff --git a/refarray/ref_array_priv.h b/refarray/ref_array_priv.h new file mode 100644 index 0000000000000000000000000000000000000000..021ae3aa4708b25199cfb066ad294608e8158da0 --- /dev/null +++ b/refarray/ref_array_priv.h @@ -0,0 +1,30 @@ +/* + REF ARRAY + + Header file for internal functions of the dynamic array with reference count. + + Author: + Lukas Slebodnik + Copyright (C) 2014 Red Hat + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef REF_ARRAY_PRIV_H +#define REF_ARRAY_PRIV_H + +struct ref_array; + +/* Debug function */ +void ref_array_debug(struct ref_array *ra, int num); + +#endif /* REF_ARRAY_PRIV_H */ diff --git a/refarray/ref_array_ut.c b/refarray/ref_array_ut.c index 5df089fbf878150dcb0812af800417f6abc114a2..6e3f05bc153725da7fc8bca117680a2e211ace77 100644 --- a/refarray/ref_array_ut.c +++ b/refarray/ref_array_ut.c @@ -25,6 +25,7 @@ #include #include "ref_array.h" +#include "ref_array_priv.h" #define TRACE_HOME #include "trace.h" @@ -35,8 +36,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.4.2