diff --git a/CHANGES/v2.3.md b/CHANGES/v2.3.md
index fbe3446704f5a86656f15e556d7f842c4aed1e0e..63224b51b61ea8c9e3deb505b666bc2c39774d05 100644
--- a/CHANGES/v2.3.md
+++ b/CHANGES/v2.3.md
@@ -223,7 +223,8 @@ For users:
   Should be irrelevant for the vast majority of cases.
 
 For developers:
-- Doxygen on travis-ci has been updated to 1.8.14
+- Doxygen on travis-ci has been updated to 1.8.14.
+- Embedded astyle updated to 3.1.
 - `make clean` now correctly removes the `src/lib/plumed` executable.
 
 
diff --git a/astyle/CMakeLists.txt b/astyle/CMakeLists.txt
new file mode 100755
index 0000000000000000000000000000000000000000..6931e91ad204cb70ef61ff615af07fcb51ee471d
--- /dev/null
+++ b/astyle/CMakeLists.txt
@@ -0,0 +1,172 @@
+cmake_minimum_required(VERSION 3.0)
+project(astyle CXX)
+
+# Release Build - release by default (except for Borland)
+if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release")
+endif()
+
+# Build Options - executable by default, libraries on request
+option(BUILD_JAVA_LIBS   "Build java library"   OFF)
+option(BUILD_SHARED_LIBS "Build shared library" OFF)
+option(BUILD_STATIC_LIBS "Build static library" OFF)
+
+# Linux Soname Version
+set(MAJORVER 3)
+set(MINORVER 1)
+set(PATCHVER 0)
+set(SOLIBVER ${MAJORVER}.${MINORVER}.${PATCHVER})
+
+# AStyle Source
+list(APPEND SRCS
+    src/ASBeautifier.cpp
+    src/ASEnhancer.cpp
+    src/ASFormatter.cpp
+    src/ASLocalizer.cpp
+    src/ASResource.cpp
+    src/astyle_main.cpp)
+
+# AStyle Documentation
+list(APPEND DOCS
+    doc/astyle.html
+    doc/install.html
+    doc/news.html
+    doc/notes.html
+    doc/styles.css)
+
+# If a java library is requested, shared libraries should be enabled
+# and the Java Development Kit 'include' directories added
+if(BUILD_JAVA_LIBS)
+    set(BUILD_SHARED_LIBS ON)
+    if(WIN32)
+        set(java_home $ENV{JAVA_HOME})
+        if(NOT java_home)
+            message(FATAL_ERROR "Environment variable JAVA_HOME not defined")
+        endif()
+        if(NOT EXISTS ${java_home}/include)
+            message(FATAL_ERROR "Java Development Kit not installed at ${java_home}")
+        endif()
+    else()
+        if(NOT EXISTS /usr/lib/jvm/default-java/include)
+            message(FATAL_ERROR "Java Development Kit not installed")
+        endif()
+    endif()
+endif()
+
+# Define the output type and install directories
+# To uninstall 'xargs rm < install_manifest.txt'
+if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS)
+    add_library(astyle ${SRCS})
+    if(NOT WIN32)
+        install(TARGETS astyle DESTINATION /usr/lib)
+    endif()
+else()
+    add_executable(astyle ${SRCS})
+    if(WIN32)
+        set(pf86 "PROGRAMFILES(x86)")
+        set(prog_files $ENV{${pf86}})
+        if(NOT prog_files)
+            set(prog_files $ENV{PROGRAMFILES})
+        endif()
+        install(TARGETS astyle DESTINATION ${prog_files}/AStyle)
+        install(FILES ${DOCS} DESTINATION ${prog_files}/AStyle/doc/)
+    else()
+        install(TARGETS astyle DESTINATION /usr/bin)
+        install(FILES ${DOCS} DESTINATION /usr/share/doc/astyle)
+    endif()
+endif()
+
+# Set build-specific compile options
+if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS)
+    if(BUILD_JAVA_LIBS)
+        target_compile_options(astyle PRIVATE -DASTYLE_JNI)
+        if(WIN32)
+            target_include_directories(astyle PRIVATE $ENV{JAVA_HOME}/include)
+            target_include_directories(astyle PRIVATE $ENV{JAVA_HOME}/include/win32)
+        else()
+            target_include_directories(astyle PRIVATE /usr/lib/jvm/default-java/include)
+            target_include_directories(astyle PRIVATE /usr/lib/jvm/default-java/include/linux)
+        endif()
+    else()
+        target_compile_options(astyle PRIVATE -DASTYLE_LIB)
+    endif()
+    # Windows DLL exports removed
+    set_property(TARGET astyle PROPERTY DEFINE_SYMBOL "")
+    # Linux solib version added
+    set_property(TARGET astyle PROPERTY VERSION ${SOLIBVER})
+    set_property(TARGET astyle PROPERTY SOVERSION ${MAJORVER})
+endif()
+
+# Set file names if different than 'astyle'
+if(BUILD_JAVA_LIBS)
+    if(WIN32)
+        set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle31j)
+        set_property(TARGET astyle PROPERTY PREFIX "")
+    else()
+        set_property(TARGET astyle PROPERTY OUTPUT_NAME astylej)
+    endif()
+elseif(BUILD_SHARED_LIBS)
+    if(WIN32)
+        set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle31)
+        set_property(TARGET astyle PROPERTY PREFIX "")
+    endif()
+elseif(BUILD_STATIC_LIBS)
+    if(WIN32)
+        set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyleLib)
+        set_property(TARGET astyle PROPERTY PREFIX "")
+    endif()
+else()
+    if(WIN32)
+        set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle)
+    endif()
+endif()
+
+macro(set_linker_options strip_option)
+    # Remove -rdynamic and add 'strip' to linker flags
+    if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
+        set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+        set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_EXE_LINKER_FLAGS} ${strip_option}")
+        set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${strip_option}")
+    endif()
+    # Shared library options
+    if(BUILD_SHARED_LIBS)
+        if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+            set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
+        elseif(MINGW)
+            # minGW dlls don't work
+            # tdm-gcc dlls work with everything except python
+            set(CMAKE_SHARED_LINKER_FLAGS
+                "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--add-stdcall-alias -Wl,--dll")
+        elseif(BORLAND)
+            # use a development environment to compile Borland dlls
+        endif()
+    endif()
+endmacro()
+
+# Set default compile options for supported compilers
+if(APPLE)
+    target_compile_options(
+        astyle PRIVATE -W -Wall -fno-rtti -fno-exceptions -std=c++11 -stdlib=libc++)
+    set_linker_options("")
+elseif(NOT WIN32)   # Linux
+    target_compile_options(astyle PRIVATE -Wall -fno-rtti -fno-exceptions -std=c++11)
+    set_linker_options("-s")
+elseif(BORLAND)     # Release must be explicitely requested for Borland
+    target_compile_options(astyle PRIVATE -w -x-)   # Cannot use no-rtti (-RT-)
+    set_linker_options("")
+elseif(MINGW)
+    target_compile_options(astyle PRIVATE -Wall -Wextra -fno-rtti -fno-exceptions -std=c++0x)
+    set_linker_options("-s")
+endif()
+
+# Display build information
+if(BUILD_JAVA_LIBS)
+    message("CMAKE_BUILD_TYPE is Java ${CMAKE_BUILD_TYPE} ${SOLIBVER}")
+elseif(BUILD_SHARED_LIBS)
+    message("CMAKE_BUILD_TYPE is Shared ${CMAKE_BUILD_TYPE} ${SOLIBVER}")
+elseif(BUILD_STATIC_LIBS)
+    message("CMAKE_BUILD_TYPE is Static ${CMAKE_BUILD_TYPE}")
+else()
+    message("CMAKE_BUILD_TYPE is Executable ${CMAKE_BUILD_TYPE}")
+endif()
+set(CMAKE_VERBOSE_MAKEFILE ON)
diff --git a/astyle/LICENSE.md b/astyle/LICENSE.md
index cb356f6404ddafeae5d2b87faf0c0ca837b4a9bc..906a35d028f60568e84276ec8388e91b4735b047 100755
--- a/astyle/LICENSE.md
+++ b/astyle/LICENSE.md
@@ -1,6 +1,6 @@
 ### MIT License
 
-Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/astyle/build/cb-clang/Clang AStyle Java.cbp b/astyle/build/cb-clang/Clang AStyle Java.cbp
index a8029e29f20c3168c3b57f8922c7010c3479d34c..c5ab51d421194563df56712e2f49dcb1c64fbcc7 100755
--- a/astyle/build/cb-clang/Clang AStyle Java.cbp	
+++ b/astyle/build/cb-clang/Clang AStyle Java.cbp	
@@ -21,6 +21,7 @@
 					<Add option="-fno-exceptions" />
 					<Add option="-fPIC" />
 					<Add option="-Wno-c++98-compat" />
+					<Add option="-Wno-c++98-compat-pedantic" />
 					<Add option="-Wno-exit-time-destructors" />
 					<Add option="-Wno-global-constructors" />
 					<Add option="-Wno-missing-variable-declarations" />
@@ -54,6 +55,7 @@
 					<Add option="-fno-exceptions" />
 					<Add option="-fPIC" />
 					<Add option="-Wno-c++98-compat" />
+					<Add option="-Wno-c++98-compat-pedantic" />
 					<Add option="-Wno-exit-time-destructors" />
 					<Add option="-Wno-global-constructors" />
 					<Add option="-Wno-missing-variable-declarations" />
@@ -76,7 +78,7 @@
 			</Target>
 			<Environment>
 				<Variable name="MAJORVER" value="3" />
-				<Variable name="MINORVER" value="0" />
+				<Variable name="MINORVER" value="1" />
 				<Variable name="PATCHVER" value="0" />
 				<Variable name="SOLIBVER" value="$(MAJORVER).$(MINORVER).$(PATCHVER)" />
 			</Environment>
diff --git a/astyle/build/cb-clang/Clang AStyle So.cbp b/astyle/build/cb-clang/Clang AStyle So.cbp
index 3c8f7c5945e522348d5d028892953c89161c9d4f..a4cf1713f1215d3dbb08e24ca1e92552df806763 100755
--- a/astyle/build/cb-clang/Clang AStyle So.cbp	
+++ b/astyle/build/cb-clang/Clang AStyle So.cbp	
@@ -59,7 +59,7 @@
 					<Add option="-Wno-sign-conversion" />
 					<Add option="-Wno-weak-vtables" />
 					<Add option="-DASTYLE_LIB" />
-					<Add option="-DDNDEBUG" />
+					<Add option="-DNDEBUG" />
 				</Compiler>
 				<Linker>
 					<Add option="-s" />
@@ -68,7 +68,7 @@
 			</Target>
 			<Environment>
 				<Variable name="MAJORVER" value="3" />
-				<Variable name="MINORVER" value="0" />
+				<Variable name="MINORVER" value="1" />
 				<Variable name="PATCHVER" value="0" />
 				<Variable name="SOLIBVER" value="$(MAJORVER).$(MINORVER).$(PATCHVER)" />
 			</Environment>
diff --git a/astyle/build/cb-clang/Clang AStyle.cbp b/astyle/build/cb-clang/Clang AStyle.cbp
index 44d31b73f924de49f6fad9dbe3a3c3fab22b2f04..171c9b87cf66143e18bf9933acde77442bac4e86 100755
--- a/astyle/build/cb-clang/Clang AStyle.cbp	
+++ b/astyle/build/cb-clang/Clang AStyle.cbp	
@@ -11,7 +11,7 @@
 				<Option object_output="obj/Debug/" />
 				<Option type="1" />
 				<Option compiler="clang" />
-				<Option parameters='&apos;&quot;$HOME/Projects/AStyleDev/test-c/*.cpp&quot;&apos; &apos;&quot;$HOME/Projects/AStyleDev/test-c/*.h&quot;&apos;  -vR' />
+				<Option parameters='&apos;&quot;$HOME/Projects/AStyleFuzz/afl-out/crashes/*.cpp&quot;&apos;  -v' />
 				<Option projectLinkerOptionsRelation="0" />
 				<Option projectIncludeDirsRelation="0" />
 				<Option projectResourceIncludeDirsRelation="0" />
diff --git a/astyle/build/cb-gcc/Gcc AStyle Java.cbp b/astyle/build/cb-gcc/Gcc AStyle Java.cbp
index 544b1bb413ebc2ab878fd1b7c09939e1eefcf2bf..ee00ffa5c78222f7a0940f00194a4a2c57a2c181 100755
--- a/astyle/build/cb-gcc/Gcc AStyle Java.cbp	
+++ b/astyle/build/cb-gcc/Gcc AStyle Java.cbp	
@@ -80,7 +80,7 @@
 			</Target>
 			<Environment>
 				<Variable name="MAJORVER" value="3" />
-				<Variable name="MINORVER" value="0" />
+				<Variable name="MINORVER" value="1" />
 				<Variable name="PATCHVER" value="0" />
 				<Variable name="SOLIBVER" value="$(MAJORVER).$(MINORVER).$(PATCHVER)" />
 			</Environment>
diff --git a/astyle/build/cb-gcc/Gcc AStyle So.cbp b/astyle/build/cb-gcc/Gcc AStyle So.cbp
index 36479823cfa726e90545bf55a3217080f0f79e58..5bcded34e96f1b2e9b3831b59d626c84fba976ff 100755
--- a/astyle/build/cb-gcc/Gcc AStyle So.cbp	
+++ b/astyle/build/cb-gcc/Gcc AStyle So.cbp	
@@ -76,7 +76,7 @@
 			</Target>
 			<Environment>
 				<Variable name="MAJORVER" value="3" />
-				<Variable name="MINORVER" value="0" />
+				<Variable name="MINORVER" value="1" />
 				<Variable name="PATCHVER" value="0" />
 				<Variable name="SOLIBVER" value="$(MAJORVER).$(MINORVER).$(PATCHVER)" />
 			</Environment>
diff --git a/astyle/build/cb-gcc/Gcc AStyle.cbp b/astyle/build/cb-gcc/Gcc AStyle.cbp
index cf6eae6fcf44b6bff0e5a300654372fc990c5856..ad80db44a06633e0dc25423527c0d95c52417069 100755
--- a/astyle/build/cb-gcc/Gcc AStyle.cbp	
+++ b/astyle/build/cb-gcc/Gcc AStyle.cbp	
@@ -33,6 +33,17 @@
 					<Add option="-g" />
 					<Add option="-fno-rtti" />
 					<Add option="-fno-exceptions" />
+					<Add option="-Wswitch" />
+					<Add option="-Wno-deprecated-declarations" />
+					<Add option="-Wempty-body" />
+					<Add option="-Wconversion" />
+					<Add option="-Wreturn-type" />
+					<Add option="-Wparentheses" />
+					<Add option="-Wno-format" />
+					<Add option="-Wuninitialized" />
+					<Add option="-Wunused-function" />
+					<Add option="-Wunused-value" />
+					<Add option="-Wunused-variable" />
 				</Compiler>
 			</Target>
 			<Target title="Release">
@@ -62,6 +73,18 @@
 					<Add option="-std=c++11" />
 					<Add option="-fno-rtti" />
 					<Add option="-fno-exceptions" />
+					<Add option="-Wswitch" />
+					<Add option="-Wno-deprecated-declarations" />
+					<Add option="-Wempty-body" />
+					<Add option="-Wconversion" />
+					<Add option="-Wreturn-type" />
+					<Add option="-Wparentheses" />
+					<Add option="-Wno-format" />
+					<Add option="-Wuninitialized" />
+					<Add option="-Wunreachable-code" />
+					<Add option="-Wunused-function" />
+					<Add option="-Wunused-value" />
+					<Add option="-Wunused-variable" />
 					<Add option="-DNDEBUG" />
 				</Compiler>
 				<Linker>
@@ -90,12 +113,23 @@
 					<Add option="-Wextra" />
 					<Add option="-Wall" />
 					<Add option="-std=c++11" />
+					<Add option="-fno-exceptions" />
+					<Add option="-fno-rtti" />
 					<Add option="-Wint-to-pointer-cast" />
 					<Add option="-Woverloaded-virtual" />
 					<Add option="-Wwrite-strings" />
 					<Add option="-Wno-switch-default" />
-					<Add option="-fno-exceptions" />
-					<Add option="-fno-rtti" />
+					<Add option="-Wswitch" />
+					<Add option="-Wno-deprecated-declarations" />
+					<Add option="-Wempty-body" />
+					<Add option="-Wconversion" />
+					<Add option="-Wreturn-type" />
+					<Add option="-Wparentheses" />
+					<Add option="-Wno-format" />
+					<Add option="-Wuninitialized" />
+					<Add option="-Wunused-function" />
+					<Add option="-Wunused-value" />
+					<Add option="-Wunused-variable" />
 				</Compiler>
 			</Target>
 			<Target title="Coverage">
diff --git a/astyle/build/cb-intel/Intel AStyle Java.cbp b/astyle/build/cb-intel/Intel AStyle Java.cbp
index 4f1c9a3071effa47a5551610b39dcf40ffe03a69..204bf151a1af4035947b01a74997d03ee3666719 100755
--- a/astyle/build/cb-intel/Intel AStyle Java.cbp	
+++ b/astyle/build/cb-intel/Intel AStyle Java.cbp	
@@ -17,7 +17,6 @@
 					<Add option="-g" />
 					<Add option="-w3" />
 					<Add option="-Wextra" />
-					<Add option="-std=c++11" />
 					<Add option="-fno-exceptions" />
 					<Add option="-fPIC" />
 					<Add option="-DASTYLE_JNI" />
@@ -41,7 +40,6 @@
 					<Add option="-Wall" />
 					<Add option="-w3" />
 					<Add option="-Wextra" />
-					<Add option="-std=c++11" />
 					<Add option="-fno-exceptions" />
 					<Add option="-fPIC" />
 					<Add option="-wd11074,11076" />
@@ -59,7 +57,7 @@
 			</Target>
 			<Environment>
 				<Variable name="MAJORVER" value="3" />
-				<Variable name="MINORVER" value="0" />
+				<Variable name="MINORVER" value="1" />
 				<Variable name="PATCHVER" value="0" />
 				<Variable name="SOLIBVER" value="$(MAJORVER).$(MINORVER).$(PATCHVER)" />
 			</Environment>
diff --git a/astyle/build/cb-intel/Intel AStyle So.cbp b/astyle/build/cb-intel/Intel AStyle So.cbp
index d770bd87b433f746ed254f0728f863dbb9a6b5ff..91fefab7a1b9e33aba3435b7c2be4c248320e1f1 100755
--- a/astyle/build/cb-intel/Intel AStyle So.cbp	
+++ b/astyle/build/cb-intel/Intel AStyle So.cbp	
@@ -55,7 +55,7 @@
 			</Target>
 			<Environment>
 				<Variable name="MAJORVER" value="3" />
-				<Variable name="MINORVER" value="0" />
+				<Variable name="MINORVER" value="1" />
 				<Variable name="PATCHVER" value="0" />
 				<Variable name="SOLIBVER" value="$(MAJORVER).$(MINORVER).$(PATCHVER)" />
 			</Environment>
diff --git a/astyle/build/clang/Makefile b/astyle/build/clang/Makefile
index bf14fe53305542f734b203370b4d516f7b2fb220..aa2a0fc821dc3dc097f9c9619180af12284b36f5 100755
--- a/astyle/build/clang/Makefile
+++ b/astyle/build/clang/Makefile
@@ -45,7 +45,7 @@ INSTALL=install -o $(USER) -g $(USER)
 MAJORVER = 3
 # Library's minor version number -- Increment when functionnality is added in a
 # backward-compatible manner; reset to 0 when major number changes.
-MINORVER = 0
+MINORVER = 1
 # Library's patch version number -- Increment in case of backward-compatible
 # bug fixes or refactoring; reset to 0 when minor number changes.
 PATCHVER = 0
diff --git a/astyle/build/gcc/Makefile b/astyle/build/gcc/Makefile
index 72151f80d3fea8fc5921bbed27069b6ee9df11b4..97c724dcee4a625dd00b8f3f061841fd7838202e 100755
--- a/astyle/build/gcc/Makefile
+++ b/astyle/build/gcc/Makefile
@@ -45,7 +45,7 @@ INSTALL=install -o $(USER) -g $(USER)
 MAJORVER = 3
 # Library's minor version number -- Increment when functionnality is added in a
 # backward-compatible manner; reset to 0 when major number changes.
-MINORVER = 0
+MINORVER = 1
 # Library's patch version number -- Increment in case of backward-compatible
 # bug fixes or refactoring; reset to 0 when minor number changes.
 PATCHVER = 0
diff --git a/astyle/build/intel/Makefile b/astyle/build/intel/Makefile
index 84eee05c7c3aabdedab3895012e9432feec2ab24..0d91f85353e99c81d94e1fcd347ccc5491d859e2 100755
--- a/astyle/build/intel/Makefile
+++ b/astyle/build/intel/Makefile
@@ -55,7 +55,7 @@ INSTALL=install -o $(USER) -g $(USER)
 MAJORVER = 3
 # Library's minor version number -- Increment when functionnality is added in a
 # backward-compatible manner; reset to 0 when major number changes.
-MINORVER = 0
+MINORVER = 1
 # Library's patch version number -- Increment in case of backward-compatible
 # bug fixes or refactoring; reset to 0 when minor number changes.
 PATCHVER = 0
diff --git a/astyle/doc/astyle.html b/astyle/doc/astyle.html
index d3b656128d7d21fd0355aa412207f75deb4fd2b5..cd2b42a6369755e3740624adc27aff6f36e27107 100755
--- a/astyle/doc/astyle.html
+++ b/astyle/doc/astyle.html
@@ -28,11 +28,38 @@
         span.option { color: saddlebrown; font-weight: bold; }
     </style>
 
+    <!--  When the user scrolls down from the top of the document, show the button -->
+
+    <script type="text/javascript">
+        // the <button> is described in the <body> section
+        window.onscroll = function () { scrollFunction() };
+
+        // When the user scrolls down 400px from the top of the document, show the button
+        function scrollFunction() {
+            if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400) {
+                document.getElementById("topBtn").style.display = "block";
+            } else {
+                document.getElementById("topBtn").style.display = "none";
+            }
+        }
+
+        // When the user clicks on the button, scroll to the top of the document
+        // Changed to scroll to "Contents" instead of "Top".
+        function topFunction() {
+            //document.body.scrollTop = 0;
+            //document.documentElement.scrollTop = 0;
+            var scroll_element = document.getElementById("Contents");
+            scroll_element.scrollIntoView();
+        }
+    </script>
+
 </head>
 
 <body>
 
-    <h1>Artistic Style 3.0</h1>
+    <button onclick="topFunction()" id="topBtn" title="Go to Contents"><b>Top</b></button>
+
+    <h1>Artistic Style 3.1</h1>
 
     <h2>
         A Free, Fast, and Small Automatic Formatter<br />
@@ -50,7 +77,7 @@
     <p class="contents1">
         <a class="contents" href="#_Options">Options</a></p>
     <p class="contents1">
-        <a class="contents" href="#_Options_File">Options&nbsp;File</a></p>
+        <a class="contents" href="#_Option_Files">Option&nbsp;Files</a></p>
     <p class="contents1">
         <a class="contents" href="#_Disable_Formatting">Disable&nbsp;Formatting</a></p>
     <p class="contents1">
@@ -65,7 +92,7 @@
         <a class="contents" href="#_style=stroustrup">style=stroustrup</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_style=whitesmith">style=whitesmith</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_style=vtk">style=vtk</a>&nbsp;&nbsp;&nbsp;
-        <a class="contents" href="#_style=banner">style=banner</a>&nbsp;&nbsp;&nbsp;
+        <a class="contents" href="#_style=ratliff">style=ratliff</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_style=gnu">style=gnu</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_style=linux">style=linux</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_style=horstmann">style=horstmann</a>&nbsp;&nbsp;&nbsp;
@@ -138,6 +165,8 @@
         <a class="contents" href="#_add-braces">add&#8209;braces</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_add-one-line-braces">add&#8209;one&#8209;line&#8209;braces</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_remove-braces">remove&#8209;braces</a>&nbsp;&nbsp;&nbsp;
+        <a class="contents" href="#_break-return-type">break&#8209;return&#8209;type</a>&nbsp;&nbsp;&nbsp;
+        <a class="contents" href="#_attach-return-type">attach&#8209;return&#8209;type</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_keep-one-line-blocks">keep&#8209;one&#8209;line&#8209;blocks</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_keep-one-line-statements">keep&#8209;one&#8209;line&#8209;statements</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_convert-tabs">convert&#8209;tabs</a>&nbsp;&nbsp;&nbsp;
@@ -178,8 +207,8 @@
     <p class="contents1">
         <a class="contents" href="#_Command_Line_Only">Command&nbsp;Line&nbsp;Only</a></p>
     <p class="contents2">
-        <a class="contents" href="#_options=">options</a>&nbsp;&nbsp;&nbsp;
-        <a class="contents" href="#_options=none">options=none</a>&nbsp;&nbsp;&nbsp;
+        <a class="contents" href="#_options">options</a>&nbsp;&nbsp;&nbsp;
+        <a class="contents" href="#_project">project</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_ascii">ascii</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_version">version</a>&nbsp;&nbsp;&nbsp;
         <a class="contents" href="#_help">help</a>&nbsp;&nbsp;&nbsp;
@@ -310,8 +339,8 @@
         as described above.</p>
     <p>
         A third option is to use an options file from the &quot;file&quot; folder. If there is a coding style you want
-        to duplicate, input the appropriate <a href="#_Options_File">options file</a>. Use the option
-        <a href="#_options=">options=####</a> to specify the file to use. It must contain a path for the file, including
+        to duplicate, input the appropriate <a href="#_Option_Files">option file</a>. Use the option
+        <a href="#_options">options=####</a> to specify the file to use. It must contain a path for the file, including
         the file name. </p>
     <p>
         Once you are familiar with the options you can customize the format to your personal preference.</p>
@@ -323,12 +352,14 @@
 
     <h3 id="_Usage">Usage</h3>
 
+    <h4>Command Line</h4>
+
     <p>
         Artistic style is a console program that receives information from the command line.</p>
     <div class="code">
         <p class="code">
             Command line format:</p>
-        <pre>astyle&nbsp; [OPTIONS]&nbsp; <em>SourceFile1&nbsp; SourceFile2&nbsp; SourceFile3&nbsp; [ . . . ]</em></pre>
+        <pre>astyle&nbsp; [OPTIONS]&nbsp; <em>SourceFilePath1&nbsp; SourceFilePath2&nbsp; SourceFilePath3&nbsp; [ . . . ]</em></pre>
     </div>
     <p>
         The square brackets [ ] indicate that more than one option or more than one file name can be entered. They are
@@ -336,22 +367,42 @@
     <div class="code">
         <p class="code">
             Example to format a single file:</p>
-        <pre>astyle  --style=allman  /home/user/project/foo.cpp
+        <pre>astyle&nbsp; --style=allman&nbsp; /home/project/foo.cpp
 </pre>
         <p class="code">
-            Example to format all .cpp and .h files recursively:</p>
-        <pre>astyle  --style=allman --recursive  /home/user/project/*.cpp  /home/user/project/*.h
+            Example to format C# files recursively:</p>
+        <pre>astyle&nbsp; --style=allman&nbsp; --recursive&nbsp; /home/project/*.cs
 </pre>
     </div>
+
+    <h4>File Extensions</h4>
+
+    <p>
+        Multiple file extensions may be used if separated by commas or semicolons. An optional space may follow if the
+        entire file path is enclosed in double quotes. There is no limit to the number of extensions used.
+    </p>
+    <div class="code">
+        <p class="code">
+            Example to format C++ files recursively using multiple file extensions:</p>
+        <pre>astyle&nbsp; --style=allman&nbsp; --recursive&nbsp; /home/project/*.cpp,*.h
+</pre>
+    </div>
+
+    <h4>Redirection</h4>
+
     <p>
         The < and > characters may be used to redirect the files into standard input (stdin) and out of standard output
-        (stdout) - don't forget them! With this option only one file at a time can be formatted. Wildcards are not
-        recognized, there are no console messages, and a backup is not created. On Windows the output will always have
+        (stdout) - don't forget them! With this option, only one file at a time can be formatted. Wildcards are not
+        recognized, there are no console messages, and a backup is not created. On Windows, the output will always have
         Windows line ends. The options "stdin=" and "stdout=" can be used instead of redirection.</p>
     <div class="code">
         <p class="code">
             Example of redirection option to format a single file and change the name:</p>
         <pre>astyle --style=allman &lt; <em>OriginalSourceFile</em> &gt; <em>BeautifiedSourceFile</em>
+</pre>
+        <p class="code">
+            Example of redirection using "stdin=" and "stdout=" to format a single file and change the name:</p>
+        <pre>astyle --style=allman --stdin=<em>OriginalSourceFile</em> --stdout=<em>BeautifiedSourceFile</em>
 </pre>
     </div>
     <div class="code">
@@ -372,7 +423,7 @@
         Not specifying any options will result in the <a href="#_default_brace_style">default brace style</a>,
         4 spaces per indent, and no formatting changes.</p>
     <p>
-        Options may be written in two different ways.</p>
+        This program follows the usual GNU command line syntax. Options may be written two different ways.</p>
 
     <h4>Long options</h4>
 
@@ -391,33 +442,59 @@
 
     <!--  * * * * * * * * * * * * * *  Options File  * * * * * * * * * * * * * *  -->
 
-    <h3 id="_Options_File">Options File</h3>
+    <h3 id="_Option_Files">Option Files</h3>
 
     <p>
-        An OPTIONAL, default options file may be used to supplement or replace the command line options.&nbsp;</p>
-    <ul>
-        <li>The command line options have precedence. If there is a conflict between a command line option and an option in
-            the default options file, the command line option will be used.
+        An OPTIONAL default option file and/or project option file may be used to supplement or replace the command
+        line options. They may use the computer's standard encoding, UTF-8 or UTF-16 unicode encoding.</p>
+    <p>
+        Options may be set apart by new-lines, tabs, commas, or spaces. Long options in the option file may be written
+        without the preceding '--'. Lines within the option file that begin with '#' are considered line-comments.
+        The option files used in formatting and their location can be displayed by using the --verbose 
+        option. </p>
+    <ol>
+        <li>The <strong>command line options</strong> have precedence. If there is a conflict between a command line option
+            and an option in a default or project file, the command line option will be used.
+        </li>
+        <li>The <strong>project option file</strong> has precedence over the default option file but not the command line
+            options. The project option file should be in the top directory of the project being formatted. The file is identified
+            by a file name only. One of the command line <a href="#_project">project</a> options must be used to indicate
+            a file is available, or it must be referred to by the environment variable. Artistic Style looks for the file
+            in the current directory or one of its parent directories in the following order.
+            <ul>
+                <li>the file name indicated by the --project= command line option.</li>
+                <li>the file named .astylerc or _ astylerc. </li>
+                <li>the file name identified by the environment variable ARTISTIC_STYLE_PROJECT_OPTIONS if it exists.</li>
+                <li>the file or environment variable can be disabled by specifying --project=none on the command line.</li>
+            </ul>
+            The file is expected to be in the top directory of the project being formatted. Only one file will be used per
+            execution and all files to be formatted are assumed to be in the same project. Artistic Style will search 
+            backward in the directory path to find the project option file. The initial directory path for the search is obtained
+            from one of the following locations in the following order.
+            <ul>
+                <li>The first <em>SourceFilePath</em> entered on the command line.</li>
+                <li>The value of "--stdin=" if it is used for redirection.</li>
+                <li>The current directory if "<" is used for rediredction. If the file to be formatted is not in the current 
+                    directory, use the "--stdin=" option instead.</li>
+            </ul>
         </li>
-        <li>Artistic Style looks for this file in the following locations (in order):
-            <ol>
-                <li>the file indicated by the --options= command line option;</li>
-                <li>the file and directory indicated by the environment variable ARTISTIC_STYLE_OPTIONS (if it exists);</li>
-                <li>the file named .astylerc in the directory pointed to by the HOME environment variable (e.g. "$HOME/.astylerc"
-                    on Linux);
-                </li>
-                <li>the file named astylerc in the directory pointed to by the USERPROFILE environment variable (e.g. "%USERPROFILE%\astylerc"
-                    on Windows).
-                </li>
-            </ol>
+        <li>The <strong>default option file</strong> can be used for all projects. The file is identified by a file path and
+            a file name. One of the command line <a href="#_options">options</a> must be used to indicate a file is available,
+            or it must be referred to by the environment variable. Artistic Style looks for a file path and file name in the
+            following order.
+            <ul>
+                <li>the file path indicated by the --options= command line option.</li>
+                <li>the file path indicated by the environment variable ARTISTIC_STYLE_OPTIONS if it exists.</li>
+                <li>the file named .astylerc in the directory pointed to by the HOME environment variable 
+                    (e.g. "$HOME<strong>/.</strong>astylerc" on Linux); </li>
+                <li>the file named astylerc in the directory pointed to by the APPDATA environment variable 
+                    (e.g. "%APPDATA%<strong>\</strong>astylerc" on Windows). </li>
+                <li>the file or environment variable can be disabled by specifying --options=none on the command line.</li>
+            </ul>
         </li>
-        <li>This option file lookup can be disabled by specifying --options=none on the command line.</li>
-        <li>Options may be set apart by new-lines, tabs, commas, or spaces.</li>
-        <li>Long options in the options file may be written without the preceding '--'.</li>
-        <li>Lines within the options file that begin with '#' are considered line-comments.</li>
-    </ul>
+    </ol>
     <p>
-        Example of a default options file:</p>
+        Example of a default or project option file:</p>
     <div class="code">
         <pre><span class="comment"># this line is a comment</span>
 --style=allman      <span class="comment"># this is a line-end comment</span>
@@ -450,8 +527,8 @@ indent-switches     <span class="comment"># cannot do this on the command line</
     <p>
         The beginning tag is &quot;*INDENT-OFF*&quot; and the ending tag is &quot;*INDENT-ON*&quot;.
         They may be used anywhere in the program with the condition that parsing is partially disabled between the
-        tags. Disabling partial statements may result in incorrect formatting after the ending tag. If this happens expand
-        the tags to include additional code.</p>
+        tags. Disabling partial statements may result in incorrect formatting after the ending tag. If this happens,
+        expand the tags to include additional code.</p>
     <div class="code">
         <p class="code">
             The following retains the format of a preprocessor define:</p>
@@ -501,7 +578,7 @@ indent-switches     <span class="comment"># cannot do this on the command line</
     <p>
         Other brace styles are variations of these. Some will use variations on the placement of class, namespace,
         or other braces. (Stroustrup, Google, One True Brace, Lisp). Others will indent the braces (Whitesmith, VTK,
-        Banner, and GNU). Still others will use run-in braces where the following statement is on the same line as the
+        Banner, and GNU). Others will use run-in braces where the following statement is on the same line as the
         brace (Horstmann and Pico).</p>
     <p>
         There are technical arguments for selecting one style over another. But the usual reason comes down to
@@ -592,11 +669,11 @@ indent-switches     <span class="comment"># cannot do this on the command line</
         &nbsp;</p>
     <p id="_style=stroustrup">
         <code class="title">--style=stroustrup / -A4</code><br />
-        Stroustrup style uses linux braces with closing headers broken from closing braces 
+        Stroustrup style uses linux braces with closing headers broken from closing braces
         (e.g. &#8209;&#8209;break&#8209;closing&#8209;headers). Opening braces are broken from function definitions only.
         The opening braces are attached to everything else, including namespaces, classes, arrays, structs, enums, and
         statements within a function. This style frequently is used with &quot;attach&#8209;closing&#8209;while&quot;,
-        tabbed indents, and an indent of 5 spaces per tab.</p>
+        tabbed indents, and an indent of 5 spaces.</p>
     <div class="code">
         <pre>int Foo(bool isBar)
 <span class="brace">{</span>
@@ -632,8 +709,9 @@ indent-switches     <span class="comment"># cannot do this on the command line</
         &nbsp;</p>
     <p id="_style=vtk">
         <code class="title">--style=vtk / -A15</code><br />
-        VTK (Visualization Toolkit) style uses broken, indented braces, except for the opening brace. Switch blocks
-        are indented to prevent a 'hanging indent' with following case statements. </p>
+        VTK (Visualization Toolkit) style uses broken, indented braces, except for the opening brace of classes, 
+        arrays, structs, enums, and function definitions.. Switch blocks are indented to prevent a 'hanging
+        indent' with following case statements. </p>
     <div class="code">
         <pre>int Foo(bool isBar)
 <span class="brace">{</span>
@@ -649,9 +727,9 @@ indent-switches     <span class="comment"># cannot do this on the command line</
     </div>
     <p>
         &nbsp;</p>
-    <p id="_style=banner">
-        <code class="title">--style=banner / -A6</code><br />
-        Banner style uses attached, indented braces. Switch blocks and class blocks are indented to prevent a 'hanging
+    <p id="_style=ratliff">
+        <code class="title">--style=ratliff / --style=banner / -A6</code><br />
+        Ratliff style uses attached, indented braces. Switch blocks and class blocks are indented to prevent a 'hanging
         indent' with following case statements and C++ class modifiers (public, private, protected).&nbsp;</p>
     <div class="code">
         <pre>int Foo(bool isBar) <span class="brace">{</span>
@@ -668,9 +746,9 @@ indent-switches     <span class="comment"># cannot do this on the command line</
         &nbsp;</p>
     <p id="_style=gnu">
         <code class="title">--style=gnu / -A7</code><br />
-        GNU style uses broken braces and indented blocks. Extra indentation is added to blocks <strong>within a
-            function</strong> only. Other braces and blocks are broken, but NOT indented. This style frequently is
-        used with an indent of 2 spaces.</p>
+        GNU style uses broken braces. Extra indentation is added to blocks <strong>within a function</strong>
+        only. The entire block is indented, not just the brace. This style frequently is used with an indent of 2 
+        spaces. </p>
     <div class="code">
         <pre>int Foo(bool isBar)
 <span class="brace">{</span>
@@ -769,7 +847,7 @@ indent-switches     <span class="comment"># cannot do this on the command line</
         <code class="title">--style=mozilla / -A16</code><br />
         Mozilla style uses linux braces. Opening braces are broken from classes, structs, enums, and function
         definitions. The braces are attached to everything else, including namespaces, arrays, and statements
-        within a function. This style frequently is used with an indent of 2 spaces.</p>
+        within a function. This style frequently is used with an indent of 2 spaces and --break-return-type.</p>
     <div class="code">
         <pre>int Foo(bool isBar)
 <span class="brace">{</span>
@@ -962,7 +1040,7 @@ indent-switches     <span class="comment"># cannot do this on the command line</
         &nbsp;</p>
     <p id="_attach_inlines">
         <code class="title">--attach-inlines / -xl</code><br />
-        Attach braces to class and struct inline function definitions. This option has precedence for all 
+        Attach braces to class and struct inline function definitions. This option has precedence for all
         styles except Horstmann and Pico (run-in styles). It is effective for C++ files only.</p>
     <div class="code">
         <p class="code">
@@ -1410,7 +1488,6 @@ if (a &lt; b
         &nbsp;</p>
     <p id="_max-continuation-indent">
         <code class="title">--max-continuation-indent=<span class="option">#</span> / -M<span class="option">#</span></code><br />
-        <code class="title">--max-instatement-indent=<span class="option">#</span> is depreciated</code><br />
         Set the &nbsp;maximum of <span class="option">#</span> spaces to indent a continuation line. The
         <span class="option">#</span> indicates a number of columns and must not be less than <strong>40</strong> or
         greater than <strong>120</strong>. If no value is set, the default value of <strong>40</strong> will be
@@ -1522,12 +1599,12 @@ isBar = false;
         remain in the original column, if possible. Note that there is no option to unpad. Once padded, they
         stay padded.</p>
     <div class="code">
-        <pre>if (isFoo(a,b)
+        <pre>if (isFoo(a,b))
     bar(a,b);
 </pre>
         <p class="code">
             becomes:</p>
-        <pre>if (isFoo(a, b)
+        <pre>if (isFoo(a, b))
     bar(a, b);
 </pre>
     </div>
@@ -1575,7 +1652,7 @@ isBar = false;
         only. Parens that are empty will not be padded. Any end of line comments will remain in the original column,
         if possible. This can be used with unpad-paren below to remove unwanted spaces. If used with pad&#8209;paren or
         pad&#8209;paren&#8209;out, this option will be ignored. If used with pad&#8209;paren&#8209;in, the result will
-        be the same as pad&#8209;paren.</p>
+        be the pad&#8209;paren.</p>
     <div class="code">
         <pre>if (isFoo((a+2), b))
     bar(a, b);
@@ -1690,32 +1767,32 @@ isBar = false;
     <div class="code">
         <pre>char* foo1;
 char &amp; foo2;
-String ^s1;</pre>
+string ^s1;</pre>
         <p class="code">
             becomes (with align-pointer=type):</p>
         <pre>char* foo1;
 char&amp; foo2;
-String^ s1;</pre>
+string^ s1;</pre>
     </div>
     <div class="code">
         <pre>char* foo1;
 char &amp; foo2;
-String ^s1;</pre>
+string ^s1;</pre>
         <p class="code">
             becomes (with align-pointer=middle):</p>
         <pre>char * foo1;
 char &amp; foo2;
-String ^ s1;</pre>
+string ^ s1;</pre>
     </div>
     <div class="code">
         <pre>char* foo1;
 char &amp; foo2;
-String ^s1;</pre>
+string ^s1;</pre>
         <p class="code">
             becomes (with align-pointer=name):</p>
         <pre>char *foo1;
 char &amp;foo2;
-String ^s1;</pre>
+string ^s1;</pre>
     </div>
     <p>
         &nbsp;</p>
@@ -1756,9 +1833,7 @@ String ^s1;</pre>
     <h3 id="_Formatting_Options">Formatting Options</h3>
 
     <p id="_break-closing-braces">
-        <code class="title">--break-closing-braces / -y<br />
-            --break-closing-brackets is depreciated </code>
-        <br />
+        <code class="title">--break-closing-braces / -y</code><br />
         When used with --style=java, --style=kr, --style=stroustrup, --style=linux, or --style=1tbs, this breaks closing
         headers (e.g. 'else', 'catch', ...) from their immediately preceding closing braces. Closing header braces
         are always broken with the other styles.</p>
@@ -1820,10 +1895,7 @@ else
     <p>
         &nbsp;</p>
     <p id="_break-one-line-headers">
-        <code class="title">--break-one-line-headers / -xb </code>
-        <br />
-    </p>
-    <p>
+        <code class="title">--break-one-line-headers / -xb </code><br />
         Break one line headers (e.g. &#39;if&#39;, &#39;while&#39;,&nbsp;&#39;else&#39;,&nbsp;...) from a statement residing
         on the same line. If the statement is enclosed in braces, the braces will be formatted according to the requested
         brace style. </p>
@@ -1854,16 +1926,14 @@ else
     <p>
         &nbsp;</p>
     <p id="_add-braces">
-        <code class="title">--add-braces / -j <br />
-            --add-brackets is depreciated </code>
-        <br />
+        <code class="title">--add-braces / -j </code><br />
         Add braces to unbraced one line conditional statements (e.g. 'if', 'for', 'while'...). The statement must
         be on a single line. The braces will be added according to the requested brace style. If no style is requested
         the braces will be attached. </p>
     <p>
         Braces will NOT be added to a multi-statement line if keep-one-line-statements is requested. Braces will
-        NOT be added to a one line block if keep-one-line-blocks is requested. If --add-one-line-braces is also
-        used, the result will be one line braces.</p>
+        NOT be added to a one line block if keep-one-line-blocks is requested. If used with --add-one-line-braces,
+        the result will be one line braces.</p>
     <div class="code">
         <pre>if (isFoo)
     isFoo = false;
@@ -1878,9 +1948,7 @@ else
     <p>
         &nbsp;</p>
     <p id="_add-one-line-braces">
-        <code class="title">--add-one-line-braces / -J <br />
-            --add-one-line-brackets is depreciated </code>
-        <br />
+        <code class="title">--add-one-line-braces / -J </code><br />
         Add one line braces to unbraced one line conditional statements (e.g. 'if', 'for',
         'while'...). The statement must be on a single line. The option implies --keep-one-line-blocks and
         will not break the one line blocks.</p>
@@ -1897,9 +1965,7 @@ else
     <p>
         &nbsp;</p>
     <p id="_remove-braces">
-        <code class="title">--remove-braces / -xj <br />
-            --remove-brackets is depreciated </code>
-        <br />
+        <code class="title">--remove-braces / -xj</code><br />
         Remove braces from conditional statements (e.g. 'if', 'for', 'while'...).
         The statement must be a single statement on a single line. If --add-braces or --add-one-line-braces is also
         used the result will be to add braces. Braces will not be removed from "One True Brace Style",
@@ -1917,6 +1983,39 @@ else
     </div>
     <p>
         &nbsp;</p>
+    <p id="_break-return-type">
+        <code class="title">--break-return-type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; / -xB</code><br />
+        <code class="title">--break-return-type-decl / -xD</code><br />
+        Break the return type from the function name. The two options are for the function definitions (-xB), and the
+        function declarations or signatures (-xD). If used with --attach-return-type, the result will be to break the
+        return type. This option has no effect on Objective-C functions.</p>
+    <div class="code">
+        <pre>void Foo(bool isFoo);</pre>
+        <p class="code">
+            becomes:</p>
+        <pre>void
+Foo(bool isFoo);</pre>
+    </div>
+    <p>
+        &nbsp;</p>
+    <p id="_attach-return-type">
+        <code class="title">--attach-return-type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; / -xf</code><br />
+        <code class="title">--attach-return-type-decl / -xh</code><br />
+        Attach the return type to the function name. The two options are for the function definitions (-xf), and the 
+        function declarations or signatures (-xh). They are intended to undo the --break-return-type options. If used
+        with --break-return-type, the result will be to break the return type. This option has no effect on 
+        Objective-C functions.</p>
+    <div class="code">
+        <pre>void
+Foo(bool isFoo);</pre>
+        <p class="code">
+            becomes:</p>
+        <pre>void Foo(bool isFoo);</pre>
+    </div>
+    <p>
+        &nbsp;</p>
+
+
     <p id="_keep-one-line-blocks">
         <code class="title">--keep-one-line-blocks / -O </code>
         <br />
@@ -1991,8 +2090,8 @@ else
             <br />
             --break-after-logical / -xL</code><br />
         The option max&#8209;code&#8209;length will break a line if the code exceeds <span class="option">#</span>
-        characters. The valid values are 50 thru 200. Lines without logical conditionals will break on a logical conditional
-        (||, &amp;&amp;, ...), comma, paren, semicolon, or space.</p>
+        characters. The valid values are <strong>50</strong> thru <strong>200</strong>. Lines without logical conditionals
+        will break on a logical conditional (||, &amp;&amp;, ...), comma, paren, semicolon, or space.</p>
     <p>
         Some code will not be broken, such as comments, quotes, and arrays. If used with keep&#8209;one&#8209;line&#8209;blocks
         or add-one-line-braces the blocks will NOT be broken. If used with keep&#8209;one&#8209;line&#8209;statements
@@ -2000,9 +2099,9 @@ else
         break point within the max code length, the line will be broken at the first available break point after the max
         code length.</p>
     <p>
-        By default logical conditionals will be placed first in the new line. The option break&#8209;after&#8209;logical
-        will cause the logical conditionals to be placed last on the previous line. This option has no effect without
-        max&#8209;code&#8209;length.</p>
+        By default logical conditionals will be placed first in the new line. The option
+        <strong>break&#8209;after&#8209;logical</strong> will cause the logical conditionals to be placed last on the
+        previous line. This option has no effect without max&#8209;code&#8209;length.</p>
     <div class="code">
         <pre>if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVariable3 == thatVariable3)
     bar();</pre>
@@ -2038,11 +2137,11 @@ else
     <h3 id="_Objective_C_Options">Objective&#8209;C Options</h3>
 
     <p>
-        These options are effective for Objective&#8209;C files only. The paren padding options will still apply to the
-        Objective-C method prefix and return type unless overridden by the following options.</p>
+        These options are effective for Objective&#8209;C files only. The standard paren padding options will still apply
+        to the Objective-C method prefix and return type unless overridden by the following options.</p>
     <p>
         Because of the longer indents sometimes needed for Objective&#8209;C, the option "max-continuation-indent" may
-        need to be increased. If you are not getting the paren and square bracket alignment you want try increasing
+        need to be increased. If you are not getting the paren and square bracket alignment you want, try increasing
         this value. The option is described in the "Indentation Options" section.</p>
     <p id="_pad-method-prefix">
         <code class="title">--pad-method-prefix / -xQ</code><br />
@@ -2104,9 +2203,9 @@ else
         &nbsp;</p>
     <p id="_pad-param-type">
         <code class="title">--pad-param-type / -xS</code><br />
-        Insert space padding around the Objective&#8209;C parameter type. This will add exactly one space. Any additional
-        spaces will be deleted. This has precedence over the pad method colon option and will always cause space padding
-        after the method colon.</p>
+        Insert space padding around an Objective&#8209;C parameter type. This will add exactly
+        one space. Any additional spaces will be deleted. This has precedence over the pad method colon option and
+        will always cause space padding after a method colon.</p>
     <div class="code">
         <pre>-(void)foo1:(bool)barArg1;
 -(void)foo2:    (bool)   barArg2;</pre>
@@ -2119,9 +2218,9 @@ else
         &nbsp;</p>
     <p id="_unpad-param-type">
         <code class="title">--unpad-param-type / -xs</code><br />
-        Remove all space padding around the Objective&#8209;C parameter type. This option  takes precedence over the pad
-        paren outside option. The pad method colon option has precedence over the <strong>opening</strong> paren. The
-        closing paren will always be unpadded.</p>
+        Remove all space padding around an Objective&#8209;C parameter type. This option  takes precedence over the
+        pad paren outside option. The pad method colon option has precedence over the <strong>opening</strong> paren.
+        The closing paren will always be unpadded.</p>
     <div class="code">
         <pre>-(void)foo1: (bool)    barArg1;
 -(void)foo2:     (bool)    barArg2;</pre>
@@ -2207,7 +2306,7 @@ else
     <h3 id="_Other_Options">Other Options</h3>
 
     <p>
-        These are non-formatting options available for the command-line. They can also be included in an options
+        These are non-formatting options available for the command-line. They can also be included in an option
         file.</p>
 
     <p id="_suffix">
@@ -2233,11 +2332,11 @@ else
     <p>
         Excludes are matched from the end of the file path. An exclude option of "templates" will exclude ALL directories
         named "templates". An exclude option of "cpp/templates" will exclude ALL "cpp/templates" directories. You may
-        proceed backwards in the directory tree to exclude only the required directories.</p>
+        proceed backward in the directory tree to exclude only the required directories.</p>
     <p>
         Specific files may be excluded in the same manner. An exclude option of "default.cpp" will exclude ALL files
         named "default.cpp". An exclude option of "python/default.cpp" will exclude ALL files named "default.cpp"
-        contained in a "python" subdirectory. You may proceed backwards in the directory tree to exclude only the
+        contained in a "python" subdirectory. You may proceed backward in the directory tree to exclude only the
         required files.</p>
     <p>
         Wildcards are NOT allowed. There may be more than one exclude statement. The file path and name may be placed
@@ -2266,7 +2365,8 @@ else
         file.</p>
     <p id="_verbose">
         <code class="title">--verbose / -v</code><br />
-        Verbose display mode. Display optional information, such as release number, date, and statistical data.</p>
+        Verbose display mode. Display optional information, such as release number, date, 
+        option file locations, and statistical data.</p>
     <p id="_formatted">
         <code class="title">--formatted / -Q</code><br />
         Formatted files display mode. Display only the files that have been formatted. Do not display files that
@@ -2280,8 +2380,8 @@ else
             --lineend=macold&nbsp;&nbsp;/ -z3
         </code><br />
         Force use of the specified line end style. Valid options are windows (CRLF), linux (LF), and macold (CR). MacOld
-        style is the format for Mac&nbsp;OS&nbsp;9 and earlier. OS&nbsp;X uses the Linux style. If one of these options
-        is not used, the line ends will be determined automatically from the input file.</p>
+        style is the format for Mac&nbsp;OS&nbsp;9 and earlier. MacOS and OS&nbsp;X uses the Linux style. If one of
+        these options is not used, the line ends will be determined automatically from the input file.</p>
     <p>
         When <strong>redirection</strong> is used on Windows the output will always have Windows line ends. This option
         will be ignored.</p>
@@ -2294,13 +2394,33 @@ else
     <h3 id="_Command_Line_Only">Command Line Only</h3>
 
     <p>These options are available for the command-line only. They are NOT available in an options file.</p>
-    <p id="_options=">
+
+    <p id="_options">
         <code class="title">--options=<span class="option">####</span></code><br />
-        Specify an options file #### to read and use. It must contain a file path for the file. This will allow the file
-        name to be changed from astylerc or .astylerc.</p>
-    <p id="_options=none">
         <code class="title">--options=none</code><br />
-        Disable the default options file. Only the command-line parameters will be used.</p>
+        Specify an options file #### to read and use. It must contain a file path and a file name. This will allow
+        the file name to be changed from astylerc or .astylerc.</p>
+    <p>
+        The "none" option will disable the default options file if one exists. Only command-line parameters will be used.
+    </p>
+    <p>
+        Further information is available in the <a href="#_Option_Files">Option&nbsp;Files</a> section.</p>
+    <p id="_project">
+        <code class="title">--project</code><br />
+        <code class="title">--project=<span class="option">####</span></code><br />
+        <code class="title">--project=none</code> <br />
+        Specify a project option file to use. The option file 
+        should have&nbsp; the default name of .astylerc or _astylerc and should be in the top directory of the project
+        being formatted. </p>
+    <p>
+        Specify a  project options file #### to use. It must contain a file name only without a directory path.
+        This will allow the project file name to be changed from .astylerc or _astylerc. It should be in the top directory
+        of the project being formatted. </p>
+    <p>
+        The "none" option will disable a project options file if one exists. In this case, the project option file will
+        not be used.</p>
+    <p>
+        Further information is available in the <a href="#_Option_Files">Option&nbsp;Files</a> section.</p>
     <p id="_ascii">
         <code class="title">--ascii / -I</code><br />
         The displayed output will be ASCII characters only. The text will be displayed in English and numbers will not
@@ -2315,8 +2435,7 @@ else
         options.</p>
     <p id="_html">
         <code class="title">--html / -!</code><br />
-        Open the HTML help
-        file "astyle.html" in the default browser and quit. The short option must be by itself, it
+        Open the HTML help file "astyle.html" in the default browser and quit. The short option must be by itself, it
         cannot be concatenated with other options. The documentation must be installed in the standard install path (/usr/share/doc/astyle/html
         for Linux or %PROGRAMFILES%\AStyle\doc for Windows). If installed to a different path use html=###.</p>
     <p id="_html=">
@@ -2324,7 +2443,7 @@ else
         Open an HTML help file in the default browser using the file path #### and quit. An HTML file other than "astyle.help"
         may be specified. The path may include a directory path and a file name, or a file name only (e.g. html=install.html).
         If only a file name is used, it is assumed to be in the standard install path (/usr/share/doc/astyle/html
-        for Linux or %PROGRAMFILES%\AStyle\doc for Windows). In both cases the file name must include the html extension.
+        for Linux or %PROGRAMFILES%\AStyle\doc for Windows). In both cases, the file name must include the html extension.
         File paths containing spaces must be enclosed in quotes.</p>
     <p>
         On Linux the HTML file is opened using the script "xdg-open" from the install package "xdg-utils". This should
@@ -2338,7 +2457,7 @@ else
         Do not use this with "&lt;" redirection.</p>
     <p id="_stdout=">
         <code class="title">--stdout=<span class="option">####</span></code><br />
-        Open a file using the file path #### as output to single file formatting. This is a replacement for redirection.
+        Open a file using the file path #### as output from single file formatting. This is a replacement for redirection.
         Do not use this with "&gt;" redirection.</p>
     <p>
         &nbsp;</p>
diff --git a/astyle/doc/install.html b/astyle/doc/install.html
index 9b33c7addb4ff6a62ef6e249dbf1a617a35edaf3..643e89a4a69ecaba7bc5c6996c5899efd7faf4df 100755
--- a/astyle/doc/install.html
+++ b/astyle/doc/install.html
@@ -24,7 +24,7 @@
     <p class="contents1">
         <a class="contents" href="#_Linux_Version">Linux Version</a></p>
     <p class="contents2">
-        <a class="contents" href="#_CodeBlocks_Linux">CodeBlocks Linux</a></p>
+        <a class="contents" href="#_CMake_Linux">CMake Linux</a></p>
     <p class="contents2">
         <a class="contents" href="#_GCC_Makefile">GCC Makefile</a></p>
     <p class="contents2">
@@ -32,21 +32,27 @@
     <p class="contents2">
         <a class="contents" href="#_Intel_Makefile">Intel Makefile</a></p>
     <p class="contents2">
-        <a class="contents" href="#_Other_Makefile_Targets">Other Makefile Targets</a></p>
+        <a class="contents" href="#_CodeBlocks_Linux">CodeBlocks Linux</a></p>
     <p class="contents1">
         <a class="contents" href="#_MacOS_Version">MacOS Version</a></p>
     <p class="contents2">
-        <a class="contents" href="#_Xcode">Xcode</a></p>
+        <a class="contents" href="#_CMake_MacOS">CMake MacOS</a></p>
     <p class="contents2">
         <a class="contents" href="#_MacOS_Makefile">MacOS Makefile</a></p>
+    <p class="contents2">
+        <a class="contents" href="#_Xcode">Xcode</a></p>
     <p class="contents1">
         <a class="contents" href="#_Windows_Version">Windows Version</a></p>
     <p class="contents2">
         <a class="contents" href="#_Precompiled_Executable">Precompiled Executable</a></p>
+    <p class="contents2">
+        <a class="contents" href="#_CMake_Windows">CMake Windows</a></p>
     <p class="contents2">
         <a class="contents" href="#_CodeBlocks_Windows">CodeBlocks Windows</a></p>
     <p class="contents2">
         <a class="contents" href="#_Visual_Studio">Visual Studio</a></p>
+    <p class="contents1">
+        <a class="contents" href="#_Other_Makefile_Targets">Other Makefile Targets</a></p>
     <p class="contents1">
         <a class="contents" href="#_Other_Development_Environments">Other Development Environments</a></p>
     <p class="contents1">
@@ -66,44 +72,74 @@
         astyle_x.x_windows.zip is the <strong>Windows </strong>version of Artistic Style. It contains the source code,
         documentation, Visual C project files, and an executable. The Windows Version compile instructions below give
         information for compiling the source code.</p>
+    <p>
+        astyle_x.x_windows_xp.zip is the <strong>Windows XP </strong>version of Artistic Style. It is identical to the
+        above Windows version except the executable is compiled to be compatible with Windows XP. If you are not running
+        Windows XP, use the above version.</p>
     <p>
         Only one platform is supported in each distribution package. If you use Artistic Style on more than one platform
         you will need to download packages for each platform. The main difference in platforms is the build directories
         and the line endings. Most compilers and development packages will accept any type of line ending. The source
         code and documentation are the same for all distributions.</p>
 
-    <h3 id="_Linux_Version">Linux Version</h3>
+    <h3 id="_Linux_Version">Linux Version </h3>
 
-    <h4 id="_CodeBlocks_Linux">CodeBlocks Linux</h4>
+    <h4 id="_CMake_Linux">CMake Linux</h4>
 
     <p>
-        There are build folders for the following compilers. All compiler folders are in the &quot;build&quot; directory.
-    </p>
-    <ul>
-        <li><strong>cb-clang</strong> contains the workspace and project files for the Linux Clang Compiler.</li>
-        <li><strong>cb-gcc</strong> contains the workspace and project files for the Linux GCC Compiler.</li>
-        <li><strong>cb-intel</strong> contains the workspace and project files for the Linux Intel Compiler.</li>
-    </ul>
-    <p>
-        There are workspace and project files for each folder. All projects have at least Debug and Release 
-        configurations. All output will be in the &quot;bin&quot; directory. </p>
+        Artistic Style has CMake support for GCC, Clang, and Intel compilers. Other compilers will probably work if 
+        the necessary options are set. Refer to the section on <a href="#_Compiler_Options">Compiler Options</a> for 
+        more information.</p>
     <p>
-        The workspace contains the following projects.</p>
+        Since the different builds use the same source files an &quot;out of source&quot; build should be used. The
+        default build is a release version. A debug version must be specifically requested. The
+        the following options are available for building the various configurations.</p>
     <ul>
-        <li><strong>AStyle </strong>builds the Artistic Style command line program (astyle). </li>
-        <li><strong>AStyle So </strong>builds the Artistic Style program as a shared object (libastyle.so). </li>
-        <li><strong>AStyle Java </strong>builds the Artistic Style program as a shared object (libastylej.so) that can
-            be called from a Java program. The Java Development Kit (JDK) is required for the project to compile. The 
-            Project Properties must have an include path to the JDK include directories.</li>
-        <li><strong>AStyle A </strong>builds the Artistic Style program as a Static Library (libastyle.a). This can be
+        <li>The default builds the Artistic Style command line executable (astyle). </li>
+        <li>BUILD_SHARED_LIBS builds the Artistic Style program as a shared object (libastyle.so). </li>
+        <li>BUILD_JAVA_LIBS builds the Artistic Style program as a shared object (libastylej.so) that can be called 
+            from a Java program. The Java Development Kit (JDK) must be installed for the project to compile.</li>
+        <li>BUILD_STATIC_LIBS builds the Artistic Style program as a Static Library (libastyle.a) that can be 
             statically linked to a user program.</li>
     </ul>
 
+    <h5>EXAMPLES</h5>
+
     <p>
-        For other Linux development environments, follow the instructions in <a href="#_Other_Development_Environments">Other
-            Development
-            Environments</a>.
-    </p>
+        The following examples are assumed to be run from the astyle directory that contains 
+        CMakeLists.txt. They show out of source builds that generate makefiles.</p>
+    <p>
+        To build the console release version:</p>
+    <pre>mkdir  as-gcc-exe
+cd  as-gcc-exe
+cmake  ../
+make
+</pre>
+    <p>
+        To build the shared debug version:</p>
+    <pre>mkdir  --parents  as-gcc-so
+cd  as-gcc-so
+cmake  -DBUILD_SHARED_LIBS=1  -DCMAKE_BUILD_TYPE=Debug  ../
+make
+</pre>
+    <p>
+        To build the Java release version using the Clang compiler:</p>
+    <pre>mkdir  as-clang-java
+cd  as-clang-java
+CXX=clang++  CC=clang  cmake  -DBUILD_JAVA_LIBS=1  ../
+make
+</pre>
+
+    <h5>INSTALL</h5>
+
+    <p>
+        The makefile install option installs the astyle executable and documentation files. The default is /usr/bin for
+        the executable and /usr/share/doc/astyle for the documentation. You must have the appropriate permissions to use
+        install. </p>
+
+    <p>
+        There is no uninstall. The easiest way to uninstall is to use the install_manifest.txt file, for example 
+        &quot;<strong>xargs rm &lt; install_manifest.txt</strong>&quot;.</p>
 
     <h4 id="_GCC_Makefile">GCC Makefile</h4>
 
@@ -159,7 +195,7 @@
 
     <p>
         Clang has a static analyzer that finds potential bugs in C/C++ and Objective-C programs. It can be run as a standalone
-        tool from the command-line, and runs in tandem with a build. There is a script file, analyze.sh, that will run
+        tool from the command-line and runs in tandem with a build. There is a script file, analyze.sh, that will run
         the analysis on Artistic Style.</p>
     <p>
         The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
@@ -183,14 +219,10 @@
         These procedures and the makefile are for recent versions of the compiler. They may not work for earlier versions.
         Instructions for your compiler are in the compiler documentation file "get_started_lc.htm".</p>
     <p>
-        To compile the source there are environment variables that must be set by running the compiler environment script
-        compilervars.sh (or compilervars.csh) with an argument that specifies the target architecture. If this has not
-        been done already enter: "<strong>source &nbsp;&lt;install-dir&gt;/bin/compilervars.sh&nbsp;&lt;arg&gt;</strong>",
-        where &lt;install-dir&gt; is the directory where the compiler is installed and &lt;arg&gt; is <strong>ia32 </strong>
-        or <strong>intel64</strong>. If this is not done "make" will display an error message "*** The compiler environment
-        variables are not set." On an Intel x64 platform installed in the default directory the instruction would 
-        be</p>
-    <pre>source /opt/intel/bin/compilervars.sh intel64</pre>
+        To compile with Intel there are environment variables that must be set by running the compiler environment 
+        script compilervars.sh (or compilervars.csh) with an argument that specifies the target architecture. This
+        should be done before running the make. If it is not done, &quot;make&quot; will display an error message
+        stating that the compiler environment variables are not set.</p>
     <p>
         The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
         astyle/build/intel directory. The output executables will be in the astyle/build/intel/bin directory. To build
@@ -205,63 +237,65 @@
         The <a href="#_Other_Makefile_Targets">Other Makefile Targets</a> section contains additional target 
         options.</p>
 
-    <h4 id="_Other_Makefile_Targets">Other Makefile Targets</h4>
+    <h4 id="_CodeBlocks_Linux">CodeBlocks Linux</h4>
 
     <p>
-        The following makefile targets are available for GCC, Clang, Intel, and Mac.</p>
-
-    <h5>clean</h5>
-
+        There are build folders for the following compilers. All compiler folders are in the &quot;build&quot; directory.
+    </p>
+    <ul>
+        <li><strong>cb-clang</strong> contains the workspace and project files for the Linux Clang Compiler.</li>
+        <li><strong>cb-gcc</strong> contains the workspace and project files for the Linux GCC Compiler.</li>
+        <li><strong>cb-intel</strong> contains the workspace and project files for the Linux Intel Compiler.</li>
+    </ul>
     <p>
-        Removes the object and executable files for all configurations.</p>
+        There are workspace and project files for each folder. All projects have at least Debug and Release 
+        configurations. All output will be in the &quot;bin&quot; directory. </p>
     <p>
-        To remove the files for all configurations:</p>
-    <pre>make clean
-</pre>
-
-    <h5>cleanobj</h5>
+        The workspace contains the following projects.</p>
+    <ul>
+        <li><strong>AStyle </strong>builds the Artistic Style command line program (astyle). </li>
+        <li><strong>AStyle So </strong>builds the Artistic Style program as a shared object (libastyle.so). </li>
+        <li><strong>AStyle Java </strong>builds the Artistic Style program as a shared object (libastylej.so) that can
+            be called from a Java program. The Java Development Kit (JDK) is required for the project to compile. The 
+            Project Properties must have an include path to the JDK include directories.</li>
+        <li><strong>AStyle A </strong>builds the Artistic Style program as a Static Library (libastyle.a). This can be
+            statically linked to a user program.</li>
+    </ul>
 
     <p>
-        Removes the object files for all configurations. The executables will not be removed.</p>
-    <p>
-        To remove only the object files for all configurations:</p>
-    <pre>make cleanobj
-</pre>
+        For other Linux development environments, follow the instructions in <a href="#_Other_Development_Environments">Other
+            Development Environments</a>.</p>
 
-    <h5>install</h5>
+    <h3 id="_MacOS_Version">MacOS Version</h3>
+
+    <h4 id="_CMake_MacOS">CMake MacOS</h4>
 
     <p>
-        Installs the
-        astyle executable and documentation files. The default is /usr/bin for the executable and /usr/share/doc/astyle
-        for the documentation. You must have the appropriate permissions to use install.</p>
-    <p>
-        To install the astyle to the default directories:</p>
-    <pre>sudo make install
-</pre>
-    <p>
-        To install astyle to a different bin directory set a value for the macro $(prefix). For example, to install the
-        executable to a user's home directory (/home/<i>user</i>/bin):</p>
-    <pre>sudo make prefix=$HOME install
-</pre>
+        Artistic Style has CMake support for MacOS. It is used the same as <a href="#_CMake_Linux">CMake Linux</a>
+        except the supported compilers are only GCC and Clang.</p>
 
-    <h5>uninstall</h5>
+    <h4 id="_MacOS_Makefile">MacOS Makefile</h4>
 
     <p>
-        Uninstalls the executable and documentation. You must have the appropriate permissions to use uninstall.</p>
+        The Artistic Style makefile compile uses the Mac OS &quot;Command Line Tools&quot;. If you have Xcode 4.3 or newer
+        the command line tools, such as &quot;make&quot;, are NOT installed by default. They must be downloaded and installed
+        separately. Once everything is successfully installed, you should see &quot;make&quot; and other command line
+        developer tools in /usr/bin.</p>
     <p>
-        To uninstall astyle from the default directories:</p>
-    <pre>sudo make uninstall
+        The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
+        astyle/build/mac directory. The executables will be in the astyle/build/mac/bin directory. To build the command
+        line configuration, enter the following:</p>
+    <pre>cd astyle/build/mac<br />make
 </pre>
     <p>
-        To uninstall the files from a different directory set a value for the macro $(prefix). For example, to uninstall
-        the files from a user's home directory (/home/<i>user</i>):</p>
-    <pre> sudo make prefix=$HOME uninstall
+        To build the other astyle configurations, you can enter the file name or a symbolic name. The configurations for
+        Mac are the same as for the <a href="#_GCC_Makefile">GCC Makefile</a>. More than one configuration can be
+        built at the same time. For example, to build all the release configurations enter:</p>
+    <pre>cd astyle/build/mac<br />make release shared static
 </pre>
     <p>
-        NOTE: The uninstall option will NOT remove the .astylerc files from the users' home directories. The files must
-        be removed individually for each user.</p>
-
-    <h3 id="_MacOS_Version">MacOS Version</h3>
+        The <a href="#_Other_Makefile_Targets">Other Makefile Targets</a> section contains additional target 
+        options.</p>
 
     <h4 id="_Xcode">Xcode</h4>
 
@@ -281,7 +315,7 @@
             C++ or C# program.</li>
     </ul>
 
-    <h5>install</h5>
+    <h5>INSTALL</h5>
 
     <p>
         Only the astyle executable is installed. The library project installs are sent to UninstalledProjects in
@@ -300,7 +334,7 @@ sudo xcodebuild install -project AStyle.xcodeproj
     <pre>sudo bash install.sh
 </pre>
 
-    <h5>uninstall</h5>
+    <h5>UNINSTALL</h5>
 
     <p>
         Uninstalls the executable and documentation. You must have the appropriate permissions to use uninstall.</p>
@@ -312,36 +346,80 @@ sudo xcodebuild install -project AStyle.xcodeproj
         NOTE: The uninstall option will NOT remove the .astylerc files from the users' home directories. The files must
         be removed individually for each user.</p>
 
-    <h4 id="_MacOS_Makefile">MacOS Makefile</h4>
+    <h3 id="_Windows_Version">Windows Version</h3>
+
+    <h4 id="_Precompiled_Executable">Precompiled Executable</h4>
 
     <p>
-        The Artistic Style makefile compile uses the Mac OS &quot;Command Line Tools&quot;. If you have Xcode 4.3 or newer
-        the command line tools, such as &quot;make&quot;, are NOT installed by default. They must be downloaded and installed
-        separately. Once everything is successfully installed, you should see &quot;make&quot; and other command line
-        developer tools in /usr/bin.</p>
+        In addition to the source files, the Windows distribution package contains an Artistic Style Win32 executable
+        (AStyle.exe). If you prefer to compile the executable yourself, pursue the following instructions.</p>
+
+    <h4 id="_CMake_Windows">CMake Windows</h4>
+
     <p>
-        The build has no autoconf dependency. To build the Artistic Style configurations use the makefile located in the
-        astyle/build/mac directory. The executables will be in the astyle/build/mac/bin directory. To build the command
-        line configuration, enter the following:</p>
-    <pre>cd astyle/build/mac<br />make
+        Artistic Style has CMake support for Borland, and MinGW compilers. Other compilers will probably work if 
+        the necessary options are set. Refer to the section on <a href="#_Compiler_Options">Compiler Options</a> for 
+        more information.</p>
+    <p>
+        The console executable will run for both of the supported compilers. The DLL builds may not. CMake does not 
+        fully support all Windows compilers. To build the DLLs it would be best to generate an IDE project file and 
+        compile the DLLs with the IDE. The &quot;build&quot; folder contains project files for CodeBlocks and Visual Studio.
+    </p>
+    <p>
+        Since the different builds use the same source files an &quot;out of source&quot; build should be used. The
+        default build for MinGW is a release version. A debug version must be specifically requested. For 
+        Borland, a release build may need to be specifically requested, depending on the CMake release used. Borland 
+        has been tested with the bcc32c free compiler. It may or may not work with other Borland compilers. The the following
+        options are available for building the various configurations.</p>
+    <ul>
+        <li>The default builds the Artistic Style command line executable (AStyle.exe). </li>
+        <li>BUILD_SHARED_LIBS builds the Artistic Style program as a DLL (AStylexx.dll, where xx is the astyle release 
+            number). </li>
+        <li>BUILD_JAVA_LIBS builds the Artistic Style program as a DLL (AStylexxj.dll, where xx is the astyle release 
+            number) that can be called from a Java program. The Java Development Kit (JDK) must be installed for the project
+            to compile.</li>
+        <li>BUILD_STATIC_LIBS builds the Artistic Style program as a Static Library (AStyleLib.lib) that can be 
+            statically linked to a user program.</li>
+    </ul>
+
+    <h5>EXAMPLES</h5>
+
+    <p>
+        The following examples are assumed to be run from the astyle directory that contains 
+        CMakeLists.txt. They show out of source builds that generate makefiles. </p>
+    <p>
+        A path to the compiler executable 
+        may need to be declared before compiling. And the Borland free compiler will need the compiler name.
+        To set the variables before compiling (replace the path names with the paths on your computer):</p>
+    <pre>set PATH=C:\Program Files\CMake\bin;%PATH%
+set PATH=C:\Program Files (x86)\Embarcadero\BCC101\bin;%PATH%
+set CXX=bcc32c
 </pre>
     <p>
-        To build the other astyle configurations, you can enter the file name or a symbolic name. The configurations for
-        Mac are the same as for the <a href="#_GCC_Makefile">GCC Makefile</a>. More than one configuration can be
-        built at the same time. For example, to build all the release configurations enter:</p>
-    <pre>cd astyle/build/mac<br />make release shared static
+        To build the Borland console release version (the release build may need to be specified):</p>
+    <pre>md  as-bcc32c-exe
+cd  as-bcc32c-exe
+cmake  -G "Borland Makefiles"  -DCMAKE_BUILD_TYPE=Release  ../
+make
 </pre>
     <p>
-        The <a href="#_Other_Makefile_Targets">Other Makefile Targets</a> section contains additional target 
-        options.</p>
+        To build the MinGW console release version:</p>
+    <pre>md  as-mingw-exe
+cd  as-mingw-exe
+cmake  -G "MinGW Makefiles"  ../
+mingw32-make</pre>
 
-    <h3 id="_Windows_Version">Windows Version</h3>
+    <p>As stated previously, the DLL builds may not work with the CMake generated makefiles.</p>
+    <h5>INSTALL</h5>
 
-    <h4 id="_Precompiled_Executable">Precompiled Executable</h4>
+    <p>
+        The makefile install option installs the astyle executable and documentation files. The default is &quot;C:\Program
+        Files (x86)\AStyle&quot; for the executable and &quot;C:\Program Files (x86)\AStyle\doc&quot; for the documentation.
+        You may need to run as an administrator to install. </p>
 
     <p>
-        In addition to the source files, the Windows distribution package contains an Artistic Style Win32 executable
-        (AStyle.exe). If you prefer to compile the executable yourself, pursue the following instructions.</p>
+        There is no uninstall. The uninstall must be done manually. Just remove the two folders indicated in the 
+        Install. </p>
 
     <h4 id="_CodeBlocks_Windows">CodeBlocks Windows</h4>
 
@@ -369,9 +447,8 @@ sudo xcodebuild install -project AStyle.xcodeproj
             statically linked to a calling program.</li>
     </ul>
     <p>
-        For other development environments, follow the instructions in <a href="#_Other_Development_Environments">Other Development
-            Environments</a>.
-    </p>
+        For other Windows development environments, follow the instructions in <a href="#_Other_Development_Environments">
+            Other Development Environments</a>.</p>
 
     <h4 id="_Visual_Studio">Visual Studio</h4>
 
@@ -385,9 +462,9 @@ sudo xcodebuild install -project AStyle.xcodeproj
         <li><strong>All AStyle </strong>builds the release and the debug configurations for all the following.
         </li>
         <li><strong>AStyle </strong>builds the Artistic Style command line program (AStyle.exe). This project has an extra
-            "Static" option. It is the same as the "Release" build except that it is linked with a static runtime library.
-            This is needed if the executable is to be run on a system without Visual Studio installed. The builds for this
-            configuration are placed in a separate &quot;binstatic&quot; directory. </li>
+            &quot;Static&quot;" option. It is the same as the &quot;Release&quot; build except that it is linked with a static
+            runtime library. This is needed if the executable is to be run on a system without Visual Studio installed. The
+            builds for this configuration are placed in a separate &quot;binstatic&quot; directory. </li>
         <li><strong>AStyle Dll </strong>builds the Artistic Style program as a Dynamic Link Library (AStyle.dll). This will
             also build an export library and a static library for linking the dll. </li>
         <li><strong>AStyle Java </strong>builds the Artistic Style program as a Dynamic Link Library (AStylej.dll) that can
@@ -399,11 +476,70 @@ sudo xcodebuild install -project AStyle.xcodeproj
         <li><strong>AStyle Lib </strong>builds the Artistic Style program as a Static Library (libAStyle.lib). This can be
             statically linked to a calling program.</li>
     </ul>
+    <p>
+        For other Windows development environments, follow the instructions in <a href="#_Other_Development_Environments">
+            Other Development Environments</a>.</p>
+
+    <h3 id="_Other_Makefile_Targets">Other Makefile Targets</h3>
+
+    <p>
+        The following makefile targets are available for GCC, Clang, Intel, and Mac.</p>
+
+    <h5>CLEAN</h5>
+
+    <p>
+        Removes the object and executable files for all configurations.</p>
+    <p>
+        To remove the files for all configurations:</p>
+    <pre>make clean
+</pre>
+
+    <h5>CLEANOBJ</h5>
+
+    <p>
+        Removes the object files for all configurations. The executables will not be removed.</p>
+    <p>
+        To remove only the object files for all configurations:</p>
+    <pre>make cleanobj
+</pre>
+
+    <h5>INSTALL</h5>
+
+    <p>
+        Installs the astyle executable and documentation files. The default is /usr/bin for the executable and /usr/share/doc/astyle
+        for the documentation. You must have the appropriate permissions to use install.</p>
+    <p>
+        To install the astyle to the default directories:</p>
+    <pre>sudo make install
+</pre>
+    <p>
+        To install astyle to a different bin directory set a value for the macro $(prefix). For example, to install the
+        executable to a user's home directory (/home/<i>user</i>/bin):</p>
+    <pre>sudo make prefix=$HOME install
+</pre>
+
+    <h5>UNINSTALL</h5>
+
+    <p>
+        Uninstalls the executable and documentation. You must have the appropriate permissions to use uninstall.</p>
+    <p>
+        To uninstall astyle from the default directories:</p>
+    <pre>sudo make uninstall
+</pre>
+    <p>
+        To uninstall the files from a different directory set a value for the macro $(prefix). For example, to uninstall
+        the files from a user's home directory (/home/<i>user</i>):</p>
+    <pre> sudo make prefix=$HOME uninstall
+</pre>
+    <p>
+        NOTE: The uninstall option will NOT remove the .astylerc files from the users' home directories. The files must
+        be removed individually for each user.</p>
 
     <h3 id="_Other_Development_Environments">Other Development Environments</h3>
 
     <p>
-        To use other development environments a project file must be built.</p>
+        To use other development environments project files usually must be built. CMake can be used if the development
+        environment is supported. Otherwise, use the development environment to create files.</p>
     <ul>
         <li>Create a project using the development environment.</li>
         <li>Add to the project all the .cpp and .h files in the "src" directory.</li>
diff --git a/astyle/doc/news.html b/astyle/doc/news.html
index ebe7b948d3ba1abcb8662545a9b36b22a2c886ab..7ba5f6cd7812310e0f99dc770adc408742e23c9e 100755
--- a/astyle/doc/news.html
+++ b/astyle/doc/news.html
@@ -17,8 +17,90 @@
     <p>
         &nbsp;</p>
 
+    <h3>Artistic Style 3.1&nbsp; (January 2018)</h3>
+
+    <p>
+        The Windows default option file location has been changed from USERPROFILE to APPDATA. This 
+        moves the file from the User directory and to the user's hidden AppData<strong>\</strong>Roaming directory. The
+        USERPROFILE location has been depreciated and will be removed in a future release. You will need to relocate the
+        options file manually, Artistic Style will not change it. If the options file is in both locations, the new APPDATA
+        location will be used.</p>
+    <p>
+        The console build now accepts option file input encoded in UTF-16, or UTF-8 with a Byte Order Mark (BOM or signature).
+    </p>
+    <p>
+        New options, &quot;break-return-type&quot; and &quot;break-return-type-decl&quot;, will break the return type
+        from function definitions and function declarations. Additional new options, &quot;attach-return-type&quot; and
+        &quot;attach-return-type-decl&quot;, will attach the broken return types to function definitions and function
+        declarations. There is more information in the &quot;Formatting Options&quot; section of the documentation.
+    </p>
+    <p>
+        A new option, &quot;style=ratliff&quot;, has been added as an alternate for banner style.</p>
+    <p>
+        Several changes have been made to Objective-C which will improve formatting in certain cases.</p>
+    <p>
+        CMake can now be used to compile the AStyle builds. It is run from the top level folder instead of the 
+        &quot;build&quot; folder, and builds a Release configuration by default. The &quot;Install&nbsp;Information&quot;
+        contains additional information. </p>
+    <p>
+        When formatting files from the command line, multiple file extensions may now be used. The file 
+        extensions should be separated by commas or semicolons. For example, to format C++ files, use 
+        &quot;astyle /home/project/*.cpp,*.h&quot;. This will change the processing sequence to format all requested files
+        in a directory rather than formatting a directory once for each file extension. There is additional information
+        in the &quot;Usage&quot; section of the documentation.
+    </p>
+    <p>
+        New options &quot;project&quot;, &quot;project=####&quot;, and &quot;project=none&quot;will allow the use of an
+        optional project option file. This may be used to supplement or replace the command line options and the default
+        option file. The file is identified by a file name only and resides in the top level folder of a project. The
+        default file names are .astylerc or _astylerc. A specific file name may also be specified. Instead of an
+        option, the environment variable ARTISTIC_STYLE_PROJECT_OPTION may be used. Using the environment variable 
+        will make the project file the default for all projects. When formatting files in a project, the project option
+        file will be obtained from the files directory or a parent directory. The documentation has the details
+        in the &quot;Option Files&quot; section. The &quot;project&quot; option is described in the 
+        &quot;Command Line Only&quot; section.</p>
+    <p>
+        Allowing both option files enables them to be used for different purposes. For example, the default 
+        options could contain the file formatting options and the project options could contain the excludes for the 
+        given project. The order of precedence, highest to lowest, is command line options, project options, and default
+        options. Options with a value (e.g. style=kr, indent=spaces) may be replaced by an option with a higher precedence.
+        The binary options (indent-classes, pad-oper) cannot be changed. Once they are set they stay set. Both the 
+        default and project option files may be disabled if they are present and not required. When testing the 
+        option files, the options &quot;verbose&quot; and &quot;dry-run&quot; may be used. The option files used
+        will be displayed by the "verbose" option.</p>
+    <p>
+        When making changes to more than one file in a project, it may be desirable to format an entire folder. Wildcards
+        may be used in a single folder without recursive. The current directory is used if a path is not given. So,
+        for example, to format all changed files in the current directory using the project options, use the command:
+        &quot;astyle&nbsp;--project&nbsp;-A9s&nbsp;*.cpp,*.h&quot;. This example uses the project option file .astylerc
+        or _astylerc and overrides the project options with the command line -A9s options.</p>
+    <p>
+        Language translations have been added for the new project option file. A few of the other messages were changed
+        as well. If there is a better translation available report the change as a bug report. Be sure to include the
+        new translation. Translations are in the ASLocalizer.cpp file.</p>
+    <p>
+        A new virtual method, getPeekStart(), has been added to the pure virtual class ASSourceIterator. If you have 
+        inherited this class to access the formatter, you will need to add a method similar to getPeekStart() in the 
+        ASStreamIterator class in astyle_main.h.</p>
+    <p>
+        The Artistic Style source code has been fuzz tested with American Fuzzy Lop (AFL) and libFuzzer from Clang. This
+        will help prevent crashes caused by invalid input. There were about 30 corrections made to the source code. Most
+        of the crashes were caused by asserts which would not be present in a release version. There were a couple of
+        corrections that required logic changes. The changes should not affect the way the code is formatted.</p>
+    <p>
+        The documentation file, astyle.html, now has a sticky button in the lower right corner. It appears after you 
+        have scrolled past the Contents section. It is labeled &quot;Top&quot; but actually takes you back to the Contents.
+        The purpose is to improve speed in navigating the document. </p>
+    <p>
+        Thanks to Rian Quinn, David Haney, and Tamás Kurucsai for their contributions.</p>
+
     <h3>Artistic Style 3.0&nbsp; (April 2017)</h3>
 
+    <p>
+        Release 3.0.1 (May 2017) is a maintenance release and no new features were added. A list of changes is in
+        the Release Notes. The following information is for the original 3.0 release. Thanks to Juan Alday for his 
+        contribution. </p>
+
     <p>
         In the Artistic Style documentation, in General Information, Other Considerations, there is a list of
         terminology used for special characters used in programming. The terms used by Artistic Style have been
diff --git a/astyle/doc/notes.html b/astyle/doc/notes.html
index 7b3746baf0aeb3a58307fe326bf3e962b260aa6f..f63ce74ebb975dfc8b16f08b72cf1667a1c15989 100755
--- a/astyle/doc/notes.html
+++ b/astyle/doc/notes.html
@@ -17,6 +17,64 @@
     <p>
         &nbsp;</p>
 
+    <h3>Artistic Style 3.1&nbsp; (January 2018)</h3>
+
+    <ul>
+        <li>Add new options "project", "project=####", and "project=none" (#11).</li>
+        <li>Add new options, &quot;break-return-type&quot; and &quot;break-return-type-decl&quot; (358, 286, 205, 16).
+        </li>
+        <li>Add new options, &quot;attach-return-type&quot; and &quot;attach-return-type-decl&quot; (358, 286, 205, 16).
+        </li>
+        <li>Add new option "style=ratliff", as an alternate name for banner style.</li>
+        <li>Add new environment variable ARTISTIC_STYLE_PROJECT_OPTIONS (#11).</li>
+        <li>Add multiple extensions to the command line file paths option.</li>
+        <li>Improve recognition of unary + and - when using pad-oper.</li>
+        <li>Change the Windows default options file location from USERPROFILE to APPDATA.</li>
+        <li>Change options file input to accept UTF-16, or UTF-8 with a BOM (or signature).</li>
+        <li>Change &quot;unsigned short&quot; data type to c++11 &quot;char16_t&quot;.</li>
+        <li>Change translations for new project options file.</li>
+        <li>Fix utf8LengthFromUtf16() calculation being less than the actual length.</li>
+        <li>Fix multiply followed by a dereference for &quot;align-pointer=type&quot;.</li>
+        <li>Fix recognition of a uniform class initializer in a base class initialization (#441).</li>
+        <li>Fix indentation of "volatile" keyword not used in a method definition (#450).</li>
+        <li>Fix indentation of "final" keyword not used in a method definition (#450).</li>
+        <li>Fix indentation of compound literals in an argument list (#456).</li>
+        <li>Fix indentation of trailing return type method following a constructor (#463).</li>
+        <li>Fix space padding of closing brace before a dot (#468).</li>
+        <li>Fix Objective-C to allow for &quot;Extern C&quot; statements in the source files (#443, 444, 446).</li>
+        <li>Fix Objective-C to allow for method definitions without a specified return type (#447).</li>
+        <li>Fix Objective-C to allow for method definitions with multiple param types.</li>
+        <li>Fix Objective-C to replace tabbed padding with a space.</li>
+        <li>Fix Objective-C formatting of line-end comments with &quot;unpad-return-type&quot;.</li>
+        <li>Fix Objective-C &quot;align-method-colon&quot; to ignore ternary (?) operators.</li>
+        <li>Fix C# base class constructor indentation (#459).</li>
+        <li>Fix C# indentation of method declaration containing a colon (#465)</li>
+        <li>Fix C/C++ to allow &quot;interface&quot; as a non-keyword (#445).</li>
+        <li>Fix Java to allow &quot;default&quot; as a non-switch keyword.</li>
+        <li>Fix line ends initialization if no line end has been read.</li>
+        <li>Fix Java build from including ASLocalizer in the shared library.</li>
+        <li>Fix to check for AStyleWx line tags after C style comments.</li>
+        <li>Fix boundary conditions and other errors discovered by fuzzing.</li>
+        <li>Refactoring:
+            <ul>
+                <li>Extract method isNumericVariable() in ASFormatter class.</li>
+                <li>Extract method isTopLevel() in ASBeautifier class.</li>
+                <li>Extract method fileExists() in Console class.</li>
+                <li>Rename ASEncoding variable from &quot;utf8_16&quot; to &quot;encode&quot;.</li>
+                <li>Rename ASBeautifier vector from squareBracketDepthStack to parenDepthStack.</li>
+                <li>Combine style options in ASOptions class to avoid compiler limits.</li>
+            </ul>
+        </li>
+    </ul>
+
+    <h3>Artistic Style 3.0.1&nbsp; (May 2017)</h3>
+
+    <ul>
+        <li>Fix crash caused by certain class initializer formats (#435).</li>
+        <li>Fix &quot;final&quot; identifier not being recognized as a pre-command header (#433).</li>
+        <li>Fix recognition of certain rvalue reference variables.</li>
+    </ul>
+
     <h3>Artistic Style 3.0&nbsp; (April 2017)</h3>
 
     <ul>
@@ -37,8 +95,7 @@
         <li>Fix attach-inlines to not attach a brace followed by a run-in comment.</li>
         <li>Fix not always breaking lines after &quot;add-braces&quot; (#341).</li>
         <li>Fix unpadding the &quot;in&quot; in a foreach statement (#386).</li>
-        <li>Fix boundary conditions discovered by <a href="http://lcamtuf.coredump.cx/afl/" target="_blank"
-            title="open new window">american fuzzy lop</a> fuzzer (#370).</li>
+        <li>Fix boundary conditions discovered by american fuzzy lop fuzzer (#370).</li>
         <li>Refactoring:
             <ul>
                 <li>Replace NULL with C++11 nullptr.</li>
diff --git a/astyle/doc/styles.css b/astyle/doc/styles.css
index f486e1740d626a8982b5650a9ed2160bb1f6f58d..6d35eeba26e0c466bef5962b198817c388ff7d83 100755
--- a/astyle/doc/styles.css
+++ b/astyle/doc/styles.css
@@ -34,3 +34,26 @@ a:hover { color: #F00000; text-decoration: underline; }
 img { border: none; }
 
 pre { margin-left: 0.3in; color: navy; font-weight: bold; }
+
+/*- the following styles are for the 'top' button
+    the corresponding javascript is in the html document from
+    https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_scroll_to_top
+*/
+#topBtn {
+    display: none;          /* Hidden by default */
+    position: fixed;        /* Fixed/sticky position */
+    bottom: 55px;           /* Place the button from the bottom */
+    right: 10px;            /* Place the button from the right */
+    z-index: 99;            /* Make sure it does not overlap */
+    border: none;           /* Remove borders */
+    outline: none;          /* Remove outline */
+    background-color: #ccc; /* Set a background color */
+    color: #0000C0;         /* Text color */
+    cursor: pointer;        /* Add a mouse pointer on hover */
+    padding: 10px;          /* Some padding */
+    border-radius: 10px;    /* Rounded corners */
+}
+
+#topBtn:hover {
+    background-color: #aaa; /* Add a darker background on hover */
+}
diff --git a/astyle/file/astyle.ini b/astyle/file/astyle.ini
index 6f0283bb8ce37c7d5c13a02f40158efe75661666..18ae0f76de32f32f19f1d37e5970a6540cc92df6 100755
--- a/astyle/file/astyle.ini
+++ b/astyle/file/astyle.ini
@@ -1,31 +1,36 @@
 # astyle formatting options
 # for all projects except AStyleDev example projects
 # example projects use style=horstmann and indent=spaces (-A9s)
-# for compatibility with Visual Studio: indent=force-tab, min-conditional-indent=0 (-Tm0)
+# for compatibility with Visual Studio: force-tab-x, min-conditional-indent=0 (-Tm0)
 # short options: -A1txn -SxWwM60 -pHk1 -xbO -xQxrxsxMxP2
 
 # braces and indent
 style=allman
 indent=tab
 attach-namespaces
+
 # indentation
 indent-switches
 indent-preproc-block
 indent-preproc-define
 max-continuation-indent=60
+
 # padding
 pad-oper
 pad-header
 align-pointer=type
+
 # formatting
 break-one-line-headers
 keep-one-line-blocks
+
 # objective-c
 pad-method-prefix
 unpad-return-type
 unpad-param-type
 align-method-colon
 pad-method-colon=after
+
 # other options
 lineend=windows
 # don't use "other options" (e.g. formatted) in this file
diff --git a/astyle/file/gnu.ini b/astyle/file/gnu.ini
index 8b99d552cbba3e823b350847a434ecced3c0840d..59fa1c7509cfc83885b84d61d0ea30c8e1332aa8 100755
--- a/astyle/file/gnu.ini
+++ b/astyle/file/gnu.ini
@@ -1,6 +1,6 @@
 # Gnu Coding Style Options
 # https://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C
-# Based on an old AStyle release.
+# Based on an old AStyle release and examples from the above GNU Coding Standards.
 
 # braces and indent
 style=gnu
@@ -12,12 +12,20 @@ max-continuation-indent=80
 
 # padding
 pad-oper
+pad-first-paren-out
 pad-header
 unpad-paren
-align-pointer=type
+align-pointer=name
 
 # formatting
 break-one-line-headers
 keep-one-line-blocks
 keep-one-line-statements
 convert-tabs
+
+# objective-c
+pad-method-prefix
+pad-return-type
+unpad-param-type
+align-method-colon
+pad-method-colon=after
diff --git a/astyle/file/java.ini b/astyle/file/java.ini
index 68644947f583187da4aa5e6de6fff4a3b6f4b20e..78ef560c42aadf8fe57309eb97d3e1aee72d3d59 100755
--- a/astyle/file/java.ini
+++ b/astyle/file/java.ini
@@ -3,7 +3,6 @@
 
 # braces and indent
 style=java
-# indent=spaces    # this is the default
 
 # indentation
 min-conditional-indent=0
diff --git a/astyle/file/linux.ini b/astyle/file/linux.ini
index 9071c2a8c184cd84b32a4deee1978250c4c066ca..814bcddc50121b22aefc2cdcd8c966fdd1708d8b 100755
--- a/astyle/file/linux.ini
+++ b/astyle/file/linux.ini
@@ -13,7 +13,7 @@ max-continuation-indent=80
 pad-oper
 pad-header
 unpad-paren
-align-pointer=type
+align-pointer=name
 
 # formatting
 break-one-line-headers
diff --git a/astyle/file/mozilla.ini b/astyle/file/mozilla.ini
index f040100a707abf7f599322f1e56ca81f0dbc12fc..fa2ebfea67cb2b0d36f519793c127935bbb8273b 100755
--- a/astyle/file/mozilla.ini
+++ b/astyle/file/mozilla.ini
@@ -1,9 +1,5 @@
 # Mozilla Coding Style Options
 # https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style
-# NOTE: Function return values should be on a separate line.
-#       The astyle option are:
-#               "AlwaysBreakAfterDefinitionReturnType: TopLevel"
-#               "AlwaysBreakAfterReturnType: TopLevelDefinitions"
 
 # braces and indent
 style=mozilla
@@ -23,6 +19,8 @@ align-pointer=type
 
 # formatting
 break-one-line-headers
+break-return-type
+break-return-type-decl
 keep-one-line-blocks
 keep-one-line-statements
 convert-tabs
diff --git a/astyle/file/stroustrup.ini b/astyle/file/stroustrup.ini
index 7bf6745367e3857160cb2408ed1d45f23c8ed25e..2331b6a74a7f9edd099e25d801ff3bd7683c00c7 100755
--- a/astyle/file/stroustrup.ini
+++ b/astyle/file/stroustrup.ini
@@ -19,9 +19,7 @@ unpad-paren
 align-pointer=type
 
 # formatting
-#break-closing-braces      # now included in the style
 break-one-line-headers
 keep-one-line-blocks
 keep-one-line-statements
 convert-tabs
-
diff --git a/astyle/file/visualstudio.ini b/astyle/file/visualstudio.ini
index a11f6305f38a3019f2f9803eac15ef8d3a3df08e..9aba9844621d5ca2add3ae2efe1f4a715e1f9b9d 100755
--- a/astyle/file/visualstudio.ini
+++ b/astyle/file/visualstudio.ini
@@ -20,10 +20,3 @@ break-one-line-headers
 keep-one-line-blocks
 keep-one-line-statements
 convert-tabs
-
-# objective-c
-pad-method-prefix
-unpad-return-type
-unpad-param-type
-align-method-colon
-pad-method-colon=none
diff --git a/astyle/file/webkit.ini b/astyle/file/webkit.ini
index 10f78a1c3ee118b0efa6dbf7196fbd094a4dfe16..259a11a3ee8706f57289a301b8009c15dc503c6c 100755
--- a/astyle/file/webkit.ini
+++ b/astyle/file/webkit.ini
@@ -1,11 +1,8 @@
 # WebKit Coding Style Options
 # https://webkit.org/code-style-guidelines/
-# NOTE: Continuation lines should not be aligned with parens.
-#       The astyle option is indent-after-parens.
 
 # braces and indent
 style=stroustrup
-# indent=spaces    # this is the default
 
 # indentation
 indent-after-parens
diff --git a/astyle/src/ASBeautifier.cpp b/astyle/src/ASBeautifier.cpp
index 5f620e22394e25df3061a785ca234408110d3bf0..10317ddf49a85b17d4a69b89e4fe5647a981eecc 100755
--- a/astyle/src/ASBeautifier.cpp
+++ b/astyle/src/ASBeautifier.cpp
@@ -1,5 +1,5 @@
 // ASBeautifier.cpp
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -38,7 +38,7 @@ ASBeautifier::ASBeautifier()
 
 	headerStack = nullptr;
 	tempStacks = nullptr;
-	squareBracketDepthStack = nullptr;
+	parenDepthStack = nullptr;
 	blockStatementStack = nullptr;
 	parenStatementStack = nullptr;
 	braceBlockStateStack = nullptr;
@@ -106,8 +106,8 @@ ASBeautifier::ASBeautifier(const ASBeautifier& other) : ASBase(other)
 
 	tempStacks = copyTempStacks(other);
 
-	squareBracketDepthStack = new vector<int>;
-	*squareBracketDepthStack = *other.squareBracketDepthStack;
+	parenDepthStack = new vector<int>;
+	*parenDepthStack = *other.parenDepthStack;
 
 	blockStatementStack = new vector<bool>;
 	*blockStatementStack = *other.blockStatementStack;
@@ -200,6 +200,7 @@ ASBeautifier::ASBeautifier(const ASBeautifier& other) : ASBase(other)
 	isInEnum = other.isInEnum;
 	isInEnumTypeID = other.isInEnumTypeID;
 	isInLet = other.isInLet;
+	isInTrailingReturnType = other.isInTrailingReturnType;
 	modifierIndent = other.modifierIndent;
 	switchIndent = other.switchIndent;
 	caseIndent = other.caseIndent;
@@ -273,7 +274,7 @@ ASBeautifier::~ASBeautifier()
 	deleteContainer(activeBeautifierStackLengthStack);
 	deleteContainer(headerStack);
 	deleteTempStacksContainer(tempStacks);
-	deleteContainer(squareBracketDepthStack);
+	deleteContainer(parenDepthStack);
 	deleteContainer(blockStatementStack);
 	deleteContainer(parenStatementStack);
 	deleteContainer(braceBlockStateStack);
@@ -312,7 +313,7 @@ void ASBeautifier::init(ASSourceIterator* iter)
 	initTempStacksContainer(tempStacks, new vector<vector<const string*>*>);
 	tempStacks->emplace_back(new vector<const string*>);
 
-	initContainer(squareBracketDepthStack, new vector<int>);
+	initContainer(parenDepthStack, new vector<int>);
 	initContainer(blockStatementStack, new vector<bool>);
 	initContainer(parenStatementStack, new vector<bool>);
 	initContainer(braceBlockStateStack, new vector<bool>);
@@ -356,6 +357,7 @@ void ASBeautifier::init(ASSourceIterator* iter)
 	isInHeader = false;
 	isInTemplate = false;
 	isInConditional = false;
+	isInTrailingReturnType = false;
 
 	indentCount = 0;
 	spaceIndentCount = 0;
@@ -538,7 +540,7 @@ void ASBeautifier::setMaxContinuationIndentLength(int max)
 	maxContinuationIndent = max;
 }
 
-// retained for compatability with release 2.06
+// retained for compatibility with release 2.06
 // "MaxInStatementIndent" has been changed to "MaxContinuationIndent" in 3.0
 // it is referenced only by the old "MaxInStatementIndent" options
 void ASBeautifier::setMaxInStatementIndentLength(int max)
@@ -1010,9 +1012,12 @@ string ASBeautifier::beautify(const string& originalLine)
 			if (isInDefineDefinition && !isInDefine)
 			{
 				isInDefineDefinition = false;
-				ASBeautifier* defineBeautifier = activeBeautifierStack->back();
-				activeBeautifierStack->pop_back();
-				delete defineBeautifier;
+				if (!activeBeautifierStack->empty())
+				{
+					ASBeautifier* defineBeautifier = activeBeautifierStack->back();
+					activeBeautifierStack->pop_back();
+					delete defineBeautifier;
+				}
 			}
 		}
 		if (emptyLineFill && !isInQuoteContinuation)
@@ -1128,6 +1133,9 @@ string ASBeautifier::beautify(const string& originalLine)
 		if (!backslashEndsPrevLine && isInDefineDefinition && !isInDefine)
 		{
 			isInDefineDefinition = false;
+			// this could happen with invalid input
+			if (activeBeautifierStack->empty())
+				return originalLine;
 			ASBeautifier* defineBeautifier = activeBeautifierStack->back();
 			activeBeautifierStack->pop_back();
 
@@ -1278,6 +1286,7 @@ string ASBeautifier::preLineWS(int lineIndentCount, int lineSpaceIndentCount) co
 void ASBeautifier::registerContinuationIndent(const string& line, int i, int spaceIndentCount_,
                                               int tabIncrementIn, int minIndent, bool updateParenStack)
 {
+	assert(i >= -1);
 	int remainingCharNum = line.length() - i;
 	int nextNonWSChar = getNextProgramCharDistance(line, i);
 
@@ -1298,7 +1307,11 @@ void ASBeautifier::registerContinuationIndent(const string& line, int i, int spa
 	}
 
 	if (updateParenStack)
+	{
 		parenIndentStack->emplace_back(i + spaceIndentCount_ - runInIndentContinuation);
+		if (parenIndentStack->back() < 0)
+			parenIndentStack->back() = 0;
+	}
 
 	int tabIncrement = tabIncrementIn;
 
@@ -1328,7 +1341,7 @@ void ASBeautifier::registerContinuationIndent(const string& line, int i, int spa
 		continuationIndentCount = continuationIndentStack->back();
 
 	// the block opener is not indented for a NonInStatementArray
-	if ((isNonInStatementArray && line[i] == '{')
+	if ((isNonInStatementArray && i >= 0 && line[i] == '{')
 	        && !isInEnum && !braceBlockStateStack->empty() && braceBlockStateStack->back())
 		continuationIndentCount = 0;
 
@@ -1735,7 +1748,7 @@ int ASBeautifier::getContinuationIndentAssign(const string& line, size_t currPos
 	int start;          // start of the previous word
 	for (start = end; start > -1; start--)
 	{
-		if (!isLegalNameChar(line[start]) || line[start] == '.')
+		if (!isLegalNameChar(line[start]))
 			break;
 	}
 	start++;
@@ -1869,11 +1882,11 @@ bool ASBeautifier::isPreprocessorConditionalCplusplus(const string& line) const
 		{
 			charNum += 7;
 			charNum = preproc.find_first_not_of(" \t", charNum);
-			if (preproc.compare(charNum, 1, "(") == 0)
+			if (charNum != string::npos && preproc.compare(charNum, 1, "(") == 0)
 			{
 				++charNum;
 				charNum = preproc.find_first_not_of(" \t", charNum);
-				if (preproc.compare(charNum, 11, "__cplusplus") == 0)
+				if (charNum != string::npos && preproc.compare(charNum, 11, "__cplusplus") == 0)
 					return true;
 			}
 		}
@@ -2276,7 +2289,7 @@ void ASBeautifier::adjustObjCMethodDefinitionIndentation(const string& line_)
 		if (shouldAlignMethodColon && objCColonAlignSubsequent != -1)
 		{
 			string convertedLine = getIndentedSpaceEquivalent(line_);
-			colonIndentObjCMethodAlignment = convertedLine.find(':');
+			colonIndentObjCMethodAlignment = findObjCColonAlignment(convertedLine);
 			int objCColonAlignSubsequentIndent = objCColonAlignSubsequent + indentLength;
 			if (objCColonAlignSubsequentIndent > colonIndentObjCMethodAlignment)
 				colonIndentObjCMethodAlignment = objCColonAlignSubsequentIndent;
@@ -2310,7 +2323,7 @@ void ASBeautifier::adjustObjCMethodCallIndentation(const string& line_)
 			bracePosObjCMethodAlignment = convertedLine.find('[');
 			keywordIndentObjCMethodAlignment =
 			    getObjCFollowingKeyword(convertedLine, bracePosObjCMethodAlignment);
-			colonIndentObjCMethodAlignment = convertedLine.find(':');
+			colonIndentObjCMethodAlignment = findObjCColonAlignment(convertedLine);
 			if (colonIndentObjCMethodAlignment >= 0)
 			{
 				int objCColonAlignSubsequentIndent = objCColonAlignSubsequent + indentLength;
@@ -2322,7 +2335,7 @@ void ASBeautifier::adjustObjCMethodCallIndentation(const string& line_)
 		}
 		else
 		{
-			if (line_.find(':') != string::npos)
+			if (findObjCColonAlignment(line_) != -1)
 			{
 				if (colonIndentObjCMethodAlignment < 0)
 					spaceIndentCount += computeObjCColonAlignment(line_, objCColonAlignSubsequent);
@@ -2371,6 +2384,34 @@ void ASBeautifier::clearObjCMethodDefinitionAlignment()
 		continuationIndentStack->pop_back();
 }
 
+/**
+ * Find the first alignment colon on a line.
+ * Ternary operators (?) are bypassed.
+ */
+int ASBeautifier::findObjCColonAlignment(const string& line) const
+{
+	bool haveTernary = false;
+	for (size_t i = 0; i < line.length(); i++)
+	{
+		i = line.find_first_of(":?", i);
+		if (i == string::npos)
+			break;
+
+		if (line[i] == '?')
+		{
+			haveTernary = true;
+			continue;
+		}
+		if (haveTernary)
+		{
+			haveTernary = false;
+			continue;
+		}
+		return i;
+	}
+	return -1;
+}
+
 /**
  * Compute the spaceIndentCount necessary to align the current line colon
  * with the colon position in the argument.
@@ -2379,14 +2420,17 @@ void ASBeautifier::clearObjCMethodDefinitionAlignment()
  */
 int ASBeautifier::computeObjCColonAlignment(const string& line, int colonAlignPosition) const
 {
-	int colonPosition = line.find(':');
+	int colonPosition = findObjCColonAlignment(line);
 	if (colonPosition < 0 || colonPosition > colonAlignPosition)
 		return indentLength;
 	return (colonAlignPosition - colonPosition);
 }
 
 /*
- * Compute postition of the keyword following the method call object.
+ * Compute position of the keyword following the method call object.
+ * This is oversimplified to find unusual method calls.
+ * Use for now and see what happens.
+ * Most programmers will probably use align-method-colon anyway.
  */
 int ASBeautifier::getObjCFollowingKeyword(const string& line, int bracePos) const
 {
@@ -2444,6 +2488,34 @@ string ASBeautifier::getIndentedSpaceEquivalent(const string& line_) const
 	return convertedLine;
 }
 
+/**
+ * Determine if an item is at a top level.
+ */
+bool ASBeautifier::isTopLevel() const
+{
+	if (headerStack->empty())
+		return true;
+	else if (headerStack->back() == &AS_OPEN_BRACE
+	         && headerStack->size() >= 2)
+	{
+		if ((*headerStack)[headerStack->size() - 2] == &AS_NAMESPACE
+		        || (*headerStack)[headerStack->size() - 2] == &AS_MODULE
+		        || (*headerStack)[headerStack->size() - 2] == &AS_CLASS
+		        || (*headerStack)[headerStack->size() - 2] == &AS_INTERFACE
+		        || (*headerStack)[headerStack->size() - 2] == &AS_STRUCT
+		        || (*headerStack)[headerStack->size() - 2] == &AS_UNION)
+			return true;
+	}
+	else if (headerStack->back() == &AS_NAMESPACE
+	         || headerStack->back() == &AS_MODULE
+	         || headerStack->back() == &AS_CLASS
+	         || headerStack->back() == &AS_INTERFACE
+	         || headerStack->back() == &AS_STRUCT
+	         || headerStack->back() == &AS_UNION)
+		return true;
+	return false;
+}
+
 /**
  * Parse the current line to update indentCount and spaceIndentCount.
  */
@@ -2752,7 +2824,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 
 				if (currentHeader != nullptr)
 					registerContinuationIndent(line, i, spaceIndentCount, tabIncrementIn, minConditionalIndent, true);
-				else
+				else if (!isInObjCMethodDefinition)
 					registerContinuationIndent(line, i, spaceIndentCount, tabIncrementIn, 0, true);
 			}
 			else if (ch == ')' || ch == ']')
@@ -2803,6 +2875,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			                      || prevNonSpaceCh == ')'
 			                      || prevNonSpaceCh == ';'
 			                      || peekNextChar(line, i) == '{'
+			                      || isInTrailingReturnType
 			                      || foundPreCommandHeader
 			                      || foundPreCommandMacro
 			                      || isInClassHeader
@@ -2829,25 +2902,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 
 			if (!isBlockOpener && !isContinuation && !isInClassInitializer && !isInEnum)
 			{
-				if (headerStack->empty())
-					isBlockOpener = true;
-				else if (headerStack->back() == &AS_OPEN_BRACE
-				         && headerStack->size() >= 2)
-				{
-					if ((*headerStack)[headerStack->size() - 2] == &AS_NAMESPACE
-					        || (*headerStack)[headerStack->size() - 2] == &AS_MODULE
-					        || (*headerStack)[headerStack->size() - 2] == &AS_CLASS
-					        || (*headerStack)[headerStack->size() - 2] == &AS_INTERFACE
-					        || (*headerStack)[headerStack->size() - 2] == &AS_STRUCT
-					        || (*headerStack)[headerStack->size() - 2] == &AS_UNION)
-						isBlockOpener = true;
-				}
-				else if (headerStack->back() == &AS_NAMESPACE
-				         || headerStack->back() == &AS_MODULE
-				         || headerStack->back() == &AS_CLASS
-				         || headerStack->back() == &AS_INTERFACE
-				         || headerStack->back() == &AS_STRUCT
-				         || headerStack->back() == &AS_UNION)
+				if (isTopLevel())
 					isBlockOpener = true;
 			}
 
@@ -2917,12 +2972,13 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			        && isInIndentableStruct)
 				(*headerStack).back() = &AS_CLASS;
 
-			squareBracketDepthStack->emplace_back(parenDepth);
+			// is a brace inside a paren?
+			parenDepthStack->emplace_back(parenDepth);
 			blockStatementStack->push_back(isContinuation);
 
 			if (!continuationIndentStack->empty())
 			{
-				// completely purge the inStatementIndentStack
+				// completely purge the continuationIndentStack
 				while (!continuationIndentStack->empty())
 					popLastContinuationIndent();
 				if (isInClassInitializer || isInClassHeaderTab)
@@ -2938,6 +2994,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			if (g_preprocessorCppExternCBrace == 3)
 				++g_preprocessorCppExternCBrace;
 			parenDepth = 0;
+			isInTrailingReturnType = false;
 			isInClassHeader = false;
 			isInClassHeaderTab = false;
 			isInClassInitializer = false;
@@ -2963,6 +3020,10 @@ void ASBeautifier::parseCurrentLine(const string& line)
 		{
 			const string* newHeader = findHeader(line, i, headers);
 
+			// java can have a 'default' not in a switch
+			if (newHeader == &AS_DEFAULT
+			        && peekNextChar(line, (i + (*newHeader).length() - 1)) != ':')
+				newHeader = nullptr;
 			// Qt headers may be variables in C++
 			if (isCStyle()
 			        && (newHeader == &AS_FOREVER || newHeader == &AS_FOREACH))
@@ -2970,8 +3031,14 @@ void ASBeautifier::parseCurrentLine(const string& line)
 				if (line.find_first_of("=;", i) != string::npos)
 					newHeader = nullptr;
 			}
+			else if (isSharpStyle()
+			         && (newHeader == &AS_GET || newHeader == &AS_SET))
+			{
+				if (getNextWord(line, i + (*newHeader).length()) == "is")
+					newHeader = nullptr;
+			}
 			else if (newHeader == &AS_USING
-			         && ASBeautifier::peekNextChar(line, i + (*newHeader).length() - 1) != '(')
+			         && peekNextChar(line, i + (*newHeader).length() - 1) != '(')
 				newHeader = nullptr;
 
 			if (newHeader != nullptr)
@@ -2991,7 +3058,8 @@ void ASBeautifier::parseCurrentLine(const string& line)
 				// take care of the special case: 'else if (...)'
 				if (newHeader == &AS_IF && lastLineHeader == &AS_ELSE)
 				{
-					headerStack->pop_back();
+					if (!headerStack->empty())
+						headerStack->pop_back();
 				}
 
 				// take care of 'else'
@@ -3121,7 +3189,9 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			}  // newHeader != nullptr
 
 			if (findHeader(line, i, preCommandHeaders) != nullptr)
-				foundPreCommandHeader = true;
+				// must be after function arguments
+				if (prevNonSpaceCh == ')')
+					foundPreCommandHeader = true;
 
 			// Objective-C NSException macros are preCommandHeaders
 			if (isCStyle() && findKeyword(line, i, AS_NS_DURING))
@@ -3164,7 +3234,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 				if (i == 0)
 					indentCount += classInitializerIndents;
 			}
-			else if (isCStyle()
+			else if ((isCStyle() || isSharpStyle())
 			         && !isInCase
 			         && (prevNonSpaceCh == ')' || foundPreCommandHeader))
 			{
@@ -3311,10 +3381,10 @@ void ASBeautifier::parseCurrentLine(const string& line)
 				if (!continuationIndentStackSizeStack->empty())
 					popLastContinuationIndent();
 
-				if (!squareBracketDepthStack->empty())
+				if (!parenDepthStack->empty())
 				{
-					parenDepth = squareBracketDepthStack->back();
-					squareBracketDepthStack->pop_back();
+					parenDepth = parenDepthStack->back();
+					parenDepthStack->pop_back();
 					isContinuation = blockStatementStack->back();
 					blockStatementStack->pop_back();
 
@@ -3379,7 +3449,10 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			}
 
 			if (parenDepth == 0 && ch == ';')
+			{
 				isContinuation = false;
+				isInClassInitializer = false;
+			}
 
 			if (isInObjCMethodDefinition)
 			{
@@ -3408,7 +3481,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			if (!isInTemplate && !(isCStyle() && parenDepth > 0))
 			{
 				const string* newHeader = findHeader(line, i, preBlockStatements);
-				// handle CORBA IDL module
+				// CORBA IDL module
 				if (newHeader == &AS_MODULE)
 				{
 					char nextChar = peekNextChar(line, i + newHeader->length() - 1);
@@ -3416,7 +3489,10 @@ void ASBeautifier::parseCurrentLine(const string& line)
 						newHeader = nullptr;
 				}
 				if (newHeader != nullptr
-				        && !(isCStyle() && newHeader == &AS_CLASS && isInEnum))	// is not 'enum class'
+				        && !(isCStyle() && newHeader == &AS_CLASS && isInEnum)	// is not 'enum class'
+				        && !(isCStyle() && newHeader == &AS_INTERFACE			// CORBA IDL interface
+				             && (headerStack->empty()
+				                 || headerStack->back() != &AS_OPEN_BRACE)))
 				{
 					if (!isSharpStyle())
 						headerStack->emplace_back(newHeader);
@@ -3481,6 +3557,11 @@ void ASBeautifier::parseCurrentLine(const string& line)
 					continuationIndentStack->back() = 0;
 			}
 
+			if (isCStyle() && findKeyword(line, i, AS_AUTO) && isTopLevel())
+			{
+				isInTrailingReturnType = true;
+			}
+
 			if (isCStyle())
 			{
 				if (findKeyword(line, i, AS_ASM)
@@ -3511,11 +3592,13 @@ void ASBeautifier::parseCurrentLine(const string& line)
 
 		// Handle Objective-C statements
 
-		if (ch == '@' && !isWhiteSpace(line[i + 1])
+		if (ch == '@'
+		        && line.length() > i + 1
+		        && !isWhiteSpace(line[i + 1])
 		        && isCharPotentialHeader(line, i + 1))
 		{
 			string curWord = getCurrentWord(line, i + 1);
-			if (curWord == AS_INTERFACE	&& headerStack->empty())
+			if (curWord == AS_INTERFACE)
 			{
 				isInObjCInterface = true;
 				string name = '@' + curWord;
@@ -3550,8 +3633,10 @@ void ASBeautifier::parseCurrentLine(const string& line)
 			}
 		}
 		else if ((ch == '-' || ch == '+')
-		         && peekNextChar(line, i) == '('
-		         && headerStack->empty()
+		         && (prevNonSpaceCh == ';' || prevNonSpaceCh == '{'
+		             || headerStack->empty() || isInObjCInterface)
+		         && ASBase::peekNextChar(line, i) != '-'
+		         && ASBase::peekNextChar(line, i) != '+'
 		         && line.find_first_not_of(" \t") == i)
 		{
 			if (isInObjCInterface)
@@ -3606,7 +3691,7 @@ void ASBeautifier::parseCurrentLine(const string& line)
 				            || foundNonAssignmentOp == &AS_LS_LS))
 				{
 					// this will be true if the line begins with the operator
-					if (i < 2 && spaceIndentCount == 0)
+					if (i < foundNonAssignmentOp->length() && spaceIndentCount == 0)
 						spaceIndentCount += 2 * indentLength;
 					// align to the beginning column of the operator
 					registerContinuationIndent(line, i - foundNonAssignmentOp->length(), spaceIndentCount, tabIncrementIn, 0, false);
diff --git a/astyle/src/ASEnhancer.cpp b/astyle/src/ASEnhancer.cpp
index 402aa16d4de4853fa1a3dc7cfa6c59e6353612fd..cb197a9e4b7fbf2e33dd4223f97f5afa2ecbcc26 100755
--- a/astyle/src/ASEnhancer.cpp
+++ b/astyle/src/ASEnhancer.cpp
@@ -1,5 +1,5 @@
 // ASEnhancer.cpp
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -679,7 +679,6 @@ size_t ASEnhancer::processSwitchBlock(string& line, size_t index)
 	if (line[i] == '}')
 	{
 		sw.switchBraceCount--;
-		assert(sw.switchBraceCount <= braceCount);
 		if (sw.switchBraceCount == 0)                 // if end of switch statement
 		{
 			int lineUnindent = sw.unindentDepth;
diff --git a/astyle/src/ASFormatter.cpp b/astyle/src/ASFormatter.cpp
index 4c46aa77f9624856e164b9e3457e17165649d5fb..bd1a004422b648a22f86531ca39ee33f278b6a14 100755
--- a/astyle/src/ASFormatter.cpp
+++ b/astyle/src/ASFormatter.cpp
@@ -1,5 +1,5 @@
 // ASFormatter.cpp
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -67,6 +67,10 @@ ASFormatter::ASFormatter()
 	shouldBreakClosingHeaderBlocks = false;
 	shouldBreakClosingHeaderBraces = false;
 	shouldDeleteEmptyLines = false;
+	shouldBreakReturnType = false;
+	shouldBreakReturnTypeDecl = false;
+	shouldAttachReturnType = false;
+	shouldAttachReturnTypeDecl = false;
 	shouldBreakElseIfs = false;
 	shouldBreakLineAfterLogical = false;
 	shouldAddBraces = false;
@@ -172,7 +176,7 @@ void ASFormatter::init(ASSourceIterator* si)
 	currentChar = ' ';
 	previousChar = ' ';
 	previousCommandChar = ' ';
-	previousNonWSChar = ' ';
+	previousNonWSChar = ',';	// not a potential name or operator
 	quoteChar = '"';
 	preprocBlockEnd = 0;
 	charNum = 0;
@@ -184,6 +188,10 @@ void ASFormatter::init(ASSourceIterator* si)
 	previousReadyFormattedLineLength = string::npos;
 	preprocBraceTypeStackSize = 0;
 	spacePadNum = 0;
+	methodAttachCharNum = string::npos;
+	methodAttachLineNum = 0;
+	methodBreakCharNum = string::npos;
+	methodBreakLineNum = 0;
 	nextLineSpacePadNum = 0;
 	objCColonAlign = 0;
 	templateDepth = 0;
@@ -273,10 +281,12 @@ void ASFormatter::init(ASSourceIterator* si)
 	isInObjCInterface = false;
 	isInObjCMethodDefinition = false;
 	isInObjCReturnType = false;
+	isInObjCParam = false;
 	isInObjCSelector = false;
 	breakCurrentOneLineBlock = false;
 	shouldRemoveNextClosingBrace = false;
 	isInBraceRunIn = false;
+	returnTypeChecked = false;
 	currentLineBeginsWithBrace = false;
 	isPrependPostBlockEmptyLineRequested = false;
 	isAppendPostBlockEmptyLineRequested = false;
@@ -360,7 +370,7 @@ void ASFormatter::fixOptionVariableConflicts()
 		setBraceIndentVtk(true);		// sets both braceIndent and braceIndentVtk
 		setSwitchIndent(true);			// avoid hanging indent with case statements
 	}
-	else if (formattingStyle == STYLE_BANNER)
+	else if (formattingStyle == STYLE_RATLIFF)
 	{
 		// attached braces can have hanging indents with the closing brace
 		setBraceFormatMode(ATTACH_MODE);
@@ -435,6 +445,11 @@ void ASFormatter::fixOptionVariableConflicts()
 	// don't allow add-braces and remove-braces
 	if (shouldAddBraces || shouldAddOneLineBraces)
 		setRemoveBracesMode(false);
+	// don't allow break-return-type and attach-return-type
+	if (shouldBreakReturnType)
+		shouldAttachReturnType = false;
+	if (shouldBreakReturnTypeDecl)
+		shouldAttachReturnTypeDecl = false;
 	// don't allow indent-classes and indent-modifiers
 	if (getClassIndent())
 		setModifierIndent(false);
@@ -515,7 +530,7 @@ string ASFormatter::nextLine()
 			if (isInLineBreak)			// is true if not the first line
 				breakLine();
 			formattedLine = currentLine;
-			charNum = (int)currentLine.length() - 1;
+			charNum = (int) currentLine.length() - 1;
 			continue;
 		}
 
@@ -634,7 +649,9 @@ string ASFormatter::nextLine()
 		// check if in preprocessor
 		// ** isInPreprocessor will be automatically reset at the beginning
 		//    of a new line in getnextChar()
-		if (currentChar == '#')
+		if (currentChar == '#'
+		        && currentLine.find_first_not_of(" \t") == (size_t) charNum
+		        && !isBraceType(braceTypeStack->back(), SINGLE_LINE_TYPE))
 		{
 			isInPreprocessor = true;
 			// check for run-in
@@ -732,6 +749,7 @@ string ASFormatter::nextLine()
 			// should braces be added
 			if (currentChar != '{'
 			        && shouldAddBraces
+			        && currentChar != '#'	// don't add to preprocessor
 			        && (shouldBreakOneLineStatements || !isHeaderInMultiStatementLine)
 			        && isOkToBreakBlock(braceTypeStack->back()))
 			{
@@ -882,6 +900,58 @@ string ASFormatter::nextLine()
 			checkIfTemplateOpener();
 		}
 
+		// Check for break return type
+		if ((size_t) charNum >= methodBreakCharNum && methodBreakLineNum == 0)
+		{
+			if ((size_t) charNum == methodBreakCharNum)
+				isInLineBreak = true;
+			methodBreakCharNum = string::npos;
+			methodBreakLineNum = 0;
+		}
+		// Check for attach return type
+		if ((size_t) charNum >= methodAttachCharNum && methodAttachLineNum == 0)
+		{
+			if ((size_t) charNum == methodAttachCharNum)
+			{
+				int pa = pointerAlignment;
+				int ra = referenceAlignment;
+				int itemAlignment = (previousNonWSChar == '*' || previousNonWSChar == '^')
+				                    ? pa : ((ra == REF_SAME_AS_PTR) ? pa : ra);
+				isInLineBreak = false;
+				if (previousNonWSChar == '*' || previousNonWSChar == '&' || previousNonWSChar == '^')
+				{
+					if (itemAlignment == REF_ALIGN_TYPE)
+					{
+						if (formattedLine.length() > 0
+						        && !isWhiteSpace(formattedLine[formattedLine.length() - 1]))
+							formattedLine.append(1, ' ');
+					}
+					else if (itemAlignment == REF_ALIGN_MIDDLE)
+					{
+						if (formattedLine.length() > 0
+						        && !isWhiteSpace(formattedLine[formattedLine.length() - 1]))
+							formattedLine.append(1, ' ');
+					}
+					else if (itemAlignment == REF_ALIGN_NAME)
+					{
+						if (formattedLine.length() > 0
+						        && isWhiteSpace(formattedLine[formattedLine.length() - 1]))
+							formattedLine.erase(formattedLine.length() - 1);
+					}
+					else
+					{
+						if (formattedLine.length() > 1
+						        && !isWhiteSpace(formattedLine[formattedLine.length() - 2]))
+							formattedLine.append(1, ' ');
+					}
+				}
+				else
+					formattedLine.append(1, ' ');
+			}
+			methodAttachCharNum = string::npos;
+			methodAttachLineNum = 0;
+		}
+
 		// handle parens
 		if (currentChar == '(' || currentChar == '[' || (isInTemplate && currentChar == '<'))
 		{
@@ -959,13 +1029,21 @@ string ASFormatter::nextLine()
 				foundTrailingReturnType = false;
 				isInPotentialCalculation = false;
 				isInObjCMethodDefinition = false;
+				isImmediatelyPostObjCMethodPrefix = false;
 				isInObjCInterface = false;
 				isInEnum = false;
 				isJavaStaticConstructor = false;
 				isCharImmediatelyPostNonInStmt = false;
 				needHeaderOpeningBrace = false;
 				shouldKeepLineUnbroken = false;
+				returnTypeChecked = false;
 				objCColonAlign = 0;
+				//assert(methodBreakCharNum == string::npos);	// comment out
+				//assert(methodBreakLineNum == 0);				// comment out
+				methodBreakCharNum = string::npos;
+				methodBreakLineNum = 0;
+				methodAttachCharNum = string::npos;
+				methodAttachLineNum = 0;
 
 				isPreviousBraceBlockRelated = !isBraceType(newBraceType, ARRAY_TYPE);
 				braceTypeStack->emplace_back(newBraceType);
@@ -1122,6 +1200,14 @@ string ASFormatter::nextLine()
 		// reset block handling flags
 		isImmediatelyPostEmptyBlock = false;
 
+		// Objective-C method prefix with no return type
+		if (isImmediatelyPostObjCMethodPrefix && currentChar != '(')
+		{
+			if (shouldPadMethodPrefix || shouldUnPadMethodPrefix)
+				padObjCMethodPrefix();
+			isImmediatelyPostObjCMethodPrefix = false;
+		}
+
 		// look for headers
 		bool isPotentialHeader = isCharPotentialHeader(currentLine, charNum);
 
@@ -1132,6 +1218,11 @@ string ASFormatter::nextLine()
 
 			newHeader = findHeader(headers);
 
+			// java can have a 'default' not in a switch
+			if (newHeader == &AS_DEFAULT
+			        && ASBeautifier::peekNextChar(
+			            currentLine, charNum + (*newHeader).length() - 1) != ':')
+				newHeader = nullptr;
 			// Qt headers may be variables in C++
 			if (isCStyle()
 			        && (newHeader == &AS_FOREVER || newHeader == &AS_FOREACH))
@@ -1311,7 +1402,7 @@ string ASFormatter::nextLine()
 					foundClassHeader = true;
 				if (newHeader == &AS_STRUCT)
 					foundStructHeader = true;
-				if (newHeader == &AS_INTERFACE)
+				if (newHeader == &AS_INTERFACE && !foundNamespaceHeader && !foundClassHeader)
 					foundInterfaceHeader = true;
 				foundPreDefinitionHeader = true;
 				appendSequence(*newHeader);
@@ -1321,7 +1412,7 @@ string ASFormatter::nextLine()
 			}
 			else if ((newHeader = findHeader(preCommandHeaders)) != nullptr)
 			{
-				// a 'const' variable is not a preCommandHeader
+				// must be after function arguments
 				if (previousNonWSChar == ')')
 					foundPreCommandHeader = true;
 			}
@@ -1354,6 +1445,12 @@ string ASFormatter::nextLine()
 			if (currentChar == ';')
 			{
 				squareBracketCount = 0;
+				//assert(methodBreakCharNum == string::npos);	// comment out
+				//assert(methodBreakLineNum == 0);				// comment out
+				methodBreakCharNum = string::npos;
+				methodBreakLineNum = 0;
+				methodAttachCharNum = string::npos;
+				methodAttachLineNum = 0;
 
 				if (((shouldBreakOneLineStatements
 				        || isBraceType(braceTypeStack->back(), SINGLE_LINE_TYPE))
@@ -1384,6 +1481,7 @@ string ASFormatter::nextLine()
 			if (currentChar != ';'
 			        || (needHeaderOpeningBrace && parenStack->back() == 0))
 				currentHeader = nullptr;
+
 			resetEndOfStatement();
 		}
 
@@ -1404,7 +1502,7 @@ string ASFormatter::nextLine()
 			         && !foundPreDefinitionHeader   // not in a definition block
 			         && previousCommandChar != ')'  // not after closing paren of a method header
 			         && !foundPreCommandHeader      // not after a 'noexcept'
-			         && squareBracketCount == 0        // not in objC method call
+			         && squareBracketCount == 0     // not in objC method call
 			         && !isInObjCMethodDefinition   // not objC '-' or '+' method
 			         && !isInObjCInterface          // not objC @interface
 			         && !isInObjCSelector           // not objC @selector
@@ -1418,10 +1516,15 @@ string ASFormatter::nextLine()
 			}
 
 			if (isCStyle()
-			        && shouldPadMethodColon
 			        && (squareBracketCount > 0 || isInObjCMethodDefinition || isInObjCSelector)
 			        && !foundQuestionMark)			// not in a ?: sequence
-				padObjCMethodColon();
+			{
+				isImmediatelyPostObjCMethodPrefix = false;
+				isInObjCReturnType = false;
+				isInObjCParam = true;
+				if (shouldPadMethodColon)
+					padObjCMethodColon();
+			}
 
 			if (isInObjCInterface)
 			{
@@ -1449,8 +1552,8 @@ string ASFormatter::nextLine()
 
 			if (findKeyword(currentLine, charNum, AS_RETURN))
 			{
-				isInPotentialCalculation = true;	// return is the same as an = sign
-				isImmediatelyPostReturn = true;
+				isInPotentialCalculation = true;
+				isImmediatelyPostReturn = true;		// return is the same as an = sign
 			}
 
 			if (findKeyword(currentLine, charNum, AS_OPERATOR))
@@ -1476,10 +1579,31 @@ string ASFormatter::nextLine()
 
 			if (isCStyle() && findKeyword(currentLine, charNum, AS_AUTO)
 			        && (isBraceType(braceTypeStack->back(), NULL_TYPE)
-			            || isBraceType(braceTypeStack->back(), NAMESPACE_TYPE)
-			            || isBraceType(braceTypeStack->back(), CLASS_TYPE)))
+			            || isBraceType(braceTypeStack->back(), DEFINITION_TYPE)))
 				foundTrailingReturnType = true;
 
+			// check for break/attach return type
+			if (shouldBreakReturnType || shouldBreakReturnTypeDecl
+			        || shouldAttachReturnType || shouldAttachReturnTypeDecl)
+			{
+				if ((isBraceType(braceTypeStack->back(), NULL_TYPE)
+				        || isBraceType(braceTypeStack->back(), DEFINITION_TYPE))
+				        && !returnTypeChecked
+				        && !foundNamespaceHeader
+				        && !foundClassHeader
+				        && !isInObjCMethodDefinition
+				        // bypass objective-C and java @ character
+				        && charNum == (int) currentLine.find_first_not_of(" \t")
+				        && !(isCStyle() && isCharPotentialHeader(currentLine, charNum)
+				             && (findKeyword(currentLine, charNum, AS_PUBLIC)
+				                 || findKeyword(currentLine, charNum, AS_PRIVATE)
+				                 || findKeyword(currentLine, charNum, AS_PROTECTED))))
+				{
+					findReturnTypeSplitPoint(currentLine);
+					returnTypeChecked = true;
+				}
+			}
+
 			// Objective-C NSException macros are preCommandHeaders
 			if (isCStyle() && findKeyword(currentLine, charNum, AS_NS_DURING))
 				foundPreCommandMacro = true;
@@ -1555,6 +1679,9 @@ string ASFormatter::nextLine()
 		// determine if this is an Objective-C statement
 
 		if (currentChar == '@'
+		        && isCStyle()
+		        && (int) currentLine.length() > charNum + 1
+		        && !isWhiteSpace(currentLine[charNum + 1])
 		        && isCharPotentialHeader(currentLine, charNum + 1)
 		        && findKeyword(currentLine, charNum + 1, AS_INTERFACE)
 		        && isBraceType(braceTypeStack->back(), NULL_TYPE))
@@ -1566,6 +1693,9 @@ string ASFormatter::nextLine()
 			continue;
 		}
 		else if (currentChar == '@'
+		         && isCStyle()
+		         && (int) currentLine.length() > charNum + 1
+		         && !isWhiteSpace(currentLine[charNum + 1])
 		         && isCharPotentialHeader(currentLine, charNum + 1)
 		         && findKeyword(currentLine, charNum + 1, AS_SELECTOR))
 		{
@@ -1576,13 +1706,16 @@ string ASFormatter::nextLine()
 			continue;
 		}
 		else if ((currentChar == '-' || currentChar == '+')
+		         && isCStyle()
 		         && (int) currentLine.find_first_not_of(" \t") == charNum
-		         && peekNextChar() == '('
-		         && isBraceType(braceTypeStack->back(), NULL_TYPE)
-		         && !isInPotentialCalculation)
+		         && !isInPotentialCalculation
+		         && !isInObjCMethodDefinition
+		         && (isBraceType(braceTypeStack->back(), NULL_TYPE)
+		             || (isBraceType(braceTypeStack->back(), EXTERN_TYPE))))
 		{
 			isInObjCMethodDefinition = true;
 			isImmediatelyPostObjCMethodPrefix = true;
+			isInObjCParam = false;
 			isInObjCInterface = false;
 			if (getAlignMethodColon())
 				objCColonAlign = findObjCColonAlignment();
@@ -1726,7 +1859,8 @@ string ASFormatter::nextLine()
 						padObjCReturnType();
 					isInObjCReturnType = false;
 				}
-				else if (shouldPadParamType || shouldUnPadParamType)
+				else if (isInObjCParam
+				         && (shouldPadParamType || shouldUnPadParamType))
 					padObjCParamType();
 			}
 			continue;
@@ -1861,7 +1995,7 @@ void ASFormatter::setRemoveBracesMode(bool state)
 	shouldRemoveBraces = state;
 }
 
-// retained for compatability with release 2.06
+// retained for compatibility with release 2.06
 // "Brackets" have been changed to "Braces" in 3.0
 // it is referenced only by the old "bracket" options
 void ASFormatter::setAddBracketsMode(bool state)
@@ -1869,7 +2003,7 @@ void ASFormatter::setAddBracketsMode(bool state)
 	setAddBracesMode(state);
 }
 
-// retained for compatability with release 2.06
+// retained for compatibility with release 2.06
 // "Brackets" have been changed to "Braces" in 3.0
 // it is referenced only by the old "bracket" options
 void ASFormatter::setAddOneLineBracketsMode(bool state)
@@ -1877,7 +2011,7 @@ void ASFormatter::setAddOneLineBracketsMode(bool state)
 	setAddOneLineBracesMode(state);
 }
 
-// retained for compatability with release 2.06
+// retained for compatibility with release 2.06
 // "Brackets" have been changed to "Braces" in 3.0
 // it is referenced only by the old "bracket" options
 void ASFormatter::setRemoveBracketsMode(bool state)
@@ -1885,7 +2019,7 @@ void ASFormatter::setRemoveBracketsMode(bool state)
 	setRemoveBracesMode(state);
 }
 
-// retained for compatability with release 2.06
+// retained for compatibility with release 2.06
 // "Brackets" have been changed to "Braces" in 3.0
 // it is referenced only by the old "bracket" options
 void ASFormatter::setBreakClosingHeaderBracketsMode(bool state)
@@ -1893,7 +2027,6 @@ void ASFormatter::setBreakClosingHeaderBracketsMode(bool state)
 	setBreakClosingHeaderBracesMode(state);
 }
 
-
 /**
  * set the brace formatting mode.
  * options:
@@ -2276,6 +2409,26 @@ void ASFormatter::setDeleteEmptyLinesMode(bool state)
 	shouldDeleteEmptyLines = state;
 }
 
+void ASFormatter::setBreakReturnType(bool state)
+{
+	shouldBreakReturnType = state;
+}
+
+void ASFormatter::setBreakReturnTypeDecl(bool state)
+{
+	shouldBreakReturnTypeDecl = state;
+}
+
+void ASFormatter::setAttachReturnType(bool state)
+{
+	shouldAttachReturnType = state;
+}
+
+void ASFormatter::setAttachReturnTypeDecl(bool state)
+{
+	shouldAttachReturnTypeDecl = state;
+}
+
 /**
  * set the pointer alignment.
  *
@@ -2490,6 +2643,11 @@ bool ASFormatter::getNextLine(bool emptyLineWasDeleted /*false*/)
 	if (currentLine.length() == 0)
 		currentLine = string(" ");        // a null is inserted if this is not done
 
+	if (methodBreakLineNum > 0)
+		--methodBreakLineNum;
+	if (methodAttachLineNum > 0)
+		--methodAttachLineNum;
+
 	// unless reading in the first line of the file, break a new line.
 	if (!isVirgin)
 		isInLineBreak = true;
@@ -2844,7 +3002,8 @@ BraceType ASFormatter::getBraceType()
 		                      || ((previousCommandChar == '{' || previousCommandChar == '}')
 		                          && isPreviousBraceBlockRelated)
 		                      || (isInClassInitializer
-		                          && (!isLegalNameChar(previousNonWSChar) || foundPreCommandHeader))
+		                          && ((!isLegalNameChar(previousNonWSChar) && previousNonWSChar != '(')
+		                              || foundPreCommandHeader))
 		                      || foundTrailingReturnType
 		                      || isInObjCMethodDefinition
 		                      || isInObjCInterface
@@ -2894,6 +3053,36 @@ BraceType ASFormatter::getBraceType()
 	return returnVal;
 }
 
+bool ASFormatter::isNumericVariable(string word) const
+{
+	if (word == "bool"
+	        || word == "int"
+	        || word == "void"
+	        || word == "char"
+	        || word == "long"
+	        || word == "short"
+	        || word == "double"
+	        || word == "float"
+	        || (word.length() >= 4     // check end of word for _t
+	            && word.compare(word.length() - 2, 2, "_t") == 0)
+// removed release 3.1
+//	        || word == "Int32"
+//	        || word == "UInt32"
+//	        || word == "Int64"
+//	        || word == "UInt64"
+	        || word == "BOOL"
+	        || word == "DWORD"
+	        || word == "HWND"
+	        || word == "INT"
+	        || word == "LPSTR"
+	        || word == "VOID"
+	        || word == "LPVOID"
+	        || word == "wxFontEncoding"
+	   )
+		return true;
+	return false;
+}
+
 /**
 * check if a colon is a class initializer separator
 *
@@ -2988,18 +3177,17 @@ bool ASFormatter::isPointerOrReference() const
 	string nextText = peekNextText(currentLine.substr(charNum + 1));
 	if (nextText.length() == 0)
 		nextText = " ";
-	char nextChar = nextText[0];
 	if (isDigit(lastWord[0])
-	        || isDigit(nextChar)
-	        || nextChar == '!'
-	        || nextChar == '~')
+	        || isDigit(nextText[0])
+	        || nextText[0] == '!'
+	        || nextText[0] == '~')
 		return false;
 
 	// check for multiply then a dereference (a * *b)
+	char nextChar = peekNextChar();
 	if (currentChar == '*'
-	        && charNum < (int) currentLine.length() - 1
-	        && isWhiteSpace(currentLine[charNum + 1])
-	        && nextChar == '*')
+	        && nextChar == '*'
+	        && !isPointerToPointer(currentLine, charNum))
 		return false;
 
 	if ((foundCastOperator && nextChar == '>')
@@ -3017,7 +3205,7 @@ bool ASFormatter::isPointerOrReference() const
 	//check for rvalue reference
 	if (currentChar == '&' && nextChar == '&')
 	{
-		if (lastWord == "auto")
+		if (lastWord == AS_AUTO)
 			return true;
 		if (previousNonWSChar == '>')
 			return true;
@@ -3175,7 +3363,7 @@ bool ASFormatter::isDereferenceOrAddressOf() const
 			return true;
 	}
 
-	// check for reference to a pointer *& (cannot have &*)
+	// check for reference to a pointer *&
 	if ((currentChar == '*' && nextChar == '&')
 	        || (previousNonWSChar == '*' && currentChar == '&'))
 		return false;
@@ -3262,6 +3450,27 @@ bool ASFormatter::isPointerOrReferenceVariable(const string& word) const
 	        || word == "VOID");
 }
 
+/**
+ * Check if * * is a pointer to a pointer or a multiply then a dereference.
+ *
+ * @return        true if a pointer *.
+ */
+bool ASFormatter::isPointerToPointer(const string& line, int currPos) const
+{
+	assert(line[currPos] == '*' && peekNextChar() == '*');
+	if ((int) line.length() > currPos + 1 && line[currPos + 1] == '*')
+		return true;
+	size_t nextText = line.find_first_not_of(" \t", currPos + 1);
+	if (nextText == string::npos || line[nextText] != '*')
+		return false;
+	size_t nextText2 = line.find_first_not_of(" \t", nextText + 1);
+	if (nextText == string::npos)
+		return false;
+	if (line[nextText2] == ')' || line[nextText2] == '*')
+		return true;
+	return false;
+}
+
 /**
  * check if the currently reached '+' or '-' character is a unary operator
  * this method takes for granted that the current character
@@ -3273,11 +3482,31 @@ bool ASFormatter::isUnaryOperator() const
 {
 	assert(currentChar == '+' || currentChar == '-');
 
+	// does a digit follow a c-style cast
+	if (previousCommandChar == ')')
+	{
+		if (!isdigit(peekNextChar()))
+			return false;
+		size_t end = currentLine.rfind(')', charNum);
+		if (end == string::npos)
+			return false;
+		size_t lastChar = currentLine.find_last_not_of(" \t", end - 1);
+		if (lastChar == string::npos)
+			return false;
+		if (currentLine[lastChar] == '*')
+			end = lastChar;
+		string prevWord = getPreviousWord(currentLine, end);
+		if (prevWord.empty())
+			return false;
+		if (!isNumericVariable(prevWord))
+			return false;
+		return true;
+	}
+
 	return ((isCharImmediatelyPostReturn || !isLegalNameChar(previousCommandChar))
 	        && previousCommandChar != '.'
 	        && previousCommandChar != '\"'
 	        && previousCommandChar != '\''
-	        && previousCommandChar != ')'
 	        && previousCommandChar != ']');
 }
 
@@ -3327,7 +3556,7 @@ bool ASFormatter::isNonInStatementArrayBrace() const
 	char nextChar = peekNextChar();
 	// if this opening brace begins the line there will be no inStatement indent
 	if (currentLineBeginsWithBrace
-	        && charNum == (int) currentLineFirstBraceNum
+	        && (size_t) charNum == currentLineFirstBraceNum
 	        && nextChar != '}')
 		returnVal = true;
 	// if an opening brace ends the line there will be no inStatement indent
@@ -3380,15 +3609,11 @@ int ASFormatter::isOneLineBlockReached(const string& line, int startChar) const
 			continue;
 		}
 
-		if (ch == '\\')
-		{
-			++i;
-			continue;
-		}
-
 		if (isInQuote_)
 		{
-			if (ch == quoteChar_)
+			if (ch == '\\')
+				++i;
+			else if (ch == quoteChar_)
 				isInQuote_ = false;
 			continue;
 		}
@@ -3523,7 +3748,8 @@ bool ASFormatter::isUniformInitializerBrace() const
 	if (isCStyle() && !isInEnum && !isImmediatelyPostPreprocessor)
 	{
 		if (isInClassInitializer
-		        || isLegalNameChar(previousNonWSChar))
+		        || isLegalNameChar(previousNonWSChar)
+		        || previousNonWSChar == '(')
 			return true;
 	}
 	return false;
@@ -3612,11 +3838,12 @@ string ASFormatter::peekNextText(const string& firstLine,
                                  bool endOnEmptyLine /*false*/,
                                  shared_ptr<ASPeekStream> streamArg /*nullptr*/) const
 {
+	assert(sourceIterator->getPeekStart() == 0 || streamArg != nullptr);	// Borland may need != 0
 	bool isFirstLine = true;
 	string nextLine_ = firstLine;
 	size_t firstChar = string::npos;
 	shared_ptr<ASPeekStream> stream = streamArg;
-	if (stream == nullptr)							// Borland may need == 0
+	if (stream == nullptr)					// Borland may need == 0
 		stream = make_shared<ASPeekStream>(sourceIterator);
 
 	// find the first non-blank text, bypassing all comments.
@@ -3684,7 +3911,10 @@ void ASFormatter::adjustComments()
 		size_t endNum = currentLine.find("*/", charNum + 2);
 		if (endNum == string::npos)
 			return;
-		if (currentLine.find_first_not_of(" \t", endNum + 2) != string::npos)
+		// following line comments may be a tag from AStyleWx //[[)>
+		size_t nextNum = currentLine.find_first_not_of(" \t", endNum + 2);
+		if (nextNum != string::npos
+		        && currentLine.compare(nextNum, 2, "//") != 0)
 			return;
 	}
 
@@ -3856,7 +4086,8 @@ void ASFormatter::formatPointerOrReference()
 
 	int pa = pointerAlignment;
 	int ra = referenceAlignment;
-	int itemAlignment = (currentChar == '*' || currentChar == '^') ? pa : ((ra == REF_SAME_AS_PTR) ? pa : ra);
+	int itemAlignment = (currentChar == '*' || currentChar == '^')
+	                    ? pa : ((ra == REF_SAME_AS_PTR) ? pa : ra);
 
 	// check for ** and &&
 	int ptrLength = 1;
@@ -3902,7 +4133,7 @@ void ASFormatter::formatPointerOrReference()
 	}
 	else	// pointerAlignment == PTR_ALIGN_NONE
 	{
-		formattedLine.append(ptrLength, currentChar);
+		formattedLine.append(currentLine.substr(charNum, ptrLength));
 		if (ptrLength > 1)
 			goForward(ptrLength - 1);
 	}
@@ -3918,28 +4149,34 @@ void ASFormatter::formatPointerOrReferenceToType()
 
 	// do this before bumping charNum
 	bool isOldPRCentered = isPointerOrReferenceCentered();
-
-	size_t prevCh = formattedLine.find_last_not_of(" \t");
-	if (prevCh == string::npos)
-		prevCh = 0;
-	if (formattedLine.length() == 0 || prevCh == formattedLine.length() - 1)
-		formattedLine.append(1, currentChar);
-	else
+	string sequenceToInsert(1, currentChar);
+	// get the sequence
+	if (currentChar == peekNextChar())
 	{
-		// exchange * or & with character following the type
-		// this may not work every time with a tab character
-		string charSave = formattedLine.substr(prevCh + 1, 1);
-		formattedLine[prevCh + 1] = currentChar;
-		formattedLine.append(charSave);
+		for (size_t i = charNum + 1; currentLine.length() > i; i++)
+		{
+			if (currentLine[i] == sequenceToInsert[0])
+			{
+				sequenceToInsert.append(1, currentLine[i]);
+				goForward(1);
+				continue;
+			}
+			break;
+		}
 	}
-	if (isSequenceReached("**") || isSequenceReached("&&"))
+	// append the seqence
+	string charSave;
+	size_t prevCh = formattedLine.find_last_not_of(" \t");
+	if (prevCh < formattedLine.length())
 	{
-		if (formattedLine.length() == 1)
-			formattedLine.append(1, currentChar);
-		else
-			formattedLine.insert(prevCh + 2, 1, currentChar);
-		goForward(1);
+		charSave = formattedLine.substr(prevCh + 1);
+		formattedLine.resize(prevCh + 1);
 	}
+	formattedLine.append(sequenceToInsert);
+	if (peekNextChar() != ')')
+		formattedLine.append(charSave);
+	else
+		spacePadNum -= charSave.length();
 	// if no space after then add one
 	if (charNum < (int) currentLine.length() - 1
 	        && !isWhiteSpace(currentLine[charNum + 1])
@@ -3953,7 +4190,7 @@ void ASFormatter::formatPointerOrReferenceToType()
 		spacePadNum--;
 	}
 	// update the formattedLine split point
-	if (maxCodeLength != string::npos)
+	if (maxCodeLength != string::npos && formattedLine.length() > 0)
 	{
 		size_t index = formattedLine.length() - 1;
 		if (isWhiteSpace(formattedLine[index]))
@@ -3979,15 +4216,18 @@ void ASFormatter::formatPointerOrReferenceToMiddle()
 	else
 		wsBefore = charNum - wsBefore - 1;
 	string sequenceToInsert(1, currentChar);
-	if (isSequenceReached("**"))
-	{
-		sequenceToInsert = "**";
-		goForward(1);
-	}
-	else if (isSequenceReached("&&"))
+	if (currentChar == peekNextChar())
 	{
-		sequenceToInsert = "&&";
-		goForward(1);
+		for (size_t i = charNum + 1; currentLine.length() > i; i++)
+		{
+			if (currentLine[i] == sequenceToInsert[0])
+			{
+				sequenceToInsert.append(1, currentLine[i]);
+				goForward(1);
+				continue;
+			}
+			break;
+		}
 	}
 	// if reference to a pointer check for conflicting alignment
 	else if (currentChar == '*' && peekNextChar() == '&'
@@ -4059,7 +4299,10 @@ void ASFormatter::formatPointerOrReferenceToMiddle()
 		// insert the pointer or reference char
 		size_t padAfter = (wsBefore + wsAfter) / 2;
 		size_t index = formattedLine.length() - padAfter;
-		formattedLine.insert(index, sequenceToInsert);
+		if (index < formattedLine.length())
+			formattedLine.insert(index, sequenceToInsert);
+		else
+			formattedLine.append(sequenceToInsert);
 	}
 	else	// formattedLine.length() == 0
 	{
@@ -4097,15 +4340,18 @@ void ASFormatter::formatPointerOrReferenceToName()
 	if (startNum == string::npos)
 		startNum = 0;
 	string sequenceToInsert(1, currentChar);
-	if (isSequenceReached("**"))
+	if (currentChar == peekNextChar())
 	{
-		sequenceToInsert = "**";
-		goForward(1);
-	}
-	else if (isSequenceReached("&&"))
-	{
-		sequenceToInsert = "&&";
-		goForward(1);
+		for (size_t i = charNum + 1; currentLine.length() > i; i++)
+		{
+			if (currentLine[i] == sequenceToInsert[0])
+			{
+				sequenceToInsert.append(1, currentLine[i]);
+				goForward(1);
+				continue;
+			}
+			break;
+		}
 	}
 	// if reference to a pointer align both to name
 	else if (currentChar == '*' && peekNextChar() == '&')
@@ -4118,7 +4364,7 @@ void ASFormatter::formatPointerOrReferenceToName()
 	char peekedChar = peekNextChar();
 	bool isAfterScopeResolution = previousNonWSChar == ':';		// check for ::
 	// if this is not the last thing on the line
-	if (!isBeforeAnyComment()
+	if ((isLegalNameChar(peekedChar) || peekedChar == '(' || peekedChar == '[' || peekedChar == '=')
 	        && (int) currentLine.find_first_not_of(" \t", charNum + 1) > charNum)
 	{
 		// goForward() to convert tabs to spaces, if necessary,
@@ -4130,13 +4376,13 @@ void ASFormatter::formatPointerOrReferenceToName()
 			if (shouldPadParensOutside && peekedChar == '(' && !isOldPRCentered)
 			{
 				// empty parens don't count
-				size_t start = currentLine.find_first_not_of("( \t", charNum + 1);
+				size_t start = currentLine.find_first_not_of("( \t", i);
 				if (start != string::npos && currentLine[start] != ')')
 					break;
 			}
 			goForward(1);
 			if (formattedLine.length() > 0)
-				formattedLine.append(1, currentLine[i]);
+				formattedLine.append(1, currentLine[charNum]);
 			else
 				spacePadNum--;
 		}
@@ -4161,6 +4407,7 @@ void ASFormatter::formatPointerOrReferenceToName()
 	if (isOldPRCentered
 	        && formattedLine.length() > startNum + 1
 	        && isWhiteSpace(formattedLine[startNum + 1])
+	        && peekedChar != '*'		// check for '* *'
 	        && !isBeforeAnyComment())
 	{
 		formattedLine.erase(startNum + 1, 1);
@@ -4209,7 +4456,8 @@ void ASFormatter::formatPointerOrReferenceCast()
 
 	int pa = pointerAlignment;
 	int ra = referenceAlignment;
-	int itemAlignment = (currentChar == '*' || currentChar == '^') ? pa : ((ra == REF_SAME_AS_PTR) ? pa : ra);
+	int itemAlignment = (currentChar == '*' || currentChar == '^')
+	                    ? pa : ((ra == REF_SAME_AS_PTR) ? pa : ra);
 
 	string sequenceToInsert(1, currentChar);
 	if (isSequenceReached("**") || isSequenceReached("&&"))
@@ -4228,9 +4476,19 @@ void ASFormatter::formatPointerOrReferenceCast()
 	if (prevNum != string::npos)
 	{
 		prevCh = formattedLine[prevNum];
-		if (prevNum + 1 < formattedLine.length()
-		        && isWhiteSpace(formattedLine[prevNum + 1])
-		        && prevCh != '(')
+		if (itemAlignment == PTR_ALIGN_TYPE && currentChar == '*' && prevCh == '*')
+		{
+			// '* *' may be a multiply followed by a dereference
+			if (prevNum + 2 < formattedLine.length()
+			        && isWhiteSpace(formattedLine[prevNum + 2]))
+			{
+				spacePadNum -= (formattedLine.length() - 2 - prevNum);
+				formattedLine.erase(prevNum + 2);
+			}
+		}
+		else if (prevNum + 1 < formattedLine.length()
+		         && isWhiteSpace(formattedLine[prevNum + 1])
+		         && prevCh != '(')
 		{
 			spacePadNum -= (formattedLine.length() - 1 - prevNum);
 			formattedLine.erase(prevNum + 1);
@@ -4294,43 +4552,19 @@ void ASFormatter::padParens()
 					        && isCharPotentialHeader(prevWord, 0))
 						prevWordH = ASBase::findHeader(prevWord, 0, headers);
 					if (prevWordH != nullptr)
-						prevIsParenHeader = true;
-					else if (prevWord == AS_RETURN)  // don't unpad
-						prevIsParenHeader = true;
+						prevIsParenHeader = true;    // don't unpad
+					else if (prevWord == AS_RETURN)
+						prevIsParenHeader = true;    // don't unpad
 					else if ((prevWord == AS_NEW || prevWord == AS_DELETE)
-					         && shouldPadHeader)  // don't unpad
-						prevIsParenHeader = true;
-					else if (isCStyle() && prevWord == AS_THROW && shouldPadHeader) // don't unpad
-						prevIsParenHeader = true;
-					else if (prevWord == "and" || prevWord == "or" || prevWord == "in")  // don't unpad
-						prevIsParenHeader = true;
+					         && shouldPadHeader)
+						prevIsParenHeader = true;    // don't unpad
+					else if (isCStyle() && prevWord == AS_THROW && shouldPadHeader)
+						prevIsParenHeader = true;    // don't unpad
+					else if (prevWord == "and" || prevWord == "or" || prevWord == "in")
+						prevIsParenHeader = true;    // don't unpad
 					// don't unpad variables
-					else if (prevWord == "bool"
-					         || prevWord == "int"
-					         || prevWord == "void"
-					         || prevWord == "void*"
-					         || prevWord == "char"
-					         || prevWord == "char*"
-					         || prevWord == "long"
-					         || prevWord == "double"
-					         || prevWord == "float"
-					         || (prevWord.length() >= 4     // check end of word for _t
-					             && prevWord.compare(prevWord.length() - 2, 2, "_t") == 0)
-					         || prevWord == "Int32"
-					         || prevWord == "UInt32"
-					         || prevWord == "Int64"
-					         || prevWord == "UInt64"
-					         || prevWord == "BOOL"
-					         || prevWord == "DWORD"
-					         || prevWord == "HWND"
-					         || prevWord == "INT"
-					         || prevWord == "LPSTR"
-					         || prevWord == "VOID"
-					         || prevWord == "LPVOID"
-					        )
-					{
-						prevIsParenHeader = true;
-					}
+					else if (isNumericVariable(prevWord))
+						prevIsParenHeader = true;    // don't unpad
 				}
 			}
 			// do not unpad operators, but leave them if already padded
@@ -4457,22 +4691,23 @@ void ASFormatter::padParens()
 }
 
 /**
-* add or remove space padding to objective-c parens
+* add or remove space padding to objective-c method prefix (- or +)
+* if this is a '(' it begins a return type
 * these options have precedence over the padParens methods
 * the padParens method has already been called, this method adjusts
 */
 void ASFormatter::padObjCMethodPrefix()
 {
-	assert(currentChar == '(' && isImmediatelyPostObjCMethodPrefix);
+	assert(isInObjCMethodDefinition && isImmediatelyPostObjCMethodPrefix);
 	assert(shouldPadMethodPrefix || shouldUnPadMethodPrefix);
 
 	size_t prefix = formattedLine.find_first_of("+-");
 	if (prefix == string::npos)
 		return;
-	size_t paren = formattedLine.find_first_of('(');
-	if (paren == string::npos)
-		return;
-	int spaces = paren - prefix - 1;
+	size_t firstChar = formattedLine.find_first_not_of(" \t", prefix + 1);
+	if (firstChar == string::npos)
+		firstChar = formattedLine.length();
+	int spaces = firstChar - prefix - 1;
 
 	if (shouldPadMethodPrefix)
 	{
@@ -4484,6 +4719,7 @@ void ASFormatter::padObjCMethodPrefix()
 		else if (spaces > 1)
 		{
 			formattedLine.erase(prefix + 1, spaces - 1);
+			formattedLine[prefix + 1] = ' ';  // convert any tab to space
 			spacePadNum -= spaces - 1;
 		}
 	}
@@ -4528,6 +4764,7 @@ void ASFormatter::padObjCReturnType()
 		{
 			// do not use goForward here
 			currentLine.erase(charNum + 1, spaces - 1);
+			currentLine[charNum + 1] = ' ';  // convert any tab to space
 			spacePadNum -= spaces - 1;
 		}
 	}
@@ -4537,16 +4774,13 @@ void ASFormatter::padObjCReturnType()
 		// this will already be padded if pad-paren is used
 		if (formattedLine[formattedLine.length() - 1] == ' ')
 		{
-			spacePadNum -= formattedLine.length() - 1 - nextText;
 			int lastText = formattedLine.find_last_not_of(" \t");
+			spacePadNum -= formattedLine.length() - lastText - 1;
 			formattedLine.resize(lastText + 1);
 		}
-		if (spaces > 0)
-		{
-			// do not use goForward here
-			currentLine.erase(charNum + 1, spaces);
-			spacePadNum -= spaces;
-		}
+		// do not use goForward here
+		currentLine.erase(charNum + 1, spaces);
+		spacePadNum -= spaces;
 	}
 }
 
@@ -4583,6 +4817,7 @@ void ASFormatter::padObjCParamType()
 			if (spaces > 1)
 			{
 				formattedLine.erase(prevText + 1, spaces - 1);
+				formattedLine[prevText + 1] = ' ';  // convert any tab to space
 				spacePadNum -= spaces - 1;
 			}
 		}
@@ -4620,6 +4855,7 @@ void ASFormatter::padObjCParamType()
 			{
 				// do not use goForward here
 				currentLine.erase(charNum + 1, spaces - 1);
+				currentLine[charNum + 1] = ' ';  // convert any tab to space
 				spacePadNum -= spaces - 1;
 			}
 		}
@@ -4662,7 +4898,7 @@ void ASFormatter::formatOpeningBrace(BraceType braceType)
 
 	if (breakBrace)
 	{
-		if (isBeforeAnyComment() && isOkToBreakBlock(braceType))
+		if (isBeforeAnyComment() && isOkToBreakBlock(braceType) && sourceIterator->hasMoreLines())
 		{
 			// if comment is at line end leave the comment on this line
 			if (isBeforeAnyLineEndComment(charNum) && !currentLineBeginsWithBrace)
@@ -4758,7 +4994,7 @@ void ASFormatter::formatOpeningBrace(BraceType braceType)
 				}
 				else
 				{
-					if (currentLineBeginsWithBrace && charNum == (int) currentLineFirstBraceNum)
+					if (currentLineBeginsWithBrace && (size_t) charNum == currentLineFirstBraceNum)
 					{
 						appendSpacePad();
 						appendCurrentChar(false);		// attach
@@ -4925,7 +5161,7 @@ void ASFormatter::formatArrayBraces(BraceType braceType, bool isOpeningArrayBrac
 							testForTimeToSplitFormattedLine();		// line length will have changed
 
 							if (currentLineBeginsWithBrace
-							        && (int) currentLineFirstBraceNum == charNum)
+							        && currentLineFirstBraceNum == (size_t) charNum)
 								shouldBreakLineAtNextChar = true;
 						}
 						else
@@ -4945,7 +5181,7 @@ void ASFormatter::formatArrayBraces(BraceType braceType, bool isOpeningArrayBrac
 			{
 				if (isWhiteSpace(peekNextChar()) && !isInVirginLine)
 					breakLine();
-				else if (isBeforeAnyComment())
+				else if (isBeforeAnyComment() && sourceIterator->hasMoreLines())
 				{
 					// do not break unless comment is at line end
 					if (isBeforeAnyLineEndComment(charNum) && !currentLineBeginsWithBrace)
@@ -4963,7 +5199,7 @@ void ASFormatter::formatArrayBraces(BraceType braceType, bool isOpeningArrayBrac
 				appendCurrentChar();
 
 				if (currentLineBeginsWithBrace
-				        && (int) currentLineFirstBraceNum == charNum
+				        && currentLineFirstBraceNum == (size_t) charNum
 				        && !isBraceType(braceType, SINGLE_LINE_TYPE))
 					shouldBreakLineAtNextChar = true;
 			}
@@ -4971,7 +5207,7 @@ void ASFormatter::formatArrayBraces(BraceType braceType, bool isOpeningArrayBrac
 			{
 				if (isWhiteSpace(peekNextChar()) && !isInVirginLine)
 					breakLine();
-				else if (isBeforeAnyComment())
+				else if (isBeforeAnyComment() && sourceIterator->hasMoreLines())
 				{
 					// do not break unless comment is at line end
 					if (isBeforeAnyLineEndComment(charNum) && !currentLineBeginsWithBrace)
@@ -4991,7 +5227,7 @@ void ASFormatter::formatArrayBraces(BraceType braceType, bool isOpeningArrayBrac
 			else if (braceFormatMode == NONE_MODE)
 			{
 				if (currentLineBeginsWithBrace
-				        && charNum == (int) currentLineFirstBraceNum)
+				        && (size_t) charNum == currentLineFirstBraceNum)
 				{
 					appendCurrentChar();                // don't attach
 				}
@@ -5056,7 +5292,7 @@ void ASFormatter::formatArrayBraces(BraceType braceType, bool isOpeningArrayBrac
 
 		// if a declaration follows an enum definition, space pad
 		char peekedChar = peekNextChar();
-		if (isLegalNameChar(peekedChar)
+		if ((isLegalNameChar(peekedChar) && peekedChar != '.')
 		        || peekedChar == '[')
 			appendSpaceAfter();
 	}
@@ -5470,7 +5706,7 @@ bool ASFormatter::isCurrentBraceBroken() const
 	else if (braceFormatMode == NONE_MODE)
 	{
 		if (currentLineBeginsWithBrace
-		        && (int) currentLineFirstBraceNum == charNum)
+		        && currentLineFirstBraceNum == (size_t) charNum)
 			breakBrace = true;
 	}
 	else if (braceFormatMode == BREAK_MODE || braceFormatMode == RUN_IN_MODE)
@@ -6205,6 +6441,8 @@ bool ASFormatter::removeBracesFromStatement()
 		if (nextChar != string::npos)
 			break;
 	}
+	if (!stream.hasMoreLines())
+		return false;
 
 	// don't remove if comments or a header follow the brace
 	if ((nextLine_.compare(nextChar, 2, "/*") == 0)
@@ -6301,6 +6539,277 @@ size_t ASFormatter::findNextChar(const string& line, char searchChar, int search
 	return i;
 }
 
+/**
+ * Find split point for break/attach return type.
+ */
+void ASFormatter::findReturnTypeSplitPoint(const string& firstLine)
+{
+	assert((isBraceType(braceTypeStack->back(), NULL_TYPE)
+	        || isBraceType(braceTypeStack->back(), DEFINITION_TYPE)));
+	assert(shouldBreakReturnType || shouldBreakReturnTypeDecl
+	       || shouldAttachReturnType || shouldAttachReturnTypeDecl);
+
+	bool isFirstLine     = true;
+	bool isInComment_    = false;
+	bool isInQuote_      = false;
+	bool foundSplitPoint = false;
+	bool isAlreadyBroken = false;
+	char quoteChar_      = ' ';
+	char currNonWSChar   = ' ';
+	char prevNonWSChar   = ' ';
+	size_t parenCount    = 0;
+	size_t squareCount   = 0;
+	size_t angleCount    = 0;
+	size_t breakLineNum  = 0;
+	size_t breakCharNum  = string::npos;
+	string line          = firstLine;
+
+	// Process the lines until a ';' or '{'.
+	ASPeekStream stream(sourceIterator);
+	while (stream.hasMoreLines() || isFirstLine)
+	{
+		if (isFirstLine)
+			isFirstLine = false;
+		else
+		{
+			if (isInQuote_)
+				return;
+			line = stream.peekNextLine();
+			if (!foundSplitPoint)
+				++breakLineNum;
+		}
+		size_t firstCharNum = line.find_first_not_of(" \t");
+		if (firstCharNum == string::npos)
+			continue;
+		if (line[firstCharNum] == '#')
+		{
+			// don't attach to a preprocessor
+			if (shouldAttachReturnType || shouldAttachReturnTypeDecl)
+				return;
+			else
+				continue;
+		}
+		// parse the line
+		for (size_t i = 0; i < line.length(); i++)
+		{
+			if (!isWhiteSpace(line[i]))
+			{
+				prevNonWSChar = currNonWSChar;
+				currNonWSChar = line[i];
+			}
+			else if (line[i] == '\t' && shouldConvertTabs)
+			{
+				size_t tabSize = getTabLength();
+				size_t numSpaces = tabSize - ((tabIncrementIn + i) % tabSize);
+				line.replace(i, 1, numSpaces, ' ');
+				currentChar = line[i];
+			}
+			if (line.compare(i, 2, "/*") == 0)
+				isInComment_ = true;
+			if (isInComment_)
+			{
+				if (line.compare(i, 2, "*/") == 0)
+				{
+					isInComment_ = false;
+					++i;
+				}
+				continue;
+			}
+			if (line[i] == '\\')
+			{
+				++i;
+				continue;
+			}
+
+			if (isInQuote_)
+			{
+				if (line[i] == quoteChar_)
+					isInQuote_ = false;
+				continue;
+			}
+
+			if (line[i] == '"'
+			        || (line[i] == '\'' && !isDigitSeparator(line, i)))
+			{
+				isInQuote_ = true;
+				quoteChar_ = line[i];
+				continue;
+			}
+			if (line.compare(i, 2, "//") == 0)
+			{
+				i = line.length();
+				continue;
+			}
+			// not in quote or comment
+			if (!foundSplitPoint)
+			{
+				if (line[i] == '<')
+				{
+					++angleCount;
+					continue;
+				}
+				if (line[i] == '>')
+				{
+					if (angleCount)
+						--angleCount;
+					if (!angleCount)
+					{
+						size_t nextCharNum = line.find_first_not_of(" \t*&", i + 1);
+						if (nextCharNum == string::npos)
+						{
+							breakCharNum  = string::npos;
+							continue;
+						}
+						if (line[nextCharNum] != ':')		// scope operator
+							breakCharNum  = nextCharNum;
+					}
+					continue;
+				}
+				if (angleCount)
+					continue;
+				if (line[i] == '[')
+				{
+					++squareCount;
+					continue;
+				}
+				if (line[i] == ']')
+				{
+					if (squareCount)
+						--squareCount;
+					continue;
+				}
+				// an assignment before the parens is not a function
+				if (line[i] == '=')
+					return;
+				if (isWhiteSpace(line[i]) || line[i] == '*' || line[i] == '&')
+				{
+					size_t nextNum = line.find_first_not_of(" \t", i + 1);
+					if (nextNum == string::npos)
+						breakCharNum = string::npos;
+					else
+					{
+						if (line.length() > nextNum + 1
+						        && line[nextNum] == ':' && line[nextNum + 1] == ':')
+							i = --nextNum;
+						else if (line[nextNum] != '(')
+							breakCharNum = string::npos;
+					}
+					continue;
+				}
+				if ((isLegalNameChar(line[i]) || line[i] == '~')
+				        && breakCharNum == string::npos)
+				{
+					breakCharNum = i;
+					if (isLegalNameChar(line[i])
+					        && findKeyword(line, i, AS_OPERATOR))
+					{
+						if (breakCharNum == firstCharNum)
+							isAlreadyBroken = true;
+						foundSplitPoint = true;
+						// find the operator, may be parens
+						size_t parenNum =
+						    line.find_first_not_of(" \t", i + AS_OPERATOR.length());
+						if (parenNum == string::npos)
+							return;
+						// find paren after the operator
+						parenNum = line.find('(', parenNum + 1);
+						if (parenNum == string::npos)
+							return;
+						i = --parenNum;
+					}
+					continue;
+				}
+				if (line[i] == ':'
+				        && line.length() > i + 1
+				        && line[i + 1] == ':')
+				{
+					size_t nextCharNum = line.find_first_not_of(" \t:", i + 1);
+					if (nextCharNum == string::npos)
+						return;
+
+					if (isLegalNameChar(line[nextCharNum])
+					        && findKeyword(line, nextCharNum, AS_OPERATOR))
+					{
+						i = nextCharNum;
+						if (breakCharNum == firstCharNum)
+							isAlreadyBroken = true;
+						foundSplitPoint = true;
+						// find the operator, may be parens
+						size_t parenNum =
+						    line.find_first_not_of(" \t", i + AS_OPERATOR.length());
+						if (parenNum == string::npos)
+							return;
+						// find paren after the operator
+						parenNum = line.find('(', parenNum + 1);
+						if (parenNum == string::npos)
+							return;
+						i = --parenNum;
+					}
+					else
+						i = --nextCharNum;
+					continue;
+				}
+				if (line[i] == '(' && !squareCount)
+				{
+					// is line is already broken?
+					if (breakCharNum == firstCharNum && breakLineNum > 0)
+						isAlreadyBroken = true;
+					++parenCount;
+					foundSplitPoint = true;
+					continue;
+				}
+			}
+			// end !foundSplitPoint
+			if (line[i] == '(')
+			{
+				// consecutive ')(' parens is probably a function pointer
+				if (prevNonWSChar == ')' && !parenCount)
+					return;
+				++parenCount;
+				continue;
+			}
+			if (line[i] == ')')
+			{
+				if (parenCount)
+					--parenCount;
+				continue;
+			}
+			if (line[i] == '{')
+			{
+				if (shouldBreakReturnType && foundSplitPoint && !isAlreadyBroken)
+				{
+					methodBreakCharNum = breakCharNum;
+					methodBreakLineNum = breakLineNum;
+				}
+				if (shouldAttachReturnType && foundSplitPoint && isAlreadyBroken)
+				{
+					methodAttachCharNum = breakCharNum;
+					methodAttachLineNum = breakLineNum;
+				}
+				return;
+			}
+			if (line[i] == ';')
+			{
+				if (shouldBreakReturnTypeDecl && foundSplitPoint && !isAlreadyBroken)
+				{
+					methodBreakCharNum = breakCharNum;
+					methodBreakLineNum = breakLineNum;
+				}
+				if ((shouldAttachReturnTypeDecl && foundSplitPoint && isAlreadyBroken))
+				{
+					methodAttachCharNum = breakCharNum;
+					methodAttachLineNum = breakLineNum;
+				}
+				return;
+			}
+			if (line[i] == '}')
+				return;
+		}   // end of for loop
+		if (!foundSplitPoint)
+			breakCharNum = string::npos;
+	}   // end of while loop
+}
+
 /**
  * Look ahead in the file to see if a struct has access modifiers.
  *
@@ -6511,7 +7020,7 @@ bool ASFormatter::isIndentablePreprocessorBlock(const string& firstLine, size_t
 			else if (nextLine_[i] == ':')
 			{
 				// check for '::'
-				if (nextLine_.length() > i && nextLine_[i + 1] == ':')
+				if (nextLine_.length() > i + 1 && nextLine_[i + 1] == ':')
 					++i;
 				else
 					isInClassConstructor = true;
@@ -6929,7 +7438,7 @@ void ASFormatter::updateFormattedLineSplitPoints(char appendedChar)
 		{
 			// if follows an operator break before
 			size_t parenNum;
-			if (isCharPotentialOperator(previousNonWSChar))
+			if (previousNonWSChar != ' ' && isCharPotentialOperator(previousNonWSChar))
 				parenNum = formattedLine.length() - 1;
 			else
 				parenNum = formattedLine.length();
@@ -7227,7 +7736,7 @@ size_t ASFormatter::findFormattedLineSplitPoint() const
 	{
 		// if end of the currentLine, find a new split point
 		size_t newCharNum;
-		if (isCharPotentialHeader(currentLine, charNum))
+		if (!isWhiteSpace(currentChar) && isCharPotentialHeader(currentLine, charNum))
 			newCharNum = getCurrentWord(currentLine, charNum).length() + charNum;
 		else
 			newCharNum = charNum + 2;
@@ -7425,11 +7934,15 @@ void ASFormatter::resetEndOfStatement()
 	isSharpAccessor = false;
 	isSharpDelegate = false;
 	isInObjCMethodDefinition = false;
+	isImmediatelyPostObjCMethodPrefix = false;
+	isInObjCReturnType = false;
+	isInObjCParam = false;
 	isInObjCInterface = false;
 	isInObjCSelector = false;
 	isInEnum = false;
 	isInExternC = false;
 	elseHeaderFollowsComments = false;
+	returnTypeChecked = false;
 	nonInStatementBrace = 0;
 	while (!questionMarkStack->empty())
 		questionMarkStack->pop_back();
@@ -7446,6 +7959,7 @@ int ASFormatter::findObjCColonAlignment() const
 	bool foundMethodColon = false;
 	bool isInComment_ = false;
 	bool isInQuote_ = false;
+	bool haveTernary = false;
 	char quoteChar_ = ' ';
 	int  sqBracketCount = 0;
 	int  colonAdjust = 0;
@@ -7518,9 +8032,19 @@ int ASFormatter::findObjCColonAlignment() const
 				continue;
 			if (haveFirstColon)  // multiple colons per line
 				continue;
+			if (nextLine_[i] == '?')
+			{
+				haveTernary = true;
+				continue;
+			}
 			// compute colon adjustment
 			if (nextLine_[i] == ':')
 			{
+				if (haveTernary)
+				{
+					haveTernary = false;
+					continue;
+				}
 				haveFirstColon = true;
 				foundMethodColon = true;
 				if (shouldPadMethodColon)
@@ -7575,15 +8099,19 @@ void ASFormatter::padObjCMethodColon()
 				formattedLine.erase(i);
 				--commentAdjust;
 			}
-		appendSpacePad();
+		if (formattedLine.length() > 0)
+		{
+			appendSpacePad();
+			formattedLine.back() = ' ';  // convert any tab to space
+		}
 	}
 	if (objCColonPadMode == COLON_PAD_NONE
 	        || objCColonPadMode == COLON_PAD_BEFORE
 	        || nextChar == ')')
 	{
 		// remove spaces after
-		int nextText = currentLine.find_first_not_of(" \t", charNum + 1);
-		if (nextText == (int)string::npos)
+		size_t nextText = currentLine.find_first_not_of(" \t", charNum + 1);
+		if (nextText == string::npos)
 			nextText = currentLine.length();
 		int spaces = nextText - charNum - 1;
 		if (spaces > 0)
@@ -7596,8 +8124,8 @@ void ASFormatter::padObjCMethodColon()
 	else
 	{
 		// pad space after
-		int nextText = currentLine.find_first_not_of(" \t", charNum + 1);
-		if (nextText == (int)string::npos)
+		size_t nextText = currentLine.find_first_not_of(" \t", charNum + 1);
+		if (nextText == string::npos)
 			nextText = currentLine.length();
 		int spaces = nextText - charNum - 1;
 		if (spaces == 0)
@@ -7609,6 +8137,7 @@ void ASFormatter::padObjCMethodColon()
 		{
 			// do not use goForward here
 			currentLine.erase(charNum + 1, spaces - 1);
+			currentLine[charNum + 1] = ' ';  // convert any tab to space
 			spacePadNum -= spaces - 1;
 		}
 	}
diff --git a/astyle/src/ASLocalizer.cpp b/astyle/src/ASLocalizer.cpp
index 083f68a2bb359e09a4d6f5e736eae155bca8e3cb..caece119ddeec2814519cc9ba2b7d9af586862bc 100755
--- a/astyle/src/ASLocalizer.cpp
+++ b/astyle/src/ASLocalizer.cpp
@@ -1,5 +1,5 @@
 // ASLocalizer.cpp
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 //
@@ -183,7 +183,7 @@ void ASLocalizer::setLanguageFromLCID(size_t lcid)
 	setTranslationClass();
 }
 
-#endif	// _win32
+#endif	// _WIN32
 
 string ASLocalizer::getLanguageID() const
 // Returns the language ID in m_langID.
@@ -350,6 +350,14 @@ string Translation::convertToMultiByte(const wstring& wideStr) const
 	return mbTranslation;
 }
 
+string Translation::getTranslationString(size_t i) const
+// Return the translation ascii value. Used for testing.
+{
+	if (i >= m_translation.size())
+		return string();
+	return m_translation[i].first;
+}
+
 size_t Translation::getTranslationVectorSize() const
 // Return the translation vector size.  Used for testing.
 {
@@ -403,18 +411,21 @@ Bulgarian::Bulgarian()	// български
 	addPair("Formatted  %s\n", L"Форматиран  %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"Непроменен  %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"директория  %s\n");
+	addPair("Default option file  %s\n", L"Файл с опции по подразбиране  %s\n");
+	addPair("Project option file  %s\n", L"Файл с опции за проекта  %s\n");
 	addPair("Exclude  %s\n", L"Изключвам  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Изключване (несравнимо)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s форматиран   %s hепроменен   ");
 	addPair(" seconds   ", L" секунди   ");
 	addPair("%d min %d sec   ", L"%d мин %d сек   ");
 	addPair("%s lines\n", L"%s линии\n");
-	addPair("Using default options file %s\n", L"Използване на файла възможности по подразбиране %s\n");
 	addPair("Opening HTML documentation %s\n", L"Откриване HTML документация %s\n");
-	addPair("Invalid option file options:", L"Невалидни опции опция файлове:");
+	addPair("Invalid default options:", L"Невалидни опции по подразбиране:");
+	addPair("Invalid project options:", L"Невалидни опции за проекти:");
 	addPair("Invalid command line options:", L"Невалидни опции за командния ред:");
 	addPair("For help on options type 'astyle -h'", L"За помощ относно възможностите тип 'astyle -h'");
-	addPair("Cannot open options file", L"Не може да се отвори файл опции");
+	addPair("Cannot open default option file", L"Не може да се отвори файлът с опции по подразбиране");
+	addPair("Cannot open project option file", L"Не може да се отвори файла с опции за проекта");
 	addPair("Cannot open directory", L"Не може да се отвори директория");
 	addPair("Cannot open HTML file %s\n", L"Не може да се отвори HTML файл %s\n");
 	addPair("Command execute failure", L"Command изпълни недостатъчност");
@@ -425,7 +436,7 @@ Bulgarian::Bulgarian()	// български
 	addPair("No file to process %s\n", L"Не файл за обработка %s\n");
 	addPair("Did you intend to use --recursive", L"Знаете ли възнамерявате да използвате --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Не може да са UTF-32 кодиране");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style е прекратено");
+	addPair("Artistic Style has terminated\n", L"Artistic Style е прекратено\n");
 }
 
 ChineseSimplified::ChineseSimplified()	// 中文(简体)
@@ -434,18 +445,21 @@ ChineseSimplified::ChineseSimplified()	// 中文(简体)
 	addPair("Formatted  %s\n", L"格式化  %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"未改变  %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"目录  %s\n");
+	addPair("Default option file  %s\n", L"默认选项文件  %s\n");
+	addPair("Project option file  %s\n", L"项目选项文件  %s\n");
 	addPair("Exclude  %s\n", L"排除  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"排除(无匹配项)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s 格式化   %s 未改变   ");
 	addPair(" seconds   ", L" ç§’   ");
 	addPair("%d min %d sec   ", L"%d 分 %d 秒   ");
 	addPair("%s lines\n", L"%s 行\n");
-	addPair("Using default options file %s\n", L"使用默认配置文件 %s\n");
 	addPair("Opening HTML documentation %s\n", L"打开HTML文档 %s\n");
-	addPair("Invalid option file options:", L"无效的配置文件选项:");
+	addPair("Invalid default options:", L"默认选项无效:");
+	addPair("Invalid project options:", L"项目选项无效:");
 	addPair("Invalid command line options:", L"无效的命令行选项:");
 	addPair("For help on options type 'astyle -h'", L"输入 'astyle -h' 以获得有关命令行的帮助");
-	addPair("Cannot open options file", L"无法打开配置文件");
+	addPair("Cannot open default option file", L"无法打开默认选项文件");
+	addPair("Cannot open project option file", L"无法打开项目选项文件");
 	addPair("Cannot open directory", L"无法打开目录");
 	addPair("Cannot open HTML file %s\n", L"无法打开HTML文件 %s\n");
 	addPair("Command execute failure", L"执行命令失败");
@@ -456,7 +470,7 @@ ChineseSimplified::ChineseSimplified()	// 中文(简体)
 	addPair("No file to process %s\n", L"没有文件可处理 %s\n");
 	addPair("Did you intend to use --recursive", L"你打算使用 --recursive");
 	addPair("Cannot process UTF-32 encoding", L"不能处理UTF-32编码");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style 已经终止运行");
+	addPair("Artistic Style has terminated\n", L"Artistic Style 已经终止运行\n");
 }
 
 ChineseTraditional::ChineseTraditional()	// 中文(繁體)
@@ -465,18 +479,21 @@ ChineseTraditional::ChineseTraditional()	// 中文(繁體)
 	addPair("Formatted  %s\n", L"格式化  %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"未改變  %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"目錄  %s\n");
+	addPair("Default option file  %s\n", L"默認選項文件  %s\n");
+	addPair("Project option file  %s\n", L"項目選項文件  %s\n");
 	addPair("Exclude  %s\n", L"排除  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"排除(無匹配項)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s 格式化   %s 未改變   ");
 	addPair(" seconds   ", L" ç§’   ");
 	addPair("%d min %d sec   ", L"%d 分 %d 秒   ");
 	addPair("%s lines\n", L"%s 行\n");
-	addPair("Using default options file %s\n", L"使用默認配置文件 %s\n");
 	addPair("Opening HTML documentation %s\n", L"打開HTML文檔 %s\n");
-	addPair("Invalid option file options:", L"無效的配置文件選項:");
+	addPair("Invalid default options:", L"默認選項無效:");
+	addPair("Invalid project options:", L"項目選項無效:");
 	addPair("Invalid command line options:", L"無效的命令行選項:");
 	addPair("For help on options type 'astyle -h'", L"輸入'astyle -h'以獲得有關命令行的幫助:");
-	addPair("Cannot open options file", L"無法打開配置文件");
+	addPair("Cannot open default option file", L"無法打開默認選項文件");
+	addPair("Cannot open project option file", L"無法打開項目選項文件");
 	addPair("Cannot open directory", L"無法打開目錄");
 	addPair("Cannot open HTML file %s\n", L"無法打開HTML文件 %s\n");
 	addPair("Command execute failure", L"執行命令失敗");
@@ -487,7 +504,7 @@ ChineseTraditional::ChineseTraditional()	// 中文(繁體)
 	addPair("No file to process %s\n", L"沒有文件可處理 %s\n");
 	addPair("Did you intend to use --recursive", L"你打算使用 --recursive");
 	addPair("Cannot process UTF-32 encoding", L"不能處理UTF-32編碼");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style 已經終止運行");
+	addPair("Artistic Style has terminated\n", L"Artistic Style 已經終止運行\n");
 }
 
 Dutch::Dutch()	// Nederlandse
@@ -496,18 +513,21 @@ Dutch::Dutch()	// Nederlandse
 	addPair("Formatted  %s\n", L"Geformatteerd  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Onveranderd    %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Directory  %s\n");
+	addPair("Default option file  %s\n", L"Standaard optie bestand  %s\n");
+	addPair("Project option file  %s\n", L"Project optie bestand  %s\n");
 	addPair("Exclude  %s\n", L"Uitsluiten  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Uitgesloten (ongeëvenaarde)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s geformatteerd   %s onveranderd   ");
 	addPair(" seconds   ", L" seconden   ");
 	addPair("%d min %d sec   ", L"%d min %d sec   ");
 	addPair("%s lines\n", L"%s lijnen\n");
-	addPair("Using default options file %s\n", L"Met behulp van standaard opties bestand %s\n");
 	addPair("Opening HTML documentation %s\n", L"Het openen van HTML-documentatie %s\n");
-	addPair("Invalid option file options:", L"Ongeldige optie file opties:");
+	addPair("Invalid default options:", L"Ongeldige standaardopties:");
+	addPair("Invalid project options:", L"Ongeldige projectopties:");
 	addPair("Invalid command line options:", L"Ongeldige command line opties:");
 	addPair("For help on options type 'astyle -h'", L"Voor hulp bij 'astyle-h' opties het type");
-	addPair("Cannot open options file", L"Kan niet worden geopend options bestand");
+	addPair("Cannot open default option file", L"Kan het standaardoptiesbestand niet openen");
+	addPair("Cannot open project option file", L"Kan het project optie bestand niet openen");
 	addPair("Cannot open directory", L"Kan niet open directory");
 	addPair("Cannot open HTML file %s\n", L"Kan HTML-bestand niet openen %s\n");
 	addPair("Command execute failure", L"Voeren commando falen");
@@ -518,7 +538,7 @@ Dutch::Dutch()	// Nederlandse
 	addPair("No file to process %s\n", L"Geen bestand te verwerken %s\n");
 	addPair("Did you intend to use --recursive", L"Hebt u van plan bent te gebruiken --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Kan niet verwerken UTF-32 codering");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style heeft beëindigd");
+	addPair("Artistic Style has terminated\n", L"Artistic Style heeft beëindigd\n");
 }
 
 English::English()
@@ -531,18 +551,21 @@ Estonian::Estonian()	// Eesti
 	addPair("Formatted  %s\n", L"Formaadis  %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"Muutumatu  %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"Kataloog  %s\n");
+	addPair("Default option file  %s\n", L"Vaikefunktsioonifail  %s\n");
+	addPair("Project option file  %s\n", L"Projekti valiku fail  %s\n");
 	addPair("Exclude  %s\n", L"Välista  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Välista (tasakaalustamata)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formaadis   %s muutumatu   ");
 	addPair(" seconds   ", L" sekundit   ");
 	addPair("%d min %d sec   ", L"%d min %d sek   ");
 	addPair("%s lines\n", L"%s read\n");
-	addPair("Using default options file %s\n", L"Kasutades selliseid vaikimisi valikuid faili %s\n");
 	addPair("Opening HTML documentation %s\n", L"Avamine HTML dokumentatsioon %s\n");
-	addPair("Invalid option file options:", L"Vale valik faili võimalusi:");
+	addPair("Invalid default options:", L"Vaikevalikud on sobimatud:");
+	addPair("Invalid project options:", L"Projekti valikud on sobimatud:");
 	addPair("Invalid command line options:", L"Vale käsureavõtmetega:");
 	addPair("For help on options type 'astyle -h'", L"Abiks võimaluste tüüp 'astyle -h'");
-	addPair("Cannot open options file", L"Ei saa avada võimalusi faili");
+	addPair("Cannot open default option file", L"Vaikimisi valitud faili ei saa avada");
+	addPair("Cannot open project option file", L"Projektivaliku faili ei saa avada");
 	addPair("Cannot open directory", L"Ei saa avada kataloogi");
 	addPair("Cannot open HTML file %s\n", L"Ei saa avada HTML-faili %s\n");
 	addPair("Command execute failure", L"Käsk täita rike");
@@ -553,7 +576,7 @@ Estonian::Estonian()	// Eesti
 	addPair("No file to process %s\n", L"No faili töötlema %s\n");
 	addPair("Did you intend to use --recursive", L"Kas te kavatsete kasutada --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Ei saa töödelda UTF-32 kodeeringus");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style on lõpetatud");
+	addPair("Artistic Style has terminated\n", L"Artistic Style on lõpetatud\n");
 }
 
 Finnish::Finnish()	// Suomeksi
@@ -562,18 +585,21 @@ Finnish::Finnish()	// Suomeksi
 	addPair("Formatted  %s\n", L"Muotoiltu  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Ennallaan  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Directory  %s\n");
+	addPair("Default option file  %s\n", L"Oletusasetustiedosto  %s\n");
+	addPair("Project option file  %s\n", L"Projektin valintatiedosto  %s\n");
 	addPair("Exclude  %s\n", L"Sulkea  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Sulkea (verraton)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s muotoiltu   %s ennallaan   ");
 	addPair(" seconds   ", L" sekuntia   ");
 	addPair("%d min %d sec   ", L"%d min %d sek   ");
 	addPair("%s lines\n", L"%s linjat\n");
-	addPair("Using default options file %s\n", L"Käyttämällä oletusasetuksia tiedosto %s\n");
 	addPair("Opening HTML documentation %s\n", L"Avaaminen HTML asiakirjat %s\n");
-	addPair("Invalid option file options:", L"Virheellinen vaihtoehto tiedosto vaihtoehtoja:");
+	addPair("Invalid default options:", L"Virheelliset oletusasetukset:");
+	addPair("Invalid project options:", L"Virheelliset hankevalinnat:");
 	addPair("Invalid command line options:", L"Virheellinen komentorivin:");
 	addPair("For help on options type 'astyle -h'", L"Apua vaihtoehdoista tyyppi 'astyle -h'");
-	addPair("Cannot open options file", L"Ei voi avata vaihtoehtoja tiedostoa");
+	addPair("Cannot open default option file", L"Et voi avata oletusasetustiedostoa");
+	addPair("Cannot open project option file", L"Projektin asetustiedostoa ei voi avata");
 	addPair("Cannot open directory", L"Ei Open Directory");
 	addPair("Cannot open HTML file %s\n", L"Ei voi avata HTML-tiedoston %s\n");
 	addPair("Command execute failure", L"Suorita komento vika");
@@ -584,7 +610,7 @@ Finnish::Finnish()	// Suomeksi
 	addPair("No file to process %s\n", L"Ei tiedostoa käsitellä %s\n");
 	addPair("Did you intend to use --recursive", L"Oliko aiot käyttää --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Ei voi käsitellä UTF-32 koodausta");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style on päättynyt");
+	addPair("Artistic Style has terminated\n", L"Artistic Style on päättynyt\n");
 }
 
 French::French()	// Française
@@ -593,18 +619,21 @@ French::French()	// Française
 	addPair("Formatted  %s\n", L"Formaté    %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Inchangée  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Répertoire  %s\n");
+	addPair("Default option file  %s\n", L"Fichier d'option par défaut  %s\n");
+	addPair("Project option file  %s\n", L"Fichier d'option de projet  %s\n");
 	addPair("Exclude  %s\n", L"Exclure  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Exclure (non appariés)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formaté   %s inchangée   ");
 	addPair(" seconds   ", L" seconde   ");
 	addPair("%d min %d sec   ", L"%d min %d sec   ");
 	addPair("%s lines\n", L"%s lignes\n");
-	addPair("Using default options file %s\n", L"Options par défaut utilisation du fichier %s\n");
 	addPair("Opening HTML documentation %s\n", L"Ouverture documentation HTML %s\n");
-	addPair("Invalid option file options:", L"Options Blancs option du fichier:");
+	addPair("Invalid default options:", L"Options par défaut invalides:");
+	addPair("Invalid project options:", L"Options de projet non valides:");
 	addPair("Invalid command line options:", L"Blancs options ligne de commande:");
 	addPair("For help on options type 'astyle -h'", L"Pour de l'aide sur les options tapez 'astyle -h'");
-	addPair("Cannot open options file", L"Impossible d'ouvrir le fichier d'options");
+	addPair("Cannot open default option file", L"Impossible d'ouvrir le fichier d'option par défaut");
+	addPair("Cannot open project option file", L"Impossible d'ouvrir le fichier d'option de projet");
 	addPair("Cannot open directory", L"Impossible d'ouvrir le répertoire");
 	addPair("Cannot open HTML file %s\n", L"Impossible d'ouvrir le fichier HTML %s\n");
 	addPair("Command execute failure", L"Exécuter échec de la commande");
@@ -615,7 +644,7 @@ French::French()	// Française
 	addPair("No file to process %s\n", L"Aucun fichier à traiter %s\n");
 	addPair("Did you intend to use --recursive", L"Avez-vous l'intention d'utiliser --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Impossible de traiter codage UTF-32");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style a mis fin");
+	addPair("Artistic Style has terminated\n", L"Artistic Style a mis fin\n");
 }
 
 German::German()	// Deutsch
@@ -624,18 +653,21 @@ German::German()	// Deutsch
 	addPair("Formatted  %s\n", L"Formatiert   %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Unverändert  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Verzeichnis  %s\n");
+	addPair("Default option file  %s\n", L"Standard-Optionsdatei  %s\n");
+	addPair("Project option file  %s\n", L"Projektoptionsdatei  %s\n");
 	addPair("Exclude  %s\n", L"Ausschließen  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Ausschließen (unerreichte)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formatiert   %s unverändert   ");
 	addPair(" seconds   ", L" sekunden   ");
 	addPair("%d min %d sec   ", L"%d min %d sek   ");
 	addPair("%s lines\n", L"%s linien\n");
-	addPair("Using default options file %s\n", L"Mit Standard-Optionen Dat %s\n");
 	addPair("Opening HTML documentation %s\n", L"Öffnen HTML-Dokumentation %s\n");
-	addPair("Invalid option file options:", L"Ungültige Option Datei-Optionen:");
+	addPair("Invalid default options:", L"Ungültige Standardoptionen:");
+	addPair("Invalid project options:", L"Ungültige Projektoptionen:");
 	addPair("Invalid command line options:", L"Ungültige Kommandozeilen-Optionen:");
 	addPair("For help on options type 'astyle -h'", L"Für Hilfe zu den Optionen geben Sie 'astyle -h'");
-	addPair("Cannot open options file", L"Kann nicht geöffnet werden Optionsdatei");
+	addPair("Cannot open default option file", L"Die Standardoptionsdatei kann nicht geöffnet werden");
+	addPair("Cannot open project option file", L"Die Projektoptionsdatei kann nicht geöffnet werden");
 	addPair("Cannot open directory", L"Kann nicht geöffnet werden Verzeichnis");
 	addPair("Cannot open HTML file %s\n", L"Kann nicht öffnen HTML-Datei %s\n");
 	addPair("Command execute failure", L"Execute Befehl Scheitern");
@@ -646,7 +678,7 @@ German::German()	// Deutsch
 	addPair("No file to process %s\n", L"Keine Datei zu verarbeiten %s\n");
 	addPair("Did you intend to use --recursive", L"Haben Sie verwenden möchten --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Nicht verarbeiten kann UTF-32 Codierung");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style ist beendet");
+	addPair("Artistic Style has terminated\n", L"Artistic Style ist beendet\n");
 }
 
 Greek::Greek()	// ελληνικά
@@ -655,18 +687,21 @@ Greek::Greek()	// ελληνικά
 	addPair("Formatted  %s\n", L"Διαμορφωμένη  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Αμετάβλητος   %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Κατάλογος  %s\n");
+	addPair("Default option file  %s\n", L"Προεπιλεγμένο αρχείο επιλογών  %s\n");
+	addPair("Project option file  %s\n", L"Αρχείο επιλογής έργου  %s\n");
 	addPair("Exclude  %s\n", L"Αποκλείω  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Ausschließen (unerreichte)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s σχηματοποιημένη   %s αμετάβλητες   ");
 	addPair(" seconds   ", L" δευτερόλεπτα   ");
 	addPair("%d min %d sec   ", L"%d λεπ %d δευ   ");
 	addPair("%s lines\n", L"%s γραμμές\n");
-	addPair("Using default options file %s\n", L"Χρησιμοποιώντας το αρχείο προεπιλεγμένες επιλογές %s\n");
 	addPair("Opening HTML documentation %s\n", L"Εγκαίνια έγγραφα HTML %s\n");
-	addPair("Invalid option file options:", L"Μη έγκυρες επιλογές αρχείου επιλογή:");
+	addPair("Invalid default options:", L"Μη έγκυρες επιλογές προεπιλογής:");
+	addPair("Invalid project options:", L"Μη έγκυρες επιλογές έργου:");
 	addPair("Invalid command line options:", L"Μη έγκυρη επιλογές γραμμής εντολών:");
 	addPair("For help on options type 'astyle -h'", L"Για βοήθεια σχετικά με το είδος επιλογές 'astyle -h'");
-	addPair("Cannot open options file", L"Δεν μπορείτε να ανοίξετε το αρχείο επιλογών");
+	addPair("Cannot open default option file", L"Δεν είναι δυνατό να ανοίξει το προεπιλεγμένο αρχείο επιλογών");
+	addPair("Cannot open project option file", L"Δεν είναι δυνατό να ανοίξει το αρχείο επιλογής έργου");
 	addPair("Cannot open directory", L"Δεν μπορείτε να ανοίξετε τον κατάλογο");
 	addPair("Cannot open HTML file %s\n", L"Δεν μπορείτε να ανοίξετε το αρχείο HTML %s\n");
 	addPair("Command execute failure", L"Εντολή να εκτελέσει την αποτυχία");
@@ -677,7 +712,7 @@ Greek::Greek()	// ελληνικά
 	addPair("No file to process %s\n", L"Δεν υπάρχει αρχείο για την επεξεργασία %s\n");
 	addPair("Did you intend to use --recursive", L"Μήπως σκοπεύετε να χρησιμοποιήσετε --recursive");
 	addPair("Cannot process UTF-32 encoding", L"δεν μπορεί να επεξεργαστεί UTF-32 κωδικοποίηση");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style έχει λήξει");
+	addPair("Artistic Style has terminated\n", L"Artistic Style έχει λήξει\n");
 }
 
 Hindi::Hindi()	// हिन्दी
@@ -688,18 +723,21 @@ Hindi::Hindi()	// हिन्दी
 	addPair("Formatted  %s\n", L"स्वरूपित किया  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"अपरिवर्तित     %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"निर्देशिका  %s\n");
+	addPair("Default option file  %s\n", L"डिफ़ॉल्ट विकल्प फ़ाइल  %s\n");
+	addPair("Project option file  %s\n", L"प्रोजेक्ट विकल्प फ़ाइल  %s\n");
 	addPair("Exclude  %s\n", L"निकालना  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"अपवर्जित (बेजोड़)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s स्वरूपित किया   %s अपरिवर्तित   ");
 	addPair(" seconds   ", L" सेकंड   ");
 	addPair("%d min %d sec   ", L"%d मिनट %d सेकंड   ");
 	addPair("%s lines\n", L"%s लाइनों\n");
-	addPair("Using default options file %s\n", L"डिफ़ॉल्ट विकल्प का उपयोग कर फ़ाइल %s\n");
 	addPair("Opening HTML documentation %s\n", L"एचटीएमएल प्रलेखन खोलना %s\n");
-	addPair("Invalid option file options:", L"अवैध विकल्प फ़ाइल विकल्प हैं:");
+	addPair("Invalid default options:", L"अमान्य डिफ़ॉल्ट विकल्प:");
+	addPair("Invalid project options:", L"अमान्य प्रोजेक्ट विकल्प:");
 	addPair("Invalid command line options:", L"कमांड लाइन विकल्प अवैध:");
 	addPair("For help on options type 'astyle -h'", L"विकल्पों पर मदद के लिए प्रकार 'astyle -h'");
-	addPair("Cannot open options file", L"विकल्प फ़ाइल नहीं खोल सकता है");
+	addPair("Cannot open default option file", L"डिफ़ॉल्ट विकल्प फ़ाइल नहीं खोल सकता");
+	addPair("Cannot open project option file", L"परियोजना विकल्प फ़ाइल नहीं खोल सकता");
 	addPair("Cannot open directory", L"निर्देशिका नहीं खोल सकता");
 	addPair("Cannot open HTML file %s\n", L"HTML फ़ाइल नहीं खोल सकता %s\n");
 	addPair("Command execute failure", L"आदेश विफलता निष्पादित");
@@ -710,7 +748,7 @@ Hindi::Hindi()	// हिन्दी
 	addPair("No file to process %s\n", L"कोई फ़ाइल %s प्रक्रिया के लिए\n");
 	addPair("Did you intend to use --recursive", L"क्या आप उपयोग करना चाहते हैं --recursive");
 	addPair("Cannot process UTF-32 encoding", L"UTF-32 कूटबन्धन प्रक्रिया नहीं कर सकते");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style समाप्त किया है");
+	addPair("Artistic Style has terminated\n", L"Artistic Style समाप्त किया है\n");
 }
 
 Hungarian::Hungarian()	// Magyar
@@ -719,18 +757,21 @@ Hungarian::Hungarian()	// Magyar
 	addPair("Formatted  %s\n", L"Formázott    %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Változatlan  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Címjegyzék  %s\n");
+	addPair("Default option file  %s\n", L"Alapértelmezett beállítási fájl  %s\n");
+	addPair("Project option file  %s\n", L"Projekt opciófájl  %s\n");
 	addPair("Exclude  %s\n", L"Kizár  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Escludere (senza pari)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formázott   %s változatlan   ");
 	addPair(" seconds   ", L" másodperc   ");
 	addPair("%d min %d sec   ", L"%d jeg %d más   ");
 	addPair("%s lines\n", L"%s vonalak\n");
-	addPair("Using default options file %s\n", L"Az alapértelmezett beállítások fájl %s\n");
 	addPair("Opening HTML documentation %s\n", L"Nyitó HTML dokumentáció %s\n");
-	addPair("Invalid option file options:", L"Érvénytelen opció fájlbeállítást:");
+	addPair("Invalid default options:", L"Érvénytelen alapértelmezett beállítások:");
+	addPair("Invalid project options:", L"Érvénytelen projektbeállítások:");
 	addPair("Invalid command line options:", L"Érvénytelen parancssori opciók:");
 	addPair("For help on options type 'astyle -h'", L"Ha segítségre van lehetőség típus 'astyle-h'");
-	addPair("Cannot open options file", L"Nem lehet megnyitni beállítási fájlban");
+	addPair("Cannot open default option file", L"Nem lehet megnyitni az alapértelmezett beállítási fájlt");
+	addPair("Cannot open project option file", L"Nem lehet megnyitni a projekt opció fájlt");
 	addPair("Cannot open directory", L"Nem lehet megnyitni könyvtár");
 	addPair("Cannot open HTML file %s\n", L"Nem lehet megnyitni a HTML fájlt %s\n");
 	addPair("Command execute failure", L"Command végre hiba");
@@ -741,7 +782,7 @@ Hungarian::Hungarian()	// Magyar
 	addPair("No file to process %s\n", L"Nincs fájl feldolgozása %s\n");
 	addPair("Did you intend to use --recursive", L"Esetleg a használni kívánt --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Nem tudja feldolgozni UTF-32 kódolással");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style megszűnt");
+	addPair("Artistic Style has terminated\n", L"Artistic Style megszűnt\n");
 }
 
 Italian::Italian()	// Italiano
@@ -750,18 +791,21 @@ Italian::Italian()	// Italiano
 	addPair("Formatted  %s\n", L"Formattata  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Immutato    %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Elenco  %s\n");
+	addPair("Default option file  %s\n", L"File di opzione predefinito  %s\n");
+	addPair("Project option file  %s\n", L"File di opzione del progetto  %s\n");
 	addPair("Exclude  %s\n", L"Escludere  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Escludere (senza pari)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s ormattata   %s immutato   ");
 	addPair(" seconds   ", L" secondo   ");
 	addPair("%d min %d sec   ", L"%d min %d seg   ");
 	addPair("%s lines\n", L"%s linee\n");
-	addPair("Using default options file %s\n", L"Utilizzando file delle opzioni di default %s\n");
 	addPair("Opening HTML documentation %s\n", L"Apertura di documenti HTML %s\n");
-	addPair("Invalid option file options:", L"Opzione non valida file delle opzioni:");
+	addPair("Invalid default options:", L"Opzioni di default non valide:");
+	addPair("Invalid project options:", L"Opzioni di progetto non valide:");
 	addPair("Invalid command line options:", L"Opzioni della riga di comando non valido:");
 	addPair("For help on options type 'astyle -h'", L"Per informazioni sulle opzioni di tipo 'astyle-h'");
-	addPair("Cannot open options file", L"Impossibile aprire il file opzioni");
+	addPair("Cannot open default option file", L"Impossibile aprire il file di opzione predefinito");
+	addPair("Cannot open project option file", L"Impossibile aprire il file di opzione del progetto");
 	addPair("Cannot open directory", L"Impossibile aprire la directory");
 	addPair("Cannot open HTML file %s\n", L"Impossibile aprire il file HTML %s\n");
 	addPair("Command execute failure", L"Esegui fallimento comando");
@@ -772,7 +816,7 @@ Italian::Italian()	// Italiano
 	addPair("No file to process %s\n", L"Nessun file al processo %s\n");
 	addPair("Did you intend to use --recursive", L"Hai intenzione di utilizzare --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Non è possibile processo di codifica UTF-32");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style ha terminato");
+	addPair("Artistic Style has terminated\n", L"Artistic Style ha terminato\n");
 }
 
 Japanese::Japanese()	// 日本語
@@ -781,18 +825,21 @@ Japanese::Japanese()	// 日本語
 	addPair("Formatted  %s\n", L"フォーマット済みの  %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"変わりません        %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"ディレクトリ  %s\n");
+	addPair("Default option file  %s\n", L"デフォルトオプションファイル  %s\n");
+	addPair("Project option file  %s\n", L"プロジェクトオプションファイル  %s\n");
 	addPair("Exclude  %s\n", L"除外する  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"除外する(一致しません)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s フフォーマット済みの   %s 変わりません   ");
 	addPair(" seconds   ", L" ç§’   ");
 	addPair("%d min %d sec   ", L"%d 分 %d 秒   ");
 	addPair("%s lines\n", L"%s ライン\n");
-	addPair("Using default options file %s\n", L"デフォルトのオプションファイルを使用して、 %s\n");
 	addPair("Opening HTML documentation %s\n", L"オープニングHTMLドキュメント %s\n");
-	addPair("Invalid option file options:", L"無効なオプションファイルのオプション:");
+	addPair("Invalid default options:", L"無効なデフォルトオプション:");
+	addPair("Invalid project options:", L"無効なプロジェクトオプション:");
 	addPair("Invalid command line options:", L"無効なコマンドラインオプション:");
 	addPair("For help on options type 'astyle -h'", L"コオプションの種類のヘルプについて'astyle- h'を入力してください");
-	addPair("Cannot open options file", L"オプションファイルを開くことができません");
+	addPair("Cannot open default option file", L"デフォルトのオプションファイルを開くことができません");
+	addPair("Cannot open project option file", L"プロジェクトオプションファイルを開くことができません");
 	addPair("Cannot open directory", L"ディレクトリを開くことができません。");
 	addPair("Cannot open HTML file %s\n", L"HTMLファイルを開くことができません %s\n");
 	addPair("Command execute failure", L"コマンドが失敗を実行します");
@@ -803,7 +850,7 @@ Japanese::Japanese()	// 日本語
 	addPair("No file to process %s\n", L"いいえファイルは処理しないように %s\n");
 	addPair("Did you intend to use --recursive", L"あなたは--recursive使用するつもりでした");
 	addPair("Cannot process UTF-32 encoding", L"UTF - 32エンコーディングを処理できません");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style 終了しました");
+	addPair("Artistic Style has terminated\n", L"Artistic Style 終了しました\n");
 }
 
 Korean::Korean()	// 한국의
@@ -812,18 +859,21 @@ Korean::Korean()	// 한국의
 	addPair("Formatted  %s\n", L"수정됨    %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"변경없음  %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"디렉토리  %s\n");
+	addPair("Default option file  %s\n", L"기본 옵션 파일  %s\n");
+	addPair("Project option file  %s\n", L"프로젝트 옵션 파일  %s\n");
 	addPair("Exclude  %s\n", L"제외됨  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"제외 (NO 일치)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s 수정됨   %s 변경없음   ");
 	addPair(" seconds   ", L" ì´ˆ   ");
 	addPair("%d min %d sec   ", L"%d ë¶„ %d ì´ˆ   ");
 	addPair("%s lines\n", L"%s 라인\n");
-	addPair("Using default options file %s\n", L"기본 구성 파일을 사용 %s\n");
 	addPair("Opening HTML documentation %s\n", L"HTML 문서를 열기 %s\n");
-	addPair("Invalid option file options:", L"잘못된 구성 파일 옵션 :");
+	addPair("Invalid default options:", L"잘못된 기본 옵션:");
+	addPair("Invalid project options:", L"잘못된 프로젝트 옵션:");
 	addPair("Invalid command line options:", L"잘못된 명령줄 옵션 :");
 	addPair("For help on options type 'astyle -h'", L"도움말을 보려면 옵션 유형 'astyle - H'를 사용합니다");
-	addPair("Cannot open options file", L"구성 파일을 열 수 없습니다");
+	addPair("Cannot open default option file", L"기본 옵션 파일을 열 수 없습니다.");
+	addPair("Cannot open project option file", L"프로젝트 옵션 파일을 열 수 없습니다.");
 	addPair("Cannot open directory", L"디렉토리를 열지 못했습니다");
 	addPair("Cannot open HTML file %s\n", L"HTML 파일을 열 수 없습니다 %s\n");
 	addPair("Command execute failure", L"명령 실패를 실행");
@@ -834,7 +884,7 @@ Korean::Korean()	// 한국의
 	addPair("No file to process %s\n", L"처리할 파일이 없습니다 %s\n");
 	addPair("Did you intend to use --recursive", L"--recursive 를 사용하고자 하십니까");
 	addPair("Cannot process UTF-32 encoding", L"UTF-32 인코딩을 처리할 수 없습니다");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style를 종료합니다");
+	addPair("Artistic Style has terminated\n", L"Artistic Style를 종료합니다\n");
 }
 
 Norwegian::Norwegian()	// Norsk
@@ -843,18 +893,21 @@ Norwegian::Norwegian()	// Norsk
 	addPair("Formatted  %s\n", L"Formatert  %s\n");		// should align with unchanged
 	addPair("Unchanged  %s\n", L"Uendret    %s\n");		// should align with formatted
 	addPair("Directory  %s\n", L"Katalog  %s\n");
+	addPair("Default option file  %s\n", L"Standard alternativfil  %s\n");
+	addPair("Project option file  %s\n", L"Prosjekt opsjonsfil  %s\n");
 	addPair("Exclude  %s\n", L"Ekskluder  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Ekskluder (uovertruffen)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formatert   %s uendret   ");
 	addPair(" seconds   ", L" sekunder   ");
 	addPair("%d min %d sec   ", L"%d min %d sek?   ");
 	addPair("%s lines\n", L"%s linjer\n");
-	addPair("Using default options file %s\n", L"Ved hjelp av standardalternativer fil %s\n");
 	addPair("Opening HTML documentation %s\n", L"Ã…pning HTML dokumentasjon %s\n");
-	addPair("Invalid option file options:", L"Ugyldige alternativ filalternativer:");
+	addPair("Invalid default options:", L"Ugyldige standardalternativer:");
+	addPair("Invalid project options:", L"Ugyldige prosjektalternativer:");
 	addPair("Invalid command line options:", L"Kommandolinjevalg Ugyldige:");
 	addPair("For help on options type 'astyle -h'", L"For hjelp til alternativer type 'astyle -h'");
-	addPair("Cannot open options file", L"Kan ikke åpne alternativer fil");
+	addPair("Cannot open default option file", L"Kan ikke åpne standardvalgsfilen");
+	addPair("Cannot open project option file", L"Kan ikke åpne prosjektvalgsfilen");
 	addPair("Cannot open directory", L"Kan ikke åpne katalog");
 	addPair("Cannot open HTML file %s\n", L"Kan ikke åpne HTML-fil %s\n");
 	addPair("Command execute failure", L"Command utføre svikt");
@@ -865,7 +918,7 @@ Norwegian::Norwegian()	// Norsk
 	addPair("No file to process %s\n", L"Ingen fil å behandle %s\n");
 	addPair("Did you intend to use --recursive", L"Har du tenkt å bruke --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Kan ikke behandle UTF-32 koding");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style har avsluttet");
+	addPair("Artistic Style has terminated\n", L"Artistic Style har avsluttet\n");
 }
 
 Polish::Polish()	// Polski
@@ -874,18 +927,21 @@ Polish::Polish()	// Polski
 	addPair("Formatted  %s\n", L"Sformatowany  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Niezmienione  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Katalog  %s\n");
+	addPair("Default option file  %s\n", L"Domyślny plik opcji  %s\n");
+	addPair("Project option file  %s\n", L"Plik opcji projektu  %s\n");
 	addPair("Exclude  %s\n", L"Wykluczać  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Wyklucz (niezrównany)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s sformatowany   %s niezmienione   ");
 	addPair(" seconds   ", L" sekund   ");
 	addPair("%d min %d sec   ", L"%d min %d sek   ");
 	addPair("%s lines\n", L"%s linii\n");
-	addPair("Using default options file %s\n", L"Korzystanie z domyślnej opcji %s plik\n");
 	addPair("Opening HTML documentation %s\n", L"Otwarcie dokumentacji HTML %s\n");
-	addPair("Invalid option file options:", L"Nieprawidłowy opcji pliku opcji:");
+	addPair("Invalid default options:", L"Nieprawidłowe opcje domyślne:");
+	addPair("Invalid project options:", L"Nieprawidłowe opcje projektu:");
 	addPair("Invalid command line options:", L"Nieprawidłowe opcje wiersza polecenia:");
 	addPair("For help on options type 'astyle -h'", L"Aby uzyskać pomoc od rodzaju opcji 'astyle -h'");
-	addPair("Cannot open options file", L"Nie można otworzyć pliku opcji");
+	addPair("Cannot open default option file", L"Nie można otworzyć pliku opcji domyślnych");
+	addPair("Cannot open project option file", L"Nie można otworzyć pliku opcji projektu");
 	addPair("Cannot open directory", L"Nie można otworzyć katalogu");
 	addPair("Cannot open HTML file %s\n", L"Nie można otworzyć pliku HTML %s\n");
 	addPair("Command execute failure", L"Wykonaj polecenia niepowodzenia");
@@ -896,7 +952,7 @@ Polish::Polish()	// Polski
 	addPair("No file to process %s\n", L"Brak pliku do procesu %s\n");
 	addPair("Did you intend to use --recursive", L"Czy masz zamiar używać --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Nie można procesu kodowania UTF-32");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style został zakończony");
+	addPair("Artistic Style has terminated\n", L"Artistic Style został zakończony\n");
 }
 
 Portuguese::Portuguese()	// Português
@@ -905,18 +961,21 @@ Portuguese::Portuguese()	// Português
 	addPair("Formatted  %s\n", L"Formatado   %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Inalterado  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Diretório  %s\n");
+	addPair("Default option file  %s\n", L"Arquivo de opção padrão  %s\n");
+	addPair("Project option file  %s\n", L"Arquivo de opção de projeto  %s\n");
 	addPair("Exclude  %s\n", L"Excluir  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Excluir (incomparável)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formatado   %s inalterado   ");
 	addPair(" seconds   ", L" segundo   ");
 	addPair("%d min %d sec   ", L"%d min %d seg   ");
 	addPair("%s lines\n", L"%s linhas\n");
-	addPair("Using default options file %s\n", L"Usando o arquivo de opções padrão %s\n");
 	addPair("Opening HTML documentation %s\n", L"Abrindo a documentação HTML %s\n");
-	addPair("Invalid option file options:", L"Opções de arquivo inválido opção:");
+	addPair("Invalid default options:", L"Opções padrão inválidas:");
+	addPair("Invalid project options:", L"Opções de projeto inválidas:");
 	addPair("Invalid command line options:", L"Opções de linha de comando inválida:");
 	addPair("For help on options type 'astyle -h'", L"Para obter ajuda sobre as opções de tipo 'astyle -h'");
-	addPair("Cannot open options file", L"Não é possível abrir arquivo de opções");
+	addPair("Cannot open default option file", L"Não é possível abrir o arquivo de opção padrão");
+	addPair("Cannot open project option file", L"Não é possível abrir o arquivo de opção do projeto");
 	addPair("Cannot open directory", L"Não é possível abrir diretório");
 	addPair("Cannot open HTML file %s\n", L"Não é possível abrir arquivo HTML %s\n");
 	addPair("Command execute failure", L"Executar falha de comando");
@@ -927,7 +986,7 @@ Portuguese::Portuguese()	// Português
 	addPair("No file to process %s\n", L"Nenhum arquivo para processar %s\n");
 	addPair("Did you intend to use --recursive", L"Será que você pretende usar --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Não pode processar a codificação UTF-32");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style terminou");
+	addPair("Artistic Style has terminated\n", L"Artistic Style terminou\n");
 }
 
 Romanian::Romanian()	// Română
@@ -936,18 +995,21 @@ Romanian::Romanian()	// Română
 	addPair("Formatted  %s\n", L"Formatat    %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Neschimbat  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Director  %s\n");
+	addPair("Default option file  %s\n", L"Fișier opțional implicit  %s\n");
+	addPair("Project option file  %s\n", L"Fișier opțiune proiect  %s\n");
 	addPair("Exclude  %s\n", L"Excludeți  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Excludeți (necompensată)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formatat   %s neschimbat   ");
 	addPair(" seconds   ", L" secunde   ");
 	addPair("%d min %d sec   ", L"%d min %d sec   ");
 	addPair("%s lines\n", L"%s linii\n");
-	addPair("Using default options file %s\n", L"Fișier folosind opțiunile implicite %s\n");
 	addPair("Opening HTML documentation %s\n", L"Documentație HTML deschidere %s\n");
-	addPair("Invalid option file options:", L"Opțiuni de opțiune de fișier nevalide:");
+	addPair("Invalid default options:", L"Opțiuni implicite nevalide:");
+	addPair("Invalid project options:", L"Opțiunile de proiect nevalide:");
 	addPair("Invalid command line options:", L"Opțiuni de linie de comandă nevalide:");
 	addPair("For help on options type 'astyle -h'", L"Pentru ajutor cu privire la tipul de opțiuni 'astyle -h'");
-	addPair("Cannot open options file", L"Nu se poate deschide fișierul de opțiuni");
+	addPair("Cannot open default option file", L"Nu se poate deschide fișierul cu opțiuni implicite");
+	addPair("Cannot open project option file", L"Nu se poate deschide fișierul cu opțiuni de proiect");
 	addPair("Cannot open directory", L"Nu se poate deschide directorul");
 	addPair("Cannot open HTML file %s\n", L"Nu se poate deschide fișierul HTML %s\n");
 	addPair("Command execute failure", L"Comandă executa eșec");
@@ -958,7 +1020,7 @@ Romanian::Romanian()	// Română
 	addPair("No file to process %s\n", L"Nu există un fișier pentru a procesa %s\n");
 	addPair("Did you intend to use --recursive", L"V-ați intenționați să utilizați --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Nu se poate procesa codificarea UTF-32");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style a terminat");
+	addPair("Artistic Style has terminated\n", L"Artistic Style a terminat\n");
 }
 
 Russian::Russian()	// русский
@@ -967,18 +1029,21 @@ Russian::Russian()	// русский
 	addPair("Formatted  %s\n", L"Форматированный  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"без изменений    %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"каталог  %s\n");
+	addPair("Default option file  %s\n", L"Файл с опцией по умолчанию  %s\n");
+	addPair("Project option file  %s\n", L"Файл опций проекта  %s\n");
 	addPair("Exclude  %s\n", L"исключать  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Исключить (непревзойденный)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s Форматированный   %s без изменений   ");
 	addPair(" seconds   ", L" секунды   ");
 	addPair("%d min %d sec   ", L"%d мин %d сек   ");
 	addPair("%s lines\n", L"%s линий\n");
-	addPair("Using default options file %s\n", L"Использование опции по умолчанию файл %s\n");
 	addPair("Opening HTML documentation %s\n", L"Открытие HTML документации %s\n");
-	addPair("Invalid option file options:", L"Недопустимый файл опций опцию:");
+	addPair("Invalid default options:", L"Недействительные параметры по умолчанию:");
+	addPair("Invalid project options:", L"Недопустимые параметры проекта:");
 	addPair("Invalid command line options:", L"Недопустимые параметры командной строки:");
 	addPair("For help on options type 'astyle -h'", L"Для получения справки по 'astyle -h' опций типа");
-	addPair("Cannot open options file", L"Не удается открыть файл параметров");
+	addPair("Cannot open default option file", L"Не удается открыть файл параметров по умолчанию");
+	addPair("Cannot open project option file", L"Не удается открыть файл опций проекта");
 	addPair("Cannot open directory", L"Не могу открыть каталог");
 	addPair("Cannot open HTML file %s\n", L"Не удается открыть файл HTML %s\n");
 	addPair("Command execute failure", L"Выполнить команду недостаточности");
@@ -989,7 +1054,7 @@ Russian::Russian()	// русский
 	addPair("No file to process %s\n", L"Нет файлов для обработки %s\n");
 	addPair("Did you intend to use --recursive", L"Неужели вы собираетесь использовать --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Не удается обработать UTF-32 кодировке");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style прекратил");
+	addPair("Artistic Style has terminated\n", L"Artistic Style прекратил\n");
 }
 
 Spanish::Spanish()	// Español
@@ -998,18 +1063,21 @@ Spanish::Spanish()	// Español
 	addPair("Formatted  %s\n", L"Formato     %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Inalterado  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Directorio  %s\n");
+	addPair("Default option file  %s\n", L"Archivo de opciones predeterminado  %s\n");
+	addPair("Project option file  %s\n", L"Archivo de opciones del proyecto  %s\n");
 	addPair("Exclude  %s\n", L"Excluir  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Excluir (incomparable)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formato   %s inalterado   ");
 	addPair(" seconds   ", L" segundo   ");
 	addPair("%d min %d sec   ", L"%d min %d seg   ");
 	addPair("%s lines\n", L"%s líneas\n");
-	addPair("Using default options file %s\n", L"Uso de las opciones por defecto del archivo %s\n");
 	addPair("Opening HTML documentation %s\n", L"Apertura de documentación HTML %s\n");
-	addPair("Invalid option file options:", L"Opción no válida opciones de archivo:");
+	addPair("Invalid default options:", L"Opciones predeterminadas no válidas:");
+	addPair("Invalid project options:", L"Opciones de proyecto no válidas:");
 	addPair("Invalid command line options:", L"No válido opciones de línea de comando:");
 	addPair("For help on options type 'astyle -h'", L"Para obtener ayuda sobre las opciones tipo 'astyle -h'");
-	addPair("Cannot open options file", L"No se puede abrir el archivo de opciones");
+	addPair("Cannot open default option file", L"No se puede abrir el archivo de opciones predeterminado");
+	addPair("Cannot open project option file", L"No se puede abrir el archivo de opciones del proyecto");
 	addPair("Cannot open directory", L"No se puede abrir el directorio");
 	addPair("Cannot open HTML file %s\n", L"No se puede abrir el archivo HTML %s\n");
 	addPair("Command execute failure", L"Ejecutar el fracaso de comandos");
@@ -1020,7 +1088,7 @@ Spanish::Spanish()	// Español
 	addPair("No file to process %s\n", L"No existe el fichero a procesar %s\n");
 	addPair("Did you intend to use --recursive", L"Se va a utilizar --recursive");
 	addPair("Cannot process UTF-32 encoding", L"No se puede procesar la codificación UTF-32");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style ha terminado");
+	addPair("Artistic Style has terminated\n", L"Artistic Style ha terminado\n");
 }
 
 Swedish::Swedish()	// Svenska
@@ -1029,18 +1097,21 @@ Swedish::Swedish()	// Svenska
 	addPair("Formatted  %s\n", L"Formaterade  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"Oförändrade  %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Katalog  %s\n");
+	addPair("Default option file  %s\n", L"Standardalternativsfil  %s\n");
+	addPair("Project option file  %s\n", L"Projektalternativ fil  %s\n");
 	addPair("Exclude  %s\n", L"Uteslut  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Uteslut (oöverträffad)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s formaterade   %s oförändrade   ");
 	addPair(" seconds   ", L" sekunder   ");
 	addPair("%d min %d sec   ", L"%d min %d sek   ");
 	addPair("%s lines\n", L"%s linjer\n");
-	addPair("Using default options file %s\n", L"Använda standardalternativ fil %s\n");
 	addPair("Opening HTML documentation %s\n", L"Öppna HTML-dokumentation %s\n");
-	addPair("Invalid option file options:", L"Ogiltigt alternativ fil alternativ:");
+	addPair("Invalid default options:", L"Ogiltiga standardalternativ:");
+	addPair("Invalid project options:", L"Ogiltiga projektalternativ:");
 	addPair("Invalid command line options:", L"Ogiltig kommandoraden alternativ:");
 	addPair("For help on options type 'astyle -h'", L"För hjälp om alternativ typ 'astyle -h'");
-	addPair("Cannot open options file", L"Kan inte öppna inställningsfilen");
+	addPair("Cannot open default option file", L"Kan inte öppna standardalternativsfilen");
+	addPair("Cannot open project option file", L"Kan inte öppna projektalternativsfilen");
 	addPair("Cannot open directory", L"Kan inte öppna katalog");
 	addPair("Cannot open HTML file %s\n", L"Kan inte öppna HTML-filen %s\n");
 	addPair("Command execute failure", L"Utför kommando misslyckande");
@@ -1051,7 +1122,7 @@ Swedish::Swedish()	// Svenska
 	addPair("No file to process %s\n", L"Ingen fil att bearbeta %s\n");
 	addPair("Did you intend to use --recursive", L"Har du för avsikt att använda --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Kan inte hantera UTF-32 kodning");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style har upphört");
+	addPair("Artistic Style has terminated\n", L"Artistic Style har upphört\n");
 }
 
 Ukrainian::Ukrainian()	// Український
@@ -1060,18 +1131,21 @@ Ukrainian::Ukrainian()	// Український
 	addPair("Formatted  %s\n", L"форматований  %s\n");	// should align with unchanged
 	addPair("Unchanged  %s\n", L"без змін      %s\n");	// should align with formatted
 	addPair("Directory  %s\n", L"Каталог  %s\n");
+	addPair("Default option file  %s\n", L"Файл параметра за замовчуванням  %s\n");
+	addPair("Project option file  %s\n", L"Файл варіанту проекту  %s\n");
 	addPair("Exclude  %s\n", L"Виключити  %s\n");
 	addPair("Exclude (unmatched)  %s\n", L"Виключити (неперевершений)  %s\n");
 	addPair(" %s formatted   %s unchanged   ", L" %s відформатований   %s без змін   ");
 	addPair(" seconds   ", L" секунди   ");
 	addPair("%d min %d sec   ", L"%d хви %d cek   ");
 	addPair("%s lines\n", L"%s ліній\n");
-	addPair("Using default options file %s\n", L"Використання файлів опцій за замовчуванням %s\n");
 	addPair("Opening HTML documentation %s\n", L"Відкриття HTML документації %s\n");
-	addPair("Invalid option file options:", L"Неприпустимий файл опцій опцію:");
+	addPair("Invalid default options:", L"Недійсні параметри за умовчанням:");
+	addPair("Invalid project options:", L"Недійсні параметри проекту:");
 	addPair("Invalid command line options:", L"Неприпустима параметри командного рядка:");
 	addPair("For help on options type 'astyle -h'", L"Для отримання довідки по 'astyle -h' опцій типу");
-	addPair("Cannot open options file", L"Не вдається відкрити файл параметрів");
+	addPair("Cannot open default option file", L"Неможливо відкрити файл параметрів за замовчуванням");
+	addPair("Cannot open project option file", L"Неможливо відкрити файл параметрів проекту");
 	addPair("Cannot open directory", L"Не можу відкрити каталог");
 	addPair("Cannot open HTML file %s\n", L"Не вдається відкрити файл HTML %s\n");
 	addPair("Command execute failure", L"Виконати команду недостатності");
@@ -1082,7 +1156,7 @@ Ukrainian::Ukrainian()	// Український
 	addPair("No file to process %s\n", L"Немає файлів для обробки %s\n");
 	addPair("Did you intend to use --recursive", L"Невже ви збираєтеся використовувати --recursive");
 	addPair("Cannot process UTF-32 encoding", L"Не вдається обробити UTF-32 кодуванні");
-	addPair("\nArtistic Style has terminated", L"\nArtistic Style припинив");
+	addPair("Artistic Style has terminated\n", L"Artistic Style припинив\n");
 }
 
 
diff --git a/astyle/src/ASLocalizer.h b/astyle/src/ASLocalizer.h
index c62f3a1bf711f2e29466e0a7b7913d9ee0f0cac3..703092b56f301ee4c1cf3b1d045bfb3c8b071738 100755
--- a/astyle/src/ASLocalizer.h
+++ b/astyle/src/ASLocalizer.h
@@ -1,5 +1,5 @@
 // ASLocalizer.h
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -10,6 +10,13 @@
 #include <string>
 #include <vector>
 
+// library builds do not need ASLocalizer
+#ifdef ASTYLE_JNI
+	#ifndef ASTYLE_LIB    // ASTYLE_LIB must be defined for ASTYLE_JNI
+		#define ASTYLE_LIB
+	#endif
+#endif  //  ASTYLE_JNI
+
 namespace astyle {
 
 using namespace std;
@@ -63,6 +70,7 @@ public:
 	Translation() {}
 	virtual ~Translation() {}
 	string convertToMultiByte(const wstring& wideStr) const;
+	string getTranslationString(size_t i) const;
 	size_t getTranslationVectorSize() const;
 	bool getWideTranslation(const string& stringIn, wstring& wideOut) const;
 	string& translate(const string& stringIn) const;
diff --git a/astyle/src/ASResource.cpp b/astyle/src/ASResource.cpp
index 1ded9eb1f84552f9df7171a34359600c03acff04..e2fc7724a3868fd2d9aeca72f3f97a3fd6aa83dc 100755
--- a/astyle/src/ASResource.cpp
+++ b/astyle/src/ASResource.cpp
@@ -1,5 +1,5 @@
 // ASResource.cpp
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -781,6 +781,8 @@ bool ASBase::isCharPotentialHeader(const string& line, size_t i) const
 	char prevCh = ' ';
 	if (i > 0)
 		prevCh = line[i - 1];
+	if (i > 1 && line[i - 2] == '\\')
+		prevCh = ' ';
 	if (!isLegalNameChar(prevCh) && isLegalNameChar(line[i]))
 		return true;
 	return false;
diff --git a/astyle/src/astyle.h b/astyle/src/astyle.h
index 8f30b321a1083de87f14ecd0b6cc32175098bb2c..d886aa6c203b9cf9d09d82d204c12acaadebb442 100755
--- a/astyle/src/astyle.h
+++ b/astyle/src/astyle.h
@@ -1,5 +1,5 @@
 // astyle.h
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -78,7 +78,7 @@ enum FormatStyle
 	STYLE_STROUSTRUP,
 	STYLE_WHITESMITH,
 	STYLE_VTK,
-	STYLE_BANNER,
+	STYLE_RATLIFF,
 	STYLE_GNU,
 	STYLE_LINUX,
 	STYLE_HORSTMANN,
@@ -98,7 +98,7 @@ enum BraceMode
 	RUN_IN_MODE		// broken braces
 };
 
-// maximun value for int is 16,384 (total value of 32,767)
+// maximum value for int is 16,384 (total value of 32,767)
 enum BraceType
 {
 	NULL_TYPE        = 0,
@@ -155,9 +155,10 @@ enum ReferenceAlign
 
 enum FileEncoding
 {
-	ENCODING_8BIT,
+	ENCODING_8BIT,  // includes UTF-8 without BOM
+	UTF_8BOM,       // UTF-8 with BOM
 	UTF_16BE,
-	UTF_16LE,     // Windows default
+	UTF_16LE,       // Windows default
 	UTF_32BE,
 	UTF_32LE
 };
@@ -186,6 +187,7 @@ class ASSourceIterator
 public:
 	ASSourceIterator() {}
 	virtual ~ASSourceIterator() {}
+	virtual streamoff getPeekStart() const = 0;
 	virtual int getStreamLength() const = 0;
 	virtual bool hasMoreLines() const = 0;
 	virtual string nextLine(bool emptyLineWasDeleted = false) = 0;
@@ -426,6 +428,7 @@ private:  // functions
 	int  adjustIndentCountForBreakElseIfComments() const;
 	int  computeObjCColonAlignment(const string& line, int colonAlignPosition) const;
 	int  convertTabToSpaces(int i, int tabIncrementIn) const;
+	int  findObjCColonAlignment(const string& line) const;
 	int  getContinuationIndentAssign(const string& line, size_t currPos) const;
 	int  getContinuationIndentComma(const string& line, size_t currPos) const;
 	int  getObjCFollowingKeyword(const string& line, int bracePos) const;
@@ -433,6 +436,7 @@ private:  // functions
 	bool isLineEndComment(const string& line, int startPos) const;
 	bool isPreprocessorConditionalCplusplus(const string& line) const;
 	bool isInPreprocessorUnterminatedComment(const string& line);
+	bool isTopLevel() const;
 	bool statementEndsWithComma(const string& line, int index) const;
 	const string& getIndentedLineReturn(const string& newLine, const string& originalLine) const;
 	string getIndentedSpaceEquivalent(const string& line_) const;
@@ -458,7 +462,7 @@ private:  // variables
 	vector<int>* activeBeautifierStackLengthStack;
 	vector<const string*>* headerStack;
 	vector<vector<const string*>* >* tempStacks;
-	vector<int>* squareBracketDepthStack;
+	vector<int>* parenDepthStack;
 	vector<bool>* blockStatementStack;
 	vector<bool>* parenStatementStack;
 	vector<bool>* braceBlockStateStack;
@@ -506,6 +510,7 @@ private:  // variables
 	bool isInEnum;
 	bool isInEnumTypeID;
 	bool isInLet;
+	bool isInTrailingReturnType;
 	bool modifierIndent;
 	bool switchIndent;
 	bool caseIndent;
@@ -684,6 +689,10 @@ public:	// functions
 	void setCloseTemplatesMode(bool state);
 	void setCommaPaddingMode(bool state);
 	void setDeleteEmptyLinesMode(bool state);
+	void setBreakReturnType(bool state);
+	void setBreakReturnTypeDecl(bool state);
+	void setAttachReturnType(bool state);
+	void setAttachReturnTypeDecl(bool state);
 	void setIndentCol1CommentsMode(bool state);
 	void setLineEndFormat(LineEndFormat fmt);
 	void setMaxCodeLength(int max);
@@ -703,7 +712,7 @@ public:	// functions
 	size_t getChecksumOut() const;
 	int  getChecksumDiff() const;
 	int  getFormatterFileType() const;
-	// retained for compatability with release 2.06
+	// retained for compatibility with release 2.06
 	// "Brackets" have been changed to "Braces" in 3.0
 	// they are referenced only by the old "bracket" options
 	void setAddBracketsMode(bool state);
@@ -743,10 +752,12 @@ private:  // functions
 	bool isMultiStatementLine() const;
 	bool isNextWordSharpNonParenHeader(int startChar) const;
 	bool isNonInStatementArrayBrace() const;
+	bool isNumericVariable(string word) const;
 	bool isOkToSplitFormattedLine();
 	bool isPointerOrReference() const;
 	bool isPointerOrReferenceCentered() const;
 	bool isPointerOrReferenceVariable(const string& word) const;
+	bool isPointerToPointer(const string& line, int currPos) const;
 	bool isSharpStyleWithParen(const string* header) const;
 	bool isStructAccessModified(const string& firstLine, size_t index) const;
 	bool isIndentablePreprocessorBlock(const string& firstLine, size_t index);
@@ -780,6 +791,7 @@ private:  // functions
 	void clearFormattedLineSplitPoints();
 	void convertTabToSpaces();
 	void deleteContainer(vector<BraceType>*& container);
+	void findReturnTypeSplitPoint(const string& firstLine);
 	void formatArrayRunIn();
 	void formatRunIn();
 	void formatArrayBraces(BraceType braceType, bool isOpeningArrayBrace);
@@ -870,6 +882,10 @@ private:  // variables
 	size_t formattedLineCommentNum;     // comment location on formattedLine
 	size_t leadingSpaces;
 	size_t maxCodeLength;
+	size_t methodAttachCharNum;
+	size_t methodAttachLineNum;
+	size_t methodBreakCharNum;
+	size_t methodBreakLineNum;
 
 	// possible split points
 	size_t maxSemi;			// probably a 'for' statement
@@ -971,10 +987,12 @@ private:  // variables
 	bool isInObjCMethodDefinition;
 	bool isInObjCInterface;
 	bool isInObjCReturnType;
+	bool isInObjCParam;
 	bool isInObjCSelector;
 	bool breakCurrentOneLineBlock;
 	bool shouldRemoveNextClosingBrace;
 	bool isInBraceRunIn;
+	bool returnTypeChecked;
 	bool currentLineBeginsWithBrace;
 	bool attachClosingBraceMode;
 	bool shouldBreakOneLineBlocks;
@@ -995,6 +1013,10 @@ private:  // variables
 	bool shouldPadParamType;
 	bool shouldUnPadParamType;
 	bool shouldDeleteEmptyLines;
+	bool shouldBreakReturnType;
+	bool shouldBreakReturnTypeDecl;
+	bool shouldAttachReturnType;
+	bool shouldAttachReturnTypeDecl;
 	bool needHeaderOpeningBrace;
 	bool shouldBreakLineAtNextChar;
 	bool shouldKeepLineUnbroken;
diff --git a/astyle/src/astyle_main.cpp b/astyle/src/astyle_main.cpp
index 098eafec782f930f9b87211af75a3bac0210c396..96ae075168c15f7caca76f0c02a4647c9e4060bf 100755
--- a/astyle/src/astyle_main.cpp
+++ b/astyle/src/astyle_main.cpp
@@ -1,5 +1,5 @@
 // astyle_main.cpp
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -94,11 +94,12 @@ namespace astyle {
 	jmethodID g_mid;
 #endif
 
-const char* g_version = "3.0.1";
+const char* g_version = "3.1";
 
 //-----------------------------------------------------------------------------
 // ASStreamIterator class
-// typename will be istringstream for GUI and istream otherwise
+// typename will be stringstream for AStyle
+// it could be istream or wxChar for plug-ins
 //-----------------------------------------------------------------------------
 
 template<typename T>
@@ -206,6 +207,16 @@ string ASStreamIterator<T>::nextLine(bool emptyLineWasDeleted)
 		inStream->clear();
 	}
 
+	// has not detected an input end of line
+	if (!eolWindows && !eolLinux && !eolMacOld)
+	{
+#ifdef _WIN32
+		eolWindows++;
+#else
+		eolLinux++;
+#endif
+	}
+
 	// set output end of line characters
 	if (eolWindows >= eolLinux)
 	{
@@ -334,7 +345,6 @@ ASConsole::ASConsole(ASFormatter& formatterArg) : formatter(formatterArg)
 	isFormattedOnly = false;
 	ignoreExcludeErrors = false;
 	ignoreExcludeErrorsDisplay = false;
-	optionsFileRequired = false;
 	useAscii = false;
 	// other variables
 	bypassBrowserOpen = false;
@@ -357,7 +367,7 @@ void ASConsole::convertLineEnds(ostringstream& out, int lineEnd)
 	assert(lineEnd == LINEEND_WINDOWS || lineEnd == LINEEND_LINUX || lineEnd == LINEEND_MACOLD);
 	const string& inStr = out.str();	// avoids strange looking syntax
 	string outStr;						// the converted output
-	int inLength = (int)inStr.length();
+	int inLength = (int) inStr.length();
 	for (int pos = 0; pos < inLength; pos++)
 	{
 		if (inStr[pos] == '\r')
@@ -454,7 +464,9 @@ FileEncoding ASConsole::detectEncoding(const char* data, size_t dataSize) const
 {
 	FileEncoding encoding = ENCODING_8BIT;
 
-	if (dataSize >= 4 && memcmp(data, "\x00\x00\xFE\xFF", 4) == 0)
+	if (dataSize >= 3 && memcmp(data, "\xEF\xBB\xBF", 3) == 0)
+		encoding = UTF_8BOM;
+	else if (dataSize >= 4 && memcmp(data, "\x00\x00\xFE\xFF", 4) == 0)
 		encoding = UTF_32BE;
 	else if (dataSize >= 4 && memcmp(data, "\xFF\xFE\x00\x00", 4) == 0)
 		encoding = UTF_32LE;
@@ -469,7 +481,7 @@ FileEncoding ASConsole::detectEncoding(const char* data, size_t dataSize) const
 // error exit without a message
 void ASConsole::error() const
 {
-	(*errorStream) << _("\nArtistic Style has terminated") << endl;
+	(*errorStream) << _("Artistic Style has terminated\n") << endl;
 	exit(EXIT_FAILURE);
 }
 
@@ -483,7 +495,7 @@ void ASConsole::error(const char* why, const char* what) const
 /**
  * If no files have been given, use cin for input and cout for output.
  *
- * This is used to format text for text editors like TextWrangler (Mac).
+ * This is used to format text for text editors.
  * Do NOT display any console messages when this function is used.
  */
 void ASConsole::formatCinToCout()
@@ -650,16 +662,47 @@ void ASConsole::formatFile(const string& fileName_)
 	assert(formatter.getChecksumDiff() == 0);
 }
 
-// build a vector of argv options
-// the program path argv[0] is excluded
-vector<string> ASConsole::getArgvOptions(int argc, char** argv) const
+/**
+ * Searches for a file named fileName_ in the current directory. If it is not
+ * found, recursively searches for fileName_ in the current directory's parent
+ * directories, returning the location of the first instance of fileName_
+ * found. If fileName_ is not found, an empty string is returned.
+ *
+ * @param fileName_     The filename the function should attempt to locate.
+ * @return              The full path to fileName_ in the current directory or
+ *                      nearest parent directory if found, otherwise an empty
+ *                      string.
+ */
+string ASConsole::findProjectOptionFilePath(const string& fileName_) const
 {
-	vector<string> argvOptions;
-	for (int i = 1; i < argc; i++)
+	string parent;
+
+	if (!fileNameVector.empty())
+		parent = getFullPathName(fileNameVector.front());
+	else if (!stdPathIn.empty())
+		parent = getFullPathName(stdPathIn);
+	else
+		parent = getFullPathName(getCurrentDirectory(fileName_));
+
+	// remove filename from path
+	size_t endPath = parent.find_last_of(g_fileSeparator);
+	if (endPath != string::npos)
+		parent = parent.substr(0, endPath + 1);
+
+	while (!parent.empty())
 	{
-		argvOptions.emplace_back(string(argv[i]));
+		string filepath = parent + fileName_;
+		if (fileExists(filepath.c_str()))
+			return filepath;
+		else if (fileName_ == ".astylerc")
+		{
+			filepath = parent + "_astylerc";
+			if (fileExists(filepath.c_str()))
+				return filepath;
+		}
+		parent = getParentDirectory(parent);
 	}
-	return argvOptions;
+	return string();
 }
 
 // for unit testing
@@ -731,8 +774,8 @@ bool ASConsole::getNoBackup() const
 { return noBackup; }
 
 // for unit testing
-string ASConsole::getOptionsFileName() const
-{ return optionsFileName; }
+string ASConsole::getOptionFileName() const
+{ return optionFileName; }
 
 // for unit testing
 vector<string> ASConsole::getOptionsVector() const
@@ -746,6 +789,21 @@ string ASConsole::getOrigSuffix() const
 bool ASConsole::getPreserveDate() const
 { return preserveDate; }
 
+// for unit testing
+string ASConsole::getProjectOptionFileName() const
+{
+	assert(projectOptionFileName.length() > 0);
+	// remove the directory path
+	size_t start = projectOptionFileName.find_last_of(g_fileSeparator);
+	if (start == string::npos)
+		start = 0;
+	return projectOptionFileName.substr(start + 1);
+}
+
+// for unit testing
+vector<string> ASConsole::getProjectOptionsVector() const
+{ return projectOptionsVector; }
+
 // for unit testing
 string ASConsole::getStdPathIn() const
 { return stdPathIn; }
@@ -769,11 +827,54 @@ void ASConsole::setErrorStream(ostream* errStreamPtr)
 	errorStream = errStreamPtr;
 }
 
+// build a vector of argv options
+// the program path argv[0] is excluded
+vector<string> ASConsole::getArgvOptions(int argc, char** argv) const
+{
+	vector<string> argvOptions;
+	for (int i = 1; i < argc; i++)
+	{
+		argvOptions.emplace_back(string(argv[i]));
+	}
+	return argvOptions;
+}
+
 string ASConsole::getParam(const string& arg, const char* op)
 {
 	return arg.substr(strlen(op));
 }
 
+void ASConsole::getTargetFilenames(string& targetFilename_,
+                                   vector<string>& targetFilenameVector) const
+{
+	size_t beg = 0;
+	size_t sep = 0;
+	while (beg < targetFilename_.length())
+	{
+		// find next target
+		sep = targetFilename_.find_first_of(",;", beg);
+		if (sep == string::npos)
+			sep = targetFilename_.length();
+		string fileExtension = targetFilename_.substr(beg, sep - beg);
+		beg = sep + 1;
+		// remove whitespace
+		while (fileExtension.length() > 0
+		        && (fileExtension[0] == ' ' || fileExtension[0] == '\t'))
+			fileExtension = fileExtension.erase(0, 1);
+		while (fileExtension.length() > 0
+		        && (fileExtension[fileExtension.length() - 1] == ' '
+		            || fileExtension[fileExtension.length() - 1] == '\t'))
+			fileExtension = fileExtension.erase(fileExtension.length() - 1, 1);
+		if (fileExtension.length() > 0)
+			targetFilenameVector.emplace_back(fileExtension);
+	}
+	if (targetFilenameVector.size() == 0)
+	{
+		fprintf(stderr, _("Missing filename in %s\n"), targetFilename_.c_str());
+		error();
+	}
+}
+
 // initialize output end of line
 void ASConsole::initializeOutputEOL(LineEndFormat lineEndFormat)
 {
@@ -796,18 +897,19 @@ void ASConsole::initializeOutputEOL(LineEndFormat lineEndFormat)
 		outputEOL.clear();
 }
 
+// read a file into the stringstream 'in'
 FileEncoding ASConsole::readFile(const string& fileName_, stringstream& in) const
 {
 	const int blockSize = 65536;	// 64 KB
 	ifstream fin(fileName_.c_str(), ios::binary);
 	if (!fin)
-		error("Cannot open input file", fileName_.c_str());
+		error("Cannot open file", fileName_.c_str());
 	char* data = new (nothrow) char[blockSize];
 	if (data == nullptr)
-		error("Cannot allocate memory for input file", fileName_.c_str());
+		error("Cannot allocate memory to open file", fileName_.c_str());
 	fin.read(data, blockSize);
 	if (fin.bad())
-		error("Cannot read input file", fileName_.c_str());
+		error("Cannot read file", fileName_.c_str());
 	size_t dataSize = static_cast<size_t>(fin.gcount());
 	FileEncoding encoding = detectEncoding(data, dataSize);
 	if (encoding == UTF_32BE || encoding == UTF_32LE)
@@ -819,12 +921,12 @@ FileEncoding ASConsole::readFile(const string& fileName_, stringstream& in) cons
 		if (encoding == UTF_16LE || encoding == UTF_16BE)
 		{
 			// convert utf-16 to utf-8
-			size_t utf8Size = utf8_16.utf8LengthFromUtf16(data, dataSize, isBigEndian);
+			size_t utf8Size = encode.utf8LengthFromUtf16(data, dataSize, isBigEndian);
 			char* utf8Out = new (nothrow) char[utf8Size];
 			if (utf8Out == nullptr)
 				error("Cannot allocate memory for utf-8 conversion", fileName_.c_str());
-			size_t utf8Len = utf8_16.utf16ToUtf8(data, dataSize, isBigEndian, firstBlock, utf8Out);
-			assert(utf8Len == utf8Size);
+			size_t utf8Len = encode.utf16ToUtf8(data, dataSize, isBigEndian, firstBlock, utf8Out);
+			assert(utf8Len <= utf8Size);
 			in << string(utf8Out, utf8Len);
 			delete[] utf8Out;
 		}
@@ -832,7 +934,7 @@ FileEncoding ASConsole::readFile(const string& fileName_, stringstream& in) cons
 			in << string(data, dataSize);
 		fin.read(data, blockSize);
 		if (fin.bad())
-			error("Cannot read input file", fileName_.c_str());
+			error("Cannot read file", fileName_.c_str());
 		dataSize = static_cast<size_t>(fin.gcount());
 		firstBlock = false;
 	}
@@ -865,8 +967,8 @@ void ASConsole::setIsVerbose(bool state)
 void ASConsole::setNoBackup(bool state)
 { noBackup = state; }
 
-void ASConsole::setOptionsFileName(const string& name)
-{ optionsFileName = name; }
+void ASConsole::setOptionFileName(const string& name)
+{ optionFileName = name; }
 
 void ASConsole::setOrigSuffix(const string& suffix)
 { origSuffix = suffix; }
@@ -874,6 +976,9 @@ void ASConsole::setOrigSuffix(const string& suffix)
 void ASConsole::setPreserveDate(bool state)
 { preserveDate = state; }
 
+void ASConsole::setProjectOptionFileName(const string& optfilepath)
+{ projectOptionFileName = optfilepath; }
+
 void ASConsole::setStdPathIn(const string& path)
 { stdPathIn = path; }
 
@@ -947,9 +1052,9 @@ string ASConsole::getCurrentDirectory(const string& fileName_) const
  * The fileName vector is filled with the path and names of files to process.
  *
  * @param directory     The path of the directory to be processed.
- * @param wildcard      The wildcard to be processed (e.g. *.cpp).
+ * @param wildcards     A vector of wildcards to be processed (e.g. *.cpp).
  */
-void ASConsole::getFileNames(const string& directory, const string& wildcard)
+void ASConsole::getFileNames(const string& directory, const vector<string>& wildcards)
 {
 	vector<string> subDirectory;    // sub directories of directory
 	WIN32_FIND_DATA findFileData;   // for FindFirstFile and FindNextFile
@@ -991,17 +1096,20 @@ void ASConsole::getFileNames(const string& directory, const string& wildcard)
 			continue;
 		}
 
-		// save the file name
 		string filePathName = directory + g_fileSeparator + findFileData.cFileName;
 		// check exclude before wildcmp to avoid "unmatched exclude" error
 		bool isExcluded = isPathExclued(filePathName);
 		// save file name if wildcard match
-		if (wildcmp(wildcard.c_str(), findFileData.cFileName))
+		for (size_t i = 0; i < wildcards.size(); i++)
 		{
-			if (isExcluded)
-				printMsg(_("Exclude  %s\n"), filePathName.substr(mainDirectoryLength));
-			else
-				fileName.emplace_back(filePathName);
+			if (wildcmp(wildcards[i].c_str(), findFileData.cFileName))
+			{
+				if (isExcluded)
+					printMsg(_("Exclude  %s\n"), filePathName.substr(mainDirectoryLength));
+				else
+					fileName.emplace_back(filePathName);
+				break;
+			}
 		}
 	}
 	while (FindNextFile(hFind, &findFileData) != 0);
@@ -1015,11 +1123,20 @@ void ASConsole::getFileNames(const string& directory, const string& wildcard)
 	// recurse into sub directories
 	// if not doing recursive subDirectory is empty
 	for (unsigned i = 0; i < subDirectory.size(); i++)
-		getFileNames(subDirectory[i], wildcard);
+		getFileNames(subDirectory[i], wildcards);
 
 	return;
 }
 
+// WINDOWS function to get the full path name from the relative path name
+// Return the full path name or an empty string if failed.
+string ASConsole::getFullPathName(const string& relativePath) const
+{
+	char fullPath[MAX_PATH];
+	GetFullPathName(relativePath.c_str(), MAX_PATH, fullPath, NULL);
+	return fullPath;
+}
+
 /**
  * WINDOWS function to format a number according to the current locale.
  * This formats positive integers only, no float.
@@ -1069,6 +1186,28 @@ string ASConsole::getNumberFormat(int num, size_t lcid) const
 	return formattedNum;
 }
 
+/**
+ * WINDOWS function to check for a HOME directory
+ *
+ * @param absPath       The path to be evaluated.
+ * @returns             true if absPath is HOME or is an invalid absolute
+ *                      path, false otherwise.
+ */
+bool ASConsole::isHomeOrInvalidAbsPath(const string& absPath) const
+{
+	char* env = getenv("USERPROFILE");
+	if (env == nullptr)
+		return true;
+
+	if (absPath.c_str() == env)
+		return true;
+
+	if (absPath.compare(0, strlen(env), env) != 0)
+		return true;
+
+	return false;
+}
+
 /**
  * WINDOWS function to open a HTML file in the default browser.
  */
@@ -1150,9 +1289,9 @@ string ASConsole::getCurrentDirectory(const string& fileName_) const
  * The fileName vector is filled with the path and names of files to process.
  *
  * @param directory     The path of the directory to be processed.
- * @param wildcard      The wildcard to be processed (e.g. *.cpp).
+ * @param wildcards     A vector of wildcards to be processed (e.g. *.cpp).
  */
-void ASConsole::getFileNames(const string& directory, const string& wildcard)
+void ASConsole::getFileNames(const string& directory, const vector<string>& wildcards)
 {
 	struct dirent* entry;           // entry from readdir()
 	struct stat statbuf;            // entry from stat()
@@ -1202,12 +1341,16 @@ void ASConsole::getFileNames(const string& directory, const string& wildcard)
 			// check exclude before wildcmp to avoid "unmatched exclude" error
 			bool isExcluded = isPathExclued(entryFilepath);
 			// save file name if wildcard match
-			if (wildcmp(wildcard.c_str(), entry->d_name) != 0)
+			for (string wildcard : wildcards)
 			{
-				if (isExcluded)
-					printMsg(_("Exclude  %s\n"), entryFilepath.substr(mainDirectoryLength));
-				else
-					fileName.emplace_back(entryFilepath);
+				if (wildcmp(wildcard.c_str(), entry->d_name) != 0)
+				{
+					if (isExcluded)
+						printMsg(_("Exclude  %s\n"), entryFilepath.substr(mainDirectoryLength));
+					else
+						fileName.emplace_back(entryFilepath);
+					break;
+				}
 			}
 		}
 	}
@@ -1228,10 +1371,23 @@ void ASConsole::getFileNames(const string& directory, const string& wildcard)
 		sort(subDirectory.begin(), subDirectory.end());
 	for (unsigned i = 0; i < subDirectory.size(); i++)
 	{
-		getFileNames(subDirectory[i], wildcard);
+		getFileNames(subDirectory[i], wildcards);
 	}
 }
 
+// LINUX function to get the full path name from the relative path name
+// Return the full path name or an empty string if failed.
+string ASConsole::getFullPathName(const string& relativePath) const
+{
+	// ignore realPath attribute warning
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-result"
+	char fullPath[PATH_MAX];
+	realpath(relativePath.c_str(), fullPath);
+	return fullPath;
+#pragma GCC diagnostic pop
+}
+
 /**
  * LINUX function to get locale information and call getNumberFormat.
  * This formats positive integers only, no float.
@@ -1305,6 +1461,28 @@ string ASConsole::getNumberFormat(int num, const char* groupingArg, const char*
 	return formattedNum;
 }
 
+/**
+ * LINUX function to check for a HOME directory
+ *
+ * @param absPath       The path to be evaluated.
+ * @returns             true if absPath is HOME or is an invalid absolute
+ *                      path, false otherwise.
+ */
+bool ASConsole::isHomeOrInvalidAbsPath(const string& absPath) const
+{
+	char* env = getenv("HOME");
+	if (env == nullptr)
+		return true;
+
+	if (absPath.c_str() == env)
+		return true;
+
+	if (absPath.compare(0, strlen(env), env) != 0)
+		return true;
+
+	return false;
+}
+
 /**
  * LINUX function to open a HTML file in the default browser.
  * Use xdg-open from freedesktop.org cross-desktop compatibility suite xdg-utils.
@@ -1378,12 +1556,41 @@ void ASConsole::launchDefaultBrowser(const char* filePathIn /*nullptr*/) const
 
 #endif  // _WIN32
 
+/**
+ * Returns the parent directory of absPath. If absPath is not a valid absolute
+ * path or if it does not have a parent, an empty string is returned.
+ *
+ * @param absPath       The initial directory.
+ * @return              The parent directory of absPath, or an empty string if
+ *                      one cannot be found.
+ */
+string ASConsole::getParentDirectory(const string& absPath) const
+{
+	if (isHomeOrInvalidAbsPath(absPath))
+	{
+		return string();
+	}
+	size_t offset = absPath.size() - 1;
+	if (absPath[absPath.size() - 1] == g_fileSeparator)
+	{
+		offset -= 1;
+	}
+	size_t idx = absPath.rfind(g_fileSeparator, offset);
+	if (idx == string::npos)
+	{
+		return string();
+	}
+	string str = absPath.substr(0, idx + 1);
+	return str;
+}
+
 // get individual file names from the command-line file path
 void ASConsole::getFilePaths(const string& filePath)
 {
 	fileName.clear();
 	targetDirectory = string();
 	targetFilename = string();
+	vector<string> targetFilenameVector;
 
 	// separate directory and file name
 	size_t separator = filePath.find_last_of(g_fileSeparator);
@@ -1412,11 +1619,6 @@ void ASConsole::getFilePaths(const string& filePath)
 	if (targetFilename.find_first_of("*?") != string::npos)
 		hasWildcard = true;
 
-	// clear exclude hits vector
-	size_t excludeHitsVectorSize = excludeHitsVector.size();
-	for (size_t ix = 0; ix < excludeHitsVectorSize; ix++)
-		excludeHitsVector[ix] = false;
-
 	// If the filename is not quoted on Linux, bash will replace the
 	// wildcard instead of passing it to the program.
 	if (isRecursive && !hasWildcard)
@@ -1428,6 +1630,10 @@ void ASConsole::getFilePaths(const string& filePath)
 		error();
 	}
 
+	bool hasMultipleTargets = false;
+	if (targetFilename.find_first_of(",;") != string::npos)
+		hasMultipleTargets = true;
+
 	// display directory name for wildcard processing
 	if (hasWildcard)
 	{
@@ -1435,9 +1641,17 @@ void ASConsole::getFilePaths(const string& filePath)
 		printMsg(_("Directory  %s\n"), targetDirectory + g_fileSeparator + targetFilename);
 	}
 
+	// clear exclude hits vector
+	size_t excludeHitsVectorSize = excludeHitsVector.size();
+	for (size_t ix = 0; ix < excludeHitsVectorSize; ix++)
+		excludeHitsVector[ix] = false;
+
 	// create a vector of paths and file names to process
-	if (hasWildcard || isRecursive)
-		getFileNames(targetDirectory, targetFilename);
+	if (hasWildcard || isRecursive || hasMultipleTargets)
+	{
+		getTargetFilenames(targetFilename, targetFilenameVector);
+		getFileNames(targetDirectory, targetFilenameVector);
+	}
 	else
 	{
 		// verify a single file is not a directory (needed on Linux)
@@ -1489,6 +1703,13 @@ void ASConsole::getFilePaths(const string& filePath)
 		printSeparatingLine();
 }
 
+// Check if a file exists
+bool ASConsole::fileExists(const char* file) const
+{
+	struct stat buf;
+	return (stat(file, &buf) == 0);
+}
+
 bool ASConsole::fileNameVectorIsEmpty() const
 {
 	return fileNameVector.empty();
@@ -1509,7 +1730,7 @@ bool ASConsole::isParamOption(const string& arg, const char* option)
 	bool retVal = arg.compare(0, strlen(option), option) == 0;
 	// if comparing for short option, 2nd char of arg must be numeric
 	if (retVal && strlen(option) == 1 && arg.length() > 1)
-		if (!isdigit((unsigned char)arg[1]))
+		if (!isdigit((unsigned char) arg[1]))
 			retVal = false;
 	return retVal;
 }
@@ -1544,9 +1765,9 @@ bool ASConsole::isPathExclued(const string& subPath)
 		{
 			// make it case insensitive for Windows
 			for (size_t j = 0; j < compare.length(); j++)
-				compare[j] = (char)tolower(compare[j]);
+				compare[j] = (char) tolower(compare[j]);
 			for (size_t j = 0; j < exclude.length(); j++)
-				exclude[j] = (char)tolower(exclude[j]);
+				exclude[j] = (char) tolower(exclude[j]);
 		}
 		// compare sub directory to exclude data - must check them all
 		if (compare == exclude)
@@ -1578,6 +1799,7 @@ void ASConsole::printHelp() const
 	cout << endl;
 	cout << "    Wildcards (* and ?) may be used in the filename.\n";
 	cout << "    A \'recursive\' option can process directories recursively.\n";
+	cout << "    Multiple file extensions may be separated by a comma.\n";
 	cout << endl;
 	cout << "    By default, astyle is set up to indent with four spaces per indent,\n";
 	cout << "    a maximal indentation of 40 spaces inside continuous statements,\n";
@@ -1591,20 +1813,24 @@ void ASConsole::printHelp() const
 	cout << "    Short options (starting with '-') may be appended together.\n";
 	cout << "    Thus, -bps4 is the same as -b -p -s4.\n";
 	cout << endl;
-	cout << "Options File:\n";
+	cout << "Option Files:\n";
 	cout << "-------------\n";
-	cout << "    Artistic Style looks for a default options file in the\n";
-	cout << "    following order:\n";
-	cout << "    1. The contents of the ARTISTIC_STYLE_OPTIONS environment\n";
-	cout << "       variable if it exists.\n";
-	cout << "    2. The file called .astylerc in the directory pointed to by the\n";
-	cout << "       HOME environment variable ( i.e. $HOME/.astylerc ).\n";
-	cout << "    3. The file called astylerc in the directory pointed to by the\n";
-	cout << "       USERPROFILE environment variable (i.e. %USERPROFILE%\\astylerc).\n";
-	cout << "    If a default options file is found, the options in this file will\n";
-	cout << "    be parsed BEFORE the command-line options.\n";
-	cout << "    Long options within the default option file may be written without\n";
-	cout << "    the preliminary '--'.\n";
+	cout << "    Artistic Style looks for a default option file and/or a project\n";
+	cout << "    option file in the following order:\n";
+	cout << "    1. The command line options have precedence.\n";
+	cout << "    2. The project option file has precedence over the default file\n";
+	cout << "       o the file name indicated by the --project= command line option.\n";
+	cout << "       o the file named .astylerc or _ astylerc.\n";
+	cout << "       o the file name identified by ARTISTIC_STYLE_PROJECT_OPTIONS.\n";
+	cout << "       o the file is disabled by --project=none on the command line.\n";
+	cout << "    3. The default option file that can be used for all projects.\n";
+	cout << "       o the file path indicated by the --options= command line option.\n";
+	cout << "       o the file path indicated by ARTISTIC_STYLE_OPTIONS.\n";
+	cout << "       o the file named .astylerc in the HOME directory (for Linux).\n";
+	cout << "       o the file name astylerc in the APPDATA directory (for Windows).\n";
+	cout << "       o the file is disabled by --project=none on the command line.\n";
+	cout << "    Long options within the option files may be written without '--'.\n";
+	cout << "    Line-end comments begin with a '#'.\n";
 	cout << endl;
 	cout << "Disable Formatting:\n";
 	cout << "-------------------\n";
@@ -1647,8 +1873,8 @@ void ASConsole::printHelp() const
 	cout << "    VTK style formatting/indenting.\n";
 	cout << "    Broken, indented braces except for the opening braces.\n";
 	cout << endl;
-	cout << "    --style=banner  OR  -A6\n";
-	cout << "    Banner style formatting/indenting.\n";
+	cout << "    --style=ratliff  OR  --style=banner  OR  -A6\n";
+	cout << "    Ratliff style formatting/indenting.\n";
 	cout << "    Attached, indented braces.\n";
 	cout << endl;
 	cout << "    --style=gnu  OR  -A7\n";
@@ -1876,6 +2102,16 @@ void ASConsole::printHelp() const
 	cout << "    --remove-braces  OR  -xj\n";
 	cout << "    Remove braces from a braced one line conditional statements.\n";
 	cout << endl;
+	cout << "    --break-return-type       OR  -xB\n";
+	cout << "    --break-return-type-decl  OR  -xD\n";
+	cout << "    Break the return type from the function name. Options are\n";
+	cout << "    for the function definitions and the function declarations.\n";
+	cout << endl;
+	cout << "    --attach-return-type       OR  -xf\n";
+	cout << "    --attach-return-type-decl  OR  -xh\n";
+	cout << "    Attach the return type to the function name. Options are\n";
+	cout << "    for the function definitions and the function declarations.\n";
+	cout << endl;
 	cout << "    --keep-one-line-blocks  OR  -O\n";
 	cout << "    Don't break blocks residing completely on one line.\n";
 	cout << endl;
@@ -1995,11 +2231,19 @@ void ASConsole::printHelp() const
 	cout << "Command Line Only:\n";
 	cout << "------------------\n";
 	cout << "    --options=####\n";
-	cout << "    Specify an options file #### to read and use.\n";
-	cout << endl;
 	cout << "    --options=none\n";
-	cout << "    Disable the default options file.\n";
-	cout << "    Only the command-line parameters will be used.\n";
+	cout << "    Specify a default option file #### to read and use.\n";
+	cout << "    It must contain a file path and a file name.\n";
+	cout << "    'none' disables the default option file.\n";
+	cout << endl;
+	cout << "    --project\n";
+	cout << "    --project=####\n";
+	cout << "    --project=none\n";
+	cout << "    Specify a project option file #### to read and use.\n";
+	cout << "    It must contain a file name only, without a directory path.\n";
+	cout << "    The file should be included in the project top-level directory.\n";
+	cout << "    The default file name is .astylerc or _astylerc.\n";
+	cout << "    'none' disables the project or environment variable file.\n";
 	cout << endl;
 	cout << "    --ascii  OR  -I\n";
 	cout << "    The displayed output will be ascii characters only.\n";
@@ -2019,6 +2263,14 @@ void ASConsole::printHelp() const
 	cout << "    ####. The path may include a directory path and a file name, or a\n";
 	cout << "    file name only. Paths containing spaces must be enclosed in quotes.\n";
 	cout << endl;
+	cout << "    --stdin=####\n";
+	cout << "    Use the file path #### as input to single file formatting.\n";
+	cout << "    This is a replacement for redirection.\n";
+	cout << endl;
+	cout << "    --stdout=####\n";
+	cout << "    Use the file path #### as output from single file formatting.\n";
+	cout << "    This is a replacement for redirection.\n";
+	cout << endl;
 	cout << endl;
 }
 
@@ -2047,62 +2299,102 @@ void ASConsole::processFiles()
 		printVerboseStats(startTime);
 }
 
-// process options from the command line and options file
-// build the vectors fileNameVector, excludeVector, optionsVector, and fileOptionsVector
+// process options from the command line and option files
+// build the vectors fileNameVector, excludeVector, optionsVector,
+// projectOptionsVector and fileOptionsVector
 void ASConsole::processOptions(const vector<string>& argvOptions)
 {
 	string arg;
 	bool ok = true;
-	bool shouldParseOptionsFile = true;
+	bool optionFileRequired = false;
+	bool shouldParseOptionFile = true;
+	bool projectOptionFileRequired = false;
+	bool shouldParseProjectOptionFile = true;
+	string projectOptionArg;		// save for display
 
 	// get command line options
 	for (size_t i = 0; i < argvOptions.size(); i++)
 	{
 		arg = argvOptions[i];
 
-		if ( isOption(arg, "-I" )
-		        || isOption(arg, "--ascii") )
+		if (isOption(arg, "-I")
+		        || isOption(arg, "--ascii"))
 		{
 			useAscii = true;
 			setlocale(LC_ALL, "C");		// use English decimal indicator
 			localizer.setLanguageFromName("en");
 		}
-		else if ( isOption(arg, "--options=none") )
+		else if (isOption(arg, "--options=none"))
+		{
+			optionFileRequired = false;
+			shouldParseOptionFile = false;
+			optionFileName = "";
+		}
+		else if (isParamOption(arg, "--options="))
+		{
+			optionFileName = getParam(arg, "--options=");
+			standardizePath(optionFileName);
+			optionFileName = getFullPathName(optionFileName);
+			optionFileRequired = true;
+		}
+		else if (isOption(arg, "--project=none"))
 		{
-			shouldParseOptionsFile = false;
+			projectOptionFileRequired = false;
+			shouldParseProjectOptionFile = false;
+			setProjectOptionFileName("");
 		}
-		else if ( isParamOption(arg, "--options=") )
+		else if (isParamOption(arg, "--project="))
 		{
-			optionsFileName = getParam(arg, "--options=");
-			optionsFileRequired = true;
-			if (optionsFileName.empty())
-				setOptionsFileName(" ");
+			projectOptionFileName = getParam(arg, "--project=");
+			standardizePath(projectOptionFileName);
+			projectOptionFileRequired = true;
+			shouldParseProjectOptionFile = false;
+			projectOptionArg = projectOptionFileName;
 		}
-		else if ( isOption(arg, "-h")
-		          || isOption(arg, "--help")
-		          || isOption(arg, "-?") )
+		else if (isOption(arg, "--project"))
+		{
+			projectOptionFileName = ".astylerc";
+			projectOptionFileRequired = true;
+			shouldParseProjectOptionFile = false;
+			projectOptionArg = projectOptionFileName;
+		}
+		else if (isOption(arg, "-h")
+		         || isOption(arg, "--help")
+		         || isOption(arg, "-?"))
 		{
 			printHelp();
 			exit(EXIT_SUCCESS);
 		}
-		else if ( isOption(arg, "-!")
-		          || isOption(arg, "--html") )
+		else if (isOption(arg, "-!")
+		         || isOption(arg, "--html"))
 		{
 			launchDefaultBrowser();
 			exit(EXIT_SUCCESS);
 		}
-		else if ( isParamOption(arg, "--html=") )
+		else if (isParamOption(arg, "--html="))
 		{
 			string htmlFilePath = getParam(arg, "--html=");
 			launchDefaultBrowser(htmlFilePath.c_str());
 			exit(EXIT_SUCCESS);
 		}
-		else if ( isOption(arg, "-V" )
-		          || isOption(arg, "--version") )
+		else if (isOption(arg, "-V")
+		         || isOption(arg, "--version"))
 		{
 			printf("Artistic Style Version %s\n", g_version);
 			exit(EXIT_SUCCESS);
 		}
+		else if (isParamOption(arg, "--stdin="))
+		{
+			string path = getParam(arg, "--stdin=");
+			standardizePath(path);
+			setStdPathIn(path);
+		}
+		else if (isParamOption(arg, "--stdout="))
+		{
+			string path = getParam(arg, "--stdout=");
+			standardizePath(path);
+			setStdPathOut(path);
+		}
 		else if (arg[0] == '-')
 		{
 			optionsVector.emplace_back(arg);
@@ -2114,53 +2406,125 @@ void ASConsole::processOptions(const vector<string>& argvOptions)
 		}
 	}
 
-	// get options file path and name
-	if (shouldParseOptionsFile)
+	// get option file path and name
+	if (shouldParseOptionFile)
 	{
-		if (optionsFileName.empty())
+		if (optionFileName.empty())
 		{
 			char* env = getenv("ARTISTIC_STYLE_OPTIONS");
 			if (env != nullptr)
-				setOptionsFileName(env);
+			{
+				setOptionFileName(env);
+				standardizePath(optionFileName);
+				optionFileName = getFullPathName(optionFileName);
+			}
 		}
-		if (optionsFileName.empty())
+		// for Linux
+		if (optionFileName.empty())
 		{
 			char* env = getenv("HOME");
 			if (env != nullptr)
-				setOptionsFileName(string(env) + "/.astylerc");
+			{
+				string name = string(env) + "/.astylerc";
+				if (fileExists(name.c_str()))
+					setOptionFileName(name);
+			}
 		}
-		if (optionsFileName.empty())
+		// for Windows
+		if (optionFileName.empty())
+		{
+			char* env = getenv("APPDATA");
+			if (env != nullptr)
+			{
+				string name = string(env) + "\\astylerc";
+				if (fileExists(name.c_str()))
+					setOptionFileName(name);
+			}
+		}
+		// for Windows
+		// NOTE: depreciated with release 3.1, remove when appropriate
+		// there is NO test data for this option
+		if (optionFileName.empty())
 		{
 			char* env = getenv("USERPROFILE");
 			if (env != nullptr)
-				setOptionsFileName(string(env) + "/astylerc");
+			{
+				string name = string(env) + "\\astylerc";
+				if (fileExists(name.c_str()))
+					setOptionFileName(name);
+			}
 		}
-		if (!optionsFileName.empty())
-			standardizePath(optionsFileName);
 	}
 
-	// create the options file vector and parse the options for errors
-	ASOptions options(formatter, *this);
-	if (!optionsFileName.empty())
+	// find project option file
+	if (projectOptionFileRequired)
+	{
+		string optfilepath = findProjectOptionFilePath(projectOptionFileName);
+		if (optfilepath.empty() || projectOptionArg.empty())
+			error(_("Cannot open project option file"), projectOptionArg.c_str());
+		standardizePath(optfilepath);
+		setProjectOptionFileName(optfilepath);
+	}
+	if (shouldParseProjectOptionFile)
 	{
-		ifstream optionsIn(optionsFileName.c_str());
-		if (optionsIn)
+		char* env = getenv("ARTISTIC_STYLE_PROJECT_OPTIONS");
+		if (env != nullptr)
 		{
-			options.importOptions(optionsIn, fileOptionsVector);
-			ok = options.parseOptions(fileOptionsVector,
-			                          string(_("Invalid option file options:")));
+			string optfilepath = findProjectOptionFilePath(env);
+			standardizePath(optfilepath);
+			setProjectOptionFileName(optfilepath);
 		}
-		else
+	}
+
+	ASOptions options(formatter, *this);
+	if (!optionFileName.empty())
+	{
+		stringstream optionsIn;
+		if (!fileExists(optionFileName.c_str()))
+			error(_("Cannot open default option file"), optionFileName.c_str());
+		FileEncoding encoding = readFile(optionFileName, optionsIn);
+		// bypass a BOM, all BOMs have been converted to utf-8
+		if (encoding == UTF_8BOM || encoding == UTF_16LE || encoding == UTF_16BE)
 		{
-			if (optionsFileRequired)
-				error(_("Cannot open options file"), optionsFileName.c_str());
-			optionsFileName.clear();
+			char buf[4];
+			optionsIn.get(buf, 4);
+			assert(strcmp(buf, "\xEF\xBB\xBF") == 0);
 		}
-		optionsIn.close();
+		options.importOptions(optionsIn, fileOptionsVector);
+		ok = options.parseOptions(fileOptionsVector,
+		                          string(_("Invalid default options:")));
 	}
+	else if (optionFileRequired)
+		error(_("Cannot open default option file"), optionFileName.c_str());
+
 	if (!ok)
 	{
-		(*errorStream) << options.getOptionErrors() << endl;
+		(*errorStream) << options.getOptionErrors();
+		(*errorStream) << _("For help on options type 'astyle -h'") << endl;
+		error();
+	}
+
+	if (!projectOptionFileName.empty())
+	{
+		stringstream projectOptionsIn;
+		if (!fileExists(projectOptionFileName.c_str()))
+			error(_("Cannot open project option file"), projectOptionFileName.c_str());
+		FileEncoding encoding = readFile(projectOptionFileName, projectOptionsIn);
+		// bypass a BOM, all BOMs have been converted to utf-8
+		if (encoding == UTF_8BOM || encoding == UTF_16LE || encoding == UTF_16BE)
+		{
+			char buf[4];
+			projectOptionsIn.get(buf, 4);
+			assert(strcmp(buf, "\xEF\xBB\xBF") == 0);
+		}
+		options.importOptions(projectOptionsIn, projectOptionsVector);
+		ok = options.parseOptions(projectOptionsVector,
+		                          string(_("Invalid project options:")));
+	}
+
+	if (!ok)
+	{
+		(*errorStream) << options.getOptionErrors();
 		(*errorStream) << _("For help on options type 'astyle -h'") << endl;
 		error();
 	}
@@ -2170,7 +2534,7 @@ void ASConsole::processOptions(const vector<string>& argvOptions)
 	                          string(_("Invalid command line options:")));
 	if (!ok)
 	{
-		(*errorStream) << options.getOptionErrors() << endl;
+		(*errorStream) << options.getOptionErrors();
 		(*errorStream) << _("For help on options type 'astyle -h'") << endl;
 		error();
 	}
@@ -2227,12 +2591,12 @@ void ASConsole::standardizePath(string& path, bool removeBeginningSeparator /*fa
 	// If we are on a VMS system, translate VMS style filenames to unix
 	// style.
 	fab = cc$rms_fab;
-	fab.fab$l_fna = (char*) -1;        // *NOPAD*
+	fab.fab$l_fna = (char*) -1;
 	fab.fab$b_fns = 0;
 	fab.fab$l_naml = &naml;
 	naml = cc$rms_naml;
 	strcpy(sess, path.c_str());
-	naml.naml$l_long_filename = (char*)sess;
+	naml.naml$l_long_filename = (char*) sess;
 	naml.naml$l_long_filename_size = path.length();
 	naml.naml$l_long_expand = less;
 	naml.naml$l_long_expand_alloc = sizeof(less);
@@ -2248,14 +2612,14 @@ void ASConsole::standardizePath(string& path, bool removeBeginningSeparator /*fa
 	{
 		if (!$VMS_STATUS_SUCCESS(r0_status))
 		{
-			(void)lib$signal (r0_status);
+			(void) lib$signal(r0_status);
 		}
 	}
 	less[naml.naml$l_long_expand_size - naml.naml$b_ver] = '\0';
 	sess[naml.naml$b_esl - naml.naml$b_ver] = '\0';
 	if (naml.naml$l_long_expand_size > naml.naml$b_esl)
 	{
-		path = decc$translate_vms (less);
+		path = decc$translate_vms(less);
 	}
 	else
 	{
@@ -2310,9 +2674,19 @@ void ASConsole::printVerboseHeader() const
 	header.append(str);
 	header.append("\n");
 	printf("%s", header.c_str());
-	// print options file
-	if (!optionsFileName.empty())
-		printf(_("Using default options file %s\n"), optionsFileName.c_str());
+	// print option files
+	if (!optionFileName.empty())
+		printf(_("Default option file  %s\n"), optionFileName.c_str());
+	// NOTE: depreciated with release 3.1, remove when appropriate
+	if (!optionFileName.empty())
+	{
+		char* env = getenv("USERPROFILE");
+		if (env != nullptr && optionFileName == string(env) + "\\astylerc")
+			printf("The above option file has been DEPRECIATED\n");
+	}
+	// end depreciated
+	if (!projectOptionFileName.empty())
+		printf(_("Project option file  %s\n"), projectOptionFileName.c_str());
 }
 
 void ASConsole::printVerboseStats(clock_t startTime) const
@@ -2328,7 +2702,7 @@ void ASConsole::printVerboseStats(clock_t startTime) const
 
 	// show processing time
 	clock_t stopTime = clock();
-	double secs = (stopTime - startTime) / double (CLOCKS_PER_SEC);
+	double secs = (stopTime - startTime) / double(CLOCKS_PER_SEC);
 	if (secs < 60)
 	{
 		if (secs < 2.0)
@@ -2344,18 +2718,19 @@ void ASConsole::printVerboseStats(clock_t startTime) const
 		// show minutes and seconds if time is greater than one minute
 		int min = (int) secs / 60;
 		secs -= min * 60;
-		int minsec = int (secs + .5);
+		int minsec = int(secs + .5);
 		printf(_("%d min %d sec   "), min, minsec);
 	}
 
 	string lines = getNumberFormat(linesOut);
 	printf(_("%s lines\n"), lines.c_str());
+	printf("\n");
 }
 
 void ASConsole::sleep(int seconds) const
 {
 	clock_t endwait;
-	endwait = clock_t (clock () + seconds * CLOCKS_PER_SEC);
+	endwait = clock_t(clock() + seconds * CLOCKS_PER_SEC);
 	while (clock() < endwait) {}
 }
 
@@ -2485,11 +2860,11 @@ void ASConsole::writeFile(const string& fileName_, FileEncoding encoding, ostrin
 	{
 		// convert utf-8 to utf-16
 		bool isBigEndian = (encoding == UTF_16BE);
-		size_t utf16Size = utf8_16.utf16LengthFromUtf8(out.str().c_str(), out.str().length());
+		size_t utf16Size = encode.utf16LengthFromUtf8(out.str().c_str(), out.str().length());
 		char* utf16Out = new char[utf16Size];
-		size_t utf16Len = utf8_16.utf8ToUtf16(const_cast<char*>(out.str().c_str()),
-		                                      out.str().length(), isBigEndian, utf16Out);
-		assert(utf16Len == utf16Size);
+		size_t utf16Len = encode.utf8ToUtf16(const_cast<char*>(out.str().c_str()),
+		                                     out.str().length(), isBigEndian, utf16Out);
+		assert(utf16Len <= utf16Size);
 		fout << string(utf16Out, utf16Len);
 		delete[] utf16Out;
 	}
@@ -2527,10 +2902,10 @@ void ASConsole::writeFile(const string& fileName_, FileEncoding encoding, ostrin
 // used by shared object (DLL) calls
 //-----------------------------------------------------------------------------
 
-utf16_t* ASLibrary::formatUtf16(const utf16_t* pSourceIn,		// the source to be formatted
-                                const utf16_t* pOptions,		// AStyle options
-                                fpError fpErrorHandler,			// error handler function
-                                fpAlloc fpMemoryAlloc) const	// memory allocation function)
+char16_t* ASLibrary::formatUtf16(const char16_t* pSourceIn,		// the source to be formatted
+                                 const char16_t* pOptions,		// AStyle options
+                                 fpError fpErrorHandler,		// error handler function
+                                 fpAlloc fpMemoryAlloc) const	// memory allocation function)
 {
 	const char* utf8In = convertUtf16ToUtf8(pSourceIn);
 	if (utf8In == nullptr)
@@ -2560,7 +2935,7 @@ utf16_t* ASLibrary::formatUtf16(const utf16_t* pSourceIn,		// the source to be f
 	if (utf8Out == nullptr)
 		return nullptr;
 	// convert text to wide char and return it
-	utf16_t* utf16Out = convertUtf8ToUtf16(utf8Out, fpMemoryAlloc);
+	char16_t* utf16Out = convertUtf8ToUtf16(utf8Out, fpMemoryAlloc);
 	delete[] utf8Out;
 	utf8Out = nullptr;
 	if (utf16Out == nullptr)
@@ -2584,26 +2959,26 @@ char* STDCALL ASLibrary::tempMemoryAllocation(unsigned long memoryNeeded)
  * Memory is allocated by the calling program memory allocation function.
  * The calling function must check for errors.
  */
-utf16_t* ASLibrary::convertUtf8ToUtf16(const char* utf8In, fpAlloc fpMemoryAlloc) const
+char16_t* ASLibrary::convertUtf8ToUtf16(const char* utf8In, fpAlloc fpMemoryAlloc) const
 {
 	if (utf8In == nullptr)
 		return nullptr;
 	char* data = const_cast<char*>(utf8In);
 	size_t dataSize = strlen(utf8In);
-	bool isBigEndian = utf8_16.getBigEndian();
-	// return size is in number of CHARs, not utf16_t
-	size_t utf16Size = (utf8_16.utf16LengthFromUtf8(data, dataSize) + sizeof(utf16_t));
-	char* utf16Out = fpMemoryAlloc((long)utf16Size);
+	bool isBigEndian = encode.getBigEndian();
+	// return size is in number of CHARs, not char16_t
+	size_t utf16Size = (encode.utf16LengthFromUtf8(data, dataSize) + sizeof(char16_t));
+	char* utf16Out = fpMemoryAlloc((long) utf16Size);
 	if (utf16Out == nullptr)
 		return nullptr;
 #ifdef NDEBUG
-	utf8_16.utf8ToUtf16(data, dataSize + 1, isBigEndian, utf16Out);
+	encode.utf8ToUtf16(data, dataSize + 1, isBigEndian, utf16Out);
 #else
-	size_t utf16Len = utf8_16.utf8ToUtf16(data, dataSize + 1, isBigEndian, utf16Out);
+	size_t utf16Len = encode.utf8ToUtf16(data, dataSize + 1, isBigEndian, utf16Out);
 	assert(utf16Len == utf16Size);
 #endif
-	assert(utf16Size == (utf8_16.utf16len(reinterpret_cast<utf16_t*>(utf16Out)) + 1) * sizeof(utf16_t));
-	return reinterpret_cast<utf16_t*>(utf16Out);
+	assert(utf16Size == (encode.utf16len(reinterpret_cast<char16_t*>(utf16Out)) + 1) * sizeof(char16_t));
+	return reinterpret_cast<char16_t*>(utf16Out);
 }
 
 /**
@@ -2611,22 +2986,22 @@ utf16_t* ASLibrary::convertUtf8ToUtf16(const char* utf8In, fpAlloc fpMemoryAlloc
  * The calling function must check for errors and delete the
  * allocated memory.
  */
-char* ASLibrary::convertUtf16ToUtf8(const utf16_t* utf16In) const
+char* ASLibrary::convertUtf16ToUtf8(const char16_t* utf16In) const
 {
 	if (utf16In == nullptr)
 		return nullptr;
-	char* data = reinterpret_cast<char*>(const_cast<utf16_t*>(utf16In));
+	char* data = reinterpret_cast<char*>(const_cast<char16_t*>(utf16In));
 	// size must be in chars
-	size_t dataSize = utf8_16.utf16len(utf16In) * sizeof(utf16_t);
-	bool isBigEndian = utf8_16.getBigEndian();
-	size_t utf8Size = utf8_16.utf8LengthFromUtf16(data, dataSize, isBigEndian) + 1;
+	size_t dataSize = encode.utf16len(utf16In) * sizeof(char16_t);
+	bool isBigEndian = encode.getBigEndian();
+	size_t utf8Size = encode.utf8LengthFromUtf16(data, dataSize, isBigEndian) + 1;
 	char* utf8Out = new (nothrow) char[utf8Size];
 	if (utf8Out == nullptr)
 		return nullptr;
 #ifdef NDEBUG
-	utf8_16.utf16ToUtf8(data, dataSize + 1, isBigEndian, true, utf8Out);
+	encode.utf16ToUtf8(data, dataSize + 1, isBigEndian, true, utf8Out);
 #else
-	size_t utf8Len = utf8_16.utf16ToUtf8(data, dataSize + 1, isBigEndian, true, utf8Out);
+	size_t utf8Len = encode.utf16ToUtf8(data, dataSize + 1, isBigEndian, true, utf8Out);
 	assert(utf8Len == utf8Size);
 #endif
 	assert(utf8Size == strlen(utf8Out) + 1);
@@ -2652,7 +3027,9 @@ ASOptions::ASOptions(ASFormatter& formatterArg, ASConsole& consoleArg)
 
 /**
  * parse the options vector
- * optionsVector can be either a fileOptionsVector (options file) or an optionsVector (command line)
+ * optionsVector can be either a fileOptionsVector (option file),
+ * a projectOptionsVector (project option file),
+ * or an optionsVector (command line)
  *
  * @return        true if no errors, false if errors
  */
@@ -2675,7 +3052,7 @@ bool ASOptions::parseOptions(vector<string>& optionsVector, const string& errorI
 			for (i = 1; i < arg.length(); ++i)
 			{
 				if (i > 1
-				        && isalpha((unsigned char)arg[i])
+				        && isalpha((unsigned char) arg[i])
 				        && arg[i - 1] != 'x')
 				{
 					// parse the previous option in subArg
@@ -2702,122 +3079,83 @@ bool ASOptions::parseOptions(vector<string>& optionsVector, const string& errorI
 
 void ASOptions::parseOption(const string& arg, const string& errorInfo)
 {
-	if ( isOption(arg, "style=allman") || isOption(arg, "style=bsd") || isOption(arg, "style=break") )
+	if (isOption(arg, "A1", "style=allman") || isOption(arg, "style=bsd") || isOption(arg, "style=break"))
 	{
 		formatter.setFormattingStyle(STYLE_ALLMAN);
 	}
-	else if ( isOption(arg, "style=java") || isOption(arg, "style=attach") )
+	else if (isOption(arg, "A2", "style=java") || isOption(arg, "style=attach"))
 	{
 		formatter.setFormattingStyle(STYLE_JAVA);
 	}
-	else if ( isOption(arg, "style=k&r") || isOption(arg, "style=kr") || isOption(arg, "style=k/r") )
+	else if (isOption(arg, "A3", "style=k&r") || isOption(arg, "style=kr") || isOption(arg, "style=k/r"))
 	{
 		formatter.setFormattingStyle(STYLE_KR);
 	}
-	else if ( isOption(arg, "style=stroustrup") )
+	else if (isOption(arg, "A4", "style=stroustrup"))
 	{
 		formatter.setFormattingStyle(STYLE_STROUSTRUP);
 	}
-	else if ( isOption(arg, "style=whitesmith") )
+	else if (isOption(arg, "A5", "style=whitesmith"))
 	{
 		formatter.setFormattingStyle(STYLE_WHITESMITH);
 	}
-	else if ( isOption(arg, "style=vtk") )
+	else if (isOption(arg, "A15", "style=vtk"))
 	{
 		formatter.setFormattingStyle(STYLE_VTK);
 	}
-	else if ( isOption(arg, "style=banner") )
+	else if (isOption(arg, "A6", "style=ratliff") || isOption(arg, "style=banner"))
 	{
-		formatter.setFormattingStyle(STYLE_BANNER);
+		formatter.setFormattingStyle(STYLE_RATLIFF);
 	}
-	else if ( isOption(arg, "style=gnu") )
+	else if (isOption(arg, "A7", "style=gnu"))
 	{
 		formatter.setFormattingStyle(STYLE_GNU);
 	}
-	else if ( isOption(arg, "style=linux") || isOption(arg, "style=knf") )
+	else if (isOption(arg, "A8", "style=linux") || isOption(arg, "style=knf"))
 	{
 		formatter.setFormattingStyle(STYLE_LINUX);
 	}
-	else if ( isOption(arg, "style=horstmann") || isOption(arg, "style=run-in") )
+	else if (isOption(arg, "A9", "style=horstmann") || isOption(arg, "style=run-in"))
 	{
 		formatter.setFormattingStyle(STYLE_HORSTMANN);
 	}
-	else if ( isOption(arg, "style=1tbs") || isOption(arg, "style=otbs") )
+	else if (isOption(arg, "A10", "style=1tbs") || isOption(arg, "style=otbs"))
 	{
 		formatter.setFormattingStyle(STYLE_1TBS);
 	}
-	else if ( isOption(arg, "style=google") )
+	else if (isOption(arg, "A14", "style=google"))
 	{
 		formatter.setFormattingStyle(STYLE_GOOGLE);
 	}
-	else if (isOption(arg, "style=mozilla"))
+	else if (isOption(arg, "A16", "style=mozilla"))
 	{
 		formatter.setFormattingStyle(STYLE_MOZILLA);
 	}
-	else if ( isOption(arg, "style=pico") )
+	else if (isOption(arg, "A11", "style=pico"))
 	{
 		formatter.setFormattingStyle(STYLE_PICO);
 	}
-	else if ( isOption(arg, "style=lisp") || isOption(arg, "style=python") )
+	else if (isOption(arg, "A12", "style=lisp") || isOption(arg, "style=python"))
 	{
 		formatter.setFormattingStyle(STYLE_LISP);
 	}
-	else if ( isParamOption(arg, "A") )
-	{
-		int style = 0;
-		string styleParam = getParam(arg, "A");
-		if (styleParam.length() > 0)
-			style = atoi(styleParam.c_str());
-		if (style == 1)
-			formatter.setFormattingStyle(STYLE_ALLMAN);
-		else if (style == 2)
-			formatter.setFormattingStyle(STYLE_JAVA);
-		else if (style == 3)
-			formatter.setFormattingStyle(STYLE_KR);
-		else if (style == 4)
-			formatter.setFormattingStyle(STYLE_STROUSTRUP);
-		else if (style == 5)
-			formatter.setFormattingStyle(STYLE_WHITESMITH);
-		else if (style == 6)
-			formatter.setFormattingStyle(STYLE_BANNER);
-		else if (style == 7)
-			formatter.setFormattingStyle(STYLE_GNU);
-		else if (style == 8)
-			formatter.setFormattingStyle(STYLE_LINUX);
-		else if (style == 9)
-			formatter.setFormattingStyle(STYLE_HORSTMANN);
-		else if (style == 10)
-			formatter.setFormattingStyle(STYLE_1TBS);
-		else if (style == 11)
-			formatter.setFormattingStyle(STYLE_PICO);
-		else if (style == 12)
-			formatter.setFormattingStyle(STYLE_LISP);
-		else if (style == 14)
-			formatter.setFormattingStyle(STYLE_GOOGLE);
-		else if (style == 15)
-			formatter.setFormattingStyle(STYLE_VTK);
-		else if (style == 16)
-			formatter.setFormattingStyle(STYLE_MOZILLA);
-		else
-			isOptionError(arg, errorInfo);
-	}
 	// must check for mode=cs before mode=c !!!
-	else if ( isOption(arg, "mode=cs") )
+	else if (isOption(arg, "mode=cs"))
 	{
 		formatter.setSharpStyle();
 		formatter.setModeManuallySet(true);
 	}
-	else if ( isOption(arg, "mode=c") )
+	else if (isOption(arg, "mode=c"))
 	{
 		formatter.setCStyle();
 		formatter.setModeManuallySet(true);
 	}
-	else if ( isOption(arg, "mode=java") )
+	else if (isOption(arg, "mode=java"))
 	{
 		formatter.setJavaStyle();
 		formatter.setModeManuallySet(true);
 	}
-	else if ( isParamOption(arg, "t", "indent=tab=") )
+	else if (isParamOption(arg, "t", "indent=tab="))
 	{
 		int spaceNum = 4;
 		string spaceNumParam = getParam(arg, "t", "indent=tab=");
@@ -2830,11 +3168,11 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 			formatter.setTabIndentation(spaceNum, false);
 		}
 	}
-	else if ( isOption(arg, "indent=tab") )
+	else if (isOption(arg, "indent=tab"))
 	{
 		formatter.setTabIndentation(4);
 	}
-	else if ( isParamOption(arg, "T", "indent=force-tab=") )
+	else if (isParamOption(arg, "T", "indent=force-tab="))
 	{
 		int spaceNum = 4;
 		string spaceNumParam = getParam(arg, "T", "indent=force-tab=");
@@ -2847,11 +3185,11 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 			formatter.setTabIndentation(spaceNum, true);
 		}
 	}
-	else if ( isOption(arg, "indent=force-tab") )
+	else if (isOption(arg, "indent=force-tab"))
 	{
 		formatter.setTabIndentation(4, true);
 	}
-	else if ( isParamOption(arg, "xT", "indent=force-tab-x=") )
+	else if (isParamOption(arg, "xT", "indent=force-tab-x="))
 	{
 		int tabNum = 8;
 		string tabNumParam = getParam(arg, "xT", "indent=force-tab-x=");
@@ -2864,11 +3202,11 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 			formatter.setForceTabXIndentation(tabNum);
 		}
 	}
-	else if ( isOption(arg, "indent=force-tab-x") )
+	else if (isOption(arg, "indent=force-tab-x"))
 	{
 		formatter.setForceTabXIndentation(8);
 	}
-	else if ( isParamOption(arg, "s", "indent=spaces=") )
+	else if (isParamOption(arg, "s", "indent=spaces="))
 	{
 		int spaceNum = 4;
 		string spaceNumParam = getParam(arg, "s", "indent=spaces=");
@@ -2881,7 +3219,7 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 			formatter.setSpaceIndentation(spaceNum);
 		}
 	}
-	else if ( isOption(arg, "indent=spaces") )
+	else if (isOption(arg, "indent=spaces"))
 	{
 		formatter.setSpaceIndentation(4);
 	}
@@ -2898,7 +3236,7 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else
 			formatter.setContinuationIndentation(contIndent);
 	}
-	else if ( isParamOption(arg, "m", "min-conditional-indent=") )
+	else if (isParamOption(arg, "m", "min-conditional-indent="))
 	{
 		int minIndent = MINCOND_TWO;
 		string minIndentParam = getParam(arg, "m", "min-conditional-indent=");
@@ -2909,7 +3247,7 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else
 			formatter.setMinConditionalIndentOption(minIndent);
 	}
-	else if ( isParamOption(arg, "M", "max-continuation-indent=") )
+	else if (isParamOption(arg, "M", "max-continuation-indent="))
 	{
 		int maxIndent = 40;
 		string maxIndentParam = getParam(arg, "M", "max-continuation-indent=");
@@ -2922,31 +3260,31 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else
 			formatter.setMaxContinuationIndentLength(maxIndent);
 	}
-	else if ( isOption(arg, "N", "indent-namespaces") )
+	else if (isOption(arg, "N", "indent-namespaces"))
 	{
 		formatter.setNamespaceIndent(true);
 	}
-	else if ( isOption(arg, "C", "indent-classes") )
+	else if (isOption(arg, "C", "indent-classes"))
 	{
 		formatter.setClassIndent(true);
 	}
-	else if ( isOption(arg, "xG", "indent-modifiers") )
+	else if (isOption(arg, "xG", "indent-modifiers"))
 	{
 		formatter.setModifierIndent(true);
 	}
-	else if ( isOption(arg, "S", "indent-switches") )
+	else if (isOption(arg, "S", "indent-switches"))
 	{
 		formatter.setSwitchIndent(true);
 	}
-	else if ( isOption(arg, "K", "indent-cases") )
+	else if (isOption(arg, "K", "indent-cases"))
 	{
 		formatter.setCaseIndent(true);
 	}
-	else if ( isOption(arg, "xU", "indent-after-parens") )
+	else if (isOption(arg, "xU", "indent-after-parens"))
 	{
 		formatter.setAfterParenIndent(true);
 	}
-	else if ( isOption(arg, "L", "indent-labels") )
+	else if (isOption(arg, "L", "indent-labels"))
 	{
 		formatter.setLabelIndent(true);
 	}
@@ -2954,52 +3292,52 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 	{
 		formatter.setPreprocBlockIndent(true);
 	}
-	else if ( isOption(arg, "w", "indent-preproc-define") )
+	else if (isOption(arg, "w", "indent-preproc-define"))
 	{
 		formatter.setPreprocDefineIndent(true);
 	}
-	else if ( isOption(arg, "xw", "indent-preproc-cond") )
+	else if (isOption(arg, "xw", "indent-preproc-cond"))
 	{
 		formatter.setPreprocConditionalIndent(true);
 	}
-	else if ( isOption(arg, "y", "break-closing-braces") )
+	else if (isOption(arg, "y", "break-closing-braces"))
 	{
 		formatter.setBreakClosingHeaderBracesMode(true);
 	}
-	else if ( isOption(arg, "O", "keep-one-line-blocks") )
+	else if (isOption(arg, "O", "keep-one-line-blocks"))
 	{
 		formatter.setBreakOneLineBlocksMode(false);
 	}
-	else if ( isOption(arg, "o", "keep-one-line-statements") )
+	else if (isOption(arg, "o", "keep-one-line-statements"))
 	{
 		formatter.setBreakOneLineStatementsMode(false);
 	}
-	else if ( isOption(arg, "P", "pad-paren") )
+	else if (isOption(arg, "P", "pad-paren"))
 	{
 		formatter.setParensOutsidePaddingMode(true);
 		formatter.setParensInsidePaddingMode(true);
 	}
-	else if ( isOption(arg, "d", "pad-paren-out") )
+	else if (isOption(arg, "d", "pad-paren-out"))
 	{
 		formatter.setParensOutsidePaddingMode(true);
 	}
-	else if ( isOption(arg, "xd", "pad-first-paren-out") )
+	else if (isOption(arg, "xd", "pad-first-paren-out"))
 	{
 		formatter.setParensFirstPaddingMode(true);
 	}
-	else if ( isOption(arg, "D", "pad-paren-in") )
+	else if (isOption(arg, "D", "pad-paren-in"))
 	{
 		formatter.setParensInsidePaddingMode(true);
 	}
-	else if ( isOption(arg, "H", "pad-header") )
+	else if (isOption(arg, "H", "pad-header"))
 	{
 		formatter.setParensHeaderPaddingMode(true);
 	}
-	else if ( isOption(arg, "U", "unpad-paren") )
+	else if (isOption(arg, "U", "unpad-paren"))
 	{
 		formatter.setParensUnPaddingMode(true);
 	}
-	else if ( isOption(arg, "p", "pad-oper") )
+	else if (isOption(arg, "p", "pad-oper"))
 	{
 		formatter.setOperatorPaddingMode(true);
 	}
@@ -3007,68 +3345,68 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 	{
 		formatter.setCommaPaddingMode(true);
 	}
-	else if ( isOption(arg, "xe", "delete-empty-lines") )
+	else if (isOption(arg, "xe", "delete-empty-lines"))
 	{
 		formatter.setDeleteEmptyLinesMode(true);
 	}
-	else if ( isOption(arg, "E", "fill-empty-lines") )
+	else if (isOption(arg, "E", "fill-empty-lines"))
 	{
 		formatter.setEmptyLineFill(true);
 	}
-	else if ( isOption(arg, "c", "convert-tabs") )
+	else if (isOption(arg, "c", "convert-tabs"))
 	{
 		formatter.setTabSpaceConversionMode(true);
 	}
-	else if ( isOption(arg, "xy", "close-templates") )
+	else if (isOption(arg, "xy", "close-templates"))
 	{
 		formatter.setCloseTemplatesMode(true);
 	}
-	else if ( isOption(arg, "F", "break-blocks=all") )
+	else if (isOption(arg, "F", "break-blocks=all"))
 	{
 		formatter.setBreakBlocksMode(true);
 		formatter.setBreakClosingHeaderBlocksMode(true);
 	}
-	else if ( isOption(arg, "f", "break-blocks") )
+	else if (isOption(arg, "f", "break-blocks"))
 	{
 		formatter.setBreakBlocksMode(true);
 	}
-	else if ( isOption(arg, "e", "break-elseifs") )
+	else if (isOption(arg, "e", "break-elseifs"))
 	{
 		formatter.setBreakElseIfsMode(true);
 	}
-	else if ( isOption(arg, "xb", "break-one-line-headers") )
+	else if (isOption(arg, "xb", "break-one-line-headers"))
 	{
 		formatter.setBreakOneLineHeadersMode(true);
 	}
-	else if ( isOption(arg, "j", "add-braces") )
+	else if (isOption(arg, "j", "add-braces"))
 	{
 		formatter.setAddBracesMode(true);
 	}
-	else if ( isOption(arg, "J", "add-one-line-braces") )
+	else if (isOption(arg, "J", "add-one-line-braces"))
 	{
 		formatter.setAddOneLineBracesMode(true);
 	}
-	else if ( isOption(arg, "xj", "remove-braces") )
+	else if (isOption(arg, "xj", "remove-braces"))
 	{
 		formatter.setRemoveBracesMode(true);
 	}
-	else if ( isOption(arg, "Y", "indent-col1-comments") )
+	else if (isOption(arg, "Y", "indent-col1-comments"))
 	{
 		formatter.setIndentCol1CommentsMode(true);
 	}
-	else if ( isOption(arg, "align-pointer=type") )
+	else if (isOption(arg, "align-pointer=type"))
 	{
 		formatter.setPointerAlignment(PTR_ALIGN_TYPE);
 	}
-	else if ( isOption(arg, "align-pointer=middle") )
+	else if (isOption(arg, "align-pointer=middle"))
 	{
 		formatter.setPointerAlignment(PTR_ALIGN_MIDDLE);
 	}
-	else if ( isOption(arg, "align-pointer=name") )
+	else if (isOption(arg, "align-pointer=name"))
 	{
 		formatter.setPointerAlignment(PTR_ALIGN_NAME);
 	}
-	else if ( isParamOption(arg, "k") )
+	else if (isParamOption(arg, "k"))
 	{
 		int align = 0;
 		string styleParam = getParam(arg, "k");
@@ -3083,23 +3421,23 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else if (align == 3)
 			formatter.setPointerAlignment(PTR_ALIGN_NAME);
 	}
-	else if ( isOption(arg, "align-reference=none") )
+	else if (isOption(arg, "align-reference=none"))
 	{
 		formatter.setReferenceAlignment(REF_ALIGN_NONE);
 	}
-	else if ( isOption(arg, "align-reference=type") )
+	else if (isOption(arg, "align-reference=type"))
 	{
 		formatter.setReferenceAlignment(REF_ALIGN_TYPE);
 	}
-	else if ( isOption(arg, "align-reference=middle") )
+	else if (isOption(arg, "align-reference=middle"))
 	{
 		formatter.setReferenceAlignment(REF_ALIGN_MIDDLE);
 	}
-	else if ( isOption(arg, "align-reference=name") )
+	else if (isOption(arg, "align-reference=name"))
 	{
 		formatter.setReferenceAlignment(REF_ALIGN_NAME);
 	}
-	else if ( isParamOption(arg, "W") )
+	else if (isParamOption(arg, "W"))
 	{
 		int align = 0;
 		string styleParam = getParam(arg, "W");
@@ -3116,7 +3454,7 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else if (align == 3)
 			formatter.setReferenceAlignment(REF_ALIGN_NAME);
 	}
-	else if ( isParamOption(arg, "max-code-length=") )
+	else if (isParamOption(arg, "max-code-length="))
 	{
 		int maxLength = 50;
 		string maxLengthParam = getParam(arg, "max-code-length=");
@@ -3129,7 +3467,7 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else
 			formatter.setMaxCodeLength(maxLength);
 	}
-	else if ( isParamOption(arg, "xC") )
+	else if (isParamOption(arg, "xC"))
 	{
 		int maxLength = 50;
 		string maxLengthParam = getParam(arg, "xC");
@@ -3140,40 +3478,56 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else
 			formatter.setMaxCodeLength(maxLength);
 	}
-	else if ( isOption(arg, "xL", "break-after-logical") )
+	else if (isOption(arg, "xL", "break-after-logical"))
 	{
 		formatter.setBreakAfterMode(true);
 	}
-	else if ( isOption(arg, "xc", "attach-classes") )
+	else if (isOption(arg, "xc", "attach-classes"))
 	{
 		formatter.setAttachClass(true);
 	}
-	else if ( isOption(arg, "xV", "attach-closing-while") )
+	else if (isOption(arg, "xV", "attach-closing-while"))
 	{
 		formatter.setAttachClosingWhile(true);
 	}
-	else if ( isOption(arg, "xk", "attach-extern-c") )
+	else if (isOption(arg, "xk", "attach-extern-c"))
 	{
 		formatter.setAttachExternC(true);
 	}
-	else if ( isOption(arg, "xn", "attach-namespaces") )
+	else if (isOption(arg, "xn", "attach-namespaces"))
 	{
 		formatter.setAttachNamespace(true);
 	}
-	else if ( isOption(arg, "xl", "attach-inlines") )
+	else if (isOption(arg, "xl", "attach-inlines"))
 	{
 		formatter.setAttachInline(true);
 	}
-	else if ( isOption(arg, "xp", "remove-comment-prefix") )
+	else if (isOption(arg, "xp", "remove-comment-prefix"))
 	{
 		formatter.setStripCommentPrefix(true);
 	}
+	else if (isOption(arg, "xB", "break-return-type"))
+	{
+		formatter.setBreakReturnType(true);
+	}
+	else if (isOption(arg, "xD", "break-return-type-decl"))
+	{
+		formatter.setBreakReturnTypeDecl(true);
+	}
+	else if (isOption(arg, "xf", "attach-return-type"))
+	{
+		formatter.setAttachReturnType(true);
+	}
+	else if (isOption(arg, "xh", "attach-return-type-decl"))
+	{
+		formatter.setAttachReturnTypeDecl(true);
+	}
 	// Objective-C options
-	else if ( isOption(arg, "xQ", "pad-method-prefix") )
+	else if (isOption(arg, "xQ", "pad-method-prefix"))
 	{
 		formatter.setMethodPrefixPaddingMode(true);
 	}
-	else if ( isOption(arg, "xR", "unpad-method-prefix") )
+	else if (isOption(arg, "xR", "unpad-method-prefix"))
 	{
 		formatter.setMethodPrefixUnPaddingMode(true);
 	}
@@ -3197,49 +3551,50 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 	{
 		formatter.setAlignMethodColon(true);
 	}
-	else if ( isOption(arg, "xP0", "pad-method-colon=none") )
+	else if (isOption(arg, "xP0", "pad-method-colon=none"))
 	{
 		formatter.setObjCColonPaddingMode(COLON_PAD_NONE);
 	}
-	else if ( isOption(arg, "xP1", "pad-method-colon=all") )
+	else if (isOption(arg, "xP1", "pad-method-colon=all"))
 	{
 		formatter.setObjCColonPaddingMode(COLON_PAD_ALL);
 	}
-	else if ( isOption(arg, "xP2", "pad-method-colon=after") )
+	else if (isOption(arg, "xP2", "pad-method-colon=after"))
 	{
 		formatter.setObjCColonPaddingMode(COLON_PAD_AFTER);
 	}
-	else if ( isOption(arg, "xP3", "pad-method-colon=before") )
+	else if (isOption(arg, "xP3", "pad-method-colon=before"))
 	{
 		formatter.setObjCColonPaddingMode(COLON_PAD_BEFORE);
 	}
+	// NOTE: depreciated options - remove when appropriate
 	// depreciated options ////////////////////////////////////////////////////////////////////////
-	else if ( isOption(arg, "indent-preprocessor") )		// depreciated release 2.04
+	else if (isOption(arg, "indent-preprocessor"))		// depreciated release 2.04
 	{
 		formatter.setPreprocDefineIndent(true);
 	}
-	else if ( isOption(arg, "style=ansi") )					// depreciated release 2.05
+	else if (isOption(arg, "style=ansi"))					// depreciated release 2.05
 	{
 		formatter.setFormattingStyle(STYLE_ALLMAN);
 	}
 	// depreciated in release 3.0 /////////////////////////////////////////////////////////////////
-	else if ( isOption(arg, "break-closing-brackets") )		// depreciated release 3.0
+	else if (isOption(arg, "break-closing-brackets"))		// depreciated release 3.0
 	{
 		formatter.setBreakClosingHeaderBracketsMode(true);
 	}
-	else if ( isOption(arg, "add-brackets") )				// depreciated release 3.0
+	else if (isOption(arg, "add-brackets"))				// depreciated release 3.0
 	{
 		formatter.setAddBracketsMode(true);
 	}
-	else if ( isOption(arg, "add-one-line-brackets") )		// depreciated release 3.0
+	else if (isOption(arg, "add-one-line-brackets"))		// depreciated release 3.0
 	{
 		formatter.setAddOneLineBracketsMode(true);
 	}
-	else if ( isOption(arg, "remove-brackets") )			// depreciated release 3.0
+	else if (isOption(arg, "remove-brackets"))			// depreciated release 3.0
 	{
 		formatter.setRemoveBracketsMode(true);
 	}
-	else if ( isParamOption(arg, "max-instatement-indent=") )	// depreciated release 3.0
+	else if (isParamOption(arg, "max-instatement-indent="))	// depreciated release 3.0
 	{
 		int maxIndent = 40;
 		string maxIndentParam = getParam(arg, "max-instatement-indent=");
@@ -3252,27 +3607,6 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else
 			formatter.setMaxInStatementIndentLength(maxIndent);
 	}
-//  NOTE: Removed in release 2.04.
-//	else if ( isOption(arg, "b", "brackets=break") )
-//	{
-//		formatter.setBracketFormatMode(BREAK_MODE);
-//	}
-//	else if ( isOption(arg, "a", "brackets=attach") )
-//	{
-//		formatter.setBracketFormatMode(ATTACH_MODE);
-//	}
-//	else if ( isOption(arg, "l", "brackets=linux") )
-//	{
-//		formatter.setBracketFormatMode(LINUX_MODE);
-//	}
-//	else if ( isOption(arg, "u", "brackets=stroustrup") )
-//	{
-//		formatter.setBracketFormatMode(STROUSTRUP_MODE);
-//	}
-//	else if ( isOption(arg, "g", "brackets=run-in") )
-//	{
-//		formatter.setBracketFormatMode(RUN_IN_MODE);
-//	}
 	// end depreciated options ////////////////////////////////////////////////////////////////////
 #ifdef ASTYLE_LIB
 	// End of options used by GUI /////////////////////////////////////////////////////////////////
@@ -3280,11 +3614,11 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		isOptionError(arg, errorInfo);
 #else
 	// Options used by only console ///////////////////////////////////////////////////////////////
-	else if ( isOption(arg, "n", "suffix=none") )
+	else if (isOption(arg, "n", "suffix=none"))
 	{
 		console.setNoBackup(true);
 	}
-	else if ( isParamOption(arg, "suffix=") )
+	else if (isParamOption(arg, "suffix="))
 	{
 		string suffixParam = getParam(arg, "suffix=");
 		if (suffixParam.length() > 0)
@@ -3292,13 +3626,13 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 			console.setOrigSuffix(suffixParam);
 		}
 	}
-	else if ( isParamOption(arg, "exclude=") )
+	else if (isParamOption(arg, "exclude="))
 	{
 		string suffixParam = getParam(arg, "exclude=");
 		if (suffixParam.length() > 0)
 			console.updateExcludeVector(suffixParam);
 	}
-	else if ( isOption(arg, "r", "R") || isOption(arg, "recursive") )
+	else if (isOption(arg, "r", "R") || isOption(arg, "recursive"))
 	{
 		console.setIsRecursive(true);
 	}
@@ -3306,47 +3640,47 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 	{
 		console.setIsDryRun(true);
 	}
-	else if ( isOption(arg, "Z", "preserve-date") )
+	else if (isOption(arg, "Z", "preserve-date"))
 	{
 		console.setPreserveDate(true);
 	}
-	else if ( isOption(arg, "v", "verbose") )
+	else if (isOption(arg, "v", "verbose"))
 	{
 		console.setIsVerbose(true);
 	}
-	else if ( isOption(arg, "Q", "formatted") )
+	else if (isOption(arg, "Q", "formatted"))
 	{
 		console.setIsFormattedOnly(true);
 	}
-	else if ( isOption(arg, "q", "quiet") )
+	else if (isOption(arg, "q", "quiet"))
 	{
 		console.setIsQuiet(true);
 	}
-	else if ( isOption(arg, "i", "ignore-exclude-errors") )
+	else if (isOption(arg, "i", "ignore-exclude-errors"))
 	{
 		console.setIgnoreExcludeErrors(true);
 	}
-	else if ( isOption(arg, "xi", "ignore-exclude-errors-x") )
+	else if (isOption(arg, "xi", "ignore-exclude-errors-x"))
 	{
 		console.setIgnoreExcludeErrorsAndDisplay(true);
 	}
-	else if ( isOption(arg, "X", "errors-to-stdout") )
+	else if (isOption(arg, "X", "errors-to-stdout"))
 	{
 		console.setErrorStream(&cout);
 	}
-	else if ( isOption(arg, "lineend=windows") )
+	else if (isOption(arg, "lineend=windows"))
 	{
 		formatter.setLineEndFormat(LINEEND_WINDOWS);
 	}
-	else if ( isOption(arg, "lineend=linux") )
+	else if (isOption(arg, "lineend=linux"))
 	{
 		formatter.setLineEndFormat(LINEEND_LINUX);
 	}
-	else if ( isOption(arg, "lineend=macold") )
+	else if (isOption(arg, "lineend=macold"))
 	{
 		formatter.setLineEndFormat(LINEEND_MACOLD);
 	}
-	else if ( isParamOption(arg, "z") )
+	else if (isParamOption(arg, "z"))
 	{
 		int lineendType = 0;
 		string lineendParam = getParam(arg, "z");
@@ -3361,25 +3695,13 @@ void ASOptions::parseOption(const string& arg, const string& errorInfo)
 		else if (lineendType == 3)
 			formatter.setLineEndFormat(LINEEND_MACOLD);
 	}
-	else if ( isParamOption(arg, "stdin=") )
-	{
-		string path = getParam(arg, "stdin=");
-		console.standardizePath(path);
-		console.setStdPathIn(path);
-	}
-	else if ( isParamOption(arg, "stdout=") )
-	{
-		string path = getParam(arg, "stdout=");
-		console.standardizePath(path);
-		console.setStdPathOut(path);
-	}
 	else
 		isOptionError(arg, errorInfo);
 #endif
 }	// End of parseOption function
 
-// Parse options from the options file.
-void ASOptions::importOptions(istream& in, vector<string>& optionsVector)
+// Parse options from the option file.
+void ASOptions::importOptions(stringstream& in, vector<string>& optionsVector)
 {
 	char ch;
 	bool isInQuote = false;
@@ -3456,7 +3778,7 @@ void ASOptions::isOptionError(const string& arg, const string& errorInfo)
 {
 	if (optionErrors.str().length() == 0)
 		optionErrors << errorInfo << endl;   // need main error message
-	optionErrors << arg << endl;
+	optionErrors << "\t" << arg << endl;
 }
 
 bool ASOptions::isParamOption(const string& arg, const char* option)
@@ -3464,7 +3786,7 @@ bool ASOptions::isParamOption(const string& arg, const char* option)
 	bool retVal = arg.compare(0, strlen(option), option) == 0;
 	// if comparing for short option, 2nd char of arg must be numeric
 	if (retVal && strlen(option) == 1 && arg.length() > 1)
-		if (!isdigit((unsigned char)arg[1]))
+		if (!isdigit((unsigned char) arg[1]))
 			retVal = false;
 	return retVal;
 }
@@ -3481,7 +3803,7 @@ bool ASOptions::isParamOption(const string& arg, const char* option1, const char
 // Return true if an int is big endian.
 bool ASEncoding::getBigEndian() const
 {
-	short int word = 0x0001;
+	char16_t word = 0x0001;
 	char* byte = (char*) &word;
 	return (byte[0] ? false : true);
 }
@@ -3489,11 +3811,11 @@ bool ASEncoding::getBigEndian() const
 // Swap the two low order bytes of a 16 bit integer value.
 int ASEncoding::swap16bit(int value) const
 {
-	return ( ((value & 0xff) << 8) | ((value & 0xff00) >> 8) );
+	return (((value & 0xff) << 8) | ((value & 0xff00) >> 8));
 }
 
 // Return the length of a utf-16 C string.
-// The length is in number of utf16_t.
+// The length is in number of char16_t.
 size_t ASEncoding::utf16len(const utf16* utf16In) const
 {
 	size_t length = 0;
@@ -3510,16 +3832,16 @@ size_t ASEncoding::utf16len(const utf16* utf16In) const
 size_t ASEncoding::utf8LengthFromUtf16(const char* utf16In, size_t inLen, bool isBigEndian) const
 {
 	size_t len = 0;
-	size_t wcharLen = inLen / 2;
-	const short* uptr = reinterpret_cast<const short*>(utf16In);
-	for (size_t i = 0; i < wcharLen && uptr[i];)
+	size_t wcharLen = (inLen / 2) + (inLen % 2);
+	const char16_t* uptr = reinterpret_cast<const char16_t*>(utf16In);
+	for (size_t i = 0; i < wcharLen;)
 	{
 		size_t uch = isBigEndian ? swap16bit(uptr[i]) : uptr[i];
 		if (uch < 0x80)
 			len++;
 		else if (uch < 0x800)
 			len += 2;
-		else if ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_TRAIL_LAST))
+		else if ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_LEAD_LAST))
 		{
 			len += 4;
 			i++;
@@ -3828,10 +4150,10 @@ char* STDCALL javaMemoryAlloc(unsigned long memoryNeeded)
 *           /EXPORT:AStyleGetVersion=_AStyleGetVersion@0
 * No /EXPORT is required for x64
 */
-extern "C" EXPORT utf16_t* STDCALL AStyleMainUtf16(const utf16_t* pSourceIn,	// the source to be formatted
-                                                   const utf16_t* pOptions,		// AStyle options
-                                                   fpError fpErrorHandler,		// error handler function
-                                                   fpAlloc fpMemoryAlloc)		// memory allocation function
+extern "C" EXPORT char16_t* STDCALL AStyleMainUtf16(const char16_t* pSourceIn,	// the source to be formatted
+                                                    const char16_t* pOptions,	// AStyle options
+                                                    fpError fpErrorHandler,		// error handler function
+                                                    fpAlloc fpMemoryAlloc)		// memory allocation function
 {
 	if (fpErrorHandler == nullptr)         // cannot display a message if no error handler
 		return nullptr;
@@ -3852,17 +4174,17 @@ extern "C" EXPORT utf16_t* STDCALL AStyleMainUtf16(const utf16_t* pSourceIn,	//
 		return nullptr;
 	}
 #ifndef _WIN32
-	// check size of utf16_t on Linux
+	// check size of char16_t on Linux
 	int sizeCheck = 2;
-	if (sizeof(utf16_t) != sizeCheck)
+	if (sizeof(char16_t) != sizeCheck)
 	{
-		fpErrorHandler(104, "Unsigned short is not the correct size.");
+		fpErrorHandler(104, "char16_t is not the correct size.");
 		return nullptr;
 	}
 #endif
 
 	ASLibrary library;
-	utf16_t* utf16Out = library.formatUtf16(pSourceIn, pOptions, fpErrorHandler, fpMemoryAlloc);
+	char16_t* utf16Out = library.formatUtf16(pSourceIn, pOptions, fpErrorHandler, fpMemoryAlloc);
 	return utf16Out;
 }
 
@@ -3904,7 +4226,7 @@ extern "C" EXPORT char* STDCALL AStyleMain(const char* pSourceIn,		// the source
 	ASOptions options(formatter);
 
 	vector<string> optionsVector;
-	istringstream opt(pOptions);
+	stringstream opt(pOptions);
 
 	options.importOptions(opt, optionsVector);
 
@@ -3912,8 +4234,8 @@ extern "C" EXPORT char* STDCALL AStyleMain(const char* pSourceIn,		// the source
 	if (!ok)
 		fpErrorHandler(130, options.getOptionErrors().c_str());
 
-	istringstream in(pSourceIn);
-	ASStreamIterator<istringstream> streamIterator(&in);
+	stringstream in(pSourceIn);
+	ASStreamIterator<stringstream> streamIterator(&in);
 	ostringstream out;
 	formatter.init(&streamIterator);
 
@@ -3934,7 +4256,7 @@ extern "C" EXPORT char* STDCALL AStyleMain(const char* pSourceIn,		// the source
 	}
 
 	size_t textSizeOut = out.str().length();
-	char* pTextOut = fpMemoryAlloc((long)textSizeOut + 1);     // call memory allocation function
+	char* pTextOut = fpMemoryAlloc((long) textSizeOut + 1);     // call memory allocation function
 	if (pTextOut == nullptr)
 	{
 		fpErrorHandler(120, "Allocation failure on output.");
@@ -3970,9 +4292,9 @@ int main(int argc, char** argv)
 {
 	// create objects
 	ASFormatter formatter;
-	auto console = make_shared<ASConsole>(formatter);
+	unique_ptr<ASConsole> console(new ASConsole(formatter));
 
-	// process command line and options file
+	// process command line and option files
 	// build the vectors fileNameVector, optionsVector, and fileOptionsVector
 	vector<string> argvOptions;
 	argvOptions = console->getArgvOptions(argc, argv);
diff --git a/astyle/src/astyle_main.h b/astyle/src/astyle_main.h
index 057bd91de5b1e8be7556c6e0ebbf1798c086349b..32b2be1c7fb02ea594227bfde89001330fe2715e 100755
--- a/astyle/src/astyle_main.h
+++ b/astyle/src/astyle_main.h
@@ -1,5 +1,5 @@
 // astyle_main.h
-// Copyright (c) 2017 by Jim Pattee <jimp03@email.com>.
+// Copyright (c) 2018 by Jim Pattee <jimp03@email.com>.
 // This code is licensed under the MIT License.
 // License.md describes the conditions under which this software may be distributed.
 
@@ -57,9 +57,9 @@
 	#pragma warning(disable: 4996)  // secure version deprecation warnings
 #endif
 
-// for namespace problem in version 5.0
-#if defined(_MSC_VER) && _MSC_VER < 1200        // check for V6.0
-	#error - Use Microsoft compiler version 6 or higher
+// for Visual Studio supported C++11 standard
+#if defined(_MSC_VER) && _MSC_VER < 1600
+	#error Use Microsoft Visual Studio 2010 or higher
 #endif
 
 #ifdef __clang__
@@ -101,8 +101,6 @@
 		#endif
 	#endif	// #ifdef _WIN32
 
-	// define utf-16 bit text for the platform
-	typedef unsigned short utf16_t;
 	// define pointers to callback error handler and memory allocation
 	typedef void (STDCALL* fpError)(int errorNumber, const char* errorMessage);
 	typedef char* (STDCALL* fpAlloc)(unsigned long memoryNeeded);
@@ -117,8 +115,9 @@ namespace astyle {
 //
 //----------------------------------------------------------------------------
 // ASStreamIterator class
-// typename will be istringstream for GUI and istream otherwise
-// ASSourceIterator is an abstract class defined in astyle.h
+// typename will be stringstream for AStyle
+// it could be istream or wxChar for plug-ins
+// ASSourceIterator is an inherited abstract class defined in astyle.h
 //----------------------------------------------------------------------------
 
 template<typename T>
@@ -156,6 +155,7 @@ public:	// inline functions
 	bool compareToInputBuffer(const string& nextLine_) const
 	{ return (nextLine_ == prevBuffer); }
 	const string& getOutputEOL() const { return outputEOL; }
+	streamoff getPeekStart() const { return peekStart; }
 	bool hasMoreLines() const { return !inStream->eof(); }
 };
 
@@ -167,7 +167,7 @@ public:	// inline functions
 class ASEncoding
 {
 private:
-	typedef unsigned short utf16; // 16 bits
+	typedef char16_t utf16;       // 16 bits unsigned
 	typedef unsigned char utf8;   // 8 bits
 	typedef unsigned char ubyte;  // 8 bits
 	enum { SURROGATE_LEAD_FIRST = 0xD800 };
@@ -203,7 +203,7 @@ public:
 	ASOptions(ASFormatter& formatterArg, ASConsole& consoleArg);
 #endif
 	string getOptionErrors() const;
-	void importOptions(istream& in, vector<string>& optionsVector);
+	void importOptions(stringstream& in, vector<string>& optionsVector);
 	bool parseOptions(vector<string>& optionsVector, const string& errorInfo);
 
 private:
@@ -237,7 +237,8 @@ class ASConsole
 {
 private:    // variables
 	ASFormatter& formatter;             // reference to the ASFormatter object
-	ASLocalizer localizer;              // ASLocalizer object
+	ASEncoding encode;                  // file encoding conversion
+	ASLocalizer localizer;              // language translation
 	ostream* errorStream;               // direct error messages to cerr or cout
 	// command line options
 	bool isRecursive;                   // recursive option
@@ -249,7 +250,6 @@ private:    // variables
 	bool isFormattedOnly;               // formatted lines only option
 	bool ignoreExcludeErrors;           // don't abort on unmatched excludes
 	bool ignoreExcludeErrorsDisplay;    // don't display unmatched excludes
-	bool optionsFileRequired;           // options= option
 	bool useAscii;                      // ascii option
 	// other variables
 	bool bypassBrowserOpen;             // don't open the browser on html options
@@ -261,12 +261,11 @@ private:    // variables
 	bool lineEndsMixed;                 // output has mixed line ends
 	int  linesOut;                      // number of output lines
 
-	ASEncoding utf8_16;                 // utf8/16 conversion methods
-
 	string outputEOL;                   // current line end
 	string prevEOL;                     // previous line end
-	string optionsFileName;             // file path and name of the options file to use
+	string optionFileName;              // file path and name of the options file
 	string origSuffix;                  // suffix= option
+	string projectOptionFileName;       // file path and name of the project options file
 	string stdPathIn;                   // path to input from stdin=
 	string stdPathOut;                  // path to output from stdout=
 	string targetDirectory;             // path to the directory being processed
@@ -276,6 +275,7 @@ private:    // variables
 	vector<bool>   excludeHitsVector;   // exclude flags for error reporting
 	vector<string> fileNameVector;      // file paths and names from the command line
 	vector<string> optionsVector;       // options from the command line
+	vector<string> projectOptionsVector;// project options from the project options file
 	vector<string> fileOptionsVector;   // options from the options file
 	vector<string> fileName;            // files to be processed including path
 
@@ -288,6 +288,7 @@ public:     // functions
 	void error(const char* why, const char* what) const;
 	void formatCinToCout();
 	vector<string> getArgvOptions(int argc, char** argv) const;
+	bool fileExists(const char* file) const;
 	bool fileNameVectorIsEmpty() const;
 	ostream* getErrorStream() const;
 	bool getFilesAreIdentical() const;
@@ -305,10 +306,12 @@ public:     // functions
 	string getLanguageID() const;
 	string getNumberFormat(int num, size_t lcid = 0) const;
 	string getNumberFormat(int num, const char* groupingArg, const char* separator) const;
-	string getOptionsFileName() const;
+	string getOptionFileName() const;
 	string getOrigSuffix() const;
+	string getProjectOptionFileName() const;
 	string getStdPathIn() const;
 	string getStdPathOut() const;
+	void getTargetFilenames(string& targetFilename_, vector<string>& targetFilenameVector) const;
 	void processFiles();
 	void processOptions(const vector<string>& argvOptions);
 	void setBypassBrowserOpen(bool state);
@@ -321,9 +324,10 @@ public:     // functions
 	void setIsRecursive(bool state);
 	void setIsVerbose(bool state);
 	void setNoBackup(bool state);
-	void setOptionsFileName(const string& name);
+	void setOptionFileName(const string& name);
 	void setOrigSuffix(const string& suffix);
 	void setPreserveDate(bool state);
+	void setProjectOptionFileName(const string& optfilepath);
 	void setStdPathIn(const string& path);
 	void setStdPathOut(const string& path);
 	void standardizePath(string& path, bool removeBeginningSeparator = false) const;
@@ -333,6 +337,7 @@ public:     // functions
 	vector<bool>   getExcludeHitsVector() const;
 	vector<string> getFileNameVector() const;
 	vector<string> getOptionsVector() const;
+	vector<string> getProjectOptionsVector() const;
 	vector<string> getFileOptionsVector() const;
 	vector<string> getFileName() const;
 
@@ -341,10 +346,14 @@ private:	// functions
 	ASConsole& operator=(ASConsole&);      // assignment operator not to be implemented
 	void correctMixedLineEnds(ostringstream& out);
 	void formatFile(const string& fileName_);
+	string getParentDirectory(const string& absPath) const;
+	string findProjectOptionFilePath(const string& fileName_) const;
 	string getCurrentDirectory(const string& fileName_) const;
-	void getFileNames(const string& directory, const string& wildcard);
+	void getFileNames(const string& directory, const vector<string>& wildcards);
 	void getFilePaths(const string& filePath);
+	string getFullPathName(const string& relativePath) const;
 	string getParam(const string& arg, const char* op);
+	bool isHomeOrInvalidAbsPath(const string& absPath) const;
 	void initializeOutputEOL(LineEndFormat lineEndFormat);
 	bool isOption(const string& arg, const char* op);
 	bool isOption(const string& arg, const char* a, const char* b);
@@ -380,15 +389,15 @@ public:
 	ASLibrary() {}
 	virtual ~ASLibrary() {}
 	// virtual functions are mocked in testing
-	utf16_t* formatUtf16(const utf16_t*, const utf16_t*, fpError, fpAlloc) const;
-	virtual utf16_t* convertUtf8ToUtf16(const char* utf8In, fpAlloc fpMemoryAlloc) const;
-	virtual char* convertUtf16ToUtf8(const utf16_t* utf16In) const;
+	char16_t* formatUtf16(const char16_t*, const char16_t*, fpError, fpAlloc) const;
+	virtual char16_t* convertUtf8ToUtf16(const char* utf8In, fpAlloc fpMemoryAlloc) const;
+	virtual char* convertUtf16ToUtf8(const char16_t* utf16In) const;
 
 private:
 	static char* STDCALL tempMemoryAllocation(unsigned long memoryNeeded);
 
 private:
-	ASEncoding utf8_16;         // utf8/16 conversion methods
+	ASEncoding encode;             // file encoding conversion
 };
 
 #endif	// ASTYLE_LIB
@@ -420,10 +429,10 @@ jstring STDCALL Java_AStyleInterface_AStyleMain(JNIEnv* env,
 //----------------------------------------------------------------------------
 #ifdef ASTYLE_LIB
 extern "C" EXPORT
-utf16_t* STDCALL AStyleMainUtf16(const utf16_t* pSourceIn,
-                                 const utf16_t* pOptions,
-                                 fpError fpErrorHandler,
-                                 fpAlloc fpMemoryAlloc);
+char16_t* STDCALL AStyleMainUtf16(const char16_t* pSourceIn,
+                                  const char16_t* pOptions,
+                                  fpError fpErrorHandler,
+                                  fpAlloc fpMemoryAlloc);
 #endif	// ASTYLE_LIB
 
 //-----------------------------------------------------------------------------