Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Make the inclusion of header files more consistent. All crush headers
Browse files Browse the repository at this point in the history
should be included via `#include <crush/file.h>'.  config.h was moved to
src/libcrush so that the -I flag gets set properly.

* configure.ac: update AM_CONFIG_HEADER and AC_CONFIG_SRCDIR
* src/fieldsplit/Makefile.am: remove reference to non-existent fieldsplit.h
* trunk/src/libcrush/crush/Makefile.am: add config.h.in and primes.dat to
    EXTRA_DIST.
* src/*/args.tab: reference <crush/crush_version.h>
* src/*/*.[ch]: update cpp includes which didn't have the "crush/" path.
  • Loading branch information
jeremy.hinds committed Jul 7, 2009
1 parent 6e05fcd commit bd675da
Show file tree
Hide file tree
Showing 35 changed files with 45 additions and 49 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dist-hook:
done

SUBDIRS = src contrib
export INCLUDES = -I$(abs_srcdir)/src/libcrush
PERL = @PERL@

libtool: $(LIBTOOL_DEPS)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
AC_INIT([crush],
[2008-10_trunk],
[http://code.google.com/p/crush-tools/])
AM_CONFIG_HEADER(src/libcrush/crush/config.h)
AC_CONFIG_SRCDIR(src/libcrush/crush/ffutils.h)
AM_CONFIG_HEADER(src/libcrush/config.h)
AC_CONFIG_SRCDIR(src/libcrush/ffutils.c)
AC_CONFIG_AUX_DIR([build])
AM_INIT_AUTOMAKE

Expand Down
6 changes: 3 additions & 3 deletions src/aggregate/aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include <assert.h>
#include <locale.h>

#include <ffutils.h>
#include <hashtbl.h>
#include <linklist.h>
#include <crush/ffutils.h>
#include <crush/hashtbl.h>
#include <crush/linklist.h>

#ifndef AGGREGATE_H
#define AGGREGATE_H
Expand Down
2 changes: 1 addition & 1 deletion src/aggregate/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
usage_extra =>
"All column indexes are 1-based. Either -k or -K must be specified.\\n\\nThe use of label options -K, -S, -A, or -C implies that the header row should\\nbe preserved (-p).",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/aggregate2/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
trailing_opts => "[file ...]",
usage_extra => "",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/buffer/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
" * If no files are specified, stdin is used for input, and stdout for output.\\n" .
" * Warning: this has potential to consume large amounts of memory.\\n",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/convdate/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version => "\"CRUSH_PACKAGE_VERSION\"",
usage_extra => "the file is read from the stdin and written to stdout",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
4 changes: 2 additions & 2 deletions src/convdate/convdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <ffutils.h>
#include <dbfr.h>
#include <crush/ffutils.h>
#include <crush/dbfr.h>

#ifndef CONVDATE_H
#define CONVDATE_H
Expand Down
2 changes: 1 addition & 1 deletion src/cutfield/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
trailing_opts => "[file ...]",
usage_extra => "if -d is not specified and DELIMITER enviroment variable is defined, that value will be used.",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/deltaforce/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trailing_opts => "file1 file2",
usage_extra => "if one of file1 or file2 is specified as \\\"-\\\", stdin will be used for that input stream.",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
4 changes: 2 additions & 2 deletions src/deltaforce/deltaforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# include <config.h>
#endif

#include <ffutils.h>
#include <dbfr.h>
#include <crush/ffutils.h>
#include <crush/dbfr.h>

#if HAVE_FCNTL_H
# include <fcntl.h> /* open64(), O_RDONLY, etc. */
Expand Down
2 changes: 1 addition & 1 deletion src/fieldsplit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ main.c usage.c fieldsplit_main.h : args.tab
BUILT_SOURCES = main.c usage.c fieldsplit_main.h

bin_PROGRAMS = fieldsplit
fieldsplit_SOURCES = fieldsplit.c fieldsplit.h $(BUILT_SOURCES)
fieldsplit_SOURCES = fieldsplit.c $(BUILT_SOURCES)

fieldsplit_LDADD = ../libcrush/libcrush.la

Expand Down
2 changes: 1 addition & 1 deletion src/foreach_parallel/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
trailing_opts => "<input ...>",
usage_extra => "",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/funiq/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trailing_opts => "[file ...]",
usage_extra => "",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/grepfield/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trailing_opts => "<pattern> [file ...]",
usage_extra => "if no field is specified, the entire input line is scanned.",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
4 changes: 2 additions & 2 deletions src/grepfield/grepfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
# include <stdlib.h>
#endif

#include <ffutils.h>
#include <dbfr.h>
#include <crush/ffutils.h>
#include <crush/dbfr.h>

#ifndef GREPFIELD_H
#define GREPFIELD_H
Expand Down
2 changes: 1 addition & 1 deletion src/indexof/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
trailing_opts => "",
usage_extra => "",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
3 changes: 1 addition & 2 deletions src/libcrush/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libcrush_la_SOURCES = GeneralHashFunctions.c bstree.c ffutils.c hashfuncs.c \

libcrush_includedir = $(includedir)/crush
libcrush_include_HEADERS = crush/bstree.h \
crush/config.h \
crush/crush_version.h \
crush/dbfr.h \
crush/ffutils.h \
Expand Down Expand Up @@ -35,6 +34,6 @@ test_mempool_test_LDADD = libcrush.la
test_qsort_helper_test_LDADD = libcrush.la
test_reutils_test_LDADD = libcrush.la

EXTRA_DIST = $(check_PROGRAMS)
EXTRA_DIST = $(check_PROGRAMS) config.h.in primes.dat

SUBDIRS = crush
2 changes: 0 additions & 2 deletions src/libcrush/crush/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

EXTRA_DIST = bstree.h \
config.h \
config.h.in \
crush_version.h.in \
ffutils.h \
hashfuncs.h \
Expand Down
6 changes: 3 additions & 3 deletions src/libcrush/crush/hashtbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

#include <stdlib.h>
#include <string.h> /* strcmp(), strlen() */
#include <linklist.h>
#include <hashfuncs.h>
#include <mempool.h>
#include <crush/linklist.h>
#include <crush/hashfuncs.h>
#include <crush/mempool.h>


#ifndef HASHTBL_H
Expand Down
4 changes: 2 additions & 2 deletions src/libcrush/crush/hashtbl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include <stdlib.h>
#include <string.h> /* strcmp(), strlen() */
#include <linklist.h> /* used internally */
#include <ht2_GeneralHashFunctions.h>
#include <crush/linklist.h> /* used internally */
#include <crush/ht2_GeneralHashFunctions.h>

#ifndef HASHTBL2_H
#define HASHTBL2_H
Expand Down
2 changes: 1 addition & 1 deletion src/libcrush/crush/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @brief Interface for the FIFO queue library.
*/

#include <linklist.h>
#include <crush/linklist.h>

#ifndef QUEUE_H
#define QUEUE_H
Expand Down
2 changes: 1 addition & 1 deletion src/libcrush/crush/reutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main (int argc, char *argv[]) {
*/

#ifdef HAVE_CONFIG_H
#include <crush/config.h>
#include <config.h>
#endif

#ifndef REUTILS_H
Expand Down
2 changes: 1 addition & 1 deletion src/libcrush/dbfr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#if HAVE_CONFIG_H
# include <crush/config.h>
# include <config.h>
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
Expand Down
2 changes: 1 addition & 1 deletion src/libcrush/ffutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*****************************************/

#ifdef HAVE_CONFIG_H
#include <crush/config.h>
#include <config.h>
#endif

#include <crush/ffutils.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libcrush/test/dbfr_test.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include "dbfr.h"
#include <crush/dbfr.h>

#define DIE(s, ...) \
do { \
Expand Down
2 changes: 1 addition & 1 deletion src/mergekeys/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"to determine common fields. In this case, all key fields must precede all\\n" .
"mergeable fields. A header line in each file is required in either case.",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
4 changes: 2 additions & 2 deletions src/mergekeys/mergekeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# include <config.h>
#endif

#include <ffutils.h>
#include <dbfr.h>
#include <crush/ffutils.h>
#include <crush/dbfr.h>

#ifdef HAVE_FCNTL_H
# include <fcntl.h> /* open64() */
Expand Down
2 changes: 1 addition & 1 deletion src/pivot/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trailing_opts => "[file ...]",
usage_extra => "-f, -p, and -v values are comma-separated numbers or ranges. for example:\\n\\n1,2-5,7",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/range/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
usage_extra => "<range_string> may be a mixture of comma-separated numbers and ranges (no spaces).\\n\\n".
"`example: range 1,2,6-10`",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/reorder/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trailing_opts => "[file(s)]",
usage_extra => "the fields param is exclusive of swap and move - if -f and -m or -s are\\nspecified, only -f will be used.\\n\\nexample: reorder -d : -s 1,3 -m 2,4 /etc/passwd\\n\\nwould swap fields 1 and 3, and then would move field 2 to position 4.",
do_long_opts => 1,
preproc_extra => "#include \"reorder.h\"\n#include <crush_version.h>",
preproc_extra => "#include \"reorder.h\"\n#include <crush/crush_version.h>",
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
6 changes: 3 additions & 3 deletions src/reorder/reorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
# include <assert.h>
#endif

#include <ffutils.h>
#include <dbfr.h>
#include <linklist.h>
#include <crush/ffutils.h>
#include <crush/dbfr.h>
#include <crush/linklist.h>

#ifndef REORDER_H
#define REORDER_H
Expand Down
2 changes: 1 addition & 1 deletion src/subtotal/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
trailing_opts => "",
usage_extra => "",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/tochar/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trailing_opts => "<N>",
usage_extra => "N may be decimal, octal (with leading 0), or hexadecimal (with leading 0x)",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down
2 changes: 1 addition & 1 deletion src/truncfield/args.tab
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
trailing_opts => "[file ...]",
usage_extra => "if -d is not specified and DELIMITER enviroment variable is defined, that value will be used.",
do_long_opts => 1,
preproc_extra => '#include <crush_version.h>',
preproc_extra => '#include <crush/crush_version.h>',
copyright => <<END_COPYRIGHT
Copyright 2008 Google Inc.

Expand Down

0 comments on commit bd675da

Please sign in to comment.