You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/09/25 16:43:40 UTC

[51/55] [abbrv] [partial] thrift git commit: THRIFT-2835 Add possibility to distribute generators separately from thrift core, and load them dynamically

THRIFT-2835 Add possibility to distribute generators separately from thrift core, and load them dynamically

Deploy headers needed to build plugins

Restructure source tree to match lib and to make sure headers are
deployed to INCLUDE_DIR/thrift.

This closes #368 and closes #1039


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/052abc39
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/052abc39
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/052abc39

Branch: refs/heads/master
Commit: 052abc39c60c54f9901993e76a81036b482ed6ba
Parents: 11da87e
Author: dtmuller <dt...@web.de>
Authored: Tue Jul 26 11:58:28 2016 +0200
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Mon Sep 26 01:42:02 2016 +0900

----------------------------------------------------------------------
 .gitignore                                      |   24 +-
 compiler/cpp/CMakeLists.txt                     |  121 +-
 compiler/cpp/Makefile.am                        |  210 +-
 compiler/cpp/src/Makefile.am                    |   96 +-
 compiler/cpp/src/audit/t_audit.cpp              |  466 --
 compiler/cpp/src/audit/t_audit.h                |   14 -
 compiler/cpp/src/common.cc                      |   69 -
 compiler/cpp/src/common.h                       |   43 -
 compiler/cpp/src/generate/t_as3_generator.cc    | 2594 ---------
 compiler/cpp/src/generate/t_c_glib_generator.cc | 4562 ---------------
 compiler/cpp/src/generate/t_cocoa_generator.cc  | 3301 -----------
 compiler/cpp/src/generate/t_cpp_generator.cc    | 4374 --------------
 compiler/cpp/src/generate/t_csharp_generator.cc | 3202 -----------
 compiler/cpp/src/generate/t_d_generator.cc      |  728 ---
 compiler/cpp/src/generate/t_dart_generator.cc   | 2516 ---------
 compiler/cpp/src/generate/t_delphi_generator.cc | 3920 -------------
 compiler/cpp/src/generate/t_erl_generator.cc    | 1169 ----
 compiler/cpp/src/generate/t_generator.cc        |  190 -
 compiler/cpp/src/generate/t_generator.h         |  310 -
 .../cpp/src/generate/t_generator_registry.h     |  106 -
 compiler/cpp/src/generate/t_go_generator.cc     | 3685 ------------
 compiler/cpp/src/generate/t_gv_generator.cc     |  345 --
 compiler/cpp/src/generate/t_haxe_generator.cc   | 2981 ----------
 compiler/cpp/src/generate/t_hs_generator.cc     | 1734 ------
 compiler/cpp/src/generate/t_html_generator.cc   | 1088 ----
 compiler/cpp/src/generate/t_html_generator.h    |  240 -
 compiler/cpp/src/generate/t_java_generator.cc   | 5323 ------------------
 compiler/cpp/src/generate/t_javame_generator.cc | 3295 -----------
 compiler/cpp/src/generate/t_js_generator.cc     | 2231 --------
 compiler/cpp/src/generate/t_json_generator.cc   |  727 ---
 compiler/cpp/src/generate/t_lua_generator.cc    | 1138 ----
 compiler/cpp/src/generate/t_ocaml_generator.cc  | 1762 ------
 compiler/cpp/src/generate/t_oop_generator.h     |  112 -
 compiler/cpp/src/generate/t_perl_generator.cc   | 1648 ------
 compiler/cpp/src/generate/t_php_generator.cc    | 2653 ---------
 compiler/cpp/src/generate/t_py_generator.cc     | 2625 ---------
 compiler/cpp/src/generate/t_rb_generator.cc     | 1263 -----
 compiler/cpp/src/generate/t_st_generator.cc     | 1055 ----
 compiler/cpp/src/generate/t_swift_generator.cc  | 2209 --------
 compiler/cpp/src/generate/t_xml_generator.cc    |  687 ---
 compiler/cpp/src/generate/t_xsd_generator.cc    |  376 --
 compiler/cpp/src/globals.h                      |  141 -
 compiler/cpp/src/logging.cc                     |   77 -
 compiler/cpp/src/logging.h                      |   47 -
 compiler/cpp/src/main.cc                        | 1307 -----
 compiler/cpp/src/main.h                         |  119 -
 compiler/cpp/src/parse/parse.cc                 |   39 -
 compiler/cpp/src/parse/t_base_type.h            |  117 -
 compiler/cpp/src/parse/t_const.h                |   50 -
 compiler/cpp/src/parse/t_const_value.h          |  155 -
 compiler/cpp/src/parse/t_container.h            |   47 -
 compiler/cpp/src/parse/t_doc.h                  |   55 -
 compiler/cpp/src/parse/t_enum.h                 |  110 -
 compiler/cpp/src/parse/t_enum_value.h           |   50 -
 compiler/cpp/src/parse/t_field.h                |  134 -
 compiler/cpp/src/parse/t_function.h             |   84 -
 compiler/cpp/src/parse/t_list.h                 |   41 -
 compiler/cpp/src/parse/t_map.h                  |   45 -
 compiler/cpp/src/parse/t_program.h              |  395 --
 compiler/cpp/src/parse/t_scope.h                |  181 -
 compiler/cpp/src/parse/t_service.h              |   61 -
 compiler/cpp/src/parse/t_set.h                  |   41 -
 compiler/cpp/src/parse/t_struct.h               |  171 -
 compiler/cpp/src/parse/t_type.h                 |  108 -
 compiler/cpp/src/parse/t_typedef.cc             |   34 -
 compiler/cpp/src/parse/t_typedef.h              |   67 -
 compiler/cpp/src/platform.h                     |   47 -
 compiler/cpp/src/plugin/Makefile.am             |   47 -
 compiler/cpp/src/plugin/plugin.cc               |  503 --
 compiler/cpp/src/plugin/plugin.h                |   44 -
 compiler/cpp/src/plugin/plugin.thrift           |  202 -
 compiler/cpp/src/plugin/plugin_output.cc        |  410 --
 compiler/cpp/src/plugin/plugin_output.h         |   38 -
 compiler/cpp/src/plugin/type_util.h             |   94 -
 compiler/cpp/src/thrift/audit/t_audit.cpp       |  464 ++
 compiler/cpp/src/thrift/audit/t_audit.h         |   14 +
 compiler/cpp/src/thrift/common.cc               |   69 +
 compiler/cpp/src/thrift/common.h                |   43 +
 .../cpp/src/thrift/generate/t_as3_generator.cc  | 2594 +++++++++
 .../src/thrift/generate/t_c_glib_generator.cc   | 4562 +++++++++++++++
 .../src/thrift/generate/t_cocoa_generator.cc    | 3301 +++++++++++
 .../cpp/src/thrift/generate/t_cpp_generator.cc  | 4374 ++++++++++++++
 .../src/thrift/generate/t_csharp_generator.cc   | 3202 +++++++++++
 .../cpp/src/thrift/generate/t_d_generator.cc    |  728 +++
 .../cpp/src/thrift/generate/t_dart_generator.cc | 2516 +++++++++
 .../src/thrift/generate/t_delphi_generator.cc   | 3920 +++++++++++++
 .../cpp/src/thrift/generate/t_erl_generator.cc  | 1169 ++++
 compiler/cpp/src/thrift/generate/t_generator.cc |  190 +
 compiler/cpp/src/thrift/generate/t_generator.h  |  310 +
 .../src/thrift/generate/t_generator_registry.h  |  106 +
 .../cpp/src/thrift/generate/t_go_generator.cc   | 3685 ++++++++++++
 .../cpp/src/thrift/generate/t_gv_generator.cc   |  345 ++
 .../cpp/src/thrift/generate/t_haxe_generator.cc | 2981 ++++++++++
 .../cpp/src/thrift/generate/t_hs_generator.cc   | 1734 ++++++
 .../cpp/src/thrift/generate/t_html_generator.cc | 1088 ++++
 .../cpp/src/thrift/generate/t_html_generator.h  |  240 +
 .../cpp/src/thrift/generate/t_java_generator.cc | 5323 ++++++++++++++++++
 .../src/thrift/generate/t_javame_generator.cc   | 3295 +++++++++++
 .../cpp/src/thrift/generate/t_js_generator.cc   | 2231 ++++++++
 .../cpp/src/thrift/generate/t_json_generator.cc |  727 +++
 .../cpp/src/thrift/generate/t_lua_generator.cc  | 1138 ++++
 .../src/thrift/generate/t_ocaml_generator.cc    | 1762 ++++++
 .../cpp/src/thrift/generate/t_oop_generator.h   |  112 +
 .../cpp/src/thrift/generate/t_perl_generator.cc | 1648 ++++++
 .../cpp/src/thrift/generate/t_php_generator.cc  | 2653 +++++++++
 .../cpp/src/thrift/generate/t_py_generator.cc   | 2625 +++++++++
 .../cpp/src/thrift/generate/t_rb_generator.cc   | 1263 +++++
 .../cpp/src/thrift/generate/t_st_generator.cc   | 1055 ++++
 .../src/thrift/generate/t_swift_generator.cc    | 2209 ++++++++
 .../cpp/src/thrift/generate/t_xml_generator.cc  |  687 +++
 .../cpp/src/thrift/generate/t_xsd_generator.cc  |  376 ++
 compiler/cpp/src/thrift/globals.h               |  141 +
 compiler/cpp/src/thrift/logging.cc              |   77 +
 compiler/cpp/src/thrift/logging.h               |   47 +
 compiler/cpp/src/thrift/main.cc                 | 1307 +++++
 compiler/cpp/src/thrift/main.h                  |  119 +
 compiler/cpp/src/thrift/parse/parse.cc          |   39 +
 compiler/cpp/src/thrift/parse/t_base_type.h     |  117 +
 compiler/cpp/src/thrift/parse/t_const.h         |   50 +
 compiler/cpp/src/thrift/parse/t_const_value.h   |  155 +
 compiler/cpp/src/thrift/parse/t_container.h     |   47 +
 compiler/cpp/src/thrift/parse/t_doc.h           |   55 +
 compiler/cpp/src/thrift/parse/t_enum.h          |  110 +
 compiler/cpp/src/thrift/parse/t_enum_value.h    |   50 +
 compiler/cpp/src/thrift/parse/t_field.h         |  134 +
 compiler/cpp/src/thrift/parse/t_function.h      |   84 +
 compiler/cpp/src/thrift/parse/t_list.h          |   41 +
 compiler/cpp/src/thrift/parse/t_map.h           |   45 +
 compiler/cpp/src/thrift/parse/t_program.h       |  395 ++
 compiler/cpp/src/thrift/parse/t_scope.h         |  181 +
 compiler/cpp/src/thrift/parse/t_service.h       |   61 +
 compiler/cpp/src/thrift/parse/t_set.h           |   41 +
 compiler/cpp/src/thrift/parse/t_struct.h        |  171 +
 compiler/cpp/src/thrift/parse/t_type.h          |  108 +
 compiler/cpp/src/thrift/parse/t_typedef.cc      |   34 +
 compiler/cpp/src/thrift/parse/t_typedef.h       |   67 +
 compiler/cpp/src/thrift/platform.h              |   47 +
 compiler/cpp/src/thrift/plugin/Makefile.am      |   47 +
 compiler/cpp/src/thrift/plugin/plugin.cc        |  503 ++
 compiler/cpp/src/thrift/plugin/plugin.h         |   44 +
 compiler/cpp/src/thrift/plugin/plugin.thrift    |  202 +
 compiler/cpp/src/thrift/plugin/plugin_output.cc |  410 ++
 compiler/cpp/src/thrift/plugin/plugin_output.h  |   38 +
 compiler/cpp/src/thrift/plugin/type_util.h      |   94 +
 compiler/cpp/src/thrift/thriftl.ll              |  463 ++
 compiler/cpp/src/thrift/thrifty.yy              | 1193 ++++
 compiler/cpp/src/thrift/version.h.in            |    1 +
 compiler/cpp/src/thrift/windows/config.h        |   45 +
 compiler/cpp/src/thrift/windows/version.h.in    |   33 +
 compiler/cpp/src/thriftl.ll                     |  463 --
 compiler/cpp/src/thrifty.yy                     | 1193 ----
 compiler/cpp/src/version.h.in                   |    1 -
 compiler/cpp/src/windows/config.h               |   45 -
 compiler/cpp/src/windows/version.h.in           |   33 -
 compiler/cpp/test/CMakeLists.txt                |    2 +-
 compiler/cpp/test/plugin/conversion_test.cc     |    6 +-
 compiler/cpp/test/plugin/cpp_plugin.cc          |    4 +-
 configure.ac                                    |    8 +-
 158 files changed, 71822 insertions(+), 71721 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 94e8519..9a0e275 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,28 +48,28 @@ erl_crash.dump
 /autoscan.log
 /autoscan-*.log
 /compiler/cpp/test/plugin/t_cpp_generator.cc
-/compiler/cpp/src/plugin/plugin_constants.cpp
-/compiler/cpp/src/plugin/plugin_constants.h
-/compiler/cpp/src/plugin/plugin_types.cpp
-/compiler/cpp/src/plugin/plugin_types.h
+/compiler/cpp/src/thrift/plugin/plugin_constants.cpp
+/compiler/cpp/src/thrift/plugin/plugin_constants.h
+/compiler/cpp/src/thrift/plugin/plugin_types.cpp
+/compiler/cpp/src/thrift/plugin/plugin_types.h
 /compiler/cpp/test/*test
 /compiler/cpp/test/thrift-gen-*
-/compiler/cpp/src/thrift-bootstrap
-/compiler/cpp/src/plugin/gen.stamp
+/compiler/cpp/src/thrift/thrift-bootstrap
+/compiler/cpp/src/thrift/plugin/gen.stamp
 /compiler/cpp/Debug
 /compiler/cpp/Release
-/compiler/cpp/src/libparse.a
-/compiler/cpp/src/thriftl.cc
-/compiler/cpp/src/thrifty.cc
-/compiler/cpp/src/thrifty.hh
-/compiler/cpp/src/windows/version.h
+/compiler/cpp/src/thrift/libparse.a
+/compiler/cpp/src/thrift/thriftl.cc
+/compiler/cpp/src/thrift/thrifty.cc
+/compiler/cpp/src/thrift/thrifty.hh
+/compiler/cpp/src/thrift/windows/version.h
 /compiler/cpp/thrift
 /compiler/cpp/thriftl.cc
 /compiler/cpp/thrifty.cc
 /compiler/cpp/lex.yythriftl.cc
 /compiler/cpp/thrifty.h
 /compiler/cpp/thrifty.hh
-/compiler/cpp/src/version.h
+/compiler/cpp/src/thrift/version.h
 /config.*
 /configure
 /configure.lineno

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index 48cadbc..2d9529a 100644
--- a/compiler/cpp/CMakeLists.txt
+++ b/compiler/cpp/CMakeLists.txt
@@ -19,52 +19,52 @@
 
 # Windows has a different header
 if(MSVC)
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/windows/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
 else()
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
 endif()
 
 find_package(FLEX REQUIRED)
 find_package(BISON REQUIRED)
 
 # Create flex and bison files and build the lib parse static library
-BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrifty.cc)
-FLEX_TARGET(thriftl ${CMAKE_CURRENT_SOURCE_DIR}/src/thriftl.ll ${CMAKE_CURRENT_BINARY_DIR}/thriftl.cc)
+BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc)
+FLEX_TARGET(thriftl ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thriftl.ll ${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc)
 ADD_FLEX_BISON_DEPENDENCY(thriftl thrifty)
 
 # HACK: Work around the fact that bison crates a .hh file but we need a .h file
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/thrifty.h
-                   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/thrifty.hh ${CMAKE_CURRENT_BINARY_DIR}/thrifty.h
-                   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/thrifty.hh
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.h
+                   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.hh ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.h
+                   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.hh
                    )
 
 set(libparse_SOURCES
-    ${CMAKE_CURRENT_BINARY_DIR}/thrifty.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/thriftl.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/thrifty.h
+    ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc
+    ${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc
+    ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.h
 )
 
 add_library(libparse STATIC ${libparse_SOURCES})
 
 # Create the thrift compiler
 set(compiler_core
-    src/common.cc
-    src/generate/t_generator.cc
-    src/parse/t_typedef.cc
-    src/parse/parse.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/version.h
+    src/thrift/common.cc
+    src/thrift/generate/t_generator.cc
+    src/thrift/parse/t_typedef.cc
+    src/thrift/parse/parse.cc
+    ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h
 )
 
 set(thrift-compiler_SOURCES
-    src/main.cc
-    src/audit/t_audit.cpp
+    src/thrift/main.cc
+    src/thrift/audit/t_audit.cpp
 )
 
 # This macro adds an option THRIFT_COMPILER_${NAME}
 # that allows enabling or disabling certain languages
 macro(THRIFT_ADD_COMPILER name description initial)
     string(TOUPPER "THRIFT_COMPILER_${name}" enabler)
-    set(src "src/generate/t_${name}_generator.cc")
+    set(src "src/thrift/generate/t_${name}_generator.cc")
     option(${enabler} ${description} ${initial})
     if(${enabler})
         list(APPEND thrift-compiler_SOURCES ${src})
@@ -112,25 +112,25 @@ add_executable(thrift-compiler ${thrift-compiler_SOURCES})
 
 if(${WITH_PLUGIN})
     add_executable(thrift-bootstrap ${compiler_core}
-        src/main.cc
-        src/audit/t_audit.cpp
-        src/generate/t_cpp_generator.cc
+        src/thrift/main.cc
+        src/thrift/audit/t_audit.cpp
+        src/thrift/generate/t_cpp_generator.cc
     )
     target_link_libraries(thrift-bootstrap libparse)
 
     set(PLUGIN_GEN_SOURCES
-        ${CMAKE_CURRENT_BINARY_DIR}/plugin/plugin_types.h
-        ${CMAKE_CURRENT_BINARY_DIR}/plugin/plugin_types.cpp
-        ${CMAKE_CURRENT_BINARY_DIR}/plugin/plugin_constants.h
-        ${CMAKE_CURRENT_BINARY_DIR}/plugin/plugin_constants.cpp
+        ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_types.h
+        ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_types.cpp
+        ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_constants.h
+        ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_constants.cpp
     )
 
-    file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plugin)
+    file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin)
     add_custom_command(OUTPUT ${PLUGIN_GEN_SOURCES}
-        DEPENDS thrift-bootstrap src/plugin/plugin.thrift
+        DEPENDS thrift-bootstrap src/thrift/plugin/plugin.thrift
         COMMAND thrift-bootstrap -gen cpp
-        -out ${CMAKE_CURRENT_BINARY_DIR}/plugin
-        ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin/plugin.thrift
+        -out ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin
+        ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/plugin/plugin.thrift
     )
 
     include_directories(../../lib/cpp/src)
@@ -139,9 +139,9 @@ if(${WITH_PLUGIN})
     ADD_LIBRARY_THRIFT(thriftc
         ${compiler_core}
         ${PLUGIN_GEN_SOURCES}
-        src/logging.cc
-        src/plugin/plugin_output.cc
-        src/plugin/plugin.cc
+        src/thrift/logging.cc
+        src/thrift/plugin/plugin_output.cc
+        src/thrift/plugin/plugin.cc
     )
     TARGET_INCLUDE_DIRECTORIES_THRIFT(thriftc PUBLIC ${Boost_INCLUDE_DIRS})
     TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY(thriftc thrift PUBLIC)
@@ -155,6 +155,63 @@ target_link_libraries(thrift-compiler libparse)
 
 install(TARGETS thrift-compiler DESTINATION "${BIN_INSTALL_DIR}")
 
+if(${WITH_PLUGIN})
+  # Install the headers
+  install(FILES
+      "src/thrift/common.h"
+      "src/thrift/globals.h"
+      "src/thrift/logging.h"
+      "src/thrift/main.h"
+      "src/thrift/platform.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift")
+  install(FILES
+      "src/thrift/audit/t_audit.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/audit")
+  install(FILES
+      "src/thrift/generate/t_generator.h"
+      "src/thrift/generate/t_generator_registry.h"
+      "src/thrift/generate/t_html_generator.h"
+      "src/thrift/generate/t_oop_generator.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/generate")
+  install(FILES
+      "src/thrift/parse/t_base_type.h"
+      "src/thrift/parse/t_const.h"
+      "src/thrift/parse/t_const_value.h"
+      "src/thrift/parse/t_container.h"
+      "src/thrift/parse/t_doc.h"
+      "src/thrift/parse/t_enum.h"
+      "src/thrift/parse/t_enum_value.h"
+      "src/thrift/parse/t_field.h"
+      "src/thrift/parse/t_function.h"
+      "src/thrift/parse/t_list.h"
+      "src/thrift/parse/t_map.h"
+      "src/thrift/parse/t_program.h"
+      "src/thrift/parse/t_scope.h"
+      "src/thrift/parse/t_service.h"
+      "src/thrift/parse/t_set.h"
+      "src/thrift/parse/t_struct.h"
+      "src/thrift/parse/t_typedef.h"
+      "src/thrift/parse/t_type.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/parse")
+  install(FILES
+      "src/thrift/plugin/plugin.h"
+      "src/thrift/plugin/plugin_output.h"
+      "src/thrift/plugin/type_util.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/plugin")
+if(MSVC)
+  install(FILES
+      "src/thrift/windows/config.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/windows")
+  install(FILES
+      "${CMAKE_BINARY_DIR}/compiler/cpp/thrift/windows/version.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift/windows")
+else()
+  install(FILES
+      "${CMAKE_BINARY_DIR}/compiler/cpp/thrift/version.h"
+      DESTINATION "${INCLUDE_INSTALL_DIR}/thrift")
+endif()
+endif()
+
 if(BUILD_TESTING)
     add_subdirectory(test)
 endif()

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/Makefile.am
----------------------------------------------------------------------
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index f7a7171..9d830d7 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -23,12 +23,12 @@
 
 AUTOMAKE_OPTIONS = subdir-objects
 
-# Note on why we have src and src/plugin directories:
+# Note on why we have src/thrift and src/thrift/plugin directories:
 # Since Automake supports only one set of BUILT_SOURCES per file and does not allow
 # SUBDIRS built before BUILT_SOURCES, we end up separate Makefile.am for each source
 # code generation, i.e. lex-yacc and Thrift, to achieve stable parallel make.
 
-SUBDIRS = src src/plugin .
+SUBDIRS = src src/thrift/plugin .
 if WITH_TESTS
 SUBDIRS += test
 endif
@@ -37,82 +37,82 @@ bin_PROGRAMS = thrift
 
 thrift_OBJDIR = obj
 
-plugin_gen = src/plugin/plugin_types.h \
-             src/plugin/plugin_types.cpp \
-             src/plugin/plugin_constants.h \
-             src/plugin/plugin_constants.cpp
-
-compiler_core =  src/common.h \
-                 src/common.cc \
-                 src/generate/t_generator.cc \
-                 src/generate/t_generator_registry.h \
-                 src/globals.h \
-                 src/platform.h \
-                 src/logging.h \
-                 src/parse/t_doc.h \
-                 src/parse/t_type.h \
-                 src/parse/t_base_type.h \
-                 src/parse/t_enum.h \
-                 src/parse/t_enum_value.h \
-                 src/parse/t_typedef.h \
-                 src/parse/t_typedef.cc \
-                 src/parse/t_container.h \
-                 src/parse/t_list.h \
-                 src/parse/t_set.h \
-                 src/parse/t_map.h \
-                 src/parse/t_struct.h \
-                 src/parse/t_field.h \
-                 src/parse/t_service.h \
-                 src/parse/t_function.h \
-                 src/parse/t_program.h \
-                 src/parse/t_scope.h \
-                 src/parse/t_const.h \
-                 src/parse/t_const_value.h \
-                 src/parse/parse.cc \
-                 src/generate/t_generator.h \
-                 src/generate/t_oop_generator.h \
-                 src/generate/t_html_generator.h \
-                 src/windows/config.h \
-                 src/windows/version.h
-
-thrift_SOURCES = src/main.h \
-                 src/main.cc \
-                 src/audit/t_audit.cpp \
-                 src/audit/t_audit.h
+plugin_gen = src/thrift/plugin/plugin_types.h \
+             src/thrift/plugin/plugin_types.cpp \
+             src/thrift/plugin/plugin_constants.h \
+             src/thrift/plugin/plugin_constants.cpp
+
+compiler_core =  src/thrift/common.h \
+                 src/thrift/common.cc \
+                 src/thrift/generate/t_generator.cc \
+                 src/thrift/generate/t_generator_registry.h \
+                 src/thrift/globals.h \
+                 src/thrift/platform.h \
+                 src/thrift/logging.h \
+                 src/thrift/parse/t_doc.h \
+                 src/thrift/parse/t_type.h \
+                 src/thrift/parse/t_base_type.h \
+                 src/thrift/parse/t_enum.h \
+                 src/thrift/parse/t_enum_value.h \
+                 src/thrift/parse/t_typedef.h \
+                 src/thrift/parse/t_typedef.cc \
+                 src/thrift/parse/t_container.h \
+                 src/thrift/parse/t_list.h \
+                 src/thrift/parse/t_set.h \
+                 src/thrift/parse/t_map.h \
+                 src/thrift/parse/t_struct.h \
+                 src/thrift/parse/t_field.h \
+                 src/thrift/parse/t_service.h \
+                 src/thrift/parse/t_function.h \
+                 src/thrift/parse/t_program.h \
+                 src/thrift/parse/t_scope.h \
+                 src/thrift/parse/t_const.h \
+                 src/thrift/parse/t_const_value.h \
+                 src/thrift/parse/parse.cc \
+                 src/thrift/generate/t_generator.h \
+                 src/thrift/generate/t_oop_generator.h \
+                 src/thrift/generate/t_html_generator.h \
+                 src/thrift/windows/config.h \
+                 src/thrift/windows/version.h
+
+thrift_SOURCES = src/thrift/main.h \
+                 src/thrift/main.cc \
+                 src/thrift/audit/t_audit.cpp \
+                 src/thrift/audit/t_audit.h
 
 # Specific client generator source
-thrift_SOURCES += src/generate/t_c_glib_generator.cc \
-                  src/generate/t_cpp_generator.cc \
-                  src/generate/t_java_generator.cc \
-                  src/generate/t_json_generator.cc \
-                  src/generate/t_as3_generator.cc \
-                  src/generate/t_dart_generator.cc \
-                  src/generate/t_haxe_generator.cc \
-                  src/generate/t_csharp_generator.cc \
-                  src/generate/t_py_generator.cc \
-                  src/generate/t_rb_generator.cc \
-                  src/generate/t_perl_generator.cc \
-                  src/generate/t_php_generator.cc \
-                  src/generate/t_erl_generator.cc \
-                  src/generate/t_cocoa_generator.cc \
-                  src/generate/t_swift_generator.cc \
-                  src/generate/t_st_generator.cc \
-                  src/generate/t_ocaml_generator.cc \
-                  src/generate/t_hs_generator.cc \
-                  src/generate/t_xsd_generator.cc \
-                  src/generate/t_xml_generator.cc \
-                  src/generate/t_html_generator.cc \
-                  src/generate/t_js_generator.cc \
-                  src/generate/t_javame_generator.cc \
-                  src/generate/t_delphi_generator.cc \
-                  src/generate/t_go_generator.cc \
-                  src/generate/t_gv_generator.cc \
-                  src/generate/t_d_generator.cc \
-                  src/generate/t_lua_generator.cc
+thrift_SOURCES += src/thrift/generate/t_c_glib_generator.cc \
+                  src/thrift/generate/t_cpp_generator.cc \
+                  src/thrift/generate/t_java_generator.cc \
+                  src/thrift/generate/t_json_generator.cc \
+                  src/thrift/generate/t_as3_generator.cc \
+                  src/thrift/generate/t_dart_generator.cc \
+                  src/thrift/generate/t_haxe_generator.cc \
+                  src/thrift/generate/t_csharp_generator.cc \
+                  src/thrift/generate/t_py_generator.cc \
+                  src/thrift/generate/t_rb_generator.cc \
+                  src/thrift/generate/t_perl_generator.cc \
+                  src/thrift/generate/t_php_generator.cc \
+                  src/thrift/generate/t_erl_generator.cc \
+                  src/thrift/generate/t_cocoa_generator.cc \
+                  src/thrift/generate/t_swift_generator.cc \
+                  src/thrift/generate/t_st_generator.cc \
+                  src/thrift/generate/t_ocaml_generator.cc \
+                  src/thrift/generate/t_hs_generator.cc \
+                  src/thrift/generate/t_xsd_generator.cc \
+                  src/thrift/generate/t_xml_generator.cc \
+                  src/thrift/generate/t_html_generator.cc \
+                  src/thrift/generate/t_js_generator.cc \
+                  src/thrift/generate/t_javame_generator.cc \
+                  src/thrift/generate/t_delphi_generator.cc \
+                  src/thrift/generate/t_go_generator.cc \
+                  src/thrift/generate/t_gv_generator.cc \
+                  src/thrift/generate/t_d_generator.cc \
+                  src/thrift/generate/t_lua_generator.cc
 
 thrift_CPPFLAGS = -I$(srcdir)/src
 thrift_CXXFLAGS = -Wall -Wextra -pedantic
-thrift_LDADD = @LEXLIB@ src/libparse.a
+thrift_LDADD = @LEXLIB@ src/thrift/libparse.a
 
 if !WITH_PLUGIN
 thrift_SOURCES += $(compiler_core)
@@ -125,18 +125,64 @@ thrift_LDADD += libthriftc.la
 
 nodist_libthriftc_la_SOURCES = $(plugin_gen)
 libthriftc_la_SOURCES = $(compiler_core) \
-                        src/plugin/type_util.h \
-                        src/plugin/plugin.h \
-                        src/plugin/plugin.cc \
-                        src/plugin/plugin_output.h \
-                        src/plugin/plugin_output.cc \
-                        src/plugin/plugin.thrift \
-                        src/logging.cc
+                        src/thrift/plugin/type_util.h \
+                        src/thrift/plugin/plugin.h \
+                        src/thrift/plugin/plugin.cc \
+                        src/thrift/plugin/plugin_output.h \
+                        src/thrift/plugin/plugin_output.cc \
+                        src/thrift/plugin/plugin.thrift \
+                        src/thrift/logging.cc
 
 
 libthriftc_la_CPPFLAGS = -I$(srcdir)/src -Isrc -I$(top_builddir)/lib/cpp/src -DTHRIFT_ENABLE_PLUGIN=1
 libthriftc_la_CXXFLAGS = -Wall -Wextra -pedantic
 libthriftc_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
+
+include_thriftdir = $(includedir)/thrift
+include_thrift_HEADERS = src/thrift/common.h \
+                         src/thrift/globals.h \
+                         src/thrift/logging.h \
+                         src/thrift/main.h \
+                         src/thrift/platform.h \
+                         src/thrift/version.h
+
+include_auditdir = $(include_thriftdir)/windows
+include_audit_HEADERS = src/thrift/audit/t_audit.h
+
+include_generatedir = $(include_thriftdir)/generate
+include_generate_HEADERS = src/thrift/generate/t_generator.h \
+                           src/thrift/generate/t_generator_registry.h \
+                           src/thrift/generate/t_oop_generator.h \
+                           src/thrift/generate/t_html_generator.h
+
+include_parsedir = $(include_thriftdir)/parse
+include_parse_HEADERS = src/thrift/parse/t_service.h \
+                        src/thrift/parse/t_program.h \
+                        src/thrift/parse/t_field.h \
+                        src/thrift/parse/t_scope.h \
+                        src/thrift/parse/t_typedef.h \
+                        src/thrift/parse/t_set.h \
+                        src/thrift/parse/t_const_value.h \
+                        src/thrift/parse/t_enum_value.h \
+                        src/thrift/parse/t_const.h \
+                        src/thrift/parse/t_list.h \
+                        src/thrift/parse/t_map.h \
+                        src/thrift/parse/t_container.h \
+                        src/thrift/parse/t_base_type.h \
+                        src/thrift/parse/t_enum.h \
+                        src/thrift/parse/t_function.h \
+                        src/thrift/parse/t_type.h \
+                        src/thrift/parse/t_doc.h \
+                        src/thrift/parse/t_struct.h
+
+include_plugindir = $(include_thriftdir)/plugin
+include_plugin_HEADERS = src/thrift/plugin/plugin.h \
+                         src/thrift/plugin/type_util.h \
+                         src/thrift/plugin/plugin_output.h
+
+include_windowsdir = $(include_thriftdir)/windows
+include_windows_HEADERS = src/thrift/windows/version.h \
+                          src/thrift/windows/config.h
 endif
 
 WINDOWS_DIST = \
@@ -153,7 +199,7 @@ EXTRA_DIST = \
 clean-local:
 	$(RM) version.h windows/version.h $(plugin_gen)
 
-src/main.cc: src/version.h
+src/thrift/main.cc: src/thrift/version.h
 
 style-local:
-	$(CPPSTYLE_CMD)
+  $(CPPSTYLE_CMD)

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/src/Makefile.am
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/Makefile.am b/compiler/cpp/src/Makefile.am
index e2fae70..f1863d5 100644
--- a/compiler/cpp/src/Makefile.am
+++ b/compiler/cpp/src/Makefile.am
@@ -25,63 +25,63 @@ AUTOMAKE_OPTIONS = subdir-objects
 
 AM_YFLAGS = -d
 
-BUILT_SOURCES = thrifty.cc
+BUILT_SOURCES = thrift/thrifty.cc
 
-noinst_LIBRARIES = libparse.a
+noinst_LIBRARIES = thrift/libparse.a
 
-libparse_a_CPPFLAGS = -I$(srcdir)
-libparse_a_CXXFLAGS = -Wall -Wno-sign-compare -Wno-unused
+thrift_libparse_a_CPPFLAGS = -I$(srcdir)
+thrift_libparse_a_CXXFLAGS = -Wall -Wno-sign-compare -Wno-unused
 
-libparse_a_SOURCES = thrifty.yy \
-                     thriftl.ll
+thrift_libparse_a_SOURCES = thrift/thrifty.yy \
+                     thrift/thriftl.ll
 
 clean-local:
-	$(RM) thriftl.cc thrifty.cc thrifty.h thrifty.hh
+	$(RM) thrift/thriftl.cc thrift/thrifty.cc thrift/thrifty.h thrift/thrifty.hh
 
 if WITH_PLUGIN
-noinst_PROGRAMS = thrift-bootstrap
+noinst_PROGRAMS = thrift/thrift-bootstrap
 
-thrift_bootstrap_SOURCES = \
-                 common.h \
-                 common.cc \
-                 audit/t_audit.h \
-                 audit/t_audit.cpp \
-                 generate/t_generator.cc \
-                 generate/t_generator_registry.h \
-                 globals.h \
-                 platform.h \
-                 logging.h \
-                 parse/t_doc.h \
-                 parse/t_type.h \
-                 parse/t_base_type.h \
-                 parse/t_enum.h \
-                 parse/t_enum_value.h \
-                 parse/t_typedef.h \
-                 parse/t_typedef.cc \
-                 parse/t_container.h \
-                 parse/t_list.h \
-                 parse/t_set.h \
-                 parse/t_map.h \
-                 parse/t_struct.h \
-                 parse/t_field.h \
-                 parse/t_service.h \
-                 parse/t_function.h \
-                 parse/t_program.h \
-                 parse/t_scope.h \
-                 parse/t_const.h \
-                 parse/t_const_value.h \
-                 parse/parse.cc \
-                 generate/t_generator.h \
-                 generate/t_oop_generator.h \
-                 generate/t_html_generator.h \
-                 windows/config.h \
-                 windows/version.h \
-                 generate/t_cpp_generator.cc \
-                 main.h \
-                 main.cc
+thrift_thrift_bootstrap_SOURCES = \
+                 thrift/common.h \
+                 thrift/common.cc \
+                 thrift/audit/t_audit.h \
+                 thrift/audit/t_audit.cpp \
+                 thrift/generate/t_generator.cc \
+                 thrift/generate/t_generator_registry.h \
+                 thrift/globals.h \
+                 thrift/platform.h \
+                 thrift/logging.h \
+                 thrift/parse/t_doc.h \
+                 thrift/parse/t_type.h \
+                 thrift/parse/t_base_type.h \
+                 thrift/parse/t_enum.h \
+                 thrift/parse/t_enum_value.h \
+                 thrift/parse/t_typedef.h \
+                 thrift/parse/t_typedef.cc \
+                 thrift/parse/t_container.h \
+                 thrift/parse/t_list.h \
+                 thrift/parse/t_set.h \
+                 thrift/parse/t_map.h \
+                 thrift/parse/t_struct.h \
+                 thrift/parse/t_field.h \
+                 thrift/parse/t_service.h \
+                 thrift/parse/t_function.h \
+                 thrift/parse/t_program.h \
+                 thrift/parse/t_scope.h \
+                 thrift/parse/t_const.h \
+                 thrift/parse/t_const_value.h \
+                 thrift/parse/parse.cc \
+                 thrift/generate/t_generator.h \
+                 thrift/generate/t_oop_generator.h \
+                 thrift/generate/t_html_generator.h \
+                 thrift/windows/config.h \
+                 thrift/windows/version.h \
+                 thrift/generate/t_cpp_generator.cc \
+                 thrift/main.h \
+                 thrift/main.cc
 
 main.cc: version.h
 
-thrift_bootstrap_CXXFLAGS = -Wall -Wextra -pedantic
-thrift_bootstrap_LDADD = @LEXLIB@ libparse.a
+thrift_thrift_bootstrap_CXXFLAGS = -Wall -Wextra -pedantic
+thrift_thrift_bootstrap_LDADD = @LEXLIB@ thrift/libparse.a
 endif

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/src/audit/t_audit.cpp
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/audit/t_audit.cpp b/compiler/cpp/src/audit/t_audit.cpp
deleted file mode 100644
index afcbd5e..0000000
--- a/compiler/cpp/src/audit/t_audit.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-
-#include <cassert>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <time.h>
-#include <string>
-#include <algorithm>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <limits.h>
-
-// Careful: must include globals first for extern definitions
-#include "globals.h"
-
-#include "parse/t_program.h"
-#include "parse/t_scope.h"
-#include "parse/t_const.h"
-#include "parse/t_field.h"
-
-#include "version.h"
-
-#include "t_audit.h"
-
-extern int g_warn;
-extern std::string g_curpath;
-extern bool g_return_failure;
-
-void thrift_audit_warning(int level, const char* fmt, ...) {
-   if (g_warn < level) {
-      return;
-   }
-   va_list args;
-   printf("[Thrift Audit Warning:%s] ", g_curpath.c_str());
-   va_start(args, fmt);
-   vprintf(fmt, args);
-   va_end(args);
-   printf("\n");
-}
-
-void thrift_audit_failure(const char* fmt, ...) {
-  va_list args;
-  fprintf(stderr, "[Thrift Audit Failure:%s] ", g_curpath.c_str());
-  va_start(args, fmt);
-  vfprintf(stderr, fmt, args);
-  va_end(args);
-  fprintf(stderr, "\n");
-  g_return_failure = true;
-}
-
-void compare_namespace(t_program* newProgram, t_program* oldProgram)
-{
-   const std::map<std::string, std::string>& newNamespaceMap = newProgram->get_all_namespaces();
-   const std::map<std::string, std::string>& oldNamespaceMap = oldProgram->get_all_namespaces();
-
-   for(std::map<std::string, std::string>::const_iterator oldNamespaceMapIt = oldNamespaceMap.begin();
-         oldNamespaceMapIt != oldNamespaceMap.end();
-         oldNamespaceMapIt++)
-   {
-      std::map<std::string, std::string>::const_iterator newNamespaceMapIt = newNamespaceMap.find(oldNamespaceMapIt->first);
-      if(newNamespaceMapIt == newNamespaceMap.end())
-      {
-         thrift_audit_warning(1, "Language %s not found in new thrift file\n", (oldNamespaceMapIt->first).c_str());
-      }
-      else if((newNamespaceMapIt->second) != oldNamespaceMapIt->second)
-      {
-         thrift_audit_warning(1, "Namespace %s changed in new thrift file\n", (oldNamespaceMapIt->second).c_str());
-      }
-   }
-}
-
-void compare_enum_values(t_enum* newEnum,t_enum* oldEnum)
-{
-   const std::vector<t_enum_value*>& oldEnumValues = oldEnum->get_constants();
-   for(std::vector<t_enum_value*>::const_iterator oldEnumValuesIt = oldEnumValues.begin();
-         oldEnumValuesIt != oldEnumValues.end();
-         oldEnumValuesIt++)
-   {
-      int enumValue = (*oldEnumValuesIt)->get_value();
-      t_enum_value* newEnumValue = newEnum->get_constant_by_value(enumValue);
-      if(newEnumValue != NULL)
-      {
-         std::string enumName = (*oldEnumValuesIt)->get_name();
-         if(enumName != newEnumValue->get_name())
-         {
-            thrift_audit_warning(1, "Name of the value %d changed in enum %s\n", enumValue, oldEnum->get_name().c_str());
-         }      
-      }
-      else
-      {
-         thrift_audit_failure("Enum value %d missing in %s\n", enumValue, oldEnum->get_name().c_str());
-      }
-
-   }
-}
-
-void compare_enums(const std::vector<t_enum*>& newEnumList, const std::vector<t_enum*>& oldEnumList)
-{
-   std::map<std::string,t_enum*> newEnumMap;
-   std::vector<t_enum*>::const_iterator newEnumIt;
-   for(newEnumIt = newEnumList.begin(); newEnumIt != newEnumList.end(); newEnumIt++)
-   {
-      newEnumMap[(*newEnumIt)->get_name()] = *newEnumIt;
-   }
-   std::vector<t_enum*>::const_iterator oldEnumIt;
-   for(oldEnumIt = oldEnumList.begin(); oldEnumIt != oldEnumList.end(); oldEnumIt++)
-   {
-      std::map<std::string,t_enum*>::iterator newEnumMapIt;
-      newEnumMapIt = newEnumMap.find((*oldEnumIt)->get_name());
-
-      if(newEnumMapIt == newEnumMap.end())
-      {
-         thrift_audit_warning(1, "Enum %s not found in new thrift file\n",(*oldEnumIt)->get_name().c_str());
-      }
-      else
-      {
-         compare_enum_values(newEnumMapIt->second, *oldEnumIt);
-      }
-   }
-}
-
-//This function returns 'true' if the two arguements are of same types.
-//Returns false if they are of different type
-bool compare_type(t_type* newType, t_type* oldType)
-{
-   //Comparing names of two types will work when the newType and oldType are basic types or structs or enums.
-   //However, when they are containers, get_name() returns empty for which we have to compare the type of 
-   //their elements as well.
-   if((newType->get_name()).empty() && (oldType->get_name()).empty())
-   {
-
-      if(newType->is_list() && oldType->is_list())
-      {
-         t_type* newElementType = ((t_list*)newType)->get_elem_type();
-         t_type* oldElementType = ((t_list*)oldType)->get_elem_type();
-         return compare_type(newElementType, oldElementType);
-      }
-      else if(newType->is_map() && oldType->is_map())
-      {
-         t_type* newKeyType = ((t_map*)newType)->get_key_type();
-         t_type* oldKeyType = ((t_map*)oldType)->get_key_type();
-
-         t_type* newValType = ((t_map*)newType)->get_val_type();
-         t_type* oldValType = ((t_map*)oldType)->get_val_type();
-
-         return (compare_type(newKeyType, oldKeyType) && compare_type(newValType, oldValType));
-      }
-      else if(newType->is_set() && oldType->is_set())
-      {
-         t_type* newElementType = ((t_set*)newType)->get_elem_type();
-         t_type* oldElementType = ((t_set*)oldType)->get_elem_type();
-         return compare_type(newElementType, oldElementType); 
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else if(newType->get_name() == oldType->get_name())
-   {
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool compare_pair(std::pair<t_const_value*, t_const_value*> newMapPair, std::pair<t_const_value*, t_const_value*> oldMapPair)
-{
-   return compare_defaults(newMapPair.first, oldMapPair.first) && compare_defaults(newMapPair.second, oldMapPair.second);
-}   
-
-// This function returns 'true' if the default values are same. Returns false if they are different.
-bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault)
-{
-   if(newStructDefault == NULL && oldStructDefault == NULL) return true;
-   else if(newStructDefault == NULL && oldStructDefault != NULL) return false;
-   else if (newStructDefault != NULL && oldStructDefault == NULL) return false;
-
-   if(newStructDefault->get_type() != oldStructDefault->get_type())
-   {
-      return false;
-   }
-
-   switch(newStructDefault->get_type())
-   {
-      case t_const_value::CV_INTEGER:
-         return (newStructDefault->get_integer() == oldStructDefault->get_integer());
-      case t_const_value::CV_DOUBLE:
-         return (newStructDefault->get_double() == oldStructDefault->get_double());
-      case t_const_value::CV_STRING:
-         return (newStructDefault->get_string() == oldStructDefault->get_string());
-      case t_const_value::CV_LIST:
-         {
-            const std::vector<t_const_value*>& oldDefaultList = oldStructDefault->get_list();
-            const std::vector<t_const_value*>& newDefaultList = newStructDefault->get_list();
-            bool defaultValuesCompare = (oldDefaultList.size() == newDefaultList.size());
-
-            return defaultValuesCompare && std::equal(newDefaultList.begin(), newDefaultList.end(), oldDefaultList.begin(), compare_defaults);
-         }
-      case t_const_value::CV_MAP:
-         {
-            const std::map<t_const_value*, t_const_value*> newMap = newStructDefault->get_map();
-            const std::map<t_const_value*, t_const_value*> oldMap = oldStructDefault->get_map();
-
-            bool defaultValuesCompare = (oldMap.size() == newMap.size());
-
-            return defaultValuesCompare && std::equal(newMap.begin(), newMap.end(), oldMap.begin(), compare_pair);
-         }
-      case t_const_value::CV_IDENTIFIER:
-         return (newStructDefault->get_identifier() == oldStructDefault->get_identifier());
-      default:
-         return false;
-   }
-
-}
-
-void compare_struct_field(t_field* newField, t_field* oldField, std::string oldStructName)
-{
-   t_type* newFieldType = newField->get_type();
-   t_type* oldFieldType = oldField->get_type();
-   if(!compare_type(newFieldType, oldFieldType))
-   {
-      thrift_audit_failure("Struct Field Type Changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
-   }
-
-   // A Struct member can be optional if it is mentioned explicitly, or if it is assigned with default values.
-   bool newStructFieldOptional = (newField->get_req() != t_field::T_REQUIRED);
-   bool oldStructFieldOptional = (oldField->get_req() != t_field::T_REQUIRED);
-
-   if(newStructFieldOptional != oldStructFieldOptional)
-   {
-      thrift_audit_failure("Struct Field Requiredness Changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
-   }
-   if(newStructFieldOptional || oldStructFieldOptional)
-   {
-      if(!compare_defaults(newField->get_value(), oldField->get_value()))
-      {
-         thrift_audit_warning(1, "Default value changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
-      }
-   }
-
-   std::string fieldName = newField->get_name();
-   if(fieldName != oldField->get_name())
-   {
-      thrift_audit_warning(1, "Struct field name changed for Id = %d in %s\n", newField->get_key(), oldStructName.c_str());
-   }
-
-}
-
-void compare_single_struct(t_struct* newStruct, t_struct* oldStruct, const std::string& oldStructName = std::string())
-{
-   std::string structName = oldStructName.empty() ? oldStruct->get_name() : oldStructName;
-   const std::vector<t_field*>& oldStructMembersInIdOrder = oldStruct->get_sorted_members();
-   const std::vector<t_field*>& newStructMembersInIdOrder = newStruct->get_sorted_members();
-   std::vector<t_field*>::const_iterator oldStructMemberIt = oldStructMembersInIdOrder.begin();
-   std::vector<t_field*>::const_iterator newStructMemberIt = newStructMembersInIdOrder.begin();
-
-   // Since we have the struct members in their ID order, comparing their IDs can be done by traversing the two member
-   // lists together.  
-   while(!(oldStructMemberIt == oldStructMembersInIdOrder.end() && newStructMemberIt == newStructMembersInIdOrder.end()))
-   {
-      if(newStructMemberIt == newStructMembersInIdOrder.end() && oldStructMemberIt != oldStructMembersInIdOrder.end())
-      {
-         // A field ID has been removed from the end.
-         thrift_audit_failure("Struct Field removed for Id = %d in %s \n", (*oldStructMemberIt)->get_key(), structName.c_str());
-         oldStructMemberIt++;
-      }
-      else if(newStructMemberIt != newStructMembersInIdOrder.end() && oldStructMemberIt == oldStructMembersInIdOrder.end())
-      {
-         //New field ID has been added to the end.
-         if((*newStructMemberIt)->get_req() == t_field::T_REQUIRED)
-         {
-            thrift_audit_failure("Required Struct Field Added for Id = %d in %s \n", (*newStructMemberIt)->get_key(), structName.c_str());
-         }
-         newStructMemberIt++;
-      }
-      else if((*newStructMemberIt)->get_key() == (*oldStructMemberIt)->get_key())
-      {
-         //Field ID found in both structs. Compare field types, default values.
-         compare_struct_field(*newStructMemberIt, *oldStructMemberIt, structName);
-
-         newStructMemberIt++;
-         oldStructMemberIt++;
-      }
-      else if((*newStructMemberIt)->get_key() < (*oldStructMemberIt)->get_key())
-      {
-         //New Field Id is inserted in between
-         //Adding fields to struct is fine, but adding them in the middle is suspicious. Error!!
-         thrift_audit_failure("Struct field is added in the middle with Id = %d in %s\n",  (*newStructMemberIt)->get_key(),  structName.c_str());
-         newStructMemberIt++;
-      }
-      else if((*newStructMemberIt)->get_key() > (*oldStructMemberIt)->get_key())
-      {
-         //A field is deleted in newStruct.
-         thrift_audit_failure("Struct Field removed for Id = %d in %s \n",  (*oldStructMemberIt)->get_key(), structName.c_str());
-         oldStructMemberIt++;
-      }
-
-   }
-}
-
-void compare_structs(const std::vector<t_struct*>& newStructList, const std::vector<t_struct*>& oldStructList)
-{
-   std::map<std::string,t_struct*> newStructMap;
-   std::vector<t_struct*>::const_iterator newStructListIt;
-   for(newStructListIt = newStructList.begin(); newStructListIt != newStructList.end(); newStructListIt++)
-   {
-      newStructMap[(*newStructListIt)->get_name()] = *newStructListIt;
-   }
-
-   std::vector<t_struct*>::const_iterator oldStructListIt;
-   for(oldStructListIt = oldStructList.begin(); oldStructListIt != oldStructList.end(); oldStructListIt++)
-   {
-      std::map<std::string, t_struct*>::iterator newStructMapIt;
-      newStructMapIt = newStructMap.find((*oldStructListIt)->get_name());
-      if(newStructMapIt == newStructMap.end())
-      {
-         thrift_audit_failure("Struct %s not found in new thrift file\n", (*oldStructListIt)->get_name().c_str());
-      }
-      else
-      {
-         compare_single_struct(newStructMapIt->second, *oldStructListIt);
-      }
-   }
-
-}
-
-void compare_single_function(t_function* newFunction, t_function* oldFunction)
-{
-   t_type* newFunctionReturnType = newFunction->get_returntype();
-
-   if(newFunction->is_oneway() != oldFunction->is_oneway())
-   {
-      thrift_audit_failure("Oneway attribute changed for function %s\n",oldFunction->get_name().c_str());
-   }
-   if(!compare_type(newFunctionReturnType, oldFunction->get_returntype()))
-   {
-      thrift_audit_failure("Return type changed for function %s\n",oldFunction->get_name().c_str());
-   }
-
-   //Compare function arguments.
-   compare_single_struct(newFunction->get_arglist(), oldFunction->get_arglist());
-   std::string exceptionName = oldFunction->get_name();
-   exceptionName += "_exception";
-   compare_single_struct(newFunction->get_xceptions(), oldFunction->get_xceptions(), exceptionName);
-}
-
-void compare_functions(const std::vector<t_function*>& newFunctionList, const std::vector<t_function*>& oldFunctionList)
-{
-   std::map<std::string, t_function*> newFunctionMap;
-   std::map<std::string, t_function*>::iterator newFunctionMapIt;
-   for(std::vector<t_function*>::const_iterator newFunctionIt = newFunctionList.begin();
-         newFunctionIt != newFunctionList.end();
-         newFunctionIt++)
-   {
-      newFunctionMap[(*newFunctionIt)->get_name()] = *newFunctionIt;
-   }
-
-   for(std::vector<t_function*>::const_iterator oldFunctionIt = oldFunctionList.begin();
-         oldFunctionIt != oldFunctionList.end();
-         oldFunctionIt++)
-   {
-      newFunctionMapIt = newFunctionMap.find((*oldFunctionIt)->get_name());
-      if(newFunctionMapIt == newFunctionMap.end())
-      {
-         thrift_audit_failure("New Thrift File has missing function %s\n",(*oldFunctionIt)->get_name().c_str());
-         continue;
-      }
-      else
-      {
-         //Function is found in both thrift files. Compare return type and argument list
-         compare_single_function(newFunctionMapIt->second, *oldFunctionIt);
-      }
-   }
-
-}
-
-void compare_services(const std::vector<t_service*>& newServices, const std::vector<t_service*>& oldServices)
-{
-   std::vector<t_service*>::const_iterator oldServiceIt;
-
-   std::map<std::string, t_service*> newServiceMap;
-   for(std::vector<t_service*>::const_iterator newServiceIt = newServices.begin();
-         newServiceIt != newServices.end();
-         newServiceIt++)
-   {
-      newServiceMap[(*newServiceIt)->get_name()] = *newServiceIt;
-   }
-
-
-   for(oldServiceIt = oldServices.begin(); oldServiceIt != oldServices.end(); oldServiceIt++)
-   {
-      const std::string oldServiceName = (*oldServiceIt)->get_name();
-      std::map<std::string, t_service*>::iterator newServiceMapIt = newServiceMap.find(oldServiceName);
-
-      if(newServiceMapIt == newServiceMap.end())
-      {
-         thrift_audit_failure("New Thrift file is missing a service %s\n", oldServiceName.c_str());
-      }
-      else
-      {
-         t_service* oldServiceExtends = (*oldServiceIt)->get_extends();
-         t_service* newServiceExtends = (newServiceMapIt->second)->get_extends();
-
-         if(oldServiceExtends == NULL)
-         {
-            // It is fine to add extends. So if service in older thrift did not have any extends, we are fine.
-            // DO Nothing
-         }
-         else if(oldServiceExtends != NULL && newServiceExtends == NULL)
-         {
-            thrift_audit_failure("Change in Service inheritance for %s\n", oldServiceName.c_str());
-         }
-         else
-         {
-            std::string oldExtendsName = oldServiceExtends->get_name();
-            std::string newExtendsName = newServiceExtends->get_name();
-
-            if( newExtendsName != oldExtendsName)
-            {
-               thrift_audit_failure("Change in Service inheritance for %s\n", oldServiceName.c_str());
-            }
-         }
-
-         compare_functions((newServiceMapIt->second)->get_functions(), (*oldServiceIt)->get_functions());
-      }
-
-   }
-
-}
-
-void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst)
-{
-   std::vector<t_const*>::const_iterator newConstIt;
-   std::vector<t_const*>::const_iterator oldConstIt;
-
-   std::map<std::string, t_const*> newConstMap;
-
-   for(newConstIt = newConst.begin(); newConstIt != newConst.end(); newConstIt++)
-   {
-      newConstMap[(*newConstIt)->get_name()] = *newConstIt;
-   }
-
-   std::map<std::string, t_const*>::const_iterator newConstMapIt;
-   for(oldConstIt = oldConst.begin(); oldConstIt != oldConst.end(); oldConstIt++)
-   {
-      newConstMapIt = newConstMap.find((*oldConstIt)->get_name());
-      if(newConstMapIt == newConstMap.end())
-      {
-         thrift_audit_warning(1, "Constants Missing %s \n", ((*oldConstIt)->get_name()).c_str());
-      }
-      else if(!compare_type((newConstMapIt->second)->get_type(), (*oldConstIt)->get_type()))
-      {
-         thrift_audit_warning(1, "Constant %s is of different type \n", ((*oldConstIt)->get_name()).c_str());
-      }
-      else if(!compare_defaults((newConstMapIt->second)->get_value(), (*oldConstIt)->get_value()))
-      {
-         thrift_audit_warning(1, "Constant %s has different value\n", ((*oldConstIt)->get_name()).c_str());
-      }
-   }
-}
-
-

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/src/audit/t_audit.h
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/audit/t_audit.h b/compiler/cpp/src/audit/t_audit.h
deleted file mode 100644
index be79e31..0000000
--- a/compiler/cpp/src/audit/t_audit.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef T_AUDIT_H
-#define T_AUDIT_H
-
-void compare_namespace(t_program* newProgram, t_program* oldProgram);
-void compare_enums(const std::vector<t_enum*>& newEnumList,
-                   const std::vector<t_enum*>& oldEnumList);
-bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault);
-void compare_structs(const std::vector<t_struct*>& newStructList,
-                     const std::vector<t_struct*>& oldStructList);
-void compare_services(const std::vector<t_service*>& newServices,
-                      const std::vector<t_service*>& oldServices);
-void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst);
-
-#endif

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/src/common.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/common.cc b/compiler/cpp/src/common.cc
deleted file mode 100644
index 6e11bb2..0000000
--- a/compiler/cpp/src/common.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "common.h"
-#include "parse/t_base_type.h"
-
-t_type* g_type_void;
-t_type* g_type_string;
-t_type* g_type_binary;
-t_type* g_type_slist;
-t_type* g_type_bool;
-t_type* g_type_i8;
-t_type* g_type_i16;
-t_type* g_type_i32;
-t_type* g_type_i64;
-t_type* g_type_double;
-
-void initGlobals() {
-  g_type_void = new t_base_type("void", t_base_type::TYPE_VOID);
-  g_type_string = new t_base_type("string", t_base_type::TYPE_STRING);
-  g_type_binary = new t_base_type("string", t_base_type::TYPE_STRING);
-  ((t_base_type*)g_type_binary)->set_binary(true);
-  g_type_slist = new t_base_type("string", t_base_type::TYPE_STRING);
-  ((t_base_type*)g_type_slist)->set_string_list(true);
-  g_type_bool = new t_base_type("bool", t_base_type::TYPE_BOOL);
-  g_type_i8 = new t_base_type("i8", t_base_type::TYPE_I8);
-  g_type_i16 = new t_base_type("i16", t_base_type::TYPE_I16);
-  g_type_i32 = new t_base_type("i32", t_base_type::TYPE_I32);
-  g_type_i64 = new t_base_type("i64", t_base_type::TYPE_I64);
-  g_type_double = new t_base_type("double", t_base_type::TYPE_DOUBLE);
-}
-
-void clearGlobals() {
-  delete g_type_void;
-  delete g_type_string;
-  delete g_type_bool;
-  delete g_type_i8;
-  delete g_type_i16;
-  delete g_type_i32;
-  delete g_type_i64;
-  delete g_type_double;
-}
-
-/**
- * Those are not really needed for plugins but causes link errors without
- */
-
-/**
- * The location of the last parsed doctext comment.
- */
-int g_doctext_lineno;
-int g_program_doctext_lineno = 0;
-PROGDOCTEXT_STATUS g_program_doctext_status = INVALID;

http://git-wip-us.apache.org/repos/asf/thrift/blob/052abc39/compiler/cpp/src/common.h
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/common.h b/compiler/cpp/src/common.h
deleted file mode 100644
index ab7c423..0000000
--- a/compiler/cpp/src/common.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_COMMON_H
-#define T_COMMON_H
-
-#include "parse/t_type.h"
-
-/**
- * Global types for the parser to be able to reference
- */
-
-extern t_type* g_type_void;
-extern t_type* g_type_string;
-extern t_type* g_type_binary;
-extern t_type* g_type_slist;
-extern t_type* g_type_bool;
-extern t_type* g_type_i8;
-extern t_type* g_type_i16;
-extern t_type* g_type_i32;
-extern t_type* g_type_i64;
-extern t_type* g_type_double;
-
-void initGlobals();
-void clearGlobals();
-
-#endif