From dba0da5adbc0ff90d281fb77f302c2b30a4549f6 Mon Sep 17 00:00:00 2001 From: Neel Goyal Date: Thu, 15 Aug 2013 10:16:15 -0400 Subject: [PATCH] Massive restructure and renaming --- configure.ac | 6 +++--- src/Makefile.am | 7 ++++++- src/common/Makefile.am | 7 ------- src/common/getdns_libevent.h | 12 ------------ src/{common/getdns_context.c => context.c} | 2 +- src/{common/getdns_context.h => context.h} | 2 +- src/{common/getdns_convert.c => convert.c} | 2 +- src/{common/getdns_dict.c => dict.c} | 2 +- src/example/example_all_functions.c | 2 +- src/example/example_simple_answers.c | 2 +- src/example/example_synchronous.c | 2 +- src/example/example_tree.c | 2 +- src/{common/getdns_general.c => general.c} | 2 +- src/{common => getdns}/ChangeLog | 0 src/getdns/Makefile.am | 1 + src/{common => getdns}/config.h.in | 0 src/{common/getdns_core_only.h => getdns/getdns.h} | 9 +++++++++ src/{common => getdns}/index.html | 0 src/{common => getdns}/install-sh | 0 src/{common => getdns}/make-examples-linux.sh | 0 src/{common => getdns}/make-examples-mac.sh | 0 src/{common/getdns_hostname.c => hostname.c} | 2 +- src/{common/getdns_list.c => list.c} | 2 +- src/{common/getdns_service.c => service.c} | 2 +- src/{common/getdns_sync.c => sync.c} | 2 +- src/test/tests_dict.c | 2 +- src/test/tests_list.c | 2 +- .../getdns_validate_dnssec.c => validate_dnssec.c} | 2 +- 28 files changed, 35 insertions(+), 39 deletions(-) delete mode 100644 src/common/Makefile.am delete mode 100644 src/common/getdns_libevent.h rename src/{common/getdns_context.c => context.c} (99%) rename src/{common/getdns_context.h => context.h} (97%) rename src/{common/getdns_convert.c => convert.c} (98%) rename src/{common/getdns_dict.c => dict.c} (99%) rename src/{common/getdns_general.c => general.c} (99%) rename src/{common => getdns}/ChangeLog (100%) create mode 100644 src/getdns/Makefile.am rename src/{common => getdns}/config.h.in (100%) rename src/{common/getdns_core_only.h => getdns/getdns.h} (99%) rename src/{common => getdns}/index.html (100%) rename src/{common => getdns}/install-sh (100%) rename src/{common => getdns}/make-examples-linux.sh (100%) rename src/{common => getdns}/make-examples-mac.sh (100%) rename src/{common/getdns_hostname.c => hostname.c} (98%) rename src/{common/getdns_list.c => list.c} (99%) rename src/{common/getdns_service.c => service.c} (98%) rename src/{common/getdns_sync.c => sync.c} (99%) rename src/{common/getdns_validate_dnssec.c => validate_dnssec.c} (98%) diff --git a/configure.ac b/configure.ac index 71d63e30..b6c2a655 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_PREREQ([2.68]) AC_INIT([getdns], [0.320], [melinda.shore@nomountain.net]) -AC_CONFIG_SRCDIR([src/common/getdns_general.c]) +AC_CONFIG_SRCDIR([src/getdns/getdns.h]) AM_INIT_AUTOMAKE LT_INIT AC_CONFIG_MACRO_DIR([m4]) @@ -37,6 +37,6 @@ AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T -AC_CONFIG_FILES([Makefile src/Makefile src/common/Makefile src/example/Makefile src/test/Makefile]) -AC_CONFIG_SUBDIRS([src/ src/common/ src/example/ src/test/]) +AC_CONFIG_FILES([Makefile src/Makefile src/getdns/Makefile src/example/Makefile src/test/Makefile]) +AC_CONFIG_SUBDIRS([src/ src/getdns/ src/example/ src/test/]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index cb71f868..c289b247 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1,6 @@ -SUBDIRS = common example test +SUBDIRS = example test +AM_CPPFLAGS = -Wall -Werror -g -fPIC -I$(srcdir)/ -I /usr/local/include -std=c99 +lib_LTLIBRARIES = libgetdns.la +libgetdns_la_SOURCES = context.c convert.c \ + dict.c general.c hostname.c list.c \ + service.c sync.c validate_dnssec.c diff --git a/src/common/Makefile.am b/src/common/Makefile.am deleted file mode 100644 index 07665a5b..00000000 --- a/src/common/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -AM_CPPFLAGS = -Wall -Werror -g -fPIC -I$(srcdir)/ -I /usr/local/include -std=c99 -lib_LTLIBRARIES = libgetdns.la -libgetdns_la_SOURCES = getdns_context.c getdns_convert.c \ - getdns_dict.c getdns_general.c getdns_hostname.c getdns_list.c \ - getdns_service.c getdns_sync.c getdns_validate_dnssec.c \ - getdns_core_only.h getdns_libevent.h getdns_context.h -include_HEADERS = getdns_core_only.h diff --git a/src/common/getdns_libevent.h b/src/common/getdns_libevent.h deleted file mode 100644 index 1db26e7d..00000000 --- a/src/common/getdns_libevent.h +++ /dev/null @@ -1,12 +0,0 @@ - -#include -#include - -/* For libevent, which we are using for these examples */ -getdns_return_t -getdns_extension_set_libevent_base( - getdns_context_t context, - struct event_base *this_event_base -); - - diff --git a/src/common/getdns_context.c b/src/context.c similarity index 99% rename from src/common/getdns_context.c rename to src/context.c index efbdd6c8..ec26e210 100644 --- a/src/common/getdns_context.c +++ b/src/context.c @@ -29,7 +29,7 @@ */ #include -#include +#include "getdns_context.h" #include /* stuff to make it compile pedantically */ diff --git a/src/common/getdns_context.h b/src/context.h similarity index 97% rename from src/common/getdns_context.h rename to src/context.h index 7cfdac40..3caec18c 100644 --- a/src/common/getdns_context.h +++ b/src/context.h @@ -5,7 +5,7 @@ #ifndef _GETDNS_CONTEXT_H_ #define _GETDNS_CONTEXT_H_ -#include +#include /** function pointer typedefs */ typedef void (*getdns_update_callback)(getdns_context_t context, uint16_t changed_item); diff --git a/src/common/getdns_convert.c b/src/convert.c similarity index 98% rename from src/common/getdns_convert.c rename to src/convert.c index 0025ed1c..e3182b56 100644 --- a/src/common/getdns_convert.c +++ b/src/convert.c @@ -28,7 +28,7 @@ * THE SOFTWARE. */ -#include +#include #include /* stuff to make it compile pedantically */ diff --git a/src/common/getdns_dict.c b/src/dict.c similarity index 99% rename from src/common/getdns_dict.c rename to src/dict.c index ce0701f9..8f502383 100644 --- a/src/common/getdns_dict.c +++ b/src/dict.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include /* TODO: change this to make the walk safe for reentrant/multi-thread calls */ struct getdns_list *walkresultlist; diff --git a/src/example/example_all_functions.c b/src/example/example_all_functions.c index babfc90e..afeec509 100644 --- a/src/example/example_all_functions.c +++ b/src/example/example_all_functions.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #define UNUSED_PARAM(x) ((void)(x)) diff --git a/src/example/example_simple_answers.c b/src/example/example_simple_answers.c index 59cc82c6..a4c038ef 100644 --- a/src/example/example_simple_answers.c +++ b/src/example/example_simple_answers.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #define UNUSED_PARAM(x) ((void)(x)) diff --git a/src/example/example_synchronous.c b/src/example/example_synchronous.c index c100105a..9f7b813a 100644 --- a/src/example/example_synchronous.c +++ b/src/example/example_synchronous.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include int main() diff --git a/src/example/example_tree.c b/src/example/example_tree.c index 9bda28ec..6769baad 100644 --- a/src/example/example_tree.c +++ b/src/example/example_tree.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #define UNUSED_PARAM(x) ((void)(x)) diff --git a/src/common/getdns_general.c b/src/general.c similarity index 99% rename from src/common/getdns_general.c rename to src/general.c index 409c5f70..a1e3e1ea 100644 --- a/src/common/getdns_general.c +++ b/src/general.c @@ -58,7 +58,7 @@ * Version: 0.1b */ -#include +#include "getdns_context.h" #include /* useful macros */ diff --git a/src/common/ChangeLog b/src/getdns/ChangeLog similarity index 100% rename from src/common/ChangeLog rename to src/getdns/ChangeLog diff --git a/src/getdns/Makefile.am b/src/getdns/Makefile.am new file mode 100644 index 00000000..30fa5740 --- /dev/null +++ b/src/getdns/Makefile.am @@ -0,0 +1 @@ +include_HEADERS = getdns.h diff --git a/src/common/config.h.in b/src/getdns/config.h.in similarity index 100% rename from src/common/config.h.in rename to src/getdns/config.h.in diff --git a/src/common/getdns_core_only.h b/src/getdns/getdns.h similarity index 99% rename from src/common/getdns_core_only.h rename to src/getdns/getdns.h index c7cc3a15..ff665f25 100644 --- a/src/common/getdns_core_only.h +++ b/src/getdns/getdns.h @@ -33,6 +33,7 @@ #include #include #include +#include #define GETDNS_COMPILATION_COMMENT The API implementation should fill in something here, such as a compilation version string and date, and change it each time the API is compiled. @@ -966,4 +967,12 @@ getdns_context_set_memory_reallocator( void (*value)(void*) ); +/* Extension - refactor to abstract async evt loop */ +/* For libevent, which we are using for these examples */ +getdns_return_t +getdns_extension_set_libevent_base( + getdns_context_t context, + struct event_base *this_event_base +); + #endif /* GETDNS_H */ diff --git a/src/common/index.html b/src/getdns/index.html similarity index 100% rename from src/common/index.html rename to src/getdns/index.html diff --git a/src/common/install-sh b/src/getdns/install-sh similarity index 100% rename from src/common/install-sh rename to src/getdns/install-sh diff --git a/src/common/make-examples-linux.sh b/src/getdns/make-examples-linux.sh similarity index 100% rename from src/common/make-examples-linux.sh rename to src/getdns/make-examples-linux.sh diff --git a/src/common/make-examples-mac.sh b/src/getdns/make-examples-mac.sh similarity index 100% rename from src/common/make-examples-mac.sh rename to src/getdns/make-examples-mac.sh diff --git a/src/common/getdns_hostname.c b/src/hostname.c similarity index 98% rename from src/common/getdns_hostname.c rename to src/hostname.c index 6d55c19b..e7ef7b74 100644 --- a/src/common/getdns_hostname.c +++ b/src/hostname.c @@ -28,7 +28,7 @@ * THE SOFTWARE. */ -#include +#include /* stuff to make it compile pedantically */ #define UNUSED_PARAM(x) ((void)(x)) diff --git a/src/common/getdns_list.c b/src/list.c similarity index 99% rename from src/common/getdns_list.c rename to src/list.c index 3037134b..41b04e76 100644 --- a/src/common/getdns_list.c +++ b/src/list.c @@ -29,7 +29,7 @@ */ #include -#include +#include /*---------------------------------------- getdns_list_get_length */ getdns_return_t diff --git a/src/common/getdns_service.c b/src/service.c similarity index 98% rename from src/common/getdns_service.c rename to src/service.c index 3ea3077b..c31a2d13 100644 --- a/src/common/getdns_service.c +++ b/src/service.c @@ -28,7 +28,7 @@ * THE SOFTWARE. */ -#include +#include /* stuff to make it compile pedantically */ #define UNUSED_PARAM(x) ((void)(x)) diff --git a/src/common/getdns_sync.c b/src/sync.c similarity index 99% rename from src/common/getdns_sync.c rename to src/sync.c index 0e4ab639..ae26f56a 100644 --- a/src/common/getdns_sync.c +++ b/src/sync.c @@ -27,7 +27,7 @@ * THE SOFTWARE. */ -#include +#include /* stuff to make it compile pedantically */ #define UNUSED_PARAM(x) ((void)(x)) diff --git a/src/test/tests_dict.c b/src/test/tests_dict.c index 4161f87a..4129c282 100644 --- a/src/test/tests_dict.c +++ b/src/test/tests_dict.c @@ -30,7 +30,7 @@ #include #include #include "testmessages.h" -#include "getdns_core_only.h" +#include #define TSTMSGBUF 80 diff --git a/src/test/tests_list.c b/src/test/tests_list.c index 1f0aa06f..5e6c2fa9 100644 --- a/src/test/tests_list.c +++ b/src/test/tests_list.c @@ -30,7 +30,7 @@ #include #include #include "testmessages.h" -#include "getdns_core_only.h" +#include #define TSTMSGBUF 80 diff --git a/src/common/getdns_validate_dnssec.c b/src/validate_dnssec.c similarity index 98% rename from src/common/getdns_validate_dnssec.c rename to src/validate_dnssec.c index e0a5c027..a6886502 100644 --- a/src/common/getdns_validate_dnssec.c +++ b/src/validate_dnssec.c @@ -28,7 +28,7 @@ * THE SOFTWARE. */ -#include +#include /* stuff to make it compile pedantically */ #define UNUSED_PARAM(x) ((void)(x))