Skip to content

Commit

Permalink
Moved ring_buffer.h and message.h to src/util
Browse files Browse the repository at this point in the history
which localizes all of the code and headers for one subsystem.
We will gradually be doing this with other subsystems
  • Loading branch information
alandekok committed Oct 25, 2016
1 parent 785f3d6 commit 8b33def
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 11 deletions.
16 changes: 12 additions & 4 deletions src/include/all.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# The rest of the headers are static.
#

HEADERS_DY = attributes.h features.h missing.h radpaths.h tls.h

HEADERS_DY := attributes.h features.h missing.h radpaths.h tls.h
SUBDIRS := util

HEADERS = \
build.h \
Expand Down Expand Up @@ -77,8 +77,9 @@ RFC_DICTS := $(filter-out %~,$(wildcard share/dictionary.rfc*)) \

HEADERS_RFC := $(patsubst share/dictionary.%,src/include/%.h,$(RFC_DICTS))
HEADERS += $(notdir ${HEADERS_RFC})
INCLUDE_SUBDIRS := $(addprefix src/include/, $(SUBDIRS))

.PRECIOUS: $(HEADERS_RFC)
.PRECIOUS: $(HEADERS_RFC) $(INCLUDE_SUBDIRS)

src/include/attributes.h: share/dictionary.freeradius.internal
${Q}$(ECHO) HEADER $@
Expand Down Expand Up @@ -129,10 +130,17 @@ src/include/radpaths.h: src/include/build-radpaths-h
src/freeradius-devel:
${Q}[ -e $@ ] || ln -s include $@

#
# Create subdirectories
#
.PHONY: $(INCLUDE_SUBDIRS)
$(INCLUDE_SUBDIRS):
@ln -sf ${top_srcdir}/src/$(notdir $@) $@

#
# Ensure we set up the build environment
#
BOOTSTRAP_BUILD += src/freeradius-devel $(addprefix src/include/,$(HEADERS_DY)) $(HEADERS_RFC)
BOOTSTRAP_BUILD += src/freeradius-devel $(addprefix src/include/,$(HEADERS_DY)) $(HEADERS_RFC) $(INCLUDE_SUBDIRS)
scan: $(BOOTSTRAP_BUILD)

######################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/tests/util/message_set_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

RCSID("$Id$")

#include <freeradius-devel/message.h>
#include <freeradius-devel/util/message.h>
#include <string.h>
#include <freeradius-devel/hash.h>
#include <freeradius-devel/rad_assert.h>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/util/ring_buffer_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

RCSID("$Id$")

#include <freeradius-devel/ring_buffer.h>
#include <freeradius-devel/util/ring_buffer.h>
#include <string.h>
#include <freeradius-devel/hash.h>
#include <freeradius-devel/rad_assert.h>
Expand Down
6 changes: 6 additions & 0 deletions src/util/all.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ TARGET := libfreeradius-util.a
SOURCES := ring_buffer.c message.c

TGT_PREREQS := libfreeradius-radius.la

${SRC_INCLUDE_DIR}/util/ring_buffer.h: src/include/util/ring_buffer.h

${SRC_INCLUDE_DIR}/util/message.h: src/include/util/message.h

install.src.include: ${SRC_INCLUDE_DIR}/util/ring_buffer.h ${SRC_INCLUDE_DIR}/util/message.h
2 changes: 1 addition & 1 deletion src/util/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
RCSID("$Id$")

#include <freeradius-devel/message.h>
#include <freeradius-devel/util/message.h>
#include <freeradius-devel/rad_assert.h>

#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions src/include/message.h → src/util/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
/**
* $Id$
*
* @file include/message.h
* @file util/message.h
* @brief Inter-thread messaging
*
* @copyright 2016 The FreeRADIUS Server Project
* @copyright 2016 Alan DeKok <aland@freeradius.org>
*/
RCSIDH(message_h, "$Id$")

#include <freeradius-devel/ring_buffer.h>
#include <freeradius-devel/util/ring_buffer.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/util/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
RCSID("$Id$")

#include <freeradius-devel/ring_buffer.h>
#include <freeradius-devel/util/ring_buffer.h>
#include <freeradius-devel/rad_assert.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion src/include/ring_buffer.h → src/util/ring_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* $Id$
*
* @file include/ring_buffer.h
* @file util/ring_buffer.h
* @brief Ring buffers
*
* @copyright 2016 The FreeRADIUS Server Project
Expand Down

0 comments on commit 8b33def

Please sign in to comment.