From b36e8791797d299ccf61a294e7eb6dd39ecac7dc Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 11 Oct 2007 06:57:25 +0000 Subject: [PATCH] Move private definition out of the log.h public header. Moreover, this public header is already complicated enough, and loaded everywhere git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4806 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/xbt/log.h | 14 -------------- src/Makefile.am | 1 + src/Makefile.in | 2 +- src/xbt/log.c | 4 ++-- src/xbt/log_private.h | 27 +++++++++++++++++++++++++++ src/xbt/xbt_log_appender_file.c | 2 +- src/xbt/xbt_log_layout_format.c | 2 +- src/xbt/xbt_log_layout_simple.c | 2 +- 8 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 src/xbt/log_private.h diff --git a/include/xbt/log.h b/include/xbt/log.h index edb18df0ee..45d8b8c075 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -246,20 +246,6 @@ struct xbt_log_category_s { int additivity; }; -struct xbt_log_appender_s { - void (*do_append) (xbt_log_appender_t this_appender, - char *event); - void (*free_) (xbt_log_appender_t this_); - void *data; -}; - -struct xbt_log_layout_s { - void (*do_layout)(xbt_log_layout_t l, - xbt_log_event_t event, const char *fmt); - void (*free_) (xbt_log_layout_t l); - void *data; -} ; - struct xbt_log_event_s { xbt_log_category_t cat; e_xbt_log_priority_t priority; diff --git a/src/Makefile.am b/src/Makefile.am index 40753b1330..51157cd2c4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,7 @@ EXTRA_DIST= \ xbt/graphxml.c \ xbt/graphxml.dtd \ xbt/context_private.h \ + xbt/log_private.h \ xbt/ex_interface.h \ \ surf/maxmin_private.h \ diff --git a/src/Makefile.in b/src/Makefile.in index ef800add58..720535d714 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -447,7 +447,7 @@ EXTRA_DIST = portable.h xbt/mallocator_private.h xbt/dynar_private.h \ xbt/dict_private.h xbt/heap_private.h xbt/fifo_private.h \ xbt/graph_private.h xbt/graphxml_parse.c xbt/graphxml.l \ xbt/graphxml.c xbt/graphxml.dtd xbt/context_private.h \ - xbt/ex_interface.h surf/maxmin_private.h \ + xbt/log_private.h xbt/ex_interface.h surf/maxmin_private.h \ surf/trace_mgr_private.h surf/surf_private.h \ surf/cpu_private.h surf/workstation_private.h \ surf/surf_timer_private.h surf/surfxml_parse.c surf/surfxml.l \ diff --git a/src/xbt/log.c b/src/xbt/log.c index a3da1357da..db558b7ac2 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -2,7 +2,7 @@ /* log - a generic logging facility in the spirit of log4j */ -/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ +/* Copyright (c) 2003-2007 Martin Quinson. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -20,7 +20,7 @@ #include "xbt/misc.h" #include "xbt/ex.h" #include "xbt/sysdep.h" -#include "xbt/log.h" +#include "xbt/log_private.h" #include "xbt/dynar.h" XBT_PUBLIC_DATA(int) (*xbt_pid)(); diff --git a/src/xbt/log_private.h b/src/xbt/log_private.h new file mode 100644 index 0000000000..d9a79c80c7 --- /dev/null +++ b/src/xbt/log_private.h @@ -0,0 +1,27 @@ +/* $Id: log.c 4794 2007-10-10 12:38:37Z mquinson $ */ + +/* Copyright (c) 2003-2007 Martin Quinson. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#ifndef LOG_PRIVATE_H +#define LOG_PRIVATE_H + +#include "xbt/log.h" +struct xbt_log_appender_s { + void (*do_append) (xbt_log_appender_t this_appender, + char *event); + void (*free_) (xbt_log_appender_t this_); + void *data; +}; + +struct xbt_log_layout_s { + void (*do_layout)(xbt_log_layout_t l, + xbt_log_event_t event, const char *fmt); + void (*free_) (xbt_log_layout_t l); + void *data; +} ; + + +#endif /* LOG_PRIVATE_H */ diff --git a/src/xbt/xbt_log_appender_file.c b/src/xbt/xbt_log_appender_file.c index d6a1b1a6b4..83af8a5b07 100644 --- a/src/xbt/xbt_log_appender_file.c +++ b/src/xbt/xbt_log_appender_file.c @@ -8,7 +8,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/sysdep.h" -#include "xbt/log.h" +#include "xbt/log_private.h" #include /** diff --git a/src/xbt/xbt_log_layout_format.c b/src/xbt/xbt_log_layout_format.c index 1f3e4cd999..a6df8efe96 100644 --- a/src/xbt/xbt_log_layout_format.c +++ b/src/xbt/xbt_log_layout_format.c @@ -9,7 +9,7 @@ #include "portable.h" /* execinfo when available */ #include "xbt/sysdep.h" -#include "xbt/log.h" +#include "xbt/log_private.h" #include "gras/virtu.h" /* gras_os_myname (KILLME) */ #include "xbt/synchro.h" /* xbt_thread_self_name */ #include diff --git a/src/xbt/xbt_log_layout_simple.c b/src/xbt/xbt_log_layout_simple.c index 1b0e3c026b..482e5d1b46 100644 --- a/src/xbt/xbt_log_layout_simple.c +++ b/src/xbt/xbt_log_layout_simple.c @@ -8,7 +8,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/sysdep.h" -#include "xbt/log.h" +#include "xbt/log_private.h" #include "xbt/synchro.h" /* xbt_thread_name */ #include "gras/virtu.h" #include -- 2.20.1