Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 16:20:39 -0500
committerJonah Graham2018-11-20 16:20:39 -0500
commit48d2271a58a68743e428d3096d2bca054d04e310 (patch)
tree235ba23e71c393ad22d1d57fc8fdfec14754c4ee /core
parent3cf0297769e5cfb91823e93ce570120a75fe01ce (diff)
downloadorg.eclipse.cdt-48d2271a58a68743e428d3096d2bca054d04e310.tar.gz
org.eclipse.cdt-48d2271a58a68743e428d3096d2bca054d04e310.tar.xz
org.eclipse.cdt-48d2271a58a68743e428d3096d2bca054d04e310.zip
Bug 540373: Normalize newlines with .gitattributes
There is also a new script to verify completeness of .gitattributes: releng/scripts/verify_gitattributes.sh Change-Id: I2ce270852ab54b66b6c474a6ec94203fe5bba78b
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h64
-rw-r--r--core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h58
-rw-r--r--core/org.eclipse.cdt.core.linux/library/exec0.h58
-rw-r--r--core/org.eclipse.cdt.core.linux/library/exec_pty.c372
-rw-r--r--core/org.eclipse.cdt.core.linux/library/exec_unix.c316
-rw-r--r--core/org.eclipse.cdt.core.linux/library/io.c228
-rw-r--r--core/org.eclipse.cdt.core.linux/library/spawner.c604
-rw-r--r--core/org.eclipse.cdt.core.linux/plugin.properties4
-rw-r--r--core/org.eclipse.cdt.core.macosx/library/exec_pty.c372
-rw-r--r--core/org.eclipse.cdt.core.macosx/plugin.properties4
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java64
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java604
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java1916
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java206
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h290
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c138
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cfiles/included.h20
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp48
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h84
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h8
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp144
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp16
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h16
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp16
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h16
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp14
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h16
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h14
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/a.h14
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/c.h10
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/dependency/d.h10
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp50
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp224
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp42
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c86
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h34
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp74
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h64
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h84
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp202
-rw-r--r--core/org.eclipse.cdt.core.tests/resources/search/include.h70
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CModelMock.java992
-rw-r--r--core/org.eclipse.cdt.core.win32.x86/.project44
-rw-r--r--core/org.eclipse.cdt.core.win32.x86/about.html46
-rw-r--r--core/org.eclipse.cdt.core.win32.x86/build.properties30
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/.project44
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/about.html46
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/build.properties30
-rw-r--r--core/org.eclipse.cdt.core.win32/library/Makefile_x86_64.mk146
-rw-r--r--core/org.eclipse.cdt.core.win32/library/Readme64.txt46
-rw-r--r--core/org.eclipse.cdt.core.win32/library/build64.bat22
-rw-r--r--core/org.eclipse.cdt.core.win32/library/cdt-win32.sln66
-rw-r--r--core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp36
-rw-r--r--core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h58
-rw-r--r--core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp692
-rw-r--r--core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp234
-rw-r--r--core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw58
-rw-r--r--core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h42
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTY.h90
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYInputStream.h62
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYOutputStream.h58
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/pty.sln92
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj352
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj.filters58
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj368
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj.filters178
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj332
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj.filters76
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/dllmain.cpp56
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/stdafx.cpp28
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/stdafx.h44
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/targetver.h36
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/winreg.cpp302
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj348
-rw-r--r--core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj.filters70
-rw-r--r--core/org.eclipse.cdt.core.win32/plugin.properties4
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ILanguageSettingsProvidersKeeper.java136
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/IWorkingDirectoryTracker.java56
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java530
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java578
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java872
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICFileDescription.java28
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java232
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java454
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/PathEntryScannerInfoLanguageSettingsProvider.java330
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ReferencedProjectsLanguageSettingsProvider.java158
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/ScannerInfoExtensionLanguageSettingsProvider.java316
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BatchOperation.java116
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPAliasTemplate.java56
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/rewrite/DeclarationGenerator.java90
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/ResourceContainerRelativeLocationConverter.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/StandardAttributes.java60
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPAliasTemplate.java334
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPAliasTemplateInstance.java330
-rw-r--r--core/org.eclipse.cdt.core/schema/buildConfigProvider.exsd238
-rw-r--r--core/org.eclipse.cdt.core/schema/toolChainProvider.exsd264
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/IToolChain.java548
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/StreamProgressMonitor.java216
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/ToolChainEnvironmentSupplier.java128
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCategory.java88
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine2.java66
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateInfo2.java78
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Cygwin.java666
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/LRUCache.java98
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/MinGW.java718
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/envvar/IEnvironmentChangeListener.java54
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart.h144
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart1.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart10.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart11.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart12.h12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart13.h10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart14.cpp10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart15.cpp10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart16.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart17.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart18.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart19.cpp10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart2.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart20.h8
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart21.h6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart22.cpp16
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart23.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart24.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart25.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart26.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart27.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart28.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart29.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart3.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart30.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart31.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart32.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart33.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart34.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart35.cpp10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart36.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart37.cpp10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart38.cpp20
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart39.cpp18
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart4.h10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart5.cpp12
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart6.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart7.cpp20
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart8.cpp10
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart9.cpp14
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java94
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHContentProvider.java122
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHExtensionTest.java212
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHLabelProvider.java144
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/CHOpenListener.java184
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/extension/DslNode.java152
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/TemplateProposalTest.java446
-rw-r--r--core/org.eclipse.cdt.ui/schema/CCallHierarchy.exsd296
-rw-r--r--core/org.eclipse.cdt.ui/schema/newToolChainWizards.exsd258
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ImageCombo.java3002
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHEProviderSettings.java194
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHPinAction.java74
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeAction.java378
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OrganizeIncludesAction.java284
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsImages.java490
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProviderAssociationManager.java722
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/language/settings/providers/LanguageSettingsProvidersLabelProvider.java200
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/newui/StatusMessageLine.java158
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringContribution.java64
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringDescriptor.java96
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoringRunner.java86
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICHEContentProvider.java48
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICHENode.java46
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/WorkingSetConfigAction.java168
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/language/settings/providers/AbstractLanguageSettingProviderOptionPage.java176
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/language/settings/providers/LanguageSettingsProvidersImages.java66
172 files changed, 14217 insertions, 14217 deletions
diff --git a/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h b/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h
index 3b32d2b280..ecf8f8c6a7 100644
--- a/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h
+++ b/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h
@@ -1,32 +1,32 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */
-
-#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream
-#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream
-#ifdef __cplusplus
-extern "C" {
-#endif
-#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE
-#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L
-/* Inaccessible static: skipBuffer */
-/*
- * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream
- * Method: read0
- * Signature: (I[BI)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0
- (JNIEnv *, jobject, jint, jbyteArray, jint);
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
- * Method: close0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0
- (JNIEnv *, jobject, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */
+
+#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream
+#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE
+#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L
+/* Inaccessible static: skipBuffer */
+/*
+ * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream
+ * Method: read0
+ * Signature: (I[BI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0
+ (JNIEnv *, jobject, jint, jbyteArray, jint);
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
+ * Method: close0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0
+ (JNIEnv *, jobject, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h b/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h
index f835947e06..444d71c698 100644
--- a/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h
+++ b/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h
@@ -1,29 +1,29 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */
-
-#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream
-#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
- * Method: write0
- * Signature: (I[BI)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0
- (JNIEnv *, jobject, jint, jbyteArray, jint);
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
- * Method: close0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0
- (JNIEnv *, jobject, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */
+
+#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream
+#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
+ * Method: write0
+ * Signature: (I[BI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0
+ (JNIEnv *, jobject, jint, jbyteArray, jint);
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
+ * Method: close0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0
+ (JNIEnv *, jobject, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/org.eclipse.cdt.core.linux/library/exec0.h b/core/org.eclipse.cdt.core.linux/library/exec0.h
index 3033ec1a5a..bdc56dafa7 100644
--- a/core/org.eclipse.cdt.core.linux/library/exec0.h
+++ b/core/org.eclipse.cdt.core.linux/library/exec0.h
@@ -1,29 +1,29 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- * Wind River Systems, Inc.
- * Mikhail Zabaluev (Nokia) - bug 82744
- *******************************************************************************/
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-extern pid_t exec0(const char *path, char *const argv[],
- char *const envp[], const char *dirpath,
- int channels[3]);
-
-
-extern pid_t exec_pty(const char *path, char *const argv[],
- char *const envp[], const char *dirpath,
- int channels[3], const char *pts_name, int fdm,
- int console);
-
-extern int wait0(pid_t pid);
+/*******************************************************************************
+ * Copyright (c) 2002, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ * Mikhail Zabaluev (Nokia) - bug 82744
+ *******************************************************************************/
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <errno.h>
+
+extern pid_t exec0(const char *path, char *const argv[],
+ char *const envp[], const char *dirpath,
+ int channels[3]);
+
+
+extern pid_t exec_pty(const char *path, char *const argv[],
+ char *const envp[], const char *dirpath,
+ int channels[3], const char *pts_name, int fdm,
+ int console);
+
+extern int wait0(pid_t pid);
diff --git a/core/org.eclipse.cdt.core.linux/library/exec_pty.c b/core/org.eclipse.cdt.core.linux/library/exec_pty.c
index dd68615f0e..752f545a98 100644
--- a/core/org.eclipse.cdt.core.linux/library/exec_pty.c
+++ b/core/org.eclipse.cdt.core.linux/library/exec_pty.c
@@ -1,186 +1,186 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- * Wind River Systems, Inc.
- * Mikhail Zabaluev (Nokia) - bug 82744
- * Mikhail Sennikovsky - bug 145737
- *******************************************************************************/
-#include "exec0.h"
-#include "openpty.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <libgen.h>
-#include <stdlib.h>
-#include <termios.h>
-
-/* from pfind.c */
-extern char *pfind(const char *name, char * const envp[]);
-
-pid_t
-exec_pty(const char *path, char *const argv[], char *const envp[],
- const char *dirpath, int channels[3], const char *pts_name, int fdm, int console)
-{
- int pipe2[2];
- pid_t childpid;
- char *full_path;
-
- /*
- * We use pfind() to check that the program exists and is an executable.
- * If not pass the error up. Also execve() wants a full path.
- */
- full_path = pfind(path, envp);
- if (full_path == NULL) {
- fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
- return -1;
- }
-
- /*
- * Make sure we can create our pipes before forking.
- */
- if (channels != NULL && console) {
- if (pipe(pipe2) < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
- free(full_path);
- return -1;
- }
- }
-
- childpid = fork();
-
- if (childpid < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
- free(full_path);
- return -1;
- } else if (childpid == 0) { /* child */
-
- chdir(dirpath);
-
- if (channels != NULL) {
- int fds;
-
- if (!console && setsid() < 0) {
- perror("setsid()");
- return -1;
- }
-
- fds = ptys_open(fdm, pts_name);
- if (fds < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
- return -1;
- }
-
- /* Close the read end of pipe2 */
- if (console && close(pipe2[0]) == -1) {
- perror("close(pipe2[0]))");
- }
-
- /* close the master, no need in the child */
- close(fdm);
-
- if (console) {
- set_noecho(fds);
- if (setpgid(getpid(), getpid()) < 0) {
- perror("setpgid()");
- return -1;
- }
- }
-
- /* redirections */
- dup2(fds, STDIN_FILENO); /* dup stdin */
- dup2(fds, STDOUT_FILENO); /* dup stdout */
- if (console) {
- dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
- } else {
- dup2(fds, STDERR_FILENO); /* dup stderr */
- }
- close(fds); /* done with fds. */
- }
-
- /* Close all the fd's in the child */
- {
- int fdlimit = sysconf(_SC_OPEN_MAX);
- int fd = 3;
-
- while (fd < fdlimit)
- close(fd++);
- }
-
- if (envp[0] == NULL) {
- execv(full_path, argv);
- } else {
- execve(full_path, argv, envp);
- }
-
- _exit(127);
-
- } else if (childpid != 0) { /* parent */
- if (console) {
- set_noecho(fdm);
- }
- if (channels != NULL) {
- channels[0] = fdm; /* Input Stream. */
- channels[1] = fdm; /* Output Stream. */
- if (console) {
- /* close the write end of pipe1 */
- if (close(pipe2[1]) == -1)
- perror("close(pipe2[1])");
- channels[2] = pipe2[0]; /* stderr Stream. */
- } else {
- channels[2] = fdm; /* Error Stream. */
- }
- }
-
- free(full_path);
- return childpid;
- }
-
- free(full_path);
- return -1; /*NOT REACHED */
-}
-#ifdef __STAND_ALONE__
-int main(int argc, char **argv, char **envp) {
- const char *path = "./bufferring_test";
- int channels[3] = { -1, -1, -1};
- int status;
- FILE *app_stdin;
- FILE *app_stdout;
- FILE *app_stderr;
- char pts_name[32];
- int fdm;
- char buffer[32];
-
- fdm = ptym_open(pts_name);
- status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
- if (status >= 0) {
- app_stdin = fdopen(channels[0], "w");
- app_stdout = fdopen(channels[1], "r");
- app_stderr = fdopen(channels[2], "r");
- if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) {
- fprintf(stderr, "PROBLEMS\n");
- } else {
- fputs("foo\n", app_stdin);
- fputs("bar\n", app_stdin);
- while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
- fprintf(stdout, "STDOUT: %s\n", buffer);
- }
- while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
- fprintf(stdout, "STDERR: %s\n", buffer);
- }
- }
- }
- fputs("bye\n", stdout);
- close(channels[0]);
- close(channels[1]);
- close(channels[2]);
- return 0;
-}
-#endif
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ * Mikhail Zabaluev (Nokia) - bug 82744
+ * Mikhail Sennikovsky - bug 145737
+ *******************************************************************************/
+#include "exec0.h"
+#include "openpty.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <termios.h>
+
+/* from pfind.c */
+extern char *pfind(const char *name, char * const envp[]);
+
+pid_t
+exec_pty(const char *path, char *const argv[], char *const envp[],
+ const char *dirpath, int channels[3], const char *pts_name, int fdm, int console)
+{
+ int pipe2[2];
+ pid_t childpid;
+ char *full_path;
+
+ /*
+ * We use pfind() to check that the program exists and is an executable.
+ * If not pass the error up. Also execve() wants a full path.
+ */
+ full_path = pfind(path, envp);
+ if (full_path == NULL) {
+ fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
+ return -1;
+ }
+
+ /*
+ * Make sure we can create our pipes before forking.
+ */
+ if (channels != NULL && console) {
+ if (pipe(pipe2) < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ free(full_path);
+ return -1;
+ }
+ }
+
+ childpid = fork();
+
+ if (childpid < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ free(full_path);
+ return -1;
+ } else if (childpid == 0) { /* child */
+
+ chdir(dirpath);
+
+ if (channels != NULL) {
+ int fds;
+
+ if (!console && setsid() < 0) {
+ perror("setsid()");
+ return -1;
+ }
+
+ fds = ptys_open(fdm, pts_name);
+ if (fds < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ return -1;
+ }
+
+ /* Close the read end of pipe2 */
+ if (console && close(pipe2[0]) == -1) {
+ perror("close(pipe2[0]))");
+ }
+
+ /* close the master, no need in the child */
+ close(fdm);
+
+ if (console) {
+ set_noecho(fds);
+ if (setpgid(getpid(), getpid()) < 0) {
+ perror("setpgid()");
+ return -1;
+ }
+ }
+
+ /* redirections */
+ dup2(fds, STDIN_FILENO); /* dup stdin */
+ dup2(fds, STDOUT_FILENO); /* dup stdout */
+ if (console) {
+ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
+ } else {
+ dup2(fds, STDERR_FILENO); /* dup stderr */
+ }
+ close(fds); /* done with fds. */
+ }
+
+ /* Close all the fd's in the child */
+ {
+ int fdlimit = sysconf(_SC_OPEN_MAX);
+ int fd = 3;
+
+ while (fd < fdlimit)
+ close(fd++);
+ }
+
+ if (envp[0] == NULL) {
+ execv(full_path, argv);
+ } else {
+ execve(full_path, argv, envp);
+ }
+
+ _exit(127);
+
+ } else if (childpid != 0) { /* parent */
+ if (console) {
+ set_noecho(fdm);
+ }
+ if (channels != NULL) {
+ channels[0] = fdm; /* Input Stream. */
+ channels[1] = fdm; /* Output Stream. */
+ if (console) {
+ /* close the write end of pipe1 */
+ if (close(pipe2[1]) == -1)
+ perror("close(pipe2[1])");
+ channels[2] = pipe2[0]; /* stderr Stream. */
+ } else {
+ channels[2] = fdm; /* Error Stream. */
+ }
+ }
+
+ free(full_path);
+ return childpid;
+ }
+
+ free(full_path);
+ return -1; /*NOT REACHED */
+}
+#ifdef __STAND_ALONE__
+int main(int argc, char **argv, char **envp) {
+ const char *path = "./bufferring_test";
+ int channels[3] = { -1, -1, -1};
+ int status;
+ FILE *app_stdin;
+ FILE *app_stdout;
+ FILE *app_stderr;
+ char pts_name[32];
+ int fdm;
+ char buffer[32];
+
+ fdm = ptym_open(pts_name);
+ status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
+ if (status >= 0) {
+ app_stdin = fdopen(channels[0], "w");
+ app_stdout = fdopen(channels[1], "r");
+ app_stderr = fdopen(channels[2], "r");
+ if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) {
+ fprintf(stderr, "PROBLEMS\n");
+ } else {
+ fputs("foo\n", app_stdin);
+ fputs("bar\n", app_stdin);
+ while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
+ fprintf(stdout, "STDOUT: %s\n", buffer);
+ }
+ while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
+ fprintf(stdout, "STDERR: %s\n", buffer);
+ }
+ }
+ }
+ fputs("bye\n", stdout);
+ close(channels[0]);
+ close(channels[1]);
+ close(channels[2]);
+ return 0;
+}
+#endif
diff --git a/core/org.eclipse.cdt.core.linux/library/exec_unix.c b/core/org.eclipse.cdt.core.linux/library/exec_unix.c
index ced7b744da..0d68dd13c0 100644
--- a/core/org.eclipse.cdt.core.linux/library/exec_unix.c
+++ b/core/org.eclipse.cdt.core.linux/library/exec_unix.c
@@ -1,158 +1,158 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- * Wind River Systems, Inc.
- * Mikhail Sennikovsky - bug 145737
- *******************************************************************************/
-#include "exec0.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <libgen.h>
-#include <stdlib.h>
-
-/* from pfind.c */
-extern char *pfind(const char *name, char * const envp[]);
-
-pid_t
-exec0(const char *path, char *const argv[], char *const envp[],
- const char *dirpath, int channels[3])
-{
- int pipe0[2], pipe1[2], pipe2[2];
- pid_t childpid;
- char *full_path;
-
- /*
- * We use pfind() to check that the program exists and is an executable.
- * If not pass the error up. Also execve() wants a full path.
- */
- full_path = pfind(path, envp);
- if (full_path == NULL) {
- fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
- return -1;
- }
-
- /*
- * Make sure we can create our pipes before forking.
- */
- if (channels != NULL) {
- if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) {
- fprintf(stderr, "%s(%d): returning due to error.\n",
- __FUNCTION__, __LINE__);
- free(full_path);
- return -1;
- }
- }
-
- childpid = fork();
-
- if (childpid < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n",
- __FUNCTION__, __LINE__, strerror(errno));
- free(full_path);
- return -1;
- } else if (childpid == 0) { /* child */
- char *ptr;
-
- chdir(dirpath);
-
- if (channels != NULL) {
- /* Close the write end of pipe0 */
- if (close(pipe0[1]) == -1)
- perror("close(pipe0[1])");
-
- /* Close the read end of pipe1 */
- if (close(pipe1[0]) == -1)
- perror("close(pipe1[0])");
-
- /* Close the read end of pipe2 */
- if (close(pipe2[0]) == -1)
- perror("close(pipe2[0]))");
-
- /* redirections */
- dup2(pipe0[0], STDIN_FILENO); /* dup stdin */
- dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */
- dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
- }
-
- /* Close all the fd's in the child */
- {
- int fdlimit = sysconf(_SC_OPEN_MAX);
- int fd = 3;
-
- while (fd < fdlimit)
- close(fd++);
- }
-
- setpgid(getpid(), getpid());
-
- if (envp[0] == NULL) {
- execv(full_path, argv);
- } else {
- execve(full_path, argv, envp);
- }
-
- _exit(127);
-
- } else if (childpid != 0) { /* parent */
-
- char b;
-
- if (channels != NULL) {
- /* close the read end of pipe1 */
- if (close(pipe0[0]) == -1)
- perror("close(pipe0[0])");
-
- /* close the write end of pipe2 */
- if (close(pipe1[1]) == -1)
- perror("close(pipe1[1])");
-
- /* close the write end of pipe2 */
- if (close(pipe2[1]) == -1)
- perror("close(pipe2[1])");
-
- channels[0] = pipe0[1]; /* Output Stream. */
- channels[1] = pipe1[0]; /* Input Stream. */
- channels[2] = pipe2[0]; /* Input Stream. */
- }
-
- free(full_path);
- return childpid;
- }
-
- free(full_path);
- return -1; /*NOT REACHED */
-}
-
-
-int wait0(pid_t pid)
-{
- int status;
- int val = -1;
-
- if (pid < 0)
- return -1;
-
- for (;;) {
- if (waitpid(pid, &status, 0) < 0) {
- if (errno == EINTR) {
- // interrupted system call - retry
- continue;
- }
- }
- break;
- }
- if (WIFEXITED(status)) {
- val = WEXITSTATUS(status);
- }
-
- return val;
-}
+/*******************************************************************************
+ * Copyright (c) 2002, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ * Mikhail Sennikovsky - bug 145737
+ *******************************************************************************/
+#include "exec0.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <libgen.h>
+#include <stdlib.h>
+
+/* from pfind.c */
+extern char *pfind(const char *name, char * const envp[]);
+
+pid_t
+exec0(const char *path, char *const argv[], char *const envp[],
+ const char *dirpath, int channels[3])
+{
+ int pipe0[2], pipe1[2], pipe2[2];
+ pid_t childpid;
+ char *full_path;
+
+ /*
+ * We use pfind() to check that the program exists and is an executable.
+ * If not pass the error up. Also execve() wants a full path.
+ */
+ full_path = pfind(path, envp);
+ if (full_path == NULL) {
+ fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
+ return -1;
+ }
+
+ /*
+ * Make sure we can create our pipes before forking.
+ */
+ if (channels != NULL) {
+ if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) {
+ fprintf(stderr, "%s(%d): returning due to error.\n",
+ __FUNCTION__, __LINE__);
+ free(full_path);
+ return -1;
+ }
+ }
+
+ childpid = fork();
+
+ if (childpid < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n",
+ __FUNCTION__, __LINE__, strerror(errno));
+ free(full_path);
+ return -1;
+ } else if (childpid == 0) { /* child */
+ char *ptr;
+
+ chdir(dirpath);
+
+ if (channels != NULL) {
+ /* Close the write end of pipe0 */
+ if (close(pipe0[1]) == -1)
+ perror("close(pipe0[1])");
+
+ /* Close the read end of pipe1 */
+ if (close(pipe1[0]) == -1)
+ perror("close(pipe1[0])");
+
+ /* Close the read end of pipe2 */
+ if (close(pipe2[0]) == -1)
+ perror("close(pipe2[0]))");
+
+ /* redirections */
+ dup2(pipe0[0], STDIN_FILENO); /* dup stdin */
+ dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */
+ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
+ }
+
+ /* Close all the fd's in the child */
+ {
+ int fdlimit = sysconf(_SC_OPEN_MAX);
+ int fd = 3;
+
+ while (fd < fdlimit)
+ close(fd++);
+ }
+
+ setpgid(getpid(), getpid());
+
+ if (envp[0] == NULL) {
+ execv(full_path, argv);
+ } else {
+ execve(full_path, argv, envp);
+ }
+
+ _exit(127);
+
+ } else if (childpid != 0) { /* parent */
+
+ char b;
+
+ if (channels != NULL) {
+ /* close the read end of pipe1 */
+ if (close(pipe0[0]) == -1)
+ perror("close(pipe0[0])");
+
+ /* close the write end of pipe2 */
+ if (close(pipe1[1]) == -1)
+ perror("close(pipe1[1])");
+
+ /* close the write end of pipe2 */
+ if (close(pipe2[1]) == -1)
+ perror("close(pipe2[1])");
+
+ channels[0] = pipe0[1]; /* Output Stream. */
+ channels[1] = pipe1[0]; /* Input Stream. */
+ channels[2] = pipe2[0]; /* Input Stream. */
+ }
+
+ free(full_path);
+ return childpid;
+ }
+
+ free(full_path);
+ return -1; /*NOT REACHED */
+}
+
+
+int wait0(pid_t pid)
+{
+ int status;
+ int val = -1;
+
+ if (pid < 0)
+ return -1;
+
+ for (;;) {
+ if (waitpid(pid, &status, 0) < 0) {
+ if (errno == EINTR) {
+ // interrupted system call - retry
+ continue;
+ }
+ }
+ break;
+ }
+ if (WIFEXITED(status)) {
+ val = WEXITSTATUS(status);
+ }
+
+ return val;
+}
diff --git a/core/org.eclipse.cdt.core.linux/library/io.c b/core/org.eclipse.cdt.core.linux/library/io.c
index 8540b82628..e42d6c2394 100644
--- a/core/org.eclipse.cdt.core.linux/library/io.c
+++ b/core/org.eclipse.cdt.core.linux/library/io.c
@@ -1,114 +1,114 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- * Wind River Systems, Inc.
- *******************************************************************************/
-#include <jni.h>
-#include <stdio.h>
-#include <SpawnerInputStream.h>
-#include <SpawnerOutputStream.h>
-#include <unistd.h>
-
-/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */
-/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerOutputStream */
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
- * Method: read0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env,
- jobject jobj,
- jint jfd,
- jbyteArray buf,
- jint buf_len)
-{
- int fd;
- int status;
- jbyte *data;
- int data_len;
-
- data = (*env)->GetByteArrayElements(env, buf, 0);
- data_len = buf_len;
- fd = jfd;
-
- status = read( fd, data, data_len );
- (*env)->ReleaseByteArrayElements(env, buf, data, 0);
-
- if (status == 0) {
- /* EOF. */
- status = -1;
- } else if (status == -1) {
- /* Error, toss an exception */
- jclass exception = (*env)->FindClass(env, "java/io/IOException");
- if (exception == NULL) {
- /* Give up. */
- return -1;
- }
- (*env)->ThrowNew(env, exception, "read error");
- }
-
- return status;
-}
-
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
- * Method: close0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env,
- jobject jobj,
- jint fd)
-{
- return close(fd);
-}
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
- * Method: write0
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env,
- jobject jobj,
- jint jfd,
- jbyteArray buf,
- jint buf_len)
-{
- int status;
- int fd;
- jbyte *data;
- int data_len;
-
- data = (*env)->GetByteArrayElements(env, buf, 0);
- data_len = buf_len;
- fd = jfd;
-
- status = write(fd, data, data_len);
- (*env)->ReleaseByteArrayElements(env, buf, data, 0);
-
- return status;
-}
-
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
- * Method: close0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env,
- jobject jobj,
- jint fd)
-{
- return close(fd);
-}
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ *******************************************************************************/
+#include <jni.h>
+#include <stdio.h>
+#include <SpawnerInputStream.h>
+#include <SpawnerOutputStream.h>
+#include <unistd.h>
+
+/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */
+/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerOutputStream */
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
+ * Method: read0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env,
+ jobject jobj,
+ jint jfd,
+ jbyteArray buf,
+ jint buf_len)
+{
+ int fd;
+ int status;
+ jbyte *data;
+ int data_len;
+
+ data = (*env)->GetByteArrayElements(env, buf, 0);
+ data_len = buf_len;
+ fd = jfd;
+
+ status = read( fd, data, data_len );
+ (*env)->ReleaseByteArrayElements(env, buf, data, 0);
+
+ if (status == 0) {
+ /* EOF. */
+ status = -1;
+ } else if (status == -1) {
+ /* Error, toss an exception */
+ jclass exception = (*env)->FindClass(env, "java/io/IOException");
+ if (exception == NULL) {
+ /* Give up. */
+ return -1;
+ }
+ (*env)->ThrowNew(env, exception, "read error");
+ }
+
+ return status;
+}
+
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
+ * Method: close0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env,
+ jobject jobj,
+ jint fd)
+{
+ return close(fd);
+}
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
+ * Method: write0
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env,
+ jobject jobj,
+ jint jfd,
+ jbyteArray buf,
+ jint buf_len)
+{
+ int status;
+ int fd;
+ jbyte *data;
+ int data_len;
+
+ data = (*env)->GetByteArrayElements(env, buf, 0);
+ data_len = buf_len;
+ fd = jfd;
+
+ status = write(fd, data, data_len);
+ (*env)->ReleaseByteArrayElements(env, buf, data, 0);
+
+ return status;
+}
+
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
+ * Method: close0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env,
+ jobject jobj,
+ jint fd)
+{
+ return close(fd);
+}
diff --git a/core/org.eclipse.cdt.core.linux/library/spawner.c b/core/org.eclipse.cdt.core.linux/library/spawner.c
index 67b12b05b8..217349b439 100644
--- a/core/org.eclipse.cdt.core.linux/library/spawner.c
+++ b/core/org.eclipse.cdt.core.linux/library/spawner.c
@@ -1,302 +1,302 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- * Wind River Systems, Inc.
- * Mikhail Zabaluev (Nokia) - bug 82744
- *******************************************************************************/
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <signal.h>
-#include <string.h>
-#include <jni.h>
-
-#include "exec0.h"
-#include <Spawner.h>
-
-
-#define DEBUGIT 0
-
-
-/*
- * Header for class org_eclipse_cdt_utils_spawner_Spawner
- */
-
-
-#if DEBUGIT
-static void print_array(char **c_array)
-{
- if (c_array) {
- char **p = c_array;
- for (; *p; p++) {
- if (*p) {
- fprintf(stderr, " %s", *p);
- }
- }
- } else {
- fprintf(stderr, "null");
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-
-static char **alloc_c_array(JNIEnv * env, jobjectArray j_array)
-{
- int i;
- jint c_array_size = (*env)->GetArrayLength(env, j_array);
- char **c_array = calloc(c_array_size + 1, sizeof(*c_array));
-
- if (c_array == NULL)
- return NULL;
-
- for (i = 0; i < c_array_size; i++) {
- jstring j_str =
- (jstring) (*env)->GetObjectArrayElement(env, j_array, i);
- const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL);
- c_array[i] = (char *) strdup(c_str);
- (*env)->ReleaseStringUTFChars(env, j_str, c_str);
- (*env)->DeleteLocalRef(env, j_str);
- }
-
- return c_array;
-}
-
-
-static void free_c_array(char **c_array)
-{
- if (c_array) {
- char **p = c_array;
- for (; *p; p++) {
- if (*p) {
- free(*p);
- }
- }
- free(c_array);
- }
-}
-
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_Spawner
- * Method: exec2
- * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILorg/eclipse/cdt/utils/pty/PTY;)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2
- (JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jstring jdir, jintArray jchannels,
- jstring jslaveName, jint masterFD, jboolean console)
-{
- jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
- const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
- const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL);
- char **cmd = NULL;
- char **envp = NULL;
- int fd[3];
- pid_t pid = -1;
-
- if (channels == NULL)
- goto bail_out;
-
- cmd = alloc_c_array(env, jcmd);
- if (cmd == NULL)
- goto bail_out;
-
- envp = alloc_c_array(env, jenv);
- if (envp == NULL)
- goto bail_out;
-
-#if DEBUGIT
- fprintf(stderr, "command:");
- print_array(cmd);
- fprintf(stderr, "Envp:");
- print_array(envp);
- fprintf(stderr, "dirpath: %s\n", dirpath);
- fprintf(stderr, "pts_name: %s\n", pts_name);
-#endif
-
- pid = exec_pty(cmd[0], cmd, envp, dirpath, fd, pts_name, masterFD, console);
- if (pid < 0)
- goto bail_out;
-
- channels[0] = fd[0];
- channels[1] = fd[1];
- channels[2] = fd[2];
-
- bail_out:
- (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
- (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
- (*env)->ReleaseStringUTFChars(env, jslaveName, pts_name);
- if (cmd)
- free_c_array(cmd);
- if (envp)
- free_c_array(envp);
- return pid;
-}
-
-
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj,
- jobjectArray jcmd,
- jobjectArray jenv,
- jstring jdir)
-{
- const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
- char **cmd = NULL;
- char **envp = NULL;
- pid_t pid = -1;
-
- cmd = alloc_c_array(env, jcmd);
- if (cmd == NULL)
- goto bail_out;
-
- envp = alloc_c_array(env, jenv);
- if (envp == NULL)
- goto bail_out;
-
-#if DEBUGIT
- fprintf(stderr, "command:");
- print_array(cmd);
- fprintf(stderr, "Envp:");
- print_array(envp);
- fprintf(stderr, "dirpath: %s\n", dirpath);
-#endif
-
- pid = exec0(cmd[0], cmd, envp, dirpath, NULL);
- if (pid < 0)
- goto bail_out;
-
- bail_out:
- (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
- if (cmd)
- free_c_array(cmd);
- if (envp)
- free_c_array(envp);
- return pid;
-}
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_Spawner
- * Method: exec0
- * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj,
- jobjectArray jcmd,
- jobjectArray jenv,
- jstring jdir,
- jintArray jchannels)
-{
- jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
- const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
- char **cmd = NULL;
- char **envp = NULL;
- int fd[3];
- pid_t pid = -1;
-
- if (channels == NULL)
- goto bail_out;
-
- cmd = alloc_c_array(env, jcmd);
- if (cmd == NULL)
- goto bail_out;
-
- envp = alloc_c_array(env, jenv);
- if (envp == NULL)
- goto bail_out;
-
-#if DEBUGIT
- fprintf(stderr, "command:");
- print_array(cmd);
- fprintf(stderr, "Envp:");
- print_array(envp);
- fprintf(stderr, "dirpath: %s\n", dirpath);
-#endif
-
- pid = exec0(cmd[0], cmd, envp, dirpath, fd);
- if (pid < 0)
- goto bail_out;
-
- channels[0] = fd[0];
- channels[1] = fd[1];
- channels[2] = fd[2];
-
- bail_out:
- (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
- (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
- if (cmd)
- free_c_array(cmd);
- if (envp)
- free_c_array(envp);
- return pid;
-}
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_Spawner
- * Method: raise
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj,
- jint pid, jint sig)
-{
- int status = -1;
-
- switch (sig) {
- case 0: /* NOOP */
- status = killpg(pid, 0);
- if(status == -1) {
- status = kill(pid, 0);
- }
- break;
-
- case 2: /* INTERRUPT */
- status = killpg(pid, SIGINT);
- if(status == -1) {
- status = kill(pid, SIGINT);
- }
- break;
-
- case 9: /* KILL */
- status = killpg(pid, SIGKILL);
- if(status == -1) {
- status = kill(pid, SIGKILL);
- }
- break;
-
- case 15: /* TERM */
- status = killpg(pid, SIGTERM);
- if(status == -1) {
- status = kill(pid, SIGTERM);
- }
- break;
-
- default:
- status = killpg(pid, sig); /* WHAT ?? */
- if(status == -1) {
- status = kill(pid, sig); /* WHAT ?? */
- }
- break;
- }
-
- return status;
-}
-
-
-
-/*
- * Class: org_eclipse_cdt_utils_spawner_Spawner
- * Method: waitFor
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env,
- jobject jobj, jint pid)
-{
- return wait0(pid);
-}
+/*******************************************************************************
+ * Copyright (c) 2002, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ * Mikhail Zabaluev (Nokia) - bug 82744
+ *******************************************************************************/
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <jni.h>
+
+#include "exec0.h"
+#include <Spawner.h>
+
+
+#define DEBUGIT 0
+
+
+/*
+ * Header for class org_eclipse_cdt_utils_spawner_Spawner
+ */
+
+
+#if DEBUGIT
+static void print_array(char **c_array)
+{
+ if (c_array) {
+ char **p = c_array;
+ for (; *p; p++) {
+ if (*p) {
+ fprintf(stderr, " %s", *p);
+ }
+ }
+ } else {
+ fprintf(stderr, "null");
+ }
+ fprintf(stderr, "\n");
+}
+#endif
+
+
+static char **alloc_c_array(JNIEnv * env, jobjectArray j_array)
+{
+ int i;
+ jint c_array_size = (*env)->GetArrayLength(env, j_array);
+ char **c_array = calloc(c_array_size + 1, sizeof(*c_array));
+
+ if (c_array == NULL)
+ return NULL;
+
+ for (i = 0; i < c_array_size; i++) {
+ jstring j_str =
+ (jstring) (*env)->GetObjectArrayElement(env, j_array, i);
+ const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL);
+ c_array[i] = (char *) strdup(c_str);
+ (*env)->ReleaseStringUTFChars(env, j_str, c_str);
+ (*env)->DeleteLocalRef(env, j_str);
+ }
+
+ return c_array;
+}
+
+
+static void free_c_array(char **c_array)
+{
+ if (c_array) {
+ char **p = c_array;
+ for (; *p; p++) {
+ if (*p) {
+ free(*p);
+ }
+ }
+ free(c_array);
+ }
+}
+
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_Spawner
+ * Method: exec2
+ * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILorg/eclipse/cdt/utils/pty/PTY;)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2
+ (JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jstring jdir, jintArray jchannels,
+ jstring jslaveName, jint masterFD, jboolean console)
+{
+ jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
+ const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
+ const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL);
+ char **cmd = NULL;
+ char **envp = NULL;
+ int fd[3];
+ pid_t pid = -1;
+
+ if (channels == NULL)
+ goto bail_out;
+
+ cmd = alloc_c_array(env, jcmd);
+ if (cmd == NULL)
+ goto bail_out;
+
+ envp = alloc_c_array(env, jenv);
+ if (envp == NULL)
+ goto bail_out;
+
+#if DEBUGIT
+ fprintf(stderr, "command:");
+ print_array(cmd);
+ fprintf(stderr, "Envp:");
+ print_array(envp);
+ fprintf(stderr, "dirpath: %s\n", dirpath);
+ fprintf(stderr, "pts_name: %s\n", pts_name);
+#endif
+
+ pid = exec_pty(cmd[0], cmd, envp, dirpath, fd, pts_name, masterFD, console);
+ if (pid < 0)
+ goto bail_out;
+
+ channels[0] = fd[0];
+ channels[1] = fd[1];
+ channels[2] = fd[2];
+
+ bail_out:
+ (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
+ (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
+ (*env)->ReleaseStringUTFChars(env, jslaveName, pts_name);
+ if (cmd)
+ free_c_array(cmd);
+ if (envp)
+ free_c_array(envp);
+ return pid;
+}
+
+
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj,
+ jobjectArray jcmd,
+ jobjectArray jenv,
+ jstring jdir)
+{
+ const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
+ char **cmd = NULL;
+ char **envp = NULL;
+ pid_t pid = -1;
+
+ cmd = alloc_c_array(env, jcmd);
+ if (cmd == NULL)
+ goto bail_out;
+
+ envp = alloc_c_array(env, jenv);
+ if (envp == NULL)
+ goto bail_out;
+
+#if DEBUGIT
+ fprintf(stderr, "command:");
+ print_array(cmd);
+ fprintf(stderr, "Envp:");
+ print_array(envp);
+ fprintf(stderr, "dirpath: %s\n", dirpath);
+#endif
+
+ pid = exec0(cmd[0], cmd, envp, dirpath, NULL);
+ if (pid < 0)
+ goto bail_out;
+
+ bail_out:
+ (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
+ if (cmd)
+ free_c_array(cmd);
+ if (envp)
+ free_c_array(envp);
+ return pid;
+}
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_Spawner
+ * Method: exec0
+ * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj,
+ jobjectArray jcmd,
+ jobjectArray jenv,
+ jstring jdir,
+ jintArray jchannels)
+{
+ jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
+ const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
+ char **cmd = NULL;
+ char **envp = NULL;
+ int fd[3];
+ pid_t pid = -1;
+
+ if (channels == NULL)
+ goto bail_out;
+
+ cmd = alloc_c_array(env, jcmd);
+ if (cmd == NULL)
+ goto bail_out;
+
+ envp = alloc_c_array(env, jenv);
+ if (envp == NULL)
+ goto bail_out;
+
+#if DEBUGIT
+ fprintf(stderr, "command:");
+ print_array(cmd);
+ fprintf(stderr, "Envp:");
+ print_array(envp);
+ fprintf(stderr, "dirpath: %s\n", dirpath);
+#endif
+
+ pid = exec0(cmd[0], cmd, envp, dirpath, fd);
+ if (pid < 0)
+ goto bail_out;
+
+ channels[0] = fd[0];
+ channels[1] = fd[1];
+ channels[2] = fd[2];
+
+ bail_out:
+ (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
+ (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
+ if (cmd)
+ free_c_array(cmd);
+ if (envp)
+ free_c_array(envp);
+ return pid;
+}
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_Spawner
+ * Method: raise
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj,
+ jint pid, jint sig)
+{
+ int status = -1;
+
+ switch (sig) {
+ case 0: /* NOOP */
+ status = killpg(pid, 0);
+ if(status == -1) {
+ status = kill(pid, 0);
+ }
+ break;
+
+ case 2: /* INTERRUPT */
+ status = killpg(pid, SIGINT);
+ if(status == -1) {
+ status = kill(pid, SIGINT);
+ }
+ break;
+
+ case 9: /* KILL */
+ status = killpg(pid, SIGKILL);
+ if(status == -1) {
+ status = kill(pid, SIGKILL);
+ }
+ break;
+
+ case 15: /* TERM */
+ status = killpg(pid, SIGTERM);
+ if(status == -1) {
+ status = kill(pid, SIGTERM);
+ }
+ break;
+
+ default:
+ status = killpg(pid, sig); /* WHAT ?? */
+ if(status == -1) {
+ status = kill(pid, sig); /* WHAT ?? */
+ }
+ break;
+ }
+
+ return status;
+}
+
+
+
+/*
+ * Class: org_eclipse_cdt_utils_spawner_Spawner
+ * Method: waitFor
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env,
+ jobject jobj, jint pid)
+{
+ return wait0(pid);
+}
diff --git a/core/org.eclipse.cdt.core.linux/plugin.properties b/core/org.eclipse.cdt.core.linux/plugin.properties
index 6c8e47ac7e..8895eaa75e 100644
--- a/core/org.eclipse.cdt.core.linux/plugin.properties
+++ b/core/org.eclipse.cdt.core.linux/plugin.properties
@@ -1,2 +1,2 @@
-fragmentName.linux=C/C++ Development Tools Core for Linux
-providerName=Eclipse CDT
+fragmentName.linux=C/C++ Development Tools Core for Linux
+providerName=Eclipse CDT
diff --git a/core/org.eclipse.cdt.core.macosx/library/exec_pty.c b/core/org.eclipse.cdt.core.macosx/library/exec_pty.c
index dd68615f0e..752f545a98 100644
--- a/core/org.eclipse.cdt.core.macosx/library/exec_pty.c
+++ b/core/org.eclipse.cdt.core.macosx/library/exec_pty.c
@@ -1,186 +1,186 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- * Wind River Systems, Inc.
- * Mikhail Zabaluev (Nokia) - bug 82744
- * Mikhail Sennikovsky - bug 145737
- *******************************************************************************/
-#include "exec0.h"
-#include "openpty.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <libgen.h>
-#include <stdlib.h>
-#include <termios.h>
-
-/* from pfind.c */
-extern char *pfind(const char *name, char * const envp[]);
-
-pid_t
-exec_pty(const char *path, char *const argv[], char *const envp[],
- const char *dirpath, int channels[3], const char *pts_name, int fdm, int console)
-{
- int pipe2[2];
- pid_t childpid;
- char *full_path;
-
- /*
- * We use pfind() to check that the program exists and is an executable.
- * If not pass the error up. Also execve() wants a full path.
- */
- full_path = pfind(path, envp);
- if (full_path == NULL) {
- fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
- return -1;
- }
-
- /*
- * Make sure we can create our pipes before forking.
- */
- if (channels != NULL && console) {
- if (pipe(pipe2) < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
- free(full_path);
- return -1;
- }
- }
-
- childpid = fork();
-
- if (childpid < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
- free(full_path);
- return -1;
- } else if (childpid == 0) { /* child */
-
- chdir(dirpath);
-
- if (channels != NULL) {
- int fds;
-
- if (!console && setsid() < 0) {
- perror("setsid()");
- return -1;
- }
-
- fds = ptys_open(fdm, pts_name);
- if (fds < 0) {
- fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
- return -1;
- }
-
- /* Close the read end of pipe2 */
- if (console && close(pipe2[0]) == -1) {
- perror("close(pipe2[0]))");
- }
-
- /* close the master, no need in the child */
- close(fdm);
-
- if (console) {
- set_noecho(fds);
- if (setpgid(getpid(), getpid()) < 0) {
- perror("setpgid()");
- return -1;
- }
- }
-
- /* redirections */
- dup2(fds, STDIN_FILENO); /* dup stdin */
- dup2(fds, STDOUT_FILENO); /* dup stdout */
- if (console) {
- dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
- } else {
- dup2(fds, STDERR_FILENO); /* dup stderr */
- }
- close(fds); /* done with fds. */
- }
-
- /* Close all the fd's in the child */
- {
- int fdlimit = sysconf(_SC_OPEN_MAX);
- int fd = 3;
-
- while (fd < fdlimit)
- close(fd++);
- }
-
- if (envp[0] == NULL) {
- execv(full_path, argv);
- } else {
- execve(full_path, argv, envp);
- }
-
- _exit(127);
-
- } else if (childpid != 0) { /* parent */
- if (console) {
- set_noecho(fdm);
- }
- if (channels != NULL) {
- channels[0] = fdm; /* Input Stream. */
- channels[1] = fdm; /* Output Stream. */
- if (console) {
- /* close the write end of pipe1 */
- if (close(pipe2[1]) == -1)
- perror("close(pipe2[1])");
- channels[2] = pipe2[0]; /* stderr Stream. */
- } else {
- channels[2] = fdm; /* Error Stream. */
- }
- }
-
- free(full_path);
- return childpid;
- }
-
- free(full_path);
- return -1; /*NOT REACHED */
-}
-#ifdef __STAND_ALONE__
-int main(int argc, char **argv, char **envp) {
- const char *path = "./bufferring_test";
- int channels[3] = { -1, -1, -1};
- int status;
- FILE *app_stdin;
- FILE *app_stdout;
- FILE *app_stderr;
- char pts_name[32];
- int fdm;
- char buffer[32];
-
- fdm = ptym_open(pts_name);
- status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
- if (status >= 0) {
- app_stdin = fdopen(channels[0], "w");
- app_stdout = fdopen(channels[1], "r");
- app_stderr = fdopen(channels[2], "r");
- if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) {
- fprintf(stderr, "PROBLEMS\n");
- } else {
- fputs("foo\n", app_stdin);
- fputs("bar\n", app_stdin);
- while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
- fprintf(stdout, "STDOUT: %s\n", buffer);
- }
- while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
- fprintf(stdout, "STDERR: %s\n", buffer);
- }
- }
- }
- fputs("bye\n", stdout);
- close(channels[0]);
- close(channels[1]);
- close(channels[2]);
- return 0;
-}
-#endif
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ * Mikhail Zabaluev (Nokia) - bug 82744
+ * Mikhail Sennikovsky - bug 145737
+ *******************************************************************************/
+#include "exec0.h"
+#include "openpty.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <termios.h>
+
+/* from pfind.c */
+extern char *pfind(const char *name, char * const envp[]);
+
+pid_t
+exec_pty(const char *path, char *const argv[], char *const envp[],
+ const char *dirpath, int channels[3], const char *pts_name, int fdm, int console)
+{
+ int pipe2[2];
+ pid_t childpid;
+ char *full_path;
+
+ /*
+ * We use pfind() to check that the program exists and is an executable.
+ * If not pass the error up. Also execve() wants a full path.
+ */
+ full_path = pfind(path, envp);
+ if (full_path == NULL) {
+ fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
+ return -1;
+ }
+
+ /*
+ * Make sure we can create our pipes before forking.
+ */
+ if (channels != NULL && console) {
+ if (pipe(pipe2) < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ free(full_path);
+ return -1;
+ }
+ }
+
+ childpid = fork();
+
+ if (childpid < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ free(full_path);
+ return -1;
+ } else if (childpid == 0) { /* child */
+
+ chdir(dirpath);
+
+ if (channels != NULL) {
+ int fds;
+
+ if (!console && setsid() < 0) {
+ perror("setsid()");
+ return -1;
+ }
+
+ fds = ptys_open(fdm, pts_name);
+ if (fds < 0) {
+ fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ return -1;
+ }
+
+ /* Close the read end of pipe2 */
+ if (console && close(pipe2[0]) == -1) {
+ perror("close(pipe2[0]))");
+ }
+
+ /* close the master, no need in the child */
+ close(fdm);
+
+ if (console) {
+ set_noecho(fds);
+ if (setpgid(getpid(), getpid()) < 0) {
+ perror("setpgid()");
+ return -1;
+ }
+ }
+
+ /* redirections */
+ dup2(fds, STDIN_FILENO); /* dup stdin */
+ dup2(fds, STDOUT_FILENO); /* dup stdout */
+ if (console) {
+ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
+ } else {
+ dup2(fds, STDERR_FILENO); /* dup stderr */
+ }
+ close(fds); /* done with fds. */
+ }
+
+ /* Close all the fd's in the child */
+ {
+ int fdlimit = sysconf(_SC_OPEN_MAX);
+ int fd = 3;
+
+ while (fd < fdlimit)
+ close(fd++);
+ }
+
+ if (envp[0] == NULL) {
+ execv(full_path, argv);
+ } else {
+ execve(full_path, argv, envp);
+ }
+
+ _exit(127);
+
+ } else if (childpid != 0) { /* parent */
+ if (console) {
+ set_noecho(fdm);
+ }
+ if (channels != NULL) {
+ channels[0] = fdm; /* Input Stream. */
+ channels[1] = fdm; /* Output Stream. */
+ if (console) {
+ /* close the write end of pipe1 */
+ if (close(pipe2[1]) == -1)
+ perror("close(pipe2[1])");
+ channels[2] = pipe2[0]; /* stderr Stream. */
+ } else {
+ channels[2] = fdm; /* Error Stream. */
+ }
+ }
+
+ free(full_path);
+ return childpid;
+ }
+
+ free(full_path);
+ return -1; /*NOT REACHED */
+}
+#ifdef __STAND_ALONE__
+int main(int argc, char **argv, char **envp) {
+ const char *path = "./bufferring_test";
+ int channels[3] = { -1, -1, -1};
+ int status;
+ FILE *app_stdin;
+ FILE *app_stdout;
+ FILE *app_stderr;
+ char pts_name[32];
+ int fdm;
+ char buffer[32];
+
+ fdm = ptym_open(pts_name);
+ status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
+ if (status >= 0) {
+ app_stdin = fdopen(channels[0], "w");
+ app_stdout = fdopen(channels[1], "r");
+ app_stderr = fdopen(channels[2], "r");
+ if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) {
+ fprintf(stderr, "PROBLEMS\n");
+ } else {
+ fputs("foo\n", app_stdin);
+ fputs("bar\n", app_stdin);
+ while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
+ fprintf(stdout, "STDOUT: %s\n", buffer);
+ }
+ while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
+ fprintf(stdout, "STDERR: %s\n", buffer);
+ }
+ }
+ }
+ fputs("bye\n", stdout);
+ close(channels[0]);
+ close(channels[1]);
+ close(channels[2]);
+ return 0;
+}
+#endif
diff --git a/core/org.eclipse.cdt.core.macosx/plugin.properties b/core/org.eclipse.cdt.core.macosx/plugin.properties
index dda4771c59..3ea2577f20 100644
--- a/core/org.eclipse.cdt.core.macosx/plugin.properties
+++ b/core/org.eclipse.cdt.core.macosx/plugin.properties
@@ -1,2 +1,2 @@
-fragmentName.linux=C/C++ Development Tools Core for Mac OS X
-providerName=Eclipse CDT
+fragmentName.linux=C/C++ Development Tools Core for Mac OS X
+providerName=Eclipse CDT
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java
index 17039f287f..0fde6d42f7 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.core.internal.tests.filesystem.ram;
-
-import java.net.URI;
-
-import org.eclipse.cdt.core.EFSExtensionProvider;
-
-/**
- * Test stub to test EFSExtensionProvider mappings.
- *
- */
-public class MemoryEFSExtensionProvider extends EFSExtensionProvider {
-
- public String getMappedPath(URI locationURI) {
-
- String path = locationURI.getPath();
- if (path.contains("/BeingMappedFrom/Folder")) {
- return path.replaceFirst("/BeingMappedFrom/Folder", "/LocallyMappedTo/Folder");
- }
-
- return super.getMappedPath(locationURI);
- }
-
-}
+package org.eclipse.cdt.core.internal.tests.filesystem.ram;
+
+import java.net.URI;
+
+import org.eclipse.cdt.core.EFSExtensionProvider;
+
+/**
+ * Test stub to test EFSExtensionProvider mappings.
+ *
+ */
+public class MemoryEFSExtensionProvider extends EFSExtensionProvider {
+
+ public String getMappedPath(URI locationURI) {
+
+ String path = locationURI.getPath();
+ if (path.contains("/BeingMappedFrom/Folder")) {
+ return path.replaceFirst("/BeingMappedFrom/Folder", "/LocallyMappedTo/Folder");
+ }
+
+ return super.getMappedPath(locationURI);
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java
index 7613f726fd..a7c5811518 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java
@@ -1,302 +1,302 @@
-/*******************************************************************************
- * Copyright (c) 2013 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
-import org.eclipse.cdt.core.settings.model.util.CDataUtil;
-import org.eclipse.cdt.core.testplugin.ResourceHelper;
-import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
-import org.eclipse.cdt.internal.core.language.settings.providers.ReferencedProjectsLanguageSettingsProvider;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Test cases testing ReferencedProjectsLanguageSettingsProvider functionality
- */
-public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCase {
- /**
- * Constructor.
- * @param name - name of the test.
- */
- public LanguageSettingsProviderReferencedProjectsTests(String name) {
- super(name);
-
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown(); // includes ResourceHelper cleanup
- }
-
- /**
- * @return - new TestSuite.
- */
- public static TestSuite suite() {
- return new TestSuite(LanguageSettingsProviderReferencedProjectsTests.class);
- }
-
- /**
- * main function of the class.
- *
- * @param args - arguments
- */
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Helper method to fetch configuration descriptions.
- */
- private ICConfigurationDescription[] getConfigurationDescriptions(IProject project) {
- CoreModel coreModel = CoreModel.getDefault();
- ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
- // project description
- ICProjectDescription projectDescription = mngr.getProjectDescription(project, false);
- assertNotNull(projectDescription);
- assertEquals(1, projectDescription.getConfigurations().length);
- // configuration description
- ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
- return cfgDescriptions;
- }
-
- /**
- * Helper method to set reference project.
- */
- private void setReference(IProject project, final IProject projectReferenced) throws CoreException {
- {
- CoreModel coreModel = CoreModel.getDefault();
- ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
- // project description
- ICProjectDescription projectDescription = mngr.getProjectDescription(project);
- assertNotNull(projectDescription);
- assertEquals(1, projectDescription.getConfigurations().length);
- // configuration description
- ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
- ICConfigurationDescription cfgDescription = cfgDescriptions[0];
-
- final ICConfigurationDescription cfgDescriptionReferenced = getConfigurationDescriptions(projectReferenced)[0];
- cfgDescription.setReferenceInfo(new HashMap<String, String>() {{ put(projectReferenced.getName(), cfgDescriptionReferenced.getId()); }});
- coreModel.setProjectDescription(project, projectDescription);
- }
-
- {
- // doublecheck that it's set as expected
- ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
- ICConfigurationDescription cfgDescription = cfgDescriptions[0];
- Map<String,String> refs = cfgDescription.getReferenceInfo();
- assertEquals(1, refs.size());
- Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet());
- assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]);
- }
-
- }
-
- /**
- * Test that null arguments don't crash the provider.
- */
- public void testNulls() throws Exception {
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
- assertNotNull(provider);
- List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
- assertEquals(null, entries);
- }
-
- /**
- * Test main functionality of ReferencedProjectsLanguageSettingsProvider.
- */
- public void testReferencedProjectProvider() throws Exception {
- // Create model project and accompanied descriptions
- String projectName = getName();
- IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
- IProject nonReferencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-non-referenced");
- IProject referencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-referenced");
- setReference(project, referencedProject);
-
- // get cfgDescription
- ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
- ICConfigurationDescription cfgDescription = cfgDescriptions[0];
-
- {
- // double-check that provider for referenced projects is set in the configuration
- ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
- assertNotNull(refProjectsProvider);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
- assertTrue(providers.contains(refProjectsProvider));
- }
-
- // Check that no setting entries are set initially
- {
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
- assertEquals(0, entries.size());
- }
-
- // Add an entry into a non-referenced project
- CIncludePathEntry nonRefEntry = CDataUtil.createCIncludePathEntry("non-referenced-exported", ICSettingEntry.EXPORTED);
- {
- ICConfigurationDescription[] nonRefCfgDescriptions = getConfigurationDescriptions(nonReferencedProject);
- ICConfigurationDescription nonRefCfgDescription = nonRefCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersNonRef = ((ILanguageSettingsProvidersKeeper) nonRefCfgDescription).getLanguageSettingProviders();
- // get user provider which is the first one
- ILanguageSettingsProvider userProviderNonRef = providersNonRef.get(0);
- assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderNonRef.getId());
- assertTrue(userProviderNonRef instanceof LanguageSettingsGenericProvider);
- // add sample entries
- ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(nonRefEntry);
- ((LanguageSettingsGenericProvider) userProviderNonRef).setSettingEntries(null, null, null, entries);
- }
- // Confirm that that does not add entries to the main project
- {
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
- assertEquals(0, entries.size());
- }
-
- CIncludePathEntry refEntry = CDataUtil.createCIncludePathEntry("referenced-exported", ICSettingEntry.EXPORTED);
- // Add entries into a referenced project
- {
- ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(referencedProject);
- ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
- // get user provider which is the first one
- ILanguageSettingsProvider userProviderRef = providersRef.get(0);
- assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
- assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
- // add sample entries
- ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- CIncludePathEntry refEntryNotExported = CDataUtil.createCIncludePathEntry("referenced-not-exported", 0);
- entries.add(refEntry);
- entries.add(refEntryNotExported);
- ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
- List<ICLanguageSettingEntry> entriesActual = LanguageSettingsManager.getSettingEntriesByKind(refCfgDescription, project, null, ICSettingEntry.ALL);
- assertEquals(entries, entriesActual);
- }
- // Check that the new entries from referenced project made it to the main project
- {
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
- assertEquals(CDataUtil.createCIncludePathEntry(refEntry.getName(), 0), entries.get(0));
- assertEquals(1, entries.size());
- }
- }
-
- /**
- * Test case when projects reference each other recursively.
- */
- public void testRecursiveReferences() throws Exception {
- // Create model projects that reference each other
- String projectName = getName();
- IProject projectA = ResourceHelper.createCDTProjectWithConfig(projectName + "-A");
- IProject projectB = ResourceHelper.createCDTProjectWithConfig(projectName + "-B");
- setReference(projectA, projectB);
- setReference(projectB, projectA);
-
- {
- // get cfgDescriptions to work with
- ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
- ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
- ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
- ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
- // double-check that provider for referenced projects is set in the configurations
- ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
- assertNotNull(refProjectsProvider);
- List<ILanguageSettingsProvider> providersA = ((ILanguageSettingsProvidersKeeper) cfgDescriptionA).getLanguageSettingProviders();
- assertTrue(providersA.contains(refProjectsProvider));
- List<ILanguageSettingsProvider> providersB = ((ILanguageSettingsProvidersKeeper) cfgDescriptionB).getLanguageSettingProviders();
- assertTrue(providersB.contains(refProjectsProvider));
-
- // Check that no setting entries are set initially
- List<ICLanguageSettingEntry> entriesA = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
- assertEquals(0, entriesA.size());
- List<ICLanguageSettingEntry> entriesB = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectB, null, ICSettingEntry.ALL);
- assertEquals(0, entriesB.size());
- }
-
- CIncludePathEntry entryExportedA = CDataUtil.createCIncludePathEntry("referenced-exported-A", ICSettingEntry.EXPORTED);
- CIncludePathEntry entryNotExportedA = CDataUtil.createCIncludePathEntry("referenced-not-exported-A", 0);
- // Add entries into a project A
- {
- ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectA);
- ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
- // get user provider which is the first one
- ILanguageSettingsProvider userProviderRef = providersRef.get(0);
- assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
- assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
- // add sample entries
- ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(entryExportedA);
- entries.add(entryNotExportedA);
- ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
- }
-
- CIncludePathEntry entryExportedB = CDataUtil.createCIncludePathEntry("referenced-exported-B", ICSettingEntry.EXPORTED);
- CIncludePathEntry entryNotExportedB = CDataUtil.createCIncludePathEntry("referenced-not-exported-B", 0);
- // Add entries into a project B
- {
- ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectB);
- ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
- // get user provider which is the first one
- ILanguageSettingsProvider userProviderRef = providersRef.get(0);
- assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
- assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
- // add sample entries
- ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(entryExportedB);
- entries.add(entryNotExportedB);
- ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
- }
-
- // Check that the new entries from projectB made it to projectA
- {
- ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
- ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
- assertEquals(entryExportedA, entries.get(0));
- assertEquals(entryNotExportedA, entries.get(1));
- assertEquals(CDataUtil.createCIncludePathEntry(entryExportedB.getName(), 0), entries.get(2));
- assertEquals(3, entries.size());
- }
- // Check that the new entries from projectA made it to projectB
- {
- ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
- ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionB, projectB, null, ICSettingEntry.ALL);
- assertEquals(entryExportedB, entries.get(0));
- assertEquals(entryNotExportedB, entries.get(1));
- assertEquals(CDataUtil.createCIncludePathEntry(entryExportedA.getName(), 0), entries.get(2));
- assertEquals(3, entries.size());
- }
-
- // Hopefully it gets here without stack overflow
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.core.settings.model.util.CDataUtil;
+import org.eclipse.cdt.core.testplugin.ResourceHelper;
+import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
+import org.eclipse.cdt.internal.core.language.settings.providers.ReferencedProjectsLanguageSettingsProvider;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Test cases testing ReferencedProjectsLanguageSettingsProvider functionality
+ */
+public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCase {
+ /**
+ * Constructor.
+ * @param name - name of the test.
+ */
+ public LanguageSettingsProviderReferencedProjectsTests(String name) {
+ super(name);
+
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown(); // includes ResourceHelper cleanup
+ }
+
+ /**
+ * @return - new TestSuite.
+ */
+ public static TestSuite suite() {
+ return new TestSuite(LanguageSettingsProviderReferencedProjectsTests.class);
+ }
+
+ /**
+ * main function of the class.
+ *
+ * @param args - arguments
+ */
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Helper method to fetch configuration descriptions.
+ */
+ private ICConfigurationDescription[] getConfigurationDescriptions(IProject project) {
+ CoreModel coreModel = CoreModel.getDefault();
+ ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
+ // project description
+ ICProjectDescription projectDescription = mngr.getProjectDescription(project, false);
+ assertNotNull(projectDescription);
+ assertEquals(1, projectDescription.getConfigurations().length);
+ // configuration description
+ ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
+ return cfgDescriptions;
+ }
+
+ /**
+ * Helper method to set reference project.
+ */
+ private void setReference(IProject project, final IProject projectReferenced) throws CoreException {
+ {
+ CoreModel coreModel = CoreModel.getDefault();
+ ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
+ // project description
+ ICProjectDescription projectDescription = mngr.getProjectDescription(project);
+ assertNotNull(projectDescription);
+ assertEquals(1, projectDescription.getConfigurations().length);
+ // configuration description
+ ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
+ ICConfigurationDescription cfgDescription = cfgDescriptions[0];
+
+ final ICConfigurationDescription cfgDescriptionReferenced = getConfigurationDescriptions(projectReferenced)[0];
+ cfgDescription.setReferenceInfo(new HashMap<String, String>() {{ put(projectReferenced.getName(), cfgDescriptionReferenced.getId()); }});
+ coreModel.setProjectDescription(project, projectDescription);
+ }
+
+ {
+ // doublecheck that it's set as expected
+ ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
+ ICConfigurationDescription cfgDescription = cfgDescriptions[0];
+ Map<String,String> refs = cfgDescription.getReferenceInfo();
+ assertEquals(1, refs.size());
+ Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet());
+ assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]);
+ }
+
+ }
+
+ /**
+ * Test that null arguments don't crash the provider.
+ */
+ public void testNulls() throws Exception {
+ ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
+ assertNotNull(provider);
+ List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
+ assertEquals(null, entries);
+ }
+
+ /**
+ * Test main functionality of ReferencedProjectsLanguageSettingsProvider.
+ */
+ public void testReferencedProjectProvider() throws Exception {
+ // Create model project and accompanied descriptions
+ String projectName = getName();
+ IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
+ IProject nonReferencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-non-referenced");
+ IProject referencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-referenced");
+ setReference(project, referencedProject);
+
+ // get cfgDescription
+ ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
+ ICConfigurationDescription cfgDescription = cfgDescriptions[0];
+
+ {
+ // double-check that provider for referenced projects is set in the configuration
+ ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
+ assertNotNull(refProjectsProvider);
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ assertTrue(providers.contains(refProjectsProvider));
+ }
+
+ // Check that no setting entries are set initially
+ {
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
+ assertEquals(0, entries.size());
+ }
+
+ // Add an entry into a non-referenced project
+ CIncludePathEntry nonRefEntry = CDataUtil.createCIncludePathEntry("non-referenced-exported", ICSettingEntry.EXPORTED);
+ {
+ ICConfigurationDescription[] nonRefCfgDescriptions = getConfigurationDescriptions(nonReferencedProject);
+ ICConfigurationDescription nonRefCfgDescription = nonRefCfgDescriptions[0];
+ List<ILanguageSettingsProvider> providersNonRef = ((ILanguageSettingsProvidersKeeper) nonRefCfgDescription).getLanguageSettingProviders();
+ // get user provider which is the first one
+ ILanguageSettingsProvider userProviderNonRef = providersNonRef.get(0);
+ assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderNonRef.getId());
+ assertTrue(userProviderNonRef instanceof LanguageSettingsGenericProvider);
+ // add sample entries
+ ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(nonRefEntry);
+ ((LanguageSettingsGenericProvider) userProviderNonRef).setSettingEntries(null, null, null, entries);
+ }
+ // Confirm that that does not add entries to the main project
+ {
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
+ assertEquals(0, entries.size());
+ }
+
+ CIncludePathEntry refEntry = CDataUtil.createCIncludePathEntry("referenced-exported", ICSettingEntry.EXPORTED);
+ // Add entries into a referenced project
+ {
+ ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(referencedProject);
+ ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
+ List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
+ // get user provider which is the first one
+ ILanguageSettingsProvider userProviderRef = providersRef.get(0);
+ assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
+ assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
+ // add sample entries
+ ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ CIncludePathEntry refEntryNotExported = CDataUtil.createCIncludePathEntry("referenced-not-exported", 0);
+ entries.add(refEntry);
+ entries.add(refEntryNotExported);
+ ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
+ List<ICLanguageSettingEntry> entriesActual = LanguageSettingsManager.getSettingEntriesByKind(refCfgDescription, project, null, ICSettingEntry.ALL);
+ assertEquals(entries, entriesActual);
+ }
+ // Check that the new entries from referenced project made it to the main project
+ {
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
+ assertEquals(CDataUtil.createCIncludePathEntry(refEntry.getName(), 0), entries.get(0));
+ assertEquals(1, entries.size());
+ }
+ }
+
+ /**
+ * Test case when projects reference each other recursively.
+ */
+ public void testRecursiveReferences() throws Exception {
+ // Create model projects that reference each other
+ String projectName = getName();
+ IProject projectA = ResourceHelper.createCDTProjectWithConfig(projectName + "-A");
+ IProject projectB = ResourceHelper.createCDTProjectWithConfig(projectName + "-B");
+ setReference(projectA, projectB);
+ setReference(projectB, projectA);
+
+ {
+ // get cfgDescriptions to work with
+ ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
+ ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
+ ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
+ ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
+ // double-check that provider for referenced projects is set in the configurations
+ ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
+ assertNotNull(refProjectsProvider);
+ List<ILanguageSettingsProvider> providersA = ((ILanguageSettingsProvidersKeeper) cfgDescriptionA).getLanguageSettingProviders();
+ assertTrue(providersA.contains(refProjectsProvider));
+ List<ILanguageSettingsProvider> providersB = ((ILanguageSettingsProvidersKeeper) cfgDescriptionB).getLanguageSettingProviders();
+ assertTrue(providersB.contains(refProjectsProvider));
+
+ // Check that no setting entries are set initially
+ List<ICLanguageSettingEntry> entriesA = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
+ assertEquals(0, entriesA.size());
+ List<ICLanguageSettingEntry> entriesB = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectB, null, ICSettingEntry.ALL);
+ assertEquals(0, entriesB.size());
+ }
+
+ CIncludePathEntry entryExportedA = CDataUtil.createCIncludePathEntry("referenced-exported-A", ICSettingEntry.EXPORTED);
+ CIncludePathEntry entryNotExportedA = CDataUtil.createCIncludePathEntry("referenced-not-exported-A", 0);
+ // Add entries into a project A
+ {
+ ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectA);
+ ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
+ List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
+ // get user provider which is the first one
+ ILanguageSettingsProvider userProviderRef = providersRef.get(0);
+ assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
+ assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
+ // add sample entries
+ ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(entryExportedA);
+ entries.add(entryNotExportedA);
+ ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
+ }
+
+ CIncludePathEntry entryExportedB = CDataUtil.createCIncludePathEntry("referenced-exported-B", ICSettingEntry.EXPORTED);
+ CIncludePathEntry entryNotExportedB = CDataUtil.createCIncludePathEntry("referenced-not-exported-B", 0);
+ // Add entries into a project B
+ {
+ ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectB);
+ ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
+ List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
+ // get user provider which is the first one
+ ILanguageSettingsProvider userProviderRef = providersRef.get(0);
+ assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
+ assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
+ // add sample entries
+ ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(entryExportedB);
+ entries.add(entryNotExportedB);
+ ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
+ }
+
+ // Check that the new entries from projectB made it to projectA
+ {
+ ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
+ ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
+ assertEquals(entryExportedA, entries.get(0));
+ assertEquals(entryNotExportedA, entries.get(1));
+ assertEquals(CDataUtil.createCIncludePathEntry(entryExportedB.getName(), 0), entries.get(2));
+ assertEquals(3, entries.size());
+ }
+ // Check that the new entries from projectA made it to projectB
+ {
+ ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
+ ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionB, projectB, null, ICSettingEntry.ALL);
+ assertEquals(entryExportedB, entries.get(0));
+ assertEquals(entryNotExportedB, entries.get(1));
+ assertEquals(CDataUtil.createCIncludePathEntry(entryExportedA.getName(), 0), entries.get(2));
+ assertEquals(3, entries.size());
+ }
+
+ // Hopefully it gets here without stack overflow
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java
index 72ee4c50cf..9d9bce06f5 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java
@@ -1,958 +1,958 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.ILanguage;
-import org.eclipse.cdt.core.model.LanguageManager;
-import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
-import org.eclipse.cdt.core.settings.model.CIncludeFileEntry;
-import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
-import org.eclipse.cdt.core.settings.model.CMacroEntry;
-import org.eclipse.cdt.core.settings.model.CMacroFileEntry;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICFolderDescription;
-import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
-import org.eclipse.cdt.core.testplugin.ResourceHelper;
-import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
-import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsScannerInfoProvider;
-import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- * Test cases testing LanguageSettingsProvider functionality
- */
-public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
- private static final IFile FAKE_FILE = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/project/path0"));
- private static final String PROVIDER_ID = "test.provider.id";
- private static final String PROVIDER_ID_2 = "test.provider.id.2";
- private static final String PROVIDER_NAME = "test.provider.name";
-
- // constants for getProjectDescription()
- private static final boolean READ_ONLY = false;
- private static final boolean WRITEABLE = true;
-
- private class MockProvider extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
- private final List<ICLanguageSettingEntry> entries;
-
- public MockProvider(String id, String name, List<ICLanguageSettingEntry> entries) {
- super(id, name);
- this.entries = entries;
- }
-
- @Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- return entries;
- }
- }
-
- /**
- * Constructor.
- * @param name - name of the test.
- */
- public LanguageSettingsScannerInfoProviderTests(String name) {
- super(name);
-
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown(); // includes ResourceHelper cleanup
- }
-
- /**
- * @return - new TestSuite.
- */
- public static TestSuite suite() {
- return new TestSuite(LanguageSettingsScannerInfoProviderTests.class);
- }
-
- /**
- * main function of the class.
- *
- * @param args - arguments
- */
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- /**
- * Sets build working directory for DefaultSettingConfiguration being tested.
- */
- private void setBuilderCWD(IProject project, IPath buildCWD) throws CoreException {
- CProjectDescriptionManager manager = CProjectDescriptionManager.getInstance();
- {
- ICProjectDescription prjDescription = manager.getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
-
- cfgDescription.getBuildSetting().setBuilderCWD(buildCWD);
- manager.setProjectDescription(project, prjDescription);
- // doublecheck builderCWD
- IPath actualBuildCWD = cfgDescription.getBuildSetting().getBuilderCWD();
- assertEquals(buildCWD, actualBuildCWD);
- }
- {
- // triplecheck builderCWD for different project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
-
- }
- }
-
- /**
- * Test cases when some objects are null.
- */
- public void testNulls() throws Exception {
- {
- // Handle project==null
- IResource root = ResourcesPlugin.getWorkspace().getRoot();
- assertNull(root.getProject());
-
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(root);
- assertEquals(0, info.getIncludePaths().length);
- assertEquals(0, info.getDefinedSymbols().size());
- assertEquals(0, info.getIncludeFiles().length);
- assertEquals(0, info.getMacroFiles().length);
- assertEquals(0, info.getLocalIncludePath().length);
- }
-
- {
- // Handle prjDescription==null
- IProject project = FAKE_FILE.getProject();
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
- assertNull(prjDescription);
-
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(FAKE_FILE);
- assertEquals(0, info.getIncludePaths().length);
- assertEquals(0, info.getDefinedSymbols().size());
- assertEquals(0, info.getIncludeFiles().length);
- assertEquals(0, info.getMacroFiles().length);
- assertEquals(0, info.getLocalIncludePath().length);
- }
-
- {
- // Handle language==null
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- IFile file = ResourceHelper.createFile(project, "file");
-
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- ILanguage language = LanguageManager.getInstance().getLanguageForFile(file, cfgDescription);
- assertNull(language);
-
- // AG FIXME - temporarily ignore the entry in the log
- setExpectedNumberOfLoggedNonOKStatusObjects(1);
-
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- assertEquals(0, info.getIncludePaths().length);
- assertEquals(0, info.getDefinedSymbols().size());
- assertEquals(0, info.getIncludeFiles().length);
- assertEquals(0, info.getMacroFiles().length);
- assertEquals(0, info.getLocalIncludePath().length);
- }
- }
-
- /**
- * Test empty scanner info.
- */
- public void testEmpty() throws Exception {
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // confirm that language==null
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- ILanguage language = LanguageManager.getInstance().getLanguageForFile(file, cfgDescription);
- assertNotNull(language);
-
- // test that the info is empty
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- assertEquals(0, info.getIncludePaths().length);
- assertEquals(0, info.getDefinedSymbols().size());
- assertEquals(0, info.getIncludeFiles().length);
- assertEquals(0, info.getMacroFiles().length);
- assertEquals(0, info.getLocalIncludePath().length);
- }
-
- /**
- * Test regular cases.
- */
- public void testRegular() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // sanity test of language
- ILanguage language = LanguageManager.getInstance().getLanguageForFile(file, cfgDescription);
- assertNotNull(language);
-
- // contribute the entries
- IFolder includeFolder = ResourceHelper.createFolder(project, "/include-path");
- IFolder includeLocalFolder = ResourceHelper.createFolder(project, "/local-include-path");
- IFile macroFile = ResourceHelper.createFile(project, "macro-file");
- IFile includeFile = ResourceHelper.createFile(project, "include-file");
-
- CIncludePathEntry includePathEntry = new CIncludePathEntry(includeFolder, 0);
- CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(includeLocalFolder, ICSettingEntry.LOCAL); // #include "..."
- CMacroEntry macroEntry = new CMacroEntry("MACRO", "value",0);
- CIncludeFileEntry includeFileEntry = new CIncludeFileEntry(includeFile, 0);
- CMacroFileEntry macroFileEntry = new CMacroFileEntry(macroFile, 0);
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(includePathEntry);
- entries.add(includeLocalPathEntry);
- entries.add(macroEntry);
- entries.add(includeFileEntry);
- entries.add(macroFileEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test that the scannerInfoProvider gets the entries
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
- Map<String, String> actualDefinedSymbols = info.getDefinedSymbols();
- String[] actualIncludeFiles = info.getIncludeFiles();
- String[] actualMacroFiles = info.getMacroFiles();
- String[] actualLocalIncludePath = info.getLocalIncludePath();
- // include paths
- assertEquals(includeFolder.getLocation(), new Path(actualIncludePaths[0]));
- assertEquals(1, actualIncludePaths.length);
- // macros
- assertEquals(macroEntry.getValue(), actualDefinedSymbols.get(macroEntry.getName()));
- assertEquals(1, actualDefinedSymbols.size());
- // include file
- assertEquals(includeFile.getLocation(), new Path(actualIncludeFiles[0]));
- assertEquals(1, actualIncludeFiles.length);
- // macro file
- assertEquals(macroFile.getLocation(), new Path(actualMacroFiles[0]));
- assertEquals(1, actualMacroFiles.length);
- // local include files
- assertEquals(includeLocalFolder.getLocation(), new Path(actualLocalIncludePath[0]));
- assertEquals(1, actualLocalIncludePath.length);
- }
-
- /**
- * Test "local" flag (#include "...").
- */
- public void testLocal() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- IFolder incFolder = ResourceHelper.createFolder(project, "include");
- IFolder incFolder2 = ResourceHelper.createFolder(project, "include2");
- CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0);
- CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..."
- CIncludePathEntry includeLocalPathEntry2 = new CIncludePathEntry(incFolder2, ICSettingEntry.LOCAL); // #include "..."
- CIncludePathEntry includePathEntry2 = new CIncludePathEntry(incFolder2, 0);
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(includePathEntry);
- entries.add(includeLocalPathEntry);
- // reverse order for incPath2
- entries.add(includeLocalPathEntry2);
- entries.add(includePathEntry2);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test that the scannerInfoProvider gets the entries
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
- String[] actualLocalIncludePath = info.getLocalIncludePath();
- // include paths
- assertEquals(incFolder.getLocation(), new Path(actualIncludePaths[0]));
- assertEquals(incFolder2.getLocation(), new Path(actualIncludePaths[1]));
- assertEquals(2, actualIncludePaths.length);
- // local include files
- assertEquals(incFolder.getLocation(), new Path(actualLocalIncludePath[0]));
- assertEquals(incFolder2.getLocation(), new Path(actualLocalIncludePath[1]));
- assertEquals(2, actualLocalIncludePath.length);
- }
-
- /**
- * Test Mac frameworks.
- */
- public void testFramework() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- IFolder frameworkFolder = ResourceHelper.createFolder(project, "Fmwk");
- CIncludePathEntry frameworkPathEntry = new CIncludePathEntry(frameworkFolder, ICSettingEntry.FRAMEWORKS_MAC);
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(frameworkPathEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test that the scannerInfoProvider gets the entries
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
- // include paths
- assertEquals(frameworkFolder.getLocation().append("/__framework__.framework/Headers/__header__"),
- new Path(actualIncludePaths[0]));
- assertEquals(frameworkFolder.getLocation().append("/__framework__.framework/PrivateHeaders/__header__"),
- new Path(actualIncludePaths[1]));
- assertEquals(2, actualIncludePaths.length);
- }
-
- /**
- * Test duplicate entries.
- */
- public void testDuplicate() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- IFolder incFolder = ResourceHelper.createFolder(project, "include");
- CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0);
- CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..."
- CIncludePathEntry includePathEntry2 = new CIncludePathEntry(incFolder, 0);
- CIncludePathEntry includeLocalPathEntry2 = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..."
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(includePathEntry);
- entries.add(includeLocalPathEntry);
- entries.add(includePathEntry2);
- entries.add(includeLocalPathEntry2);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test that the scannerInfoProvider gets the entries
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
- String[] actualLocalIncludePath = info.getLocalIncludePath();
- // include paths
- assertEquals(incFolder.getLocation(), new Path(actualIncludePaths[0]));
- assertEquals(1, actualIncludePaths.length);
- // local include files
- assertEquals(incFolder.getLocation(), new Path(actualLocalIncludePath[0]));
- assertEquals(1, actualLocalIncludePath.length);
- }
-
- /**
- * Test include path managed by eclipse as a workspace path.
- */
- public void testWorkspacePath() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // create sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
- // eclipse-managed folder in workspace
- IFolder incWorkspace_1 = ResourceHelper.createFolder(project, "include_1");
- IPath incWorkspaceLocation_1 = incWorkspace_1.getLocation();
- IFolder incWorkspace_2 = ResourceHelper.createFolder(project, "include_2");
- IPath incWorkspacePath_2 = incWorkspace_2.getFullPath();
- IPath incWorkspaceLocation_2 = incWorkspace_2.getLocation();
- IFolder incWorkspace_3 = ResourceHelper.createFolder(project, "include_3");
- // "relative" should make no difference for VALUE_WORKSPACE_PATH
- IPath incWorkspaceRelativePath_3 = incWorkspace_3.getFullPath().makeRelative();
- IPath incWorkspaceLocation_3 = incWorkspace_3.getLocation();
- // not having "RESOLVED" should make no difference for well formed path
- IFolder incWorkspace_4 = ResourceHelper.createFolder(project, "include_4");
- IPath incWorkspacePathNoResolved_4 = incWorkspace_4.getFullPath();
- IPath incWorkspaceLocation_4 = incWorkspace_4.getLocation();
- // folder defined by absolute path on the filesystem
- IPath incFilesystem = ResourceHelper.createWorkspaceFolder("includeFilesystem");
-
- // contribute the entries
- CIncludePathEntry incWorkspaceEntry_1 = new CIncludePathEntry(incWorkspace_1, 0);
- CIncludePathEntry incWorkspaceEntry_2 = new CIncludePathEntry(incWorkspacePath_2, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
- CIncludePathEntry incWorkspaceEntry_3 = new CIncludePathEntry(incWorkspaceRelativePath_3, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
- CIncludePathEntry incWorkspaceEntry_4 = new CIncludePathEntry(incWorkspacePathNoResolved_4, ICSettingEntry.VALUE_WORKSPACE_PATH);
- CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0);
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(incWorkspaceEntry_1);
- entries.add(incWorkspaceEntry_2);
- entries.add(incWorkspaceEntry_3);
- entries.add(incWorkspaceEntry_4);
- entries.add(incFilesystemEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
-
- assertEquals(incWorkspaceLocation_1, new Path(actualIncludePaths[0]));
- assertEquals(incWorkspaceLocation_2, new Path(actualIncludePaths[1]));
- assertEquals(incWorkspaceLocation_3, new Path(actualIncludePaths[2]));
- assertEquals(incWorkspaceLocation_4, new Path(actualIncludePaths[3]));
- assertEquals(incFilesystem, new Path(actualIncludePaths[4]));
- assertEquals(5, actualIncludePaths.length);
-
- }
-
- /**
- * Confirm that device letter is prepended on filesystems that support that.
- */
- public void testFilesystemPathNoDriveLetter() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- // change drive on build working directory
- String buildCwdDevice = project.getLocation().getDevice();
-
-// // Test manually with a device which is different from project location device (path should exist)
-// IPath buildCWD = new Path("D:/build/path");
-// String buildCwdDevice = buildCWD.getDevice();
-
- // get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // create sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- // no-drive-letter folder defined by absolute path on the filesystem
- IPath incFilesystem = ResourceHelper.createWorkspaceFolder("includeFilesystem").setDevice(null);
- CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0);
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(incFilesystemEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
-
- IPath expectedInclude = incFilesystem.setDevice(buildCwdDevice);
- assertEquals(expectedInclude, new Path(actualIncludePaths[0]));
- assertEquals(1, actualIncludePaths.length);
- }
-
- /**
- * Test relative paths.
- */
- public void testRelativePath() throws Exception {
- // create a project
- String prjName = getName();
- IProject project = ResourceHelper.createCDTProjectWithConfig(prjName);
- String relativePath = "include";
- IFolder buildFolder = ResourceHelper.createFolder(project, "buildDir");
- IFolder relativeFolder = ResourceHelper.createFolder(project, "buildDir/"+relativePath);
- IFolder relativeFolderProjName = ResourceHelper.createFolder(project, "buildDir/"+prjName);
- String markedResolved = "-MarkedResolved";
- IFolder relativeFolderProjNameResolved = ResourceHelper.createFolder(project, "buildDir/" + prjName+markedResolved);
- IPath buildCWD=buildFolder.getLocation();
- setBuilderCWD(project, buildCWD);
-
- // get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // create sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- CIncludePathEntry incRelativeEntry = new CIncludePathEntry(new Path(relativePath), 0);
- CIncludePathEntry incProjNameEntry = new CIncludePathEntry(new Path("${ProjName}"), 0);
- CIncludePathEntry incProjNameMarkedResolvedEntry = new CIncludePathEntry(new Path("${ProjName}"+markedResolved), ICSettingEntry.RESOLVED);
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(incRelativeEntry);
- entries.add(incProjNameEntry);
- entries.add(incProjNameMarkedResolvedEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
-
- // pair of entries, one from build dir another relative path
- assertEquals(relativeFolder.getLocation(), new Path(actualIncludePaths[0]));
- assertEquals(new Path(relativePath), new Path(actualIncludePaths[1]));
-
- // pair of entries, one resolved from build dir another expanded relative path
- assertEquals(relativeFolderProjName.getLocation(), new Path(actualIncludePaths[2]));
- assertEquals(new Path(prjName), new Path(actualIncludePaths[3]));
-
- // if marked RESOLVED only that path stays
- assertEquals(new Path("${ProjName}"+markedResolved), new Path(actualIncludePaths[4]));
-
- assertEquals(5, actualIncludePaths.length);
- }
-
- /**
- * Test relative paths - some combinations of dot paths.
- */
- public void testRelativePathWithDots() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- // set build CWD
- IFolder buildFolder = ResourceHelper.createFolder(project, "buildDir");
- IPath buildCWD=buildFolder.getLocation();
- setBuilderCWD(project, buildCWD);
-
- // define a few variations of paths
- String relativePath_dot = ".";
- String relativePath_dot_slash = "./";
- String relativePath_dot_slash_path = "./include";
- IFolder relativeFolder_dot_slash_path = ResourceHelper.createFolder(project, "buildDir/include");
- String relativePath_dotdot = "..";
- String relativePath_dotdot_slash = "../";
- String relativePath_dotdot_slash_path = "../include";
- IFolder relativeFolder_dotdot_slash_path = ResourceHelper.createFolder(project, "include");
- String locationPath_dotdot_path = buildCWD.toString()+"/../include2";
- IFolder incFolder_dotdot_slash_path = ResourceHelper.createFolder(project, "include2"); // "/ProjPath/buildDir/../include2"
-
- // get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // create sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- CIncludePathEntry incRelativeEntry_dot = new CIncludePathEntry(new Path(relativePath_dot), 0);
- CIncludePathEntry incRelativeEntry_dot_slash_path = new CIncludePathEntry(new Path(relativePath_dot_slash_path), 0);
- CIncludePathEntry incRelativeEntry_dotdot = new CIncludePathEntry(new Path(relativePath_dotdot), 0);
- CIncludePathEntry incRelativeEntry_dotdot_slash_path = new CIncludePathEntry(new Path(relativePath_dotdot_slash_path), 0);
- CIncludePathEntry incEntry_dotdot_path = new CIncludePathEntry(locationPath_dotdot_path, 0);
- // use LOCAL flag not to clash with plain dot entries
- CIncludePathEntry incRelativeEntry_dotdot_slash = new CIncludePathEntry(new Path(relativePath_dotdot_slash), ICSettingEntry.LOCAL);
- CIncludePathEntry incRelativeEntry_dot_slash = new CIncludePathEntry(new Path(relativePath_dot_slash), ICSettingEntry.LOCAL);
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(incRelativeEntry_dot);
- entries.add(incRelativeEntry_dot_slash);
- entries.add(incRelativeEntry_dot_slash_path);
- entries.add(incRelativeEntry_dotdot);
- entries.add(incRelativeEntry_dotdot_slash);
- entries.add(incRelativeEntry_dotdot_slash_path);
- entries.add(incEntry_dotdot_path);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
- String[] actualLocalIncludePaths = info.getLocalIncludePath();
-
- IPath expectedLocation_dot = buildFolder.getLocation();
- IPath expectedLocation_dot_slash = buildFolder.getLocation();
- IPath expectedLocation_dot_slash_path = relativeFolder_dot_slash_path.getLocation();
- IPath expectedLocation_dotdot = project.getLocation();
- IPath expectedLocation_dotdot_slash = project.getLocation();
- IPath expectedLocation_dotdot_slash_path = relativeFolder_dotdot_slash_path.getLocation();
-
- assertEquals(expectedLocation_dot, new Path(actualIncludePaths[0]));
- assertEquals(".", actualIncludePaths[1]);
- assertEquals(expectedLocation_dot_slash_path, new Path(actualIncludePaths[2]));
- assertEquals(new Path(relativePath_dot_slash_path), new Path(actualIncludePaths[3]));
-
- assertEquals(expectedLocation_dotdot, new Path(actualIncludePaths[4]));
- assertEquals("..", actualIncludePaths[5]);
- assertEquals(expectedLocation_dotdot_slash_path, new Path(actualIncludePaths[6]));
- assertEquals(new Path(relativePath_dotdot_slash_path), new Path(actualIncludePaths[7]));
- assertTrue(actualIncludePaths[7].startsWith(".."));
- assertEquals(new Path(locationPath_dotdot_path), new Path(actualIncludePaths[8]));
- assertTrue(actualIncludePaths[8].contains(".."));
- assertEquals(9, actualIncludePaths.length);
-
- assertEquals(expectedLocation_dot_slash, new Path(actualLocalIncludePaths[0]));
- assertEquals(new Path(relativePath_dot_slash), new Path(actualLocalIncludePaths[1]));
- assertTrue(actualLocalIncludePaths[1].startsWith("."));
- assertEquals(expectedLocation_dotdot_slash, new Path(actualLocalIncludePaths[2]));
- assertEquals(new Path(relativePath_dotdot_slash), new Path(actualLocalIncludePaths[3]));
- assertTrue(actualLocalIncludePaths[3].startsWith(".."));
- assertEquals(4, actualLocalIncludePaths.length);
- }
-
- /**
- * Test if build/environment variables are expanded
- */
- public void testEnvironmentVars() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- IFolder folder = ResourceHelper.createFolder(project, "Folder");
- String envPathStr = "${ProjDirPath}/Folder";
-
- // get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // create sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- CIncludePathEntry incRelativeEntry = new CIncludePathEntry(envPathStr, 0);
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(incRelativeEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
-
- IPath expectedLocation = folder.getLocation();
- assertEquals(expectedLocation, new Path(actualIncludePaths[0]));
- assertEquals(1, actualIncludePaths.length);
- }
-
- /**
- * Test from parent folder's entries.
- */
- public void testParentFolder() throws Exception {
- class MockProviderForResource extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
- private IResource rc;
- private final List<ICLanguageSettingEntry> entries;
-
- public MockProviderForResource(IResource rc, List<ICLanguageSettingEntry> entries) {
- this.rc = rc;
- this.entries = entries;
- }
-
- @Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- if (this.rc.equals(rc))
- return entries;
- return null;
- }
- }
-
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // sample file
- IFolder parentFolder = ResourceHelper.createFolder(project, "ParentFolder");
- IFile file = ResourceHelper.createFile(project, "ParentFolder/file.c");
-
- // contribute the entries
- IFolder incFolder = ResourceHelper.createFolder(project, "include");
- CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0);
-
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(includePathEntry);
-
- // add provider for parent folder
- ILanguageSettingsProvider provider = new MockProviderForResource(parentFolder, entries);
- assertNull(provider.getSettingEntries(cfgDescription, file, null));
- assertEquals(includePathEntry, provider.getSettingEntries(cfgDescription, parentFolder, null).get(0));
-
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test that the scannerInfoProvider gets the entries for
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
- // include paths
- assertEquals(incFolder.getLocation(), new Path(actualIncludePaths[0]));
- assertEquals(1, actualIncludePaths.length);
- }
-
- /**
- * Test resolved paths.
- */
- public void testResolvedPath() throws Exception {
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- IFolder folder = ResourceHelper.createFolder(project, "Folder");
- String envPathStr = "${ProjDirPath}/Folder";
-
- // get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // create sample file
- IFile file = ResourceHelper.createFile(project, "file.c");
-
- // contribute the entries
- CIncludePathEntry incRelativeEntry = new CIncludePathEntry(envPathStr, ICSettingEntry.RESOLVED);
- List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(incRelativeEntry);
-
- // add provider to the configuration
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
- String[] actualIncludePaths = info.getIncludePaths();
-
- // test that RESOLVED entries are not modified
- IPath expectedLocation = new Path(envPathStr);
- assertEquals(expectedLocation, new Path(actualIncludePaths[0]));
- assertEquals(1, actualIncludePaths.length);
- }
-
- /**
- * Get languages for the folder.
- */
- private List<String> getLanguages(IFolder folder, ICConfigurationDescription cfgDescription) {
- IPath rcPath = folder.getProjectRelativePath();
- ICFolderDescription rcDes = (ICFolderDescription) cfgDescription.getResourceDescription(rcPath, false);
- ICLanguageSetting[] langSettings = rcDes.getLanguageSettings();
- assertNotNull(langSettings);
-
- List<String> languageIds = new ArrayList<String>();
- for (ICLanguageSetting ls : langSettings) {
- String langId = ls.getLanguageId();
- if (langId!=null && !languageIds.contains(langId)) {
- languageIds.add(langId);
- }
- }
- return languageIds;
- }
-
- /**
- * Test composition of 2 languages.
- */
- public void testResourceLanguages() throws Exception {
- class MockProviderLang extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
- private final String langId;
- private final List<ICLanguageSettingEntry> entries;
-
- public MockProviderLang(String id, String name, String langId, List<ICLanguageSettingEntry> entries) {
- super(id, name);
- this.langId = langId;
- this.entries = entries;
- }
-
- @Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- if (langId==null || langId.equals(languageId))
- return entries;
- return new ArrayList<ICLanguageSettingEntry>();
- }
- }
-
- // create a project
- IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- IFolder folder = ResourceHelper.createFolder(project, "Folder");
-
- IFolder incFolderA = ResourceHelper.createFolder(project, "includeA");
- IFolder incFolderB = ResourceHelper.createFolder(project, "includeB");
- IFolder incFolderC = ResourceHelper.createFolder(project, "includeC");
-
- // get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
- assertNotNull(prjDescription);
- ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
- assertNotNull(cfgDescription);
- assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
- // find 2 languages applicable to the folder
- List<String> languageIds = getLanguages(folder, cfgDescription);
- assertTrue(languageIds.size() >= 2);
- String langId1 = languageIds.get(0);
- String langId2 = languageIds.get(1);
-
- // define overlapping entries
- CIncludePathEntry incEntryA = new CIncludePathEntry(incFolderA, 0);
- CIncludePathEntry incEntryB = new CIncludePathEntry(incFolderB, 0);
- CIncludePathEntry incEntryC = new CIncludePathEntry(incFolderC, 0);
- List<ICLanguageSettingEntry> entries1 = new ArrayList<ICLanguageSettingEntry>();
- entries1.add(incEntryA);
- entries1.add(incEntryB);
- List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>();
- entries2.add(incEntryC);
- entries2.add(incEntryB);
-
- // add providers to the configuration
- ILanguageSettingsProvider provider1 = new MockProviderLang(PROVIDER_ID, PROVIDER_NAME, langId1, entries1);
- ILanguageSettingsProvider provider2 = new MockProviderLang(PROVIDER_ID_2, PROVIDER_NAME, langId2, entries2);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- providers.add(provider1);
- providers.add(provider2);
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
- // set project description
- CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
-
- // test the entries received from the scannerInfoProvider
- LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
- ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(folder);
- String[] actualIncludePaths = info.getIncludePaths();
-
- // Test that the result is the union of entries
- assertEquals(incFolderA.getLocation(), new Path(actualIncludePaths[0]));
- assertEquals(incFolderB.getLocation(), new Path(actualIncludePaths[1]));
- assertEquals(incFolderC.getLocation(), new Path(actualIncludePaths[2]));
- assertEquals(3, actualIncludePaths.length);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.model.ILanguage;
+import org.eclipse.cdt.core.model.LanguageManager;
+import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
+import org.eclipse.cdt.core.settings.model.CIncludeFileEntry;
+import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
+import org.eclipse.cdt.core.settings.model.CMacroEntry;
+import org.eclipse.cdt.core.settings.model.CMacroFileEntry;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICFolderDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.core.testplugin.ResourceHelper;
+import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
+import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsScannerInfoProvider;
+import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+/**
+ * Test cases testing LanguageSettingsProvider functionality
+ */
+public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
+ private static final IFile FAKE_FILE = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/project/path0"));
+ private static final String PROVIDER_ID = "test.provider.id";
+ private static final String PROVIDER_ID_2 = "test.provider.id.2";
+ private static final String PROVIDER_NAME = "test.provider.name";
+
+ // constants for getProjectDescription()
+ private static final boolean READ_ONLY = false;
+ private static final boolean WRITEABLE = true;
+
+ private class MockProvider extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
+ private final List<ICLanguageSettingEntry> entries;
+
+ public MockProvider(String id, String name, List<ICLanguageSettingEntry> entries) {
+ super(id, name);
+ this.entries = entries;
+ }
+
+ @Override
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ return entries;
+ }
+ }
+
+ /**
+ * Constructor.
+ * @param name - name of the test.
+ */
+ public LanguageSettingsScannerInfoProviderTests(String name) {
+ super(name);
+
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown(); // includes ResourceHelper cleanup
+ }
+
+ /**
+ * @return - new TestSuite.
+ */
+ public static TestSuite suite() {
+ return new TestSuite(LanguageSettingsScannerInfoProviderTests.class);
+ }
+
+ /**
+ * main function of the class.
+ *
+ * @param args - arguments
+ */
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ /**
+ * Sets build working directory for DefaultSettingConfiguration being tested.
+ */
+ private void setBuilderCWD(IProject project, IPath buildCWD) throws CoreException {
+ CProjectDescriptionManager manager = CProjectDescriptionManager.getInstance();
+ {
+ ICProjectDescription prjDescription = manager.getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+
+ cfgDescription.getBuildSetting().setBuilderCWD(buildCWD);
+ manager.setProjectDescription(project, prjDescription);
+ // doublecheck builderCWD
+ IPath actualBuildCWD = cfgDescription.getBuildSetting().getBuilderCWD();
+ assertEquals(buildCWD, actualBuildCWD);
+ }
+ {
+ // triplecheck builderCWD for different project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+
+ }
+ }
+
+ /**
+ * Test cases when some objects are null.
+ */
+ public void testNulls() throws Exception {
+ {
+ // Handle project==null
+ IResource root = ResourcesPlugin.getWorkspace().getRoot();
+ assertNull(root.getProject());
+
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(root);
+ assertEquals(0, info.getIncludePaths().length);
+ assertEquals(0, info.getDefinedSymbols().size());
+ assertEquals(0, info.getIncludeFiles().length);
+ assertEquals(0, info.getMacroFiles().length);
+ assertEquals(0, info.getLocalIncludePath().length);
+ }
+
+ {
+ // Handle prjDescription==null
+ IProject project = FAKE_FILE.getProject();
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ assertNull(prjDescription);
+
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(FAKE_FILE);
+ assertEquals(0, info.getIncludePaths().length);
+ assertEquals(0, info.getDefinedSymbols().size());
+ assertEquals(0, info.getIncludeFiles().length);
+ assertEquals(0, info.getMacroFiles().length);
+ assertEquals(0, info.getLocalIncludePath().length);
+ }
+
+ {
+ // Handle language==null
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ IFile file = ResourceHelper.createFile(project, "file");
+
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ ILanguage language = LanguageManager.getInstance().getLanguageForFile(file, cfgDescription);
+ assertNull(language);
+
+ // AG FIXME - temporarily ignore the entry in the log
+ setExpectedNumberOfLoggedNonOKStatusObjects(1);
+
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ assertEquals(0, info.getIncludePaths().length);
+ assertEquals(0, info.getDefinedSymbols().size());
+ assertEquals(0, info.getIncludeFiles().length);
+ assertEquals(0, info.getMacroFiles().length);
+ assertEquals(0, info.getLocalIncludePath().length);
+ }
+ }
+
+ /**
+ * Test empty scanner info.
+ */
+ public void testEmpty() throws Exception {
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // confirm that language==null
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ ILanguage language = LanguageManager.getInstance().getLanguageForFile(file, cfgDescription);
+ assertNotNull(language);
+
+ // test that the info is empty
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ assertEquals(0, info.getIncludePaths().length);
+ assertEquals(0, info.getDefinedSymbols().size());
+ assertEquals(0, info.getIncludeFiles().length);
+ assertEquals(0, info.getMacroFiles().length);
+ assertEquals(0, info.getLocalIncludePath().length);
+ }
+
+ /**
+ * Test regular cases.
+ */
+ public void testRegular() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // sanity test of language
+ ILanguage language = LanguageManager.getInstance().getLanguageForFile(file, cfgDescription);
+ assertNotNull(language);
+
+ // contribute the entries
+ IFolder includeFolder = ResourceHelper.createFolder(project, "/include-path");
+ IFolder includeLocalFolder = ResourceHelper.createFolder(project, "/local-include-path");
+ IFile macroFile = ResourceHelper.createFile(project, "macro-file");
+ IFile includeFile = ResourceHelper.createFile(project, "include-file");
+
+ CIncludePathEntry includePathEntry = new CIncludePathEntry(includeFolder, 0);
+ CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(includeLocalFolder, ICSettingEntry.LOCAL); // #include "..."
+ CMacroEntry macroEntry = new CMacroEntry("MACRO", "value",0);
+ CIncludeFileEntry includeFileEntry = new CIncludeFileEntry(includeFile, 0);
+ CMacroFileEntry macroFileEntry = new CMacroFileEntry(macroFile, 0);
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(includePathEntry);
+ entries.add(includeLocalPathEntry);
+ entries.add(macroEntry);
+ entries.add(includeFileEntry);
+ entries.add(macroFileEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test that the scannerInfoProvider gets the entries
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+ Map<String, String> actualDefinedSymbols = info.getDefinedSymbols();
+ String[] actualIncludeFiles = info.getIncludeFiles();
+ String[] actualMacroFiles = info.getMacroFiles();
+ String[] actualLocalIncludePath = info.getLocalIncludePath();
+ // include paths
+ assertEquals(includeFolder.getLocation(), new Path(actualIncludePaths[0]));
+ assertEquals(1, actualIncludePaths.length);
+ // macros
+ assertEquals(macroEntry.getValue(), actualDefinedSymbols.get(macroEntry.getName()));
+ assertEquals(1, actualDefinedSymbols.size());
+ // include file
+ assertEquals(includeFile.getLocation(), new Path(actualIncludeFiles[0]));
+ assertEquals(1, actualIncludeFiles.length);
+ // macro file
+ assertEquals(macroFile.getLocation(), new Path(actualMacroFiles[0]));
+ assertEquals(1, actualMacroFiles.length);
+ // local include files
+ assertEquals(includeLocalFolder.getLocation(), new Path(actualLocalIncludePath[0]));
+ assertEquals(1, actualLocalIncludePath.length);
+ }
+
+ /**
+ * Test "local" flag (#include "...").
+ */
+ public void testLocal() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ IFolder incFolder = ResourceHelper.createFolder(project, "include");
+ IFolder incFolder2 = ResourceHelper.createFolder(project, "include2");
+ CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0);
+ CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..."
+ CIncludePathEntry includeLocalPathEntry2 = new CIncludePathEntry(incFolder2, ICSettingEntry.LOCAL); // #include "..."
+ CIncludePathEntry includePathEntry2 = new CIncludePathEntry(incFolder2, 0);
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(includePathEntry);
+ entries.add(includeLocalPathEntry);
+ // reverse order for incPath2
+ entries.add(includeLocalPathEntry2);
+ entries.add(includePathEntry2);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test that the scannerInfoProvider gets the entries
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+ String[] actualLocalIncludePath = info.getLocalIncludePath();
+ // include paths
+ assertEquals(incFolder.getLocation(), new Path(actualIncludePaths[0]));
+ assertEquals(incFolder2.getLocation(), new Path(actualIncludePaths[1]));
+ assertEquals(2, actualIncludePaths.length);
+ // local include files
+ assertEquals(incFolder.getLocation(), new Path(actualLocalIncludePath[0]));
+ assertEquals(incFolder2.getLocation(), new Path(actualLocalIncludePath[1]));
+ assertEquals(2, actualLocalIncludePath.length);
+ }
+
+ /**
+ * Test Mac frameworks.
+ */
+ public void testFramework() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ IFolder frameworkFolder = ResourceHelper.createFolder(project, "Fmwk");
+ CIncludePathEntry frameworkPathEntry = new CIncludePathEntry(frameworkFolder, ICSettingEntry.FRAMEWORKS_MAC);
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(frameworkPathEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test that the scannerInfoProvider gets the entries
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+ // include paths
+ assertEquals(frameworkFolder.getLocation().append("/__framework__.framework/Headers/__header__"),
+ new Path(actualIncludePaths[0]));
+ assertEquals(frameworkFolder.getLocation().append("/__framework__.framework/PrivateHeaders/__header__"),
+ new Path(actualIncludePaths[1]));
+ assertEquals(2, actualIncludePaths.length);
+ }
+
+ /**
+ * Test duplicate entries.
+ */
+ public void testDuplicate() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ IFolder incFolder = ResourceHelper.createFolder(project, "include");
+ CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0);
+ CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..."
+ CIncludePathEntry includePathEntry2 = new CIncludePathEntry(incFolder, 0);
+ CIncludePathEntry includeLocalPathEntry2 = new CIncludePathEntry(incFolder, ICSettingEntry.LOCAL); // #include "..."
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(includePathEntry);
+ entries.add(includeLocalPathEntry);
+ entries.add(includePathEntry2);
+ entries.add(includeLocalPathEntry2);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test that the scannerInfoProvider gets the entries
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+ String[] actualLocalIncludePath = info.getLocalIncludePath();
+ // include paths
+ assertEquals(incFolder.getLocation(), new Path(actualIncludePaths[0]));
+ assertEquals(1, actualIncludePaths.length);
+ // local include files
+ assertEquals(incFolder.getLocation(), new Path(actualLocalIncludePath[0]));
+ assertEquals(1, actualLocalIncludePath.length);
+ }
+
+ /**
+ * Test include path managed by eclipse as a workspace path.
+ */
+ public void testWorkspacePath() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // create sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+ // eclipse-managed folder in workspace
+ IFolder incWorkspace_1 = ResourceHelper.createFolder(project, "include_1");
+ IPath incWorkspaceLocation_1 = incWorkspace_1.getLocation();
+ IFolder incWorkspace_2 = ResourceHelper.createFolder(project, "include_2");
+ IPath incWorkspacePath_2 = incWorkspace_2.getFullPath();
+ IPath incWorkspaceLocation_2 = incWorkspace_2.getLocation();
+ IFolder incWorkspace_3 = ResourceHelper.createFolder(project, "include_3");
+ // "relative" should make no difference for VALUE_WORKSPACE_PATH
+ IPath incWorkspaceRelativePath_3 = incWorkspace_3.getFullPath().makeRelative();
+ IPath incWorkspaceLocation_3 = incWorkspace_3.getLocation();
+ // not having "RESOLVED" should make no difference for well formed path
+ IFolder incWorkspace_4 = ResourceHelper.createFolder(project, "include_4");
+ IPath incWorkspacePathNoResolved_4 = incWorkspace_4.getFullPath();
+ IPath incWorkspaceLocation_4 = incWorkspace_4.getLocation();
+ // folder defined by absolute path on the filesystem
+ IPath incFilesystem = ResourceHelper.createWorkspaceFolder("includeFilesystem");
+
+ // contribute the entries
+ CIncludePathEntry incWorkspaceEntry_1 = new CIncludePathEntry(incWorkspace_1, 0);
+ CIncludePathEntry incWorkspaceEntry_2 = new CIncludePathEntry(incWorkspacePath_2, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ CIncludePathEntry incWorkspaceEntry_3 = new CIncludePathEntry(incWorkspaceRelativePath_3, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ CIncludePathEntry incWorkspaceEntry_4 = new CIncludePathEntry(incWorkspacePathNoResolved_4, ICSettingEntry.VALUE_WORKSPACE_PATH);
+ CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0);
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(incWorkspaceEntry_1);
+ entries.add(incWorkspaceEntry_2);
+ entries.add(incWorkspaceEntry_3);
+ entries.add(incWorkspaceEntry_4);
+ entries.add(incFilesystemEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+
+ assertEquals(incWorkspaceLocation_1, new Path(actualIncludePaths[0]));
+ assertEquals(incWorkspaceLocation_2, new Path(actualIncludePaths[1]));
+ assertEquals(incWorkspaceLocation_3, new Path(actualIncludePaths[2]));
+ assertEquals(incWorkspaceLocation_4, new Path(actualIncludePaths[3]));
+ assertEquals(incFilesystem, new Path(actualIncludePaths[4]));
+ assertEquals(5, actualIncludePaths.length);
+
+ }
+
+ /**
+ * Confirm that device letter is prepended on filesystems that support that.
+ */
+ public void testFilesystemPathNoDriveLetter() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ // change drive on build working directory
+ String buildCwdDevice = project.getLocation().getDevice();
+
+// // Test manually with a device which is different from project location device (path should exist)
+// IPath buildCWD = new Path("D:/build/path");
+// String buildCwdDevice = buildCWD.getDevice();
+
+ // get project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // create sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ // no-drive-letter folder defined by absolute path on the filesystem
+ IPath incFilesystem = ResourceHelper.createWorkspaceFolder("includeFilesystem").setDevice(null);
+ CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0);
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(incFilesystemEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+
+ IPath expectedInclude = incFilesystem.setDevice(buildCwdDevice);
+ assertEquals(expectedInclude, new Path(actualIncludePaths[0]));
+ assertEquals(1, actualIncludePaths.length);
+ }
+
+ /**
+ * Test relative paths.
+ */
+ public void testRelativePath() throws Exception {
+ // create a project
+ String prjName = getName();
+ IProject project = ResourceHelper.createCDTProjectWithConfig(prjName);
+ String relativePath = "include";
+ IFolder buildFolder = ResourceHelper.createFolder(project, "buildDir");
+ IFolder relativeFolder = ResourceHelper.createFolder(project, "buildDir/"+relativePath);
+ IFolder relativeFolderProjName = ResourceHelper.createFolder(project, "buildDir/"+prjName);
+ String markedResolved = "-MarkedResolved";
+ IFolder relativeFolderProjNameResolved = ResourceHelper.createFolder(project, "buildDir/" + prjName+markedResolved);
+ IPath buildCWD=buildFolder.getLocation();
+ setBuilderCWD(project, buildCWD);
+
+ // get project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // create sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ CIncludePathEntry incRelativeEntry = new CIncludePathEntry(new Path(relativePath), 0);
+ CIncludePathEntry incProjNameEntry = new CIncludePathEntry(new Path("${ProjName}"), 0);
+ CIncludePathEntry incProjNameMarkedResolvedEntry = new CIncludePathEntry(new Path("${ProjName}"+markedResolved), ICSettingEntry.RESOLVED);
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(incRelativeEntry);
+ entries.add(incProjNameEntry);
+ entries.add(incProjNameMarkedResolvedEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+
+ // pair of entries, one from build dir another relative path
+ assertEquals(relativeFolder.getLocation(), new Path(actualIncludePaths[0]));
+ assertEquals(new Path(relativePath), new Path(actualIncludePaths[1]));
+
+ // pair of entries, one resolved from build dir another expanded relative path
+ assertEquals(relativeFolderProjName.getLocation(), new Path(actualIncludePaths[2]));
+ assertEquals(new Path(prjName), new Path(actualIncludePaths[3]));
+
+ // if marked RESOLVED only that path stays
+ assertEquals(new Path("${ProjName}"+markedResolved), new Path(actualIncludePaths[4]));
+
+ assertEquals(5, actualIncludePaths.length);
+ }
+
+ /**
+ * Test relative paths - some combinations of dot paths.
+ */
+ public void testRelativePathWithDots() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ // set build CWD
+ IFolder buildFolder = ResourceHelper.createFolder(project, "buildDir");
+ IPath buildCWD=buildFolder.getLocation();
+ setBuilderCWD(project, buildCWD);
+
+ // define a few variations of paths
+ String relativePath_dot = ".";
+ String relativePath_dot_slash = "./";
+ String relativePath_dot_slash_path = "./include";
+ IFolder relativeFolder_dot_slash_path = ResourceHelper.createFolder(project, "buildDir/include");
+ String relativePath_dotdot = "..";
+ String relativePath_dotdot_slash = "../";
+ String relativePath_dotdot_slash_path = "../include";
+ IFolder relativeFolder_dotdot_slash_path = ResourceHelper.createFolder(project, "include");
+ String locationPath_dotdot_path = buildCWD.toString()+"/../include2";
+ IFolder incFolder_dotdot_slash_path = ResourceHelper.createFolder(project, "include2"); // "/ProjPath/buildDir/../include2"
+
+ // get project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // create sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ CIncludePathEntry incRelativeEntry_dot = new CIncludePathEntry(new Path(relativePath_dot), 0);
+ CIncludePathEntry incRelativeEntry_dot_slash_path = new CIncludePathEntry(new Path(relativePath_dot_slash_path), 0);
+ CIncludePathEntry incRelativeEntry_dotdot = new CIncludePathEntry(new Path(relativePath_dotdot), 0);
+ CIncludePathEntry incRelativeEntry_dotdot_slash_path = new CIncludePathEntry(new Path(relativePath_dotdot_slash_path), 0);
+ CIncludePathEntry incEntry_dotdot_path = new CIncludePathEntry(locationPath_dotdot_path, 0);
+ // use LOCAL flag not to clash with plain dot entries
+ CIncludePathEntry incRelativeEntry_dotdot_slash = new CIncludePathEntry(new Path(relativePath_dotdot_slash), ICSettingEntry.LOCAL);
+ CIncludePathEntry incRelativeEntry_dot_slash = new CIncludePathEntry(new Path(relativePath_dot_slash), ICSettingEntry.LOCAL);
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(incRelativeEntry_dot);
+ entries.add(incRelativeEntry_dot_slash);
+ entries.add(incRelativeEntry_dot_slash_path);
+ entries.add(incRelativeEntry_dotdot);
+ entries.add(incRelativeEntry_dotdot_slash);
+ entries.add(incRelativeEntry_dotdot_slash_path);
+ entries.add(incEntry_dotdot_path);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+ String[] actualLocalIncludePaths = info.getLocalIncludePath();
+
+ IPath expectedLocation_dot = buildFolder.getLocation();
+ IPath expectedLocation_dot_slash = buildFolder.getLocation();
+ IPath expectedLocation_dot_slash_path = relativeFolder_dot_slash_path.getLocation();
+ IPath expectedLocation_dotdot = project.getLocation();
+ IPath expectedLocation_dotdot_slash = project.getLocation();
+ IPath expectedLocation_dotdot_slash_path = relativeFolder_dotdot_slash_path.getLocation();
+
+ assertEquals(expectedLocation_dot, new Path(actualIncludePaths[0]));
+ assertEquals(".", actualIncludePaths[1]);
+ assertEquals(expectedLocation_dot_slash_path, new Path(actualIncludePaths[2]));
+ assertEquals(new Path(relativePath_dot_slash_path), new Path(actualIncludePaths[3]));
+
+ assertEquals(expectedLocation_dotdot, new Path(actualIncludePaths[4]));
+ assertEquals("..", actualIncludePaths[5]);
+ assertEquals(expectedLocation_dotdot_slash_path, new Path(actualIncludePaths[6]));
+ assertEquals(new Path(relativePath_dotdot_slash_path), new Path(actualIncludePaths[7]));
+ assertTrue(actualIncludePaths[7].startsWith(".."));
+ assertEquals(new Path(locationPath_dotdot_path), new Path(actualIncludePaths[8]));
+ assertTrue(actualIncludePaths[8].contains(".."));
+ assertEquals(9, actualIncludePaths.length);
+
+ assertEquals(expectedLocation_dot_slash, new Path(actualLocalIncludePaths[0]));
+ assertEquals(new Path(relativePath_dot_slash), new Path(actualLocalIncludePaths[1]));
+ assertTrue(actualLocalIncludePaths[1].startsWith("."));
+ assertEquals(expectedLocation_dotdot_slash, new Path(actualLocalIncludePaths[2]));
+ assertEquals(new Path(relativePath_dotdot_slash), new Path(actualLocalIncludePaths[3]));
+ assertTrue(actualLocalIncludePaths[3].startsWith(".."));
+ assertEquals(4, actualLocalIncludePaths.length);
+ }
+
+ /**
+ * Test if build/environment variables are expanded
+ */
+ public void testEnvironmentVars() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ IFolder folder = ResourceHelper.createFolder(project, "Folder");
+ String envPathStr = "${ProjDirPath}/Folder";
+
+ // get project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // create sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ CIncludePathEntry incRelativeEntry = new CIncludePathEntry(envPathStr, 0);
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(incRelativeEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+
+ IPath expectedLocation = folder.getLocation();
+ assertEquals(expectedLocation, new Path(actualIncludePaths[0]));
+ assertEquals(1, actualIncludePaths.length);
+ }
+
+ /**
+ * Test from parent folder's entries.
+ */
+ public void testParentFolder() throws Exception {
+ class MockProviderForResource extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
+ private IResource rc;
+ private final List<ICLanguageSettingEntry> entries;
+
+ public MockProviderForResource(IResource rc, List<ICLanguageSettingEntry> entries) {
+ this.rc = rc;
+ this.entries = entries;
+ }
+
+ @Override
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ if (this.rc.equals(rc))
+ return entries;
+ return null;
+ }
+ }
+
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // sample file
+ IFolder parentFolder = ResourceHelper.createFolder(project, "ParentFolder");
+ IFile file = ResourceHelper.createFile(project, "ParentFolder/file.c");
+
+ // contribute the entries
+ IFolder incFolder = ResourceHelper.createFolder(project, "include");
+ CIncludePathEntry includePathEntry = new CIncludePathEntry(incFolder, 0);
+
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(includePathEntry);
+
+ // add provider for parent folder
+ ILanguageSettingsProvider provider = new MockProviderForResource(parentFolder, entries);
+ assertNull(provider.getSettingEntries(cfgDescription, file, null));
+ assertEquals(includePathEntry, provider.getSettingEntries(cfgDescription, parentFolder, null).get(0));
+
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test that the scannerInfoProvider gets the entries for
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+ // include paths
+ assertEquals(incFolder.getLocation(), new Path(actualIncludePaths[0]));
+ assertEquals(1, actualIncludePaths.length);
+ }
+
+ /**
+ * Test resolved paths.
+ */
+ public void testResolvedPath() throws Exception {
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ IFolder folder = ResourceHelper.createFolder(project, "Folder");
+ String envPathStr = "${ProjDirPath}/Folder";
+
+ // get project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // create sample file
+ IFile file = ResourceHelper.createFile(project, "file.c");
+
+ // contribute the entries
+ CIncludePathEntry incRelativeEntry = new CIncludePathEntry(envPathStr, ICSettingEntry.RESOLVED);
+ List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
+ entries.add(incRelativeEntry);
+
+ // add provider to the configuration
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_ID, PROVIDER_NAME, entries);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(file);
+ String[] actualIncludePaths = info.getIncludePaths();
+
+ // test that RESOLVED entries are not modified
+ IPath expectedLocation = new Path(envPathStr);
+ assertEquals(expectedLocation, new Path(actualIncludePaths[0]));
+ assertEquals(1, actualIncludePaths.length);
+ }
+
+ /**
+ * Get languages for the folder.
+ */
+ private List<String> getLanguages(IFolder folder, ICConfigurationDescription cfgDescription) {
+ IPath rcPath = folder.getProjectRelativePath();
+ ICFolderDescription rcDes = (ICFolderDescription) cfgDescription.getResourceDescription(rcPath, false);
+ ICLanguageSetting[] langSettings = rcDes.getLanguageSettings();
+ assertNotNull(langSettings);
+
+ List<String> languageIds = new ArrayList<String>();
+ for (ICLanguageSetting ls : langSettings) {
+ String langId = ls.getLanguageId();
+ if (langId!=null && !languageIds.contains(langId)) {
+ languageIds.add(langId);
+ }
+ }
+ return languageIds;
+ }
+
+ /**
+ * Test composition of 2 languages.
+ */
+ public void testResourceLanguages() throws Exception {
+ class MockProviderLang extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
+ private final String langId;
+ private final List<ICLanguageSettingEntry> entries;
+
+ public MockProviderLang(String id, String name, String langId, List<ICLanguageSettingEntry> entries) {
+ super(id, name);
+ this.langId = langId;
+ this.entries = entries;
+ }
+
+ @Override
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ if (langId==null || langId.equals(languageId))
+ return entries;
+ return new ArrayList<ICLanguageSettingEntry>();
+ }
+ }
+
+ // create a project
+ IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
+ IFolder folder = ResourceHelper.createFolder(project, "Folder");
+
+ IFolder incFolderA = ResourceHelper.createFolder(project, "includeA");
+ IFolder incFolderB = ResourceHelper.createFolder(project, "includeB");
+ IFolder incFolderC = ResourceHelper.createFolder(project, "includeC");
+
+ // get project/configuration descriptions
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ assertNotNull(prjDescription);
+ ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
+ assertNotNull(cfgDescription);
+ assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
+
+ // find 2 languages applicable to the folder
+ List<String> languageIds = getLanguages(folder, cfgDescription);
+ assertTrue(languageIds.size() >= 2);
+ String langId1 = languageIds.get(0);
+ String langId2 = languageIds.get(1);
+
+ // define overlapping entries
+ CIncludePathEntry incEntryA = new CIncludePathEntry(incFolderA, 0);
+ CIncludePathEntry incEntryB = new CIncludePathEntry(incFolderB, 0);
+ CIncludePathEntry incEntryC = new CIncludePathEntry(incFolderC, 0);
+ List<ICLanguageSettingEntry> entries1 = new ArrayList<ICLanguageSettingEntry>();
+ entries1.add(incEntryA);
+ entries1.add(incEntryB);
+ List<ICLanguageSettingEntry> entries2 = new ArrayList<ICLanguageSettingEntry>();
+ entries2.add(incEntryC);
+ entries2.add(incEntryB);
+
+ // add providers to the configuration
+ ILanguageSettingsProvider provider1 = new MockProviderLang(PROVIDER_ID, PROVIDER_NAME, langId1, entries1);
+ ILanguageSettingsProvider provider2 = new MockProviderLang(PROVIDER_ID_2, PROVIDER_NAME, langId2, entries2);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
+ providers.add(provider1);
+ providers.add(provider2);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
+
+ // set project description
+ CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescription);
+
+ // test the entries received from the scannerInfoProvider
+ LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
+ ExtendedScannerInfo info = scannerInfoProvider.getScannerInformation(folder);
+ String[] actualIncludePaths = info.getIncludePaths();
+
+ // Test that the result is the union of entries
+ assertEquals(incFolderA.getLocation(), new Path(actualIncludePaths[0]));
+ assertEquals(incFolderB.getLocation(), new Path(actualIncludePaths[1]));
+ assertEquals(incFolderC.getLocation(), new Path(actualIncludePaths[2]));
+ assertEquals(3, actualIncludePaths.length);
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java
index c39835629e..d6887eb6e0 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java
@@ -1,104 +1,104 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.core.runtime.Assert;
-
-/**
- * Mock Language Settings Provider that keeps count how many times it has been registered.
- */
-public class MockListenerRegisterer extends LanguageSettingsSerializableProvider implements ILanguageSettingsEditableProvider, ICListenerAgent {
- private static MockListenerManager mockListenerManager = new MockListenerManager();
-
- private static class MockListenerManager {
- private class ListenerCount {
- private MockListenerRegisterer listener;
- private int count;
- public ListenerCount(MockListenerRegisterer l, int cnt) {
- listener = l;
- count = cnt;
- }
- }
- private List<ListenerCount> register = new ArrayList<ListenerCount>();
-
- public void registerListener(MockListenerRegisterer listener) {
- for (ListenerCount lc : register) {
- if (lc.listener == listener) {
- lc.count++;
- return;
- }
- }
-
- register.add(new ListenerCount(listener, 1));
- }
-
- public void unregisterListener(MockListenerRegisterer listener) {
- for (ListenerCount lc : register) {
- if (lc.listener == listener) {
- lc.count--;
- Assert.isTrue(lc.count>=0);
- return;
- }
- }
-
- // attempt to unregister non-registered listener
- Assert.isTrue(false);
- }
-
- /**
- * Note that that count includes all listeners with that id.
- */
- public int getCount(String id) {
- int count = 0;
-
- for (ListenerCount lc : register) {
- if (lc.listener.getId().equals(id)) {
- count = count + lc.count;
- }
- }
-
- return count;
- }
- }
-
- public MockListenerRegisterer() {
- super();
- }
- public MockListenerRegisterer(String id, String name) {
- super(id, name);
- }
- @Override
- public void registerListener(ICConfigurationDescription cfgDescription) {
- mockListenerManager.registerListener(this);
- }
-
- @Override
- public void unregisterListener() {
- mockListenerManager.unregisterListener(this);
- }
- @Override
- public MockListenerRegisterer cloneShallow() throws CloneNotSupportedException {
- return (MockListenerRegisterer) super.cloneShallow();
- }
- @Override
- public MockListenerRegisterer clone() throws CloneNotSupportedException {
- return (MockListenerRegisterer) super.clone();
- }
-
- public static int getCount(String id) {
- return mockListenerManager.getCount(id);
- }
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.core.runtime.Assert;
+
+/**
+ * Mock Language Settings Provider that keeps count how many times it has been registered.
+ */
+public class MockListenerRegisterer extends LanguageSettingsSerializableProvider implements ILanguageSettingsEditableProvider, ICListenerAgent {
+ private static MockListenerManager mockListenerManager = new MockListenerManager();
+
+ private static class MockListenerManager {
+ private class ListenerCount {
+ private MockListenerRegisterer listener;
+ private int count;
+ public ListenerCount(MockListenerRegisterer l, int cnt) {
+ listener = l;
+ count = cnt;
+ }
+ }
+ private List<ListenerCount> register = new ArrayList<ListenerCount>();
+
+ public void registerListener(MockListenerRegisterer listener) {
+ for (ListenerCount lc : register) {
+ if (lc.listener == listener) {
+ lc.count++;
+ return;
+ }
+ }
+
+ register.add(new ListenerCount(listener, 1));
+ }
+
+ public void unregisterListener(MockListenerRegisterer listener) {
+ for (ListenerCount lc : register) {
+ if (lc.listener == listener) {
+ lc.count--;
+ Assert.isTrue(lc.count>=0);
+ return;
+ }
+ }
+
+ // attempt to unregister non-registered listener
+ Assert.isTrue(false);
+ }
+
+ /**
+ * Note that that count includes all listeners with that id.
+ */
+ public int getCount(String id) {
+ int count = 0;
+
+ for (ListenerCount lc : register) {
+ if (lc.listener.getId().equals(id)) {
+ count = count + lc.count;
+ }
+ }
+
+ return count;
+ }
+ }
+
+ public MockListenerRegisterer() {
+ super();
+ }
+ public MockListenerRegisterer(String id, String name) {
+ super(id, name);
+ }
+ @Override
+ public void registerListener(ICConfigurationDescription cfgDescription) {
+ mockListenerManager.registerListener(this);
+ }
+
+ @Override
+ public void unregisterListener() {
+ mockListenerManager.unregisterListener(this);
+ }
+ @Override
+ public MockListenerRegisterer cloneShallow() throws CloneNotSupportedException {
+ return (MockListenerRegisterer) super.cloneShallow();
+ }
+ @Override
+ public MockListenerRegisterer clone() throws CloneNotSupportedException {
+ return (MockListenerRegisterer) super.clone();
+ }
+
+ public static int getCount(String id) {
+ return mockListenerManager.getCount(id);
+ }
} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h b/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h
index df422c6e85..d9736eff1d 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h
+++ b/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h
@@ -1,146 +1,146 @@
-// include
-#include "included.h"
-
-// macro
-#define PRINT(string,msg) printf(string, msg)
-
-//namespace
-namespace MyPackage
-{
- // check class
- // class
- class Hello
- {
- // protected visibility
- protected:
- // field
- int x;
- // method
- inline void setX(int X)
- {
- x = X;
- };
- // check nested pachage
- // nested namespace
- namespace MyNestedPackage {
- // check parent nested class
- // nested class
- class Y
- { // public visibility
- public:
- // constructor
- Y();
- // virtual destructor
- virtual ~Y();
- };
- // check derived nested class
- // derived class
- class X : public Y {
- // private visibility
- private:
- // private field
- B b;
-
- public:
- // constructor chain
- X(int x) : Y(x) {
- cout << "In consturctor\n";
- }
- // method declaration
- int doNothing();
- };
- }
- };
-
- // check enums
- // enum without name
- enum {
- first = 1,
- second,
- third
- }
- ;
- // enum with name
- enum MyEnum {
- f,
- s,
- t };
-
- // check variables
- // variable
- int v;
- // unsigned long variable
- unsigned long vuLong;
- // unsigned short variable
- unsigned short vuShort;
-
- // check variable declarations
- // variable declaration
- extern int evar;
- // function pointer
- static void * (*orig_malloc_hook)(const char *file, int line, size_t size);
-
- // check functions
- // simple function declaration
- void foo();
- // function declaration with parameters
- char* foo(int& x,
- char**y);
- // simple function definition
- void boo(){
- int g = 0;
- };
- // check Structs
- // struct
- struct MyStruct{
- int sint;
- };
- // typedef and elaborated types
- typedef struct MyStruct myStruct;
- // typedef
- typedef struct{
- int ss;
- } myTypedef;
- // unions
- union U{
- int U1;
- };
-
-
- // check templates
- // template function
- template<class A, typename B=C>
- A aTemplatedFunction( B bInstance );
- // template method
- class enclosing {
- // public visibility
- public:
- template<class A, typename B=C>
- A aTemplatedMethod( B bInstance );
- };
- // template class
- template<class T, typename Tibor = junk>
- class myarray { /* */ };
- // template struct
- template<class T, typename Tibor = junk>
- struct mystruct { /* */ };
- // template variable
-// template <bool __threads, int __inst>
-// char* default_alloc_template<__threads, __inst>::_S_start_free = 0;
-};
- // check arrays
- // arrays
- int myArray [5][];
- int main(int argc, char * argv[])
- {
- }
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=180815
-struct bug180815 {
- int i,j;
-} bug180815_var0, bug180815_var1;
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=352350
-namespace {
- int bug352350;
+// include
+#include "included.h"
+
+// macro
+#define PRINT(string,msg) printf(string, msg)
+
+//namespace
+namespace MyPackage
+{
+ // check class
+ // class
+ class Hello
+ {
+ // protected visibility
+ protected:
+ // field
+ int x;
+ // method
+ inline void setX(int X)
+ {
+ x = X;
+ };
+ // check nested pachage
+ // nested namespace
+ namespace MyNestedPackage {
+ // check parent nested class
+ // nested class
+ class Y
+ { // public visibility
+ public:
+ // constructor
+ Y();
+ // virtual destructor
+ virtual ~Y();
+ };
+ // check derived nested class
+ // derived class
+ class X : public Y {
+ // private visibility
+ private:
+ // private field
+ B b;
+
+ public:
+ // constructor chain
+ X(int x) : Y(x) {
+ cout << "In consturctor\n";
+ }
+ // method declaration
+ int doNothing();
+ };
+ }
+ };
+
+ // check enums
+ // enum without name
+ enum {
+ first = 1,
+ second,
+ third
+ }
+ ;
+ // enum with name
+ enum MyEnum {
+ f,
+ s,
+ t };
+
+ // check variables
+ // variable
+ int v;
+ // unsigned long variable
+ unsigned long vuLong;
+ // unsigned short variable
+ unsigned short vuShort;
+
+ // check variable declarations
+ // variable declaration
+ extern int evar;
+ // function pointer
+ static void * (*orig_malloc_hook)(const char *file, int line, size_t size);
+
+ // check functions
+ // simple function declaration
+ void foo();
+ // function declaration with parameters
+ char* foo(int& x,
+ char**y);
+ // simple function definition
+ void boo(){
+ int g = 0;
+ };
+ // check Structs
+ // struct
+ struct MyStruct{
+ int sint;
+ };
+ // typedef and elaborated types
+ typedef struct MyStruct myStruct;
+ // typedef
+ typedef struct{
+ int ss;
+ } myTypedef;
+ // unions
+ union U{
+ int U1;
+ };
+
+
+ // check templates
+ // template function
+ template<class A, typename B=C>
+ A aTemplatedFunction( B bInstance );
+ // template method
+ class enclosing {
+ // public visibility
+ public:
+ template<class A, typename B=C>
+ A aTemplatedMethod( B bInstance );
+ };
+ // template class
+ template<class T, typename Tibor = junk>
+ class myarray { /* */ };
+ // template struct
+ template<class T, typename Tibor = junk>
+ struct mystruct { /* */ };
+ // template variable
+// template <bool __threads, int __inst>
+// char* default_alloc_template<__threads, __inst>::_S_start_free = 0;
+};
+ // check arrays
+ // arrays
+ int myArray [5][];
+ int main(int argc, char * argv[])
+ {
+ }
+
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=180815
+struct bug180815 {
+ int i,j;
+} bug180815_var0, bug180815_var1;
+
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=352350
+namespace {
+ int bug352350;
} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c b/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c
index e258b183e5..2f7b355860 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c
+++ b/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c
@@ -1,70 +1,70 @@
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002, 2003.
- * All Rights Reserved.
+/*
+ * (c) Copyright QNX Software Systems Ltd. 2002, 2003.
+ * All Rights Reserved.
*/
-/********
- * This is a sample C file that will be used in testing the TranslationUnit
- * class. It has a specific structure that will be looked for within the
- * test case.
- * This file is only ment to contain various C elements, and may not compile
- * into a running application (but should be valid C)
- */
-
-#include <stdio.h>
-#include <unistd.h>
-
-/* A function prototype */
-int func2p(void);
-
-/* A global variable */
-int globalvar;
-
-/* A enumeration */
-enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4};
-
-/* A structure. This also includes a typedef around the strcture def
- * which at the time of writing was not picked up.
- */
-typedef struct mystruct {
- int a;
- char b;
- long c;
-} mystruct_t;
-
-/* A union */
-union myunion {
- int x;
- char y;
- long z;
-};
-
-/* A typedef */
-typedef struct mystruct mytype;
-
-
-/* A couple functions */
-
-void * func1(void)
-{
- return(NULL);
-}
-
-
-int func2(void)
-{
- return(0);
-}
-
-int main(int argc, char ** argv)
-{
- int var1;
- printf("Hello world\n");
-}
-
-
-void func3()
-{
- printf("This is not really here\n");
-}
-
-
+/********
+ * This is a sample C file that will be used in testing the TranslationUnit
+ * class. It has a specific structure that will be looked for within the
+ * test case.
+ * This file is only ment to contain various C elements, and may not compile
+ * into a running application (but should be valid C)
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+
+/* A function prototype */
+int func2p(void);
+
+/* A global variable */
+int globalvar;
+
+/* A enumeration */
+enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4};
+
+/* A structure. This also includes a typedef around the strcture def
+ * which at the time of writing was not picked up.
+ */
+typedef struct mystruct {
+ int a;
+ char b;
+ long c;
+} mystruct_t;
+
+/* A union */
+union myunion {
+ int x;
+ char y;
+ long z;
+};
+
+/* A typedef */
+typedef struct mystruct mytype;
+
+
+/* A couple functions */
+
+void * func1(void)
+{
+ return(NULL);
+}
+
+
+int func2(void)
+{
+ return(0);
+}
+
+int main(int argc, char ** argv)
+{
+ int var1;
+ printf("Hello world\n");
+}
+
+
+void func3()
+{
+ printf("This is not really here\n");
+}
+
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/included.h b/core/org.eclipse.cdt.core.tests/resources/cfiles/included.h
index b5b6d36ac6..53eae6898a 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cfiles/included.h
+++ b/core/org.eclipse.cdt.core.tests/resources/cfiles/included.h
@@ -1,10 +1,10 @@
-#define size_t int
-class A;
-
-class B;
-
-class C;
-
-class T;
-
-class junk;
+#define size_t int
+class A;
+
+class B;
+
+class C;
+
+class T;
+
+class junk;
diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp b/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp
index f0d2c7e98c..94df40c607 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp
@@ -1,24 +1,24 @@
-void decl_0001(char);
-void (decl_0002)(char);
-void ((decl_0003))(char);
-
-void *decl_0004(char);
-void (*decl_0005)(char);
-void (*(decl_0006))(char);
-void ((*decl_0007))(char);
-
-typedef void decl_0011(char);
-typedef void (decl_0012)(char);
-typedef void ((decl_0013))(char);
-
-typedef void *decl_0014(char);
-typedef void (*decl_0015)(char);
-typedef void (*(decl_0016))(char);
-typedef void ((*decl_0017))(char);
-
-typedef void decl_0021(char);
-void (*decl_0022)(char);
-void (*(*decl_0023(int a)))(char) { return &decl_0021; }
-void (*(*(*((decl_0024)))(int))(float))(char);
-
-int (*decl_0031)(char(*yyy)(bool));
+void decl_0001(char);
+void (decl_0002)(char);
+void ((decl_0003))(char);
+
+void *decl_0004(char);
+void (*decl_0005)(char);
+void (*(decl_0006))(char);
+void ((*decl_0007))(char);
+
+typedef void decl_0011(char);
+typedef void (decl_0012)(char);
+typedef void ((decl_0013))(char);
+
+typedef void *decl_0014(char);
+typedef void (*decl_0015)(char);
+typedef void (*(decl_0016))(char);
+typedef void ((*decl_0017))(char);
+
+typedef void decl_0021(char);
+void (*decl_0022)(char);
+void (*(*decl_0023(int a)))(char) { return &decl_0021; }
+void (*(*(*((decl_0024)))(int))(float))(char);
+
+int (*decl_0031)(char(*yyy)(bool));
diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h b/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h
index 04b6e419a4..872c9f3d81 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h
+++ b/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h
@@ -1,42 +1,42 @@
-// include
-#include <stdio.h>
-#include "whatever.h"
-#include <src/slash.h>
-#include <src\backslash.h>
-#include "Program Files/space.h"
-#include "../up1dir.h"
-#include "./samedir.h"
-#include "different_extension1.hpp"
-#include "different_extension2.hh"
-#include "different_extension3.x"
-#include <no_extension>
-# include "whitespace_after_hash"
- #include "whitespace_before_hash"
-
-// failure cases:
-#include garbage
-#include "resync_after_bad_parse_1"
-#include
-#include "resync_after_bad_parse_2"
-#include "one" "two" "three"
-#include "resync_after_bad_parse_3"
-
-// from the Spec:
-
-// from [C, 6.10.p8]
-// should fail
-#define EMPTY
-EMPTY #include "invalid.h"
-
-// from [C, 6.10.2.p8]:
-// should equal #include "myInclude1.h"
-#define MYINCFILE "myInclude1.h"
-#include MYINCFILE
-
-// from [C, 6.10.3.5.p6]:
-// should equal #include "vers2.h"
-#define INCFILE(x) vers ## x
-#define xstr(x) str(x)
-#define str(x) #x
-#include xstr(INCFILE(2).h)
-
+// include
+#include <stdio.h>
+#include "whatever.h"
+#include <src/slash.h>
+#include <src\backslash.h>
+#include "Program Files/space.h"
+#include "../up1dir.h"
+#include "./samedir.h"
+#include "different_extension1.hpp"
+#include "different_extension2.hh"
+#include "different_extension3.x"
+#include <no_extension>
+# include "whitespace_after_hash"
+ #include "whitespace_before_hash"
+
+// failure cases:
+#include garbage
+#include "resync_after_bad_parse_1"
+#include
+#include "resync_after_bad_parse_2"
+#include "one" "two" "three"
+#include "resync_after_bad_parse_3"
+
+// from the Spec:
+
+// from [C, 6.10.p8]
+// should fail
+#define EMPTY
+EMPTY #include "invalid.h"
+
+// from [C, 6.10.2.p8]:
+// should equal #include "myInclude1.h"
+#define MYINCFILE "myInclude1.h"
+#include MYINCFILE
+
+// from [C, 6.10.3.5.p6]:
+// should equal #include "vers2.h"
+#define INCFILE(x) vers ## x
+#define xstr(x) str(x)
+#define str(x) #x
+#include xstr(INCFILE(2).h)
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h b/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h
index a5bf320efa..34fdd29516 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h
+++ b/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h
@@ -1,4 +1,4 @@
-// macro
-#define SINGLETON
-#define NUMBER 1
-#define PRINT(string,msg) printf(string, msg)
+// macro
+#define SINGLETON
+#define NUMBER 1
+#define PRINT(string,msg) printf(string, msg)
diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp b/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp
index 9874a1f3fd..a180890fd5 100644
--- a/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp
@@ -1,72 +1,72 @@
-class Key;
-class Value;
-class SortAlgorithm;
-class DefaultSort;
-class T;
-class X;
-class Y;
-class Bar;
-class Foo {
- template<class Bar> void fum(int i);
-};
-
-// TEMPLATE_STRUCT
-template<class Key, class Value, class SortAlgorithm=DefaultSort>
-struct Map
-{
- Key* keys;
- Value* values;
- SortAlgorithm* sortAlgorithm;
- Map();
-};
-
-// TEMPLATE_CLASS
-template<class T> class nonVector {
- private:
- T* head;
-
- public:
- nonVector() { head =new T(); }
- int length() { return 1; }
- const T& first();
-};
-
-// TEMPLATE_UNION
-template<class X, class Y, int size=16>
-union ArrayOverlay {
- public:
- X x[size];
- Y y[size];
-
- static int<X,Y> numArrays;
-};
-
-
-// TEMPLATE_METHODS
-class TemplateContainer {
- // these are in an enclosing class
- template<class Bar> void fum(int i);
- template<int> void scrum(void) {};
-};
-
-// TEMPLATE_FUNCTION
-template<class T> const T& nonVector<T>::first() const
-{
- return *head;
-}
-
-template<class X> bool IsGreaterThan(X,X);
-
-template<class Bar> void Foo::fum(int i) {}
-
-// TEMPLATE_VARIABLES
-template <bool threads, int inst> char* default_alloc_template<threads, inst>::S_start_free = 0;
-
-// an instantiation, not a template:
-complex<float> cf(0,0);
-//template<class Language, class CharacterSet, class SortAlgorithm<CharacterSet> >
-//Dictionary* TheSpellCheckDictionary;
-
-int success;
-
-
+class Key;
+class Value;
+class SortAlgorithm;
+class DefaultSort;
+class T;
+class X;
+class Y;
+class Bar;
+class Foo {
+ template<class Bar> void fum(int i);
+};
+
+// TEMPLATE_STRUCT
+template<class Key, class Value, class SortAlgorithm=DefaultSort>
+struct Map
+{
+ Key* keys;
+ Value* values;
+ SortAlgorithm* sortAlgorithm;
+ Map();
+};
+
+// TEMPLATE_CLASS
+template<class T> class nonVector {
+ private:
+ T* head;
+
+ public:
+ nonVector() { head =new T(); }
+ int length() { return 1; }
+ const T& first();
+};
+
+// TEMPLATE_UNION
+template<class X, class Y, int size=16>
+union ArrayOverlay {
+ public:
+ X x[size];
+ Y y[size];
+
+ static int<X,Y> numArrays;
+};
+
+
+// TEMPLATE_METHODS
+class TemplateContainer {
+ // these are in an enclosing class
+ template<class Bar> void fum(int i);
+ template<int> void scrum(void) {};
+};
+
+// TEMPLATE_FUNCTION
+template<class T> const T& nonVector<T>::first() const
+{
+ return *head;
+}
+
+template<class X> bool IsGreaterThan(X,X);
+
+template<class Bar> void Foo::fum(int i) {}
+
+// TEMPLATE_VARIABLES
+template <bool threads, int inst> char* default_alloc_template<threads, inst>::S_start_free = 0;
+
+// an instantiation, not a template:
+complex<float> cf(0,0);
+//template<class Language, class CharacterSet, class SortAlgorithm<CharacterSet> >
+//Dictionary* TheSpellCheckDictionary;
+
+int success;
+
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp
index 828a3aca6c..4dbb7f4f9b 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp
@@ -1,8 +1,8 @@
-#include "DepTest.h"
-#include "d.h"
-
-DepTest::DepTest()
-{};
-DepTest::~DepTest()
-{};
-
+#include "DepTest.h"
+#include "d.h"
+
+DepTest::DepTest()
+{};
+DepTest::~DepTest()
+{};
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h
index c008086c15..376c76f489 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h
@@ -1,8 +1,8 @@
-#include "Inc1.h"
-#include "a.h"
-class DepTest{
-public:
-
- DepTest();
- ~DepTest();
-};
+#include "Inc1.h"
+#include "a.h"
+class DepTest{
+public:
+
+ DepTest();
+ ~DepTest();
+};
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp
index 6f3000e6df..55014b84d5 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp
@@ -1,8 +1,8 @@
-#include "DepTest2.h"
-#include "d.h"
-
-DepTest2::DepTest2()
-{};
-DepTest2::~DepTest2()
-{};
-
+#include "DepTest2.h"
+#include "d.h"
+
+DepTest2::DepTest2()
+{};
+DepTest2::~DepTest2()
+{};
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h
index 6f084a69b1..e3a8946e84 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h
@@ -1,8 +1,8 @@
-#include "d.h"
-
-class DepTest2{
-public:
-
- DepTest2();
- ~DepTest2();
-};
+#include "d.h"
+
+class DepTest2{
+public:
+
+ DepTest2();
+ ~DepTest2();
+};
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp
index cc0d9ba24e..e3e0086c56 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp
@@ -1,7 +1,7 @@
-#include "DepTest3.h"
-
-DepTest3::DepTest3()
-{};
-DepTest3::~DepTest3()
-{};
-
+#include "DepTest3.h"
+
+DepTest3::DepTest3()
+{};
+DepTest3::~DepTest3()
+{};
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h
index b4b47ce40e..1390e03a3c 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h
@@ -1,8 +1,8 @@
-#include "a.h"
-
-class DepTest3{
-public:
-
- DepTest3();
- ~DepTest3();
-};
+#include "a.h"
+
+class DepTest3{
+public:
+
+ DepTest3();
+ ~DepTest3();
+};
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h b/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h
index 7bfbe592ca..71ea557450 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h
@@ -1,8 +1,8 @@
-#include "c.h"
-
-class X
-{
- public:
- X(){};
- ~X(){};
+#include "c.h"
+
+class X
+{
+ public:
+ X(){};
+ ~X(){};
}; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/a.h b/core/org.eclipse.cdt.core.tests/resources/dependency/a.h
index 3c66f940fc..ac18143ef8 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/a.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/a.h
@@ -1,8 +1,8 @@
-#include "c.h"
-
-class Z
-{
- public:
- Z(){};
- ~Z(){};
+#include "c.h"
+
+class Z
+{
+ public:
+ Z(){};
+ ~Z(){};
}; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/c.h b/core/org.eclipse.cdt.core.tests/resources/dependency/c.h
index bc82542a69..5c9fd01d7b 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/c.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/c.h
@@ -1,6 +1,6 @@
-class Y
-{
- public:
- Y(){};
- ~Y(){};
+class Y
+{
+ public:
+ Y(){};
+ ~Y(){};
}; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/d.h b/core/org.eclipse.cdt.core.tests/resources/dependency/d.h
index 8dcf01a87d..9f800e81d9 100644
--- a/core/org.eclipse.cdt.core.tests/resources/dependency/d.h
+++ b/core/org.eclipse.cdt.core.tests/resources/dependency/d.h
@@ -1,6 +1,6 @@
-class d
-{
- public:
- d(){};
- ~d(){};
+class d
+{
+ public:
+ d(){};
+ ~d(){};
}; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp b/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp
index 5fb91b9ce5..155edfb47b 100644
--- a/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp
@@ -1,25 +1,25 @@
-//#include "StdAfx.h"
-#include "DocumentManager.h"
-
-CDocumentManager::CDocumentManager(void)
-{
-}
-
-CDocumentManager::~CDocumentManager(void)
-{
-}
-
-void CDocumentManager::addToControlMap(UINT threadID, IUnknown * theControl)
-{
- _controlMap.insert(MUL2IUnk_Pair(threadID,theControl));
-}
-
-void CDocumentManager::getControl(ULONG threadID, IUnknown ** theControl)
-{
- if (_controlMap.find(threadID) != _controlMap.end())
- {
- theControl = &_controlMap[threadID];
- }
-
-
-}
+//#include "StdAfx.h"
+#include "DocumentManager.h"
+
+CDocumentManager::CDocumentManager(void)
+{
+}
+
+CDocumentManager::~CDocumentManager(void)
+{
+}
+
+void CDocumentManager::addToControlMap(UINT threadID, IUnknown * theControl)
+{
+ _controlMap.insert(MUL2IUnk_Pair(threadID,theControl));
+}
+
+void CDocumentManager::getControl(ULONG threadID, IUnknown ** theControl)
+{
+ if (_controlMap.find(threadID) != _controlMap.end())
+ {
+ theControl = &_controlMap[threadID];
+ }
+
+
+}
diff --git a/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp b/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp
index da47fd6b30..766afa6a80 100644
--- a/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp
@@ -1,112 +1,112 @@
-#include <iostream.h>
-#include <stdlib.h>
-#include <alloc.h>
-#include <iomanip.h>
-
-#define PRINT(a,b) cout<<(a)<<(b)
-#define CASE break;case
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
-typedef int int32;
-
-static void doSomething();
-
-namespace Z{
- int x;
- namespace X{
- namespace Y{
- enum test{cool,hi,bye,why};
- class Mail
- {
- public:
- Mail(){}
- virtual void print()=0; //Pure Virtual Function, forces redefinition
- protected:
- float postage;
- char *type;
- friend ostream& operator << (ostream& os, Mail *m);
- };
-
- class postcard : public Mail
- {
- public:
- postcard(): Mail(){postage = 0.20; type = "Postcard";}
- void print(){cout << type << ": $" << setiosflags(ios::fixed)
- <<setprecision(2) << postage <<endl;}
- };
-
- class first_class : public Mail
- {
- public:
- first_class() : Mail(){postage = 0.32; type = "First Class";}
- void print(){cout << type << ": $" <<setiosflags(ios::fixed)
- << setprecision(2) << postage <<endl;}
-
- };
-
- class Unknown : public postcard, first_class // ??? Multiple Inheritance
- {
- public:
- Unknown(): postcard(), first_class()
- {
- postcard::postage = 1.50; // MUST disambiguate
- postcard::type = "Unknown";
- }
- void print(){cout << postcard::type << ": $" <<setiosflags(ios::fixed)
- <<setprecision(2)<<postcard::postage <<endl;}
- };
-
- class container
- {
- private:
- Mail **array;
- int index;
- int sz;
- public:
- container(){array = 0;}
- ~container(){
- for(int x = 0; x <sz; x++)
- delete array[x];
- free(array);
- }
- int size() {return sz;}
- Mail* operator[](int index);
- Mail* operator = (Mail* mail);
- };
-
- main()
- {
- container PO_Box;
- PO_Box = new postcard;
- PO_Box = new first_class;
- PO_Box = new parcel_Post;
- //PO_Box = new Unknown;
- //one way of printing information
- for(int x =0; x <3; x++){
- PO_Box[x]->print();
- }
- //Overloaded <<
- for(int x =0; x <PO_Box.size(); x++){
- cout << PO_Box[x];
- }
- }
-
- ostream& operator << (ostream &os, Mail *m)
- {
- os <<setiosflags(ios::fixed) << setprecision(2)<< m->type
- << ": $" << m->postage <<endl;
-
- return os;
- }
- Mail* container::operator[](int index) {return array[index];}
- Mail* container::operator = (Mail* mail)
- {
- int size = sizeof(Mail*) * (++sz);
- int temp = sz -1;
- array = (Mail**)realloc(array, size);
- array[temp] = mail;
- return 0;
- }
- }
- }
-}
+#include <iostream.h>
+#include <stdlib.h>
+#include <alloc.h>
+#include <iomanip.h>
+
+#define PRINT(a,b) cout<<(a)<<(b)
+#define CASE break;case
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
+typedef int int32;
+
+static void doSomething();
+
+namespace Z{
+ int x;
+ namespace X{
+ namespace Y{
+ enum test{cool,hi,bye,why};
+ class Mail
+ {
+ public:
+ Mail(){}
+ virtual void print()=0; //Pure Virtual Function, forces redefinition
+ protected:
+ float postage;
+ char *type;
+ friend ostream& operator << (ostream& os, Mail *m);
+ };
+
+ class postcard : public Mail
+ {
+ public:
+ postcard(): Mail(){postage = 0.20; type = "Postcard";}
+ void print(){cout << type << ": $" << setiosflags(ios::fixed)
+ <<setprecision(2) << postage <<endl;}
+ };
+
+ class first_class : public Mail
+ {
+ public:
+ first_class() : Mail(){postage = 0.32; type = "First Class";}
+ void print(){cout << type << ": $" <<setiosflags(ios::fixed)
+ << setprecision(2) << postage <<endl;}
+
+ };
+
+ class Unknown : public postcard, first_class // ??? Multiple Inheritance
+ {
+ public:
+ Unknown(): postcard(), first_class()
+ {
+ postcard::postage = 1.50; // MUST disambiguate
+ postcard::type = "Unknown";
+ }
+ void print(){cout << postcard::type << ": $" <<setiosflags(ios::fixed)
+ <<setprecision(2)<<postcard::postage <<endl;}
+ };
+
+ class container
+ {
+ private:
+ Mail **array;
+ int index;
+ int sz;
+ public:
+ container(){array = 0;}
+ ~container(){
+ for(int x = 0; x <sz; x++)
+ delete array[x];
+ free(array);
+ }
+ int size() {return sz;}
+ Mail* operator[](int index);
+ Mail* operator = (Mail* mail);
+ };
+
+ main()
+ {
+ container PO_Box;
+ PO_Box = new postcard;
+ PO_Box = new first_class;
+ PO_Box = new parcel_Post;
+ //PO_Box = new Unknown;
+ //one way of printing information
+ for(int x =0; x <3; x++){
+ PO_Box[x]->print();
+ }
+ //Overloaded <<
+ for(int x =0; x <PO_Box.size(); x++){
+ cout << PO_Box[x];
+ }
+ }
+
+ ostream& operator << (ostream &os, Mail *m)
+ {
+ os <<setiosflags(ios::fixed) << setprecision(2)<< m->type
+ << ": $" << m->postage <<endl;
+
+ return os;
+ }
+ Mail* container::operator[](int index) {return array[index];}
+ Mail* container::operator = (Mail* mail)
+ {
+ int size = sizeof(Mail*) * (++sz);
+ int temp = sz -1;
+ array = (Mail**)realloc(array, size);
+ array[temp] = mail;
+ return 0;
+ }
+ }
+ }
+}
diff --git a/core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp b/core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp
index 8f65972886..0c908b274c 100644
--- a/core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp
@@ -1,22 +1,22 @@
-namespace A
-{
- class ForwardA;
- ForwardA * tmp;
- int something(void);
- namespace B
- {
- enum e1{dude1,dude2};
- int x;
- class C
- { static int y = 5;
- static int bar(void);
- };
- }
-}
-using namespace A::B;
-using A::B::x;
-using A::B::C;
-using A::B::C::y;
-using A::B::C::bar;
-using A::something;
+namespace A
+{
+ class ForwardA;
+ ForwardA * tmp;
+ int something(void);
+ namespace B
+ {
+ enum e1{dude1,dude2};
+ int x;
+ class C
+ { static int y = 5;
+ static int bar(void);
+ };
+ }
+}
+using namespace A::B;
+using A::B::x;
+using A::B::C;
+using A::B::C::y;
+using A::B::C::bar;
+using A::something;
using A::B::e1; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c
index e7d2a2e016..16bc625fe5 100644
--- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c
+++ b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c
@@ -1,43 +1,43 @@
-#include <Simple.h>
-
-const SimpleStruct simpleStruct =
-{
- 1
- , "mySimple"
- , 0.1232
-};
-
-#define SIZEOF( A, B ) sizeof( A.B )
-
-const OtherStruct array[] =
-{
- {
-#if FOO
- "foo"
-#else
- "bar"
-#endif
- , SIZEOF( simpleStruct, num )
- , &t_int
- , 0
- }
- , {
- "name"
- , SIZEOF( simpleStruct, floatnum )
- , &t_float
- , 1
- }
-};
-
-
-void SimpleStruct_construct( struct SimpleStruct * const this )
-{
- this->num = 1;
- this->name = "boo";
- this->floatNum = 1.5;
-}
-
-int ConnectParams_doSomething( const struct SimpleStruct * const this )
-{
- return 1;
-}
+#include <Simple.h>
+
+const SimpleStruct simpleStruct =
+{
+ 1
+ , "mySimple"
+ , 0.1232
+};
+
+#define SIZEOF( A, B ) sizeof( A.B )
+
+const OtherStruct array[] =
+{
+ {
+#if FOO
+ "foo"
+#else
+ "bar"
+#endif
+ , SIZEOF( simpleStruct, num )
+ , &t_int
+ , 0
+ }
+ , {
+ "name"
+ , SIZEOF( simpleStruct, floatnum )
+ , &t_float
+ , 1
+ }
+};
+
+
+void SimpleStruct_construct( struct SimpleStruct * const this )
+{
+ this->num = 1;
+ this->name = "boo";
+ this->floatNum = 1.5;
+}
+
+int ConnectParams_doSomething( const struct SimpleStruct * const this )
+{
+ return 1;
+}
diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h
index 96e8ef0a74..b5012c10f5 100644
--- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h
+++ b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h
@@ -1,17 +1,17 @@
-#ifndef SIMPLE_H
-#define SIMPLE_H
-
-struct SimpleStruct
-{
- int num;
- char name[ ];
- float floatNum;
-};
-
-
-void SimpleStruct_construct( struct SimpleStruct * const this );
-
-int SimpleStruct_doSomething( const struct SimpleStruct * const this );
-
-#endif /* SIMPLE_H */
-
+#ifndef SIMPLE_H
+#define SIMPLE_H
+
+struct SimpleStruct
+{
+ int num;
+ char name[ ];
+ float floatNum;
+};
+
+
+void SimpleStruct_construct( struct SimpleStruct * const this );
+
+int SimpleStruct_doSomething( const struct SimpleStruct * const this );
+
+#endif /* SIMPLE_H */
+
diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp
index 4b4055ade2..471f78e6c9 100644
--- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp
@@ -1,37 +1,37 @@
-#include <Simple.h>
-
-#include <iostream>
-
-#define NULL (void *)0
-
-SimpleClass::SimpleClass( void )
-{
- init( NULL );
-}
-
-SimpleClass::~SimpleClass( void )
-{
-}
-
-SimpleClass::SimpleClass( const SimpleClass & arg )
-{
- //TODO: copy constructor
-}
-
-SimpleClass & SimpleClass::operator=( const SimpleClass & arg )
-{
- if( this != &arg )
- {
- }
- return *this;
-}
-
-
-void SimpleClass::init( void * foo)
-{
-}
-
-InnerStruct & SimpleClass::getInner( void )
-{
- return inner;
-}
+#include <Simple.h>
+
+#include <iostream>
+
+#define NULL (void *)0
+
+SimpleClass::SimpleClass( void )
+{
+ init( NULL );
+}
+
+SimpleClass::~SimpleClass( void )
+{
+}
+
+SimpleClass::SimpleClass( const SimpleClass & arg )
+{
+ //TODO: copy constructor
+}
+
+SimpleClass & SimpleClass::operator=( const SimpleClass & arg )
+{
+ if( this != &arg )
+ {
+ }
+ return *this;
+}
+
+
+void SimpleClass::init( void * foo)
+{
+}
+
+InnerStruct & SimpleClass::getInner( void )
+{
+ return inner;
+}
diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h
index e22c5eefbd..b385fcd46f 100644
--- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h
+++ b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h
@@ -1,32 +1,32 @@
-#ifndef SIMPLE_H
-#define SIMPLE_H
-
-class OtherClass;
-
-class SimpleClass
-{
-public:
- SimpleClass( void );
- SimpleClass( const SimpleClass & arg );
-
- virtual ~SimpleClass( void );
-
- SimpleClass & operator=( const SimpleClass & arg );
-
-private:
- struct InnerStruct
- {
- inline InnerStruct( int a ){ _a = a; }
- inline ~InnerStruct( void ){}
- unsigned int _a;
- };
-
- InnerStruct inner;
-
- void init( void * );
-
-public:
- InnerStruct & getInner( void );
-};
-
-#endif /* SIMPLE_H */
+#ifndef SIMPLE_H
+#define SIMPLE_H
+
+class OtherClass;
+
+class SimpleClass
+{
+public:
+ SimpleClass( void );
+ SimpleClass( const SimpleClass & arg );
+
+ virtual ~SimpleClass( void );
+
+ SimpleClass & operator=( const SimpleClass & arg );
+
+private:
+ struct InnerStruct
+ {
+ inline InnerStruct( int a ){ _a = a; }
+ inline ~InnerStruct( void ){}
+ unsigned int _a;
+ };
+
+ InnerStruct inner;
+
+ void init( void * );
+
+public:
+ InnerStruct & getInner( void );
+};
+
+#endif /* SIMPLE_H */
diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h b/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h
index 16b506364f..6660b4e989 100644
--- a/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h
+++ b/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h
@@ -1,43 +1,43 @@
-// inclusion begins and ends on line 2
-#include <stdio.h>
-
-// simple macro begins and ends on line 5; ANOTHER on line 6
-#define SIMPLE_MACRO simple
-#define ANOTHER
-// namespace begins on line 7, ends on line 22
-namespace MyPackage{
- // class specification begins on line 10, ends on line 21
- class Hello{
- protected:
- // simple declaration begins and ends on line 13
- int x;
- // simple declaration begins and ends on line 15
- void setX(int X);
- public:
- // simple declaration begins on line 18 and ends on line 20
- Hello( void ) : x
- ( 5 ) {
- }
- };
-}
-
-// simple declaration begins on line 25 and ends on line 27
-int *
- y =
- 0;
-
-// complex macro begins on line 30 and ends on line 31
-#define COMPLEX_MACRO 33 \
- + 44
-
-// template declaration begins on line 34 and ends on line 35
-template <class A >
- A createA( void );
-
-// enumeration begins on line 38 and ends on line 43
-enum {
- one, // enumerator begins and ends on line 39
- two, // enumerator begins and ends on line 40
- three // enumerator begins on line 41, ends on line 42
- = 4
+// inclusion begins and ends on line 2
+#include <stdio.h>
+
+// simple macro begins and ends on line 5; ANOTHER on line 6
+#define SIMPLE_MACRO simple
+#define ANOTHER
+// namespace begins on line 7, ends on line 22
+namespace MyPackage{
+ // class specification begins on line 10, ends on line 21
+ class Hello{
+ protected:
+ // simple declaration begins and ends on line 13
+ int x;
+ // simple declaration begins and ends on line 15
+ void setX(int X);
+ public:
+ // simple declaration begins on line 18 and ends on line 20
+ Hello( void ) : x
+ ( 5 ) {
+ }
+ };
+}
+
+// simple declaration begins on line 25 and ends on line 27
+int *
+ y =
+ 0;
+
+// complex macro begins on line 30 and ends on line 31
+#define COMPLEX_MACRO 33 \
+ + 44
+
+// template declaration begins on line 34 and ends on line 35
+template <class A >
+ A createA( void );
+
+// enumeration begins on line 38 and ends on line 43
+enum {
+ one, // enumerator begins and ends on line 39
+ two, // enumerator begins and ends on line 40
+ three // enumerator begins on line 41, ends on line 42
+ = 4
}; \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp b/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp
index f2fa14f016..94a7173c70 100644
--- a/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp
+++ b/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp
@@ -1,102 +1,102 @@
-#include "include.h"
-
-#define FOO bar
-
-class Heal{};
-
-class A {
- A() {}
- ~A(){}
- class B {
- void f( A );
- void f( A & );
- void f( A* );
- void f( int &, const char [], A ** );
- };
-};
-
-namespace NS {
- namespace NS2{
- struct a{};
- }
- class B: public A {
- public:
- struct AA {};
- enum e {
- One,
- Two,
- Three
- };
-
- void f(){
- using namespace NS2;
- a aStruct;
- }
-
-
-
- AA anotherStruct;
- };
- union u{ } ;
-}
-
-namespace NS3{
- class C : public NS::B {
- e eE = One;
- };
-}
-
-A::B b1;
-
-typedef NS::B NS_B;
-NS_B b2;
-
-union u{
-};
-
-class AClassForFoo {};
-
-AClassForFoo foo( AClassForFoo ){
- AClassForFoo b;
- return b;
-}
-
-Head * Head::operator *= ( int index ){
- return array[ index ];
-}
-
-Head * Head::operator += ( int index ){
- return array[ index ];
-}
-
-extern int externalInt;
-extern int externalIntWithInitializer = 2;
-extern "C" int externCInt;
-extern "C" int externCIntWithInitializer = 3;
-
-void forwardFunction() { }
-void normalFunction() { }
-
-void DeclsAndDefns::forwardMethod(){ }
-
-int DeclsAndDefns::staticField = 5;
-
-
-namespace bug68235{
- struct xTag {
- int x;
- };
- typedef xTag xType;
-
- typedef struct yTag {
- int x;
- } yType;
-
- class C1{
- public:
- xType x;
- yType y;
- C1();
- ~C1();
- };
+#include "include.h"
+
+#define FOO bar
+
+class Heal{};
+
+class A {
+ A() {}
+ ~A(){}
+ class B {
+ void f( A );
+ void f( A & );
+ void f( A* );
+ void f( int &, const char [], A ** );
+ };
+};
+
+namespace NS {
+ namespace NS2{
+ struct a{};
+ }
+ class B: public A {
+ public:
+ struct AA {};
+ enum e {
+ One,
+ Two,
+ Three
+ };
+
+ void f(){
+ using namespace NS2;
+ a aStruct;
+ }
+
+
+
+ AA anotherStruct;
+ };
+ union u{ } ;
+}
+
+namespace NS3{
+ class C : public NS::B {
+ e eE = One;
+ };
+}
+
+A::B b1;
+
+typedef NS::B NS_B;
+NS_B b2;
+
+union u{
+};
+
+class AClassForFoo {};
+
+AClassForFoo foo( AClassForFoo ){
+ AClassForFoo b;
+ return b;
+}
+
+Head * Head::operator *= ( int index ){
+ return array[ index ];
+}
+
+Head * Head::operator += ( int index ){
+ return array[ index ];
+}
+
+extern int externalInt;
+extern int externalIntWithInitializer = 2;
+extern "C" int externCInt;
+extern "C" int externCIntWithInitializer = 3;
+
+void forwardFunction() { }
+void normalFunction() { }
+
+void DeclsAndDefns::forwardMethod(){ }
+
+int DeclsAndDefns::staticField = 5;
+
+
+namespace bug68235{
+ struct xTag {
+ int x;
+ };
+ typedef xTag xType;
+
+ typedef struct yTag {
+ int x;
+ } yType;
+
+ class C1{
+ public:
+ xType x;
+ yType y;
+ C1();
+ ~C1();
+ };
} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/resources/search/include.h b/core/org.eclipse.cdt.core.tests/resources/search/include.h
index f9c3d75956..bb0b00ad59 100644
--- a/core/org.eclipse.cdt.core.tests/resources/search/include.h
+++ b/core/org.eclipse.cdt.core.tests/resources/search/include.h
@@ -1,36 +1,36 @@
-#ifndef INCLUDE_H
-#define INCLUDE_H
-
-class Head {
- Head ** array;
-
- Head * operator *= ( int index );
- Head * operator * ( int index ){ return array[ index ]; }
- Head * operator += ( int index );
-
- operator const short & ();
- operator short ();
- operator short int ();
-
-};
-
-class DeclsAndDefns{
- static int staticField;
- int nonStaticField;
-
- void forwardMethod();
- void inlineMethod() {}
-};
-
-void forwardFunction();
-
-
-class Direction{
- void turn();
- void turn(int);
- void turnAgain(void);
-};
-class Right : public Direction {
- void turn() { }
-};
+#ifndef INCLUDE_H
+#define INCLUDE_H
+
+class Head {
+ Head ** array;
+
+ Head * operator *= ( int index );
+ Head * operator * ( int index ){ return array[ index ]; }
+ Head * operator += ( int index );
+
+ operator const short & ();
+ operator short ();
+ operator short int ();
+
+};
+
+class DeclsAndDefns{
+ static int staticField;
+ int nonStaticField;
+
+ void forwardMethod();
+ void inlineMethod() {}
+};
+
+void forwardFunction();
+
+
+class Direction{
+ void turn();
+ void turn(int);
+ void turnAgain(void);
+};
+class Right : public Direction {
+ void turn() { }
+};
#endif \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CModelMock.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CModelMock.java
index db644fd1d6..8483e7d116 100644
--- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CModelMock.java
+++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CModelMock.java
@@ -1,496 +1,496 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.core.testplugin;
-
-import java.util.Map;
-
-import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor;
-import org.eclipse.cdt.core.settings.model.CConfigurationStatus;
-import org.eclipse.cdt.core.settings.model.ICBuildSetting;
-import org.eclipse.cdt.core.settings.model.ICConfigExtensionReference;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICExternalSetting;
-import org.eclipse.cdt.core.settings.model.ICFileDescription;
-import org.eclipse.cdt.core.settings.model.ICFolderDescription;
-import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICResourceDescription;
-import org.eclipse.cdt.core.settings.model.ICSettingContainer;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingObject;
-import org.eclipse.cdt.core.settings.model.ICSourceEntry;
-import org.eclipse.cdt.core.settings.model.ICStorageElement;
-import org.eclipse.cdt.core.settings.model.ICTargetPlatformSetting;
-import org.eclipse.cdt.core.settings.model.WriteAccessException;
-import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.QualifiedName;
-
-/**
- * Collection of mock classes for testing
- */
-public class CModelMock {
- /**
- * Dummy implementation of ICProjectDescription for testing.
- * Feel free to override the methods you are interested to mock.
- */
- public static class DummyCProjectDescription implements ICProjectDescription {
-
- @Override
- public ICSettingObject[] getChildSettings() {
- return null;
- }
-
- @Override
- public String getId() {
- return null;
- }
-
- @Override
- public String getName() {
- return null;
- }
-
- @Override
- public int getType() {
- return 0;
- }
-
- @Override
- public boolean isValid() {
- return false;
- }
-
- @Override
- public ICConfigurationDescription getConfiguration() {
- return null;
- }
-
- @Override
- public ICSettingContainer getParent() {
- return null;
- }
-
- @Override
- public boolean isReadOnly() {
- return false;
- }
-
- @Override
- public ICStorageElement getStorage(String id, boolean create)
- throws CoreException {
- return null;
- }
-
- @Override
- public void removeStorage(String id) throws CoreException {
- }
-
- @Override
- public ICStorageElement importStorage(String id, ICStorageElement el)
- throws UnsupportedOperationException, CoreException {
- return null;
- }
-
- @Override
- public void setReadOnly(boolean readOnly, boolean keepModify) {
- }
-
- @Override
- public int getConfigurationRelations() {
- return 0;
- }
-
- @Override
- public void setConfigurationRelations(int status) {
- }
-
- @Override
- public void useDefaultConfigurationRelations() {
- }
-
- @Override
- public boolean isDefaultConfigurationRelations() {
- return false;
- }
-
- @Override
- public ICConfigurationDescription[] getConfigurations() {
- return null;
- }
-
- @Override
- public ICConfigurationDescription getActiveConfiguration() {
- return null;
- }
-
- @Override
- public void setActiveConfiguration(ICConfigurationDescription cfg)
- throws WriteAccessException {
- }
-
- @Override
- public ICConfigurationDescription createConfiguration(String id,
- String name, ICConfigurationDescription base)
- throws CoreException, WriteAccessException {
- return null;
- }
-
- @Override
- public ICConfigurationDescription createConfiguration(
- String buildSystemId, CConfigurationData data)
- throws CoreException, WriteAccessException {
- return null;
- }
-
- @Override
- public ICConfigurationDescription getConfigurationByName(String name) {
- return null;
- }
-
- @Override
- public ICConfigurationDescription getConfigurationById(String id) {
- return null;
- }
-
- @Override
- public void removeConfiguration(String name)
- throws WriteAccessException {
- }
-
- @Override
- public void removeConfiguration(ICConfigurationDescription cfg)
- throws WriteAccessException {
- }
-
- @Override
- public IProject getProject() {
- return null;
- }
-
- @Override
- public boolean isModified() {
- return false;
- }
-
- @Override
- public Object getSessionProperty(QualifiedName name) {
- return null;
- }
-
- @Override
- public void setSessionProperty(QualifiedName name, Object value) {
-
- }
-
- @Override
- public ICConfigurationDescription getDefaultSettingConfiguration() {
- return null;
- }
-
- @Override
- public void setDefaultSettingConfiguration(
- ICConfigurationDescription cfg) {
- }
-
- @Override
- public boolean isCdtProjectCreating() {
- return false;
- }
-
- @Override
- public void setCdtProjectCreated() {
- }
-
- }
-
- /**
- * Dummy implementation of ICConfigurationDescription for testing.
- * Feel free to override the methods you are interested to mock.
- */
- public static class DummyCConfigurationDescription implements ICConfigurationDescription {
- private String id;
- private ICProjectDescription projectDescription;
-
- public DummyCConfigurationDescription(String id) {
- this.id = id;
- this.projectDescription = new DummyCProjectDescription();
- }
-
- @Override
- public ICSettingObject[] getChildSettings() {
- return null;
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public String getName() {
- return null;
- }
-
- @Override
- public int getType() {
- return 0;
- }
-
- @Override
- public boolean isValid() {
- return false;
- }
-
- @Override
- public ICConfigurationDescription getConfiguration() {
- return null;
- }
-
- @Override
- public ICSettingContainer getParent() {
- return null;
- }
-
- @Override
- public boolean isReadOnly() {
- return false;
- }
-
- @Override
- public ICStorageElement getStorage(String id, boolean create)
- throws CoreException {
- return null;
- }
-
- @Override
- public void removeStorage(String id) throws CoreException {
- }
-
- @Override
- public ICStorageElement importStorage(String id, ICStorageElement el)
- throws UnsupportedOperationException, CoreException {
- return null;
- }
-
- @Override
- public void setReadOnly(boolean readOnly, boolean keepModify) {
- }
-
- @Override
- public boolean isActive() {
- return false;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
- @Override
- public void setDescription(String des) throws WriteAccessException {
- }
-
- @Override
- public ICProjectDescription getProjectDescription() {
- return projectDescription;
- }
-
- @Override
- public ICFolderDescription getRootFolderDescription() {
- return null;
- }
-
- @Override
- public ICFolderDescription[] getFolderDescriptions() {
- return null;
- }
-
- @Override
- public ICFileDescription[] getFileDescriptions() {
- return null;
- }
-
- @Override
- public ICResourceDescription[] getResourceDescriptions() {
- return null;
- }
-
- @Override
- public ICResourceDescription getResourceDescription(IPath path,
- boolean exactPath) {
- return null;
- }
-
- @Override
- public void removeResourceDescription(ICResourceDescription des)
- throws CoreException, WriteAccessException {
- }
-
- @Override
- public ICFileDescription createFileDescription(IPath path,
- ICResourceDescription base) throws CoreException,
- WriteAccessException {
- return null;
- }
-
- @Override
- public ICFolderDescription createFolderDescription(IPath path,
- ICFolderDescription base) throws CoreException,
- WriteAccessException {
- return null;
- }
-
- @Override
- public String getBuildSystemId() {
- return null;
- }
-
- @Override
- public CConfigurationData getConfigurationData() {
- return null;
- }
-
- @Override
- public void setActive() throws WriteAccessException {
- }
-
- @Override
- public void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException {
- }
-
- @Override
- public boolean isModified() {
- return false;
- }
-
- @Override
- public ICTargetPlatformSetting getTargetPlatformSetting() {
- return null;
- }
-
- @Override
- public ICSourceEntry[] getSourceEntries() {
- return null;
- }
-
- @Override
- public ICSourceEntry[] getResolvedSourceEntries() {
- return null;
- }
-
- @Override
- public void setSourceEntries(ICSourceEntry[] entries) throws CoreException, WriteAccessException {
- }
-
- @Override
- public Map<String, String> getReferenceInfo() {
- return null;
- }
-
- @Override
- public void setReferenceInfo(Map<String, String> refs) throws WriteAccessException {
- }
-
- @Override
- public ICExternalSetting[] getExternalSettings() {
- return null;
- }
-
- @Override
- public ICExternalSetting createExternalSetting(String[] languageIDs,
- String[] contentTypeIds, String[] extensions,
- ICSettingEntry[] entries) throws WriteAccessException {
- return null;
- }
-
- @Override
- public void removeExternalSetting(ICExternalSetting setting) throws WriteAccessException {
- }
-
- @Override
- public void removeExternalSettings() throws WriteAccessException {
- }
-
- @Override
- public ICBuildSetting getBuildSetting() {
- return null;
- }
-
- @Override
- public ICdtVariablesContributor getBuildVariablesContributor() {
- return null;
- }
-
- @Override
- public Object getSessionProperty(QualifiedName name) {
- return null;
- }
-
- @Override
- public void setSessionProperty(QualifiedName name, Object value) {
- }
-
- @Override
- public void setName(String name) throws WriteAccessException {
- }
-
- @Override
- public ICConfigExtensionReference[] get(String extensionPointID) {
- return null;
- }
-
- @Override
- public ICConfigExtensionReference create(String extensionPoint, String extension) throws CoreException {
- return null;
- }
-
- @Override
- public void remove(ICConfigExtensionReference ext) throws CoreException {
- }
-
- @Override
- public void remove(String extensionPoint) throws CoreException {
- }
-
- @Override
- public boolean isPreferenceConfiguration() {
- return false;
- }
-
- @Override
- public ICLanguageSetting getLanguageSettingForFile(IPath path, boolean ignoreExludeStatus) {
- return null;
- }
-
- @Override
- public void setExternalSettingsProviderIds(String[] ids) {
- }
-
- @Override
- public String[] getExternalSettingsProviderIds() {
- return null;
- }
-
- @Override
- public void updateExternalSettingsProviders(String[] ids) throws WriteAccessException {
- }
-
- @Override
- public CConfigurationStatus getConfigurationStatus() {
- return null;
- }
-
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.cdt.core.testplugin;
+
+import java.util.Map;
+
+import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor;
+import org.eclipse.cdt.core.settings.model.CConfigurationStatus;
+import org.eclipse.cdt.core.settings.model.ICBuildSetting;
+import org.eclipse.cdt.core.settings.model.ICConfigExtensionReference;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICExternalSetting;
+import org.eclipse.cdt.core.settings.model.ICFileDescription;
+import org.eclipse.cdt.core.settings.model.ICFolderDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.core.settings.model.ICSettingContainer;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICSettingObject;
+import org.eclipse.cdt.core.settings.model.ICSourceEntry;
+import org.eclipse.cdt.core.settings.model.ICStorageElement;
+import org.eclipse.cdt.core.settings.model.ICTargetPlatformSetting;
+import org.eclipse.cdt.core.settings.model.WriteAccessException;
+import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
+
+/**
+ * Collection of mock classes for testing
+ */
+public class CModelMock {
+ /**
+ * Dummy implementation of ICProjectDescription for testing.
+ * Feel free to override the methods you are interested to mock.
+ */
+ public static class DummyCProjectDescription implements ICProjectDescription {
+
+ @Override
+ public ICSettingObject[] getChildSettings() {
+ return null;
+ }
+
+ @Override
+ public String getId() {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+
+ @Override
+ public int getType() {
+ return 0;
+ }
+
+ @Override
+ public boolean isValid() {
+ return false;
+ }
+
+ @Override
+ public ICConfigurationDescription getConfiguration() {
+ return null;
+ }
+
+ @Override
+ public ICSettingContainer getParent() {
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ return false;
+ }
+
+ @Override
+ public ICStorageElement getStorage(String id, boolean create)
+ throws CoreException {
+ return null;
+ }
+
+ @Override
+ public void removeStorage(String id) throws CoreException {
+ }
+
+ @Override
+ public ICStorageElement importStorage(String id, ICStorageElement el)
+ throws UnsupportedOperationException, CoreException {
+ return null;
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly, boolean keepModify) {
+ }
+
+ @Override
+ public int getConfigurationRelations() {
+ return 0;
+ }
+
+ @Override
+ public void setConfigurationRelations(int status) {
+ }
+
+ @Override
+ public void useDefaultConfigurationRelations() {
+ }
+
+ @Override
+ public boolean isDefaultConfigurationRelations() {
+ return false;
+ }
+
+ @Override
+ public ICConfigurationDescription[] getConfigurations() {
+ return null;
+ }
+
+ @Override
+ public ICConfigurationDescription getActiveConfiguration() {
+ return null;
+ }
+
+ @Override
+ public void setActiveConfiguration(ICConfigurationDescription cfg)
+ throws WriteAccessException {
+ }
+
+ @Override
+ public ICConfigurationDescription createConfiguration(String id,
+ String name, ICConfigurationDescription base)
+ throws CoreException, WriteAccessException {
+ return null;
+ }
+
+ @Override
+ public ICConfigurationDescription createConfiguration(
+ String buildSystemId, CConfigurationData data)
+ throws CoreException, WriteAccessException {
+ return null;
+ }
+
+ @Override
+ public ICConfigurationDescription getConfigurationByName(String name) {
+ return null;
+ }
+
+ @Override
+ public ICConfigurationDescription getConfigurationById(String id) {
+ return null;
+ }
+
+ @Override
+ public void removeConfiguration(String name)
+ throws WriteAccessException {
+ }
+
+ @Override
+ public void removeConfiguration(ICConfigurationDescription cfg)
+ throws WriteAccessException {
+ }
+
+ @Override
+ public IProject getProject() {
+ return null;
+ }
+
+ @Override
+ public boolean isModified() {
+ return false;
+ }
+
+ @Override
+ public Object getSessionProperty(QualifiedName name) {
+ return null;
+ }
+
+ @Override
+ public void setSessionProperty(QualifiedName name, Object value) {
+
+ }
+
+ @Override
+ public ICConfigurationDescription getDefaultSettingConfiguration() {
+ return null;
+ }
+
+ @Override
+ public void setDefaultSettingConfiguration(
+ ICConfigurationDescription cfg) {
+ }
+
+ @Override
+ public boolean isCdtProjectCreating() {
+ return false;
+ }
+
+ @Override
+ public void setCdtProjectCreated() {
+ }
+
+ }
+
+ /**
+ * Dummy implementation of ICConfigurationDescription for testing.
+ * Feel free to override the methods you are interested to mock.
+ */
+ public static class DummyCConfigurationDescription implements ICConfigurationDescription {
+ private String id;
+ private ICProjectDescription projectDescription;
+
+ public DummyCConfigurationDescription(String id) {
+ this.id = id;
+ this.projectDescription = new DummyCProjectDescription();
+ }
+
+ @Override
+ public ICSettingObject[] getChildSettings() {
+ return null;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+
+ @Override
+ public int getType() {
+ return 0;
+ }
+
+ @Override
+ public boolean isValid() {
+ return false;
+ }
+
+ @Override
+ public ICConfigurationDescription getConfiguration() {
+ return null;
+ }
+
+ @Override
+ public ICSettingContainer getParent() {
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ return false;
+ }
+
+ @Override
+ public ICStorageElement getStorage(String id, boolean create)
+ throws CoreException {
+ return null;
+ }
+
+ @Override
+ public void removeStorage(String id) throws CoreException {
+ }
+
+ @Override
+ public ICStorageElement importStorage(String id, ICStorageElement el)
+ throws UnsupportedOperationException, CoreException {
+ return null;
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly, boolean keepModify) {
+ }
+
+ @Override
+ public boolean isActive() {
+ return false;
+ }
+
+ @Override
+ public String getDescription() {
+ return null;
+ }
+
+ @Override
+ public void setDescription(String des) throws WriteAccessException {
+ }
+
+ @Override
+ public ICProjectDescription getProjectDescription() {
+ return projectDescription;
+ }
+
+ @Override
+ public ICFolderDescription getRootFolderDescription() {
+ return null;
+ }
+
+ @Override
+ public ICFolderDescription[] getFolderDescriptions() {
+ return null;
+ }
+
+ @Override
+ public ICFileDescription[] getFileDescriptions() {
+ return null;
+ }
+
+ @Override
+ public ICResourceDescription[] getResourceDescriptions() {
+ return null;
+ }
+
+ @Override
+ public ICResourceDescription getResourceDescription(IPath path,
+ boolean exactPath) {
+ return null;
+ }
+
+ @Override
+ public void removeResourceDescription(ICResourceDescription des)
+ throws CoreException, WriteAccessException {
+ }
+
+ @Override
+ public ICFileDescription createFileDescription(IPath path,
+ ICResourceDescription base) throws CoreException,
+ WriteAccessException {
+ return null;
+ }
+
+ @Override
+ public ICFolderDescription createFolderDescription(IPath path,
+ ICFolderDescription base) throws CoreException,
+ WriteAccessException {
+ return null;
+ }
+
+ @Override
+ public String getBuildSystemId() {
+ return null;
+ }
+
+ @Override
+ public CConfigurationData getConfigurationData() {
+ return null;
+ }
+
+ @Override
+ public void setActive() throws WriteAccessException {
+ }
+
+ @Override
+ public void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException {
+ }
+
+ @Override
+ public boolean isModified() {
+ return false;
+ }
+
+ @Override
+ public ICTargetPlatformSetting getTargetPlatformSetting() {
+ return null;
+ }
+
+ @Override
+ public ICSourceEntry[] getSourceEntries() {
+ return null;
+ }
+
+ @Override
+ public ICSourceEntry[] getResolvedSourceEntries() {
+ return null;
+ }
+
+ @Override
+ public void setSourceEntries(ICSourceEntry[] entries) throws CoreException, WriteAccessException {
+ }
+
+ @Override
+ public Map<String, String> getReferenceInfo() {
+ return null;
+ }
+
+ @Override
+ public void setReferenceInfo(Map<String, String> refs) throws WriteAccessException {
+ }
+
+ @Override
+ public ICExternalSetting[] getExternalSettings() {
+ return null;
+ }
+
+ @Override
+ public ICExternalSetting createExternalSetting(String[] languageIDs,
+ String[] contentTypeIds, String[] extensions,
+ ICSettingEntry[] entries) throws WriteAccessException {
+ return null;
+ }
+
+ @Override
+ public void removeExternalSetting(ICExternalSetting setting) throws WriteAccessException {
+ }
+
+ @Override
+ public void removeExternalSettings() throws WriteAccessException {
+ }
+
+ @Override
+ public ICBuildSetting getBuildSetting() {
+ return null;
+ }
+
+ @Override
+ public ICdtVariablesContributor getBuildVariablesContributor() {
+ return null;
+ }
+
+ @Override
+ public Object getSessionProperty(QualifiedName name) {
+ return null;
+ }
+
+ @Override
+ public void setSessionProperty(QualifiedName name, Object value) {
+ }
+
+ @Override
+ public void setName(String name) throws WriteAccessException {
+ }
+
+ @Override
+ public ICConfigExtensionReference[] get(String extensionPointID) {
+ return null;
+ }
+
+ @Override
+ public ICConfigExtensionReference create(String extensionPoint, String extension) throws CoreException {
+ return null;
+ }
+
+ @Override
+ public void remove(ICConfigExtensionReference ext) throws CoreException {
+ }
+
+ @Override
+ public void remove(String extensionPoint) throws CoreException {
+ }
+
+ @Override
+ public boolean isPreferenceConfiguration() {
+ return false;
+ }
+
+ @Override
+ public ICLanguageSetting getLanguageSettingForFile(IPath path, boolean ignoreExludeStatus) {
+ return null;
+ }
+
+ @Override
+ public void setExternalSettingsProviderIds(String[] ids) {
+ }
+
+ @Override
+ public String[] getExternalSettingsProviderIds() {
+ return null;
+ }
+
+ @Override
+ public void updateExternalSettingsProviders(String[] ids) throws WriteAccessException {
+ }
+
+ @Override
+ public CConfigurationStatus getConfigurationStatus() {
+ return null;
+ }
+
+ }
+}
diff --git a/core/org.eclipse.cdt.core.win32.x86/.project b/core/org.eclipse.cdt.core.win32.x86/.project
index 29368923c4..35ed365d43 100644
--- a/core/org.eclipse.cdt.core.win32.x86/.project
+++ b/core/org.eclipse.cdt.core.win32.x86/.project
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.core.win32.x86</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.core.win32.x86</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/core/org.eclipse.cdt.core.win32.x86/about.html b/core/org.eclipse.cdt.core.win32.x86/about.html
index 5eba4faba0..d7c511887d 100644
--- a/core/org.eclipse.cdt.core.win32.x86/about.html
+++ b/core/org.eclipse.cdt.core.win32.x86/about.html
@@ -1,24 +1,24 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
-
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 22, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
+
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 22, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
</body></html> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32.x86/build.properties b/core/org.eclipse.cdt.core.win32.x86/build.properties
index 437fccbc0c..7432ecbfa6 100644
--- a/core/org.eclipse.cdt.core.win32.x86/build.properties
+++ b/core/org.eclipse.cdt.core.win32.x86/build.properties
@@ -1,15 +1,15 @@
-###############################################################################
-# Copyright (c) 2011 Marc-Andre Laperle and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Marc-Andre Laperle - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- os/,\
- about.html,\
- plugin.properties
-src.includes = about.html
+###############################################################################
+# Copyright (c) 2011 Marc-Andre Laperle and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Marc-Andre Laperle - initial API and implementation
+###############################################################################
+bin.includes = META-INF/,\
+ os/,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
diff --git a/core/org.eclipse.cdt.core.win32.x86_64/.project b/core/org.eclipse.cdt.core.win32.x86_64/.project
index 11d5a0fe82..f3a99b7c96 100644
--- a/core/org.eclipse.cdt.core.win32.x86_64/.project
+++ b/core/org.eclipse.cdt.core.win32.x86_64/.project
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.core.win32.x86_64</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.core.win32.x86_64</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/core/org.eclipse.cdt.core.win32.x86_64/about.html b/core/org.eclipse.cdt.core.win32.x86_64/about.html
index 5eba4faba0..d7c511887d 100644
--- a/core/org.eclipse.cdt.core.win32.x86_64/about.html
+++ b/core/org.eclipse.cdt.core.win32.x86_64/about.html
@@ -1,24 +1,24 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
-
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 22, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
+
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 22, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
</body></html> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32.x86_64/build.properties b/core/org.eclipse.cdt.core.win32.x86_64/build.properties
index 437fccbc0c..7432ecbfa6 100644
--- a/core/org.eclipse.cdt.core.win32.x86_64/build.properties
+++ b/core/org.eclipse.cdt.core.win32.x86_64/build.properties
@@ -1,15 +1,15 @@
-###############################################################################
-# Copyright (c) 2011 Marc-Andre Laperle and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Marc-Andre Laperle - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- os/,\
- about.html,\
- plugin.properties
-src.includes = about.html
+###############################################################################
+# Copyright (c) 2011 Marc-Andre Laperle and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Marc-Andre Laperle - initial API and implementation
+###############################################################################
+bin.includes = META-INF/,\
+ os/,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
diff --git a/core/org.eclipse.cdt.core.win32/library/Makefile_x86_64.mk b/core/org.eclipse.cdt.core.win32/library/Makefile_x86_64.mk
index bec950a18d..5fe1804cc9 100644
--- a/core/org.eclipse.cdt.core.win32/library/Makefile_x86_64.mk
+++ b/core/org.eclipse.cdt.core.win32/library/Makefile_x86_64.mk
@@ -1,73 +1,73 @@
-#*******************************************************************************
-# Copyright (c) 2011 Marc-Andre Laperle
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Marc-Andre Laperle - initial API and implementation
-#*******************************************************************************
-
-# Makefile (nmake) for Core fragment on Windows x86_64
-
-OS = win32
-ARCH = x86_64
-
-JDK_INCLUDES= "$(JAVA_HOME)\include"
-JDK_OS_INCLUDES= "$(JAVA_HOME)\include/$(OS)"
-
-CC=cl
-DEBUG_FLAGS = -DDEBUG_MONITOR -DREAD_REPORT
-CFLAGS = /TP /I$(JDK_INCLUDES) /I$(JDK_OS_INCLUDES) /EHs /nologo
-CFLAGS_UNICODE = /D "_UNICODE" /D "UNICODE" $(CFLAGS)
-
-INSTALL_DIR = ..\..\org.eclipse.cdt.core.$(OS).$(ARCH)\os\$(OS)\$(ARCH)
-
-DLL_SPAWNER = spawner.dll
-OBJS_SPAWNER=StdAfx.obj Win32ProcessEx.obj iostream.obj raise.obj spawner.obj
-
-DLL_WINREG = winreg.dll
-OBJS_WINREG=winreg/winreg.obj
-
-EXE_STARTER = starter.exe
-OBJS_STARTER=starter/starter.obj
-
-EXE_LISTTASKS = listtasks.exe
-OBJS_LISTTASKS=listtasks/listtasks.obj listtasks/StdAfx.obj
-
-.c.obj:
- cl /c $(CFLAGS_UNICODE) $*.c /Fo$@
-
-.cpp.obj:
- cl /c $(CFLAGS_UNICODE) $*.cpp /Fo$@
-
-#TODO: Use unicode for listtasks, see bug 353460
-listtasks/listtasks.obj:
- cl /c $(CFLAGS) $*.cpp /Fo$@
-
-spawner: $(OBJS_SPAWNER)
- link /dll /nologo /out:$(DLL_SPAWNER) $(OBJS_SPAWNER) User32.lib
-
-winreg: $(OBJS_WINREG)
- link /dll /nologo /out:$(DLL_WINREG) $(OBJS_WINREG) Advapi32.lib
-
-starter: $(OBJS_STARTER)
- link /nologo /out:$(EXE_STARTER) $(OBJS_STARTER) Psapi.Lib Shell32.lib
-
-listtasks: $(OBJS_LISTTASKS)
- link /nologo /out:$(EXE_LISTTASKS) $(OBJS_LISTTASKS) Psapi.Lib
-
-all: spawner winreg starter listtasks
-
-clean:
- del *.obj *.lib *.exp *.exe *.dll winreg\*.obj starter\*.obj listtasks\*.obj
-
-rebuild: clean all
-
-install: all
- copy *.dll $(INSTALL_DIR)
- copy *.exe $(INSTALL_DIR)
-
-uninstall:
- del $(INSTALL_DIR)\*.dll $(INSTALL_DIR)\*.exe
+#*******************************************************************************
+# Copyright (c) 2011 Marc-Andre Laperle
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Marc-Andre Laperle - initial API and implementation
+#*******************************************************************************
+
+# Makefile (nmake) for Core fragment on Windows x86_64
+
+OS = win32
+ARCH = x86_64
+
+JDK_INCLUDES= "$(JAVA_HOME)\include"
+JDK_OS_INCLUDES= "$(JAVA_HOME)\include/$(OS)"
+
+CC=cl
+DEBUG_FLAGS = -DDEBUG_MONITOR -DREAD_REPORT
+CFLAGS = /TP /I$(JDK_INCLUDES) /I$(JDK_OS_INCLUDES) /EHs /nologo
+CFLAGS_UNICODE = /D "_UNICODE" /D "UNICODE" $(CFLAGS)
+
+INSTALL_DIR = ..\..\org.eclipse.cdt.core.$(OS).$(ARCH)\os\$(OS)\$(ARCH)
+
+DLL_SPAWNER = spawner.dll
+OBJS_SPAWNER=StdAfx.obj Win32ProcessEx.obj iostream.obj raise.obj spawner.obj
+
+DLL_WINREG = winreg.dll
+OBJS_WINREG=winreg/winreg.obj
+
+EXE_STARTER = starter.exe
+OBJS_STARTER=starter/starter.obj
+
+EXE_LISTTASKS = listtasks.exe
+OBJS_LISTTASKS=listtasks/listtasks.obj listtasks/StdAfx.obj
+
+.c.obj:
+ cl /c $(CFLAGS_UNICODE) $*.c /Fo$@
+
+.cpp.obj:
+ cl /c $(CFLAGS_UNICODE) $*.cpp /Fo$@
+
+#TODO: Use unicode for listtasks, see bug 353460
+listtasks/listtasks.obj:
+ cl /c $(CFLAGS) $*.cpp /Fo$@
+
+spawner: $(OBJS_SPAWNER)
+ link /dll /nologo /out:$(DLL_SPAWNER) $(OBJS_SPAWNER) User32.lib
+
+winreg: $(OBJS_WINREG)
+ link /dll /nologo /out:$(DLL_WINREG) $(OBJS_WINREG) Advapi32.lib
+
+starter: $(OBJS_STARTER)
+ link /nologo /out:$(EXE_STARTER) $(OBJS_STARTER) Psapi.Lib Shell32.lib
+
+listtasks: $(OBJS_LISTTASKS)
+ link /nologo /out:$(EXE_LISTTASKS) $(OBJS_LISTTASKS) Psapi.Lib
+
+all: spawner winreg starter listtasks
+
+clean:
+ del *.obj *.lib *.exp *.exe *.dll winreg\*.obj starter\*.obj listtasks\*.obj
+
+rebuild: clean all
+
+install: all
+ copy *.dll $(INSTALL_DIR)
+ copy *.exe $(INSTALL_DIR)
+
+uninstall:
+ del $(INSTALL_DIR)\*.dll $(INSTALL_DIR)\*.exe
diff --git a/core/org.eclipse.cdt.core.win32/library/Readme64.txt b/core/org.eclipse.cdt.core.win32/library/Readme64.txt
index fc59c9e51c..ce6b137947 100644
--- a/core/org.eclipse.cdt.core.win32/library/Readme64.txt
+++ b/core/org.eclipse.cdt.core.win32/library/Readme64.txt
@@ -1,23 +1,23 @@
-#*******************************************************************************
-# Copyright (c) 2011 Marc-Andre Laperle
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Marc-Andre Laperle - initial API and implementation
-#*******************************************************************************
-
-How to build the Win32 x86_64 core fragment:
-
-1. Prerequisites
-- Install Windows SDK 7.1. If the SDK is not installed in the default location or if you want to try a different SDK, modify setenv64.bat accordingly.
-- Make sure your JAVA_HOME environment variable is set and points to a 64 bit JDK (C:\Program Files\Java\jdkX.X.X not C:\Program Files (x86)\Java\jdkX.X.X )
-
-2. Build and install
-- In a command prompt, execute setenv64.bat.
-The command prompt should turn to a different color and print a message about targeting x64.
-- Execute build64.bat
-This will build the dlls and executables, copy them to org.eclipse.cdt.core.win32.x86_64\os\win32\x86_64 then clean the build directories.
-Optionally, you can use nmake /f Makefile_x86_64.mk TARGET directly. Refer to Makefile_x86_64.mk for valid targets.
+#*******************************************************************************
+# Copyright (c) 2011 Marc-Andre Laperle
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Marc-Andre Laperle - initial API and implementation
+#*******************************************************************************
+
+How to build the Win32 x86_64 core fragment:
+
+1. Prerequisites
+- Install Windows SDK 7.1. If the SDK is not installed in the default location or if you want to try a different SDK, modify setenv64.bat accordingly.
+- Make sure your JAVA_HOME environment variable is set and points to a 64 bit JDK (C:\Program Files\Java\jdkX.X.X not C:\Program Files (x86)\Java\jdkX.X.X )
+
+2. Build and install
+- In a command prompt, execute setenv64.bat.
+The command prompt should turn to a different color and print a message about targeting x64.
+- Execute build64.bat
+This will build the dlls and executables, copy them to org.eclipse.cdt.core.win32.x86_64\os\win32\x86_64 then clean the build directories.
+Optionally, you can use nmake /f Makefile_x86_64.mk TARGET directly. Refer to Makefile_x86_64.mk for valid targets.
diff --git a/core/org.eclipse.cdt.core.win32/library/build64.bat b/core/org.eclipse.cdt.core.win32/library/build64.bat
index 8ec3065131..41201d443b 100644
--- a/core/org.eclipse.cdt.core.win32/library/build64.bat
+++ b/core/org.eclipse.cdt.core.win32/library/build64.bat
@@ -1,12 +1,12 @@
-@rem ***************************************************************************
-@rem Copyright (c) 2011 Marc-Andre Laperle and others.
-@rem All rights reserved. This program and the accompanying materials
-@rem are made available under the terms of the Eclipse Public License v1.0
-@rem which accompanies this distribution, and is available at
-@rem http://www.eclipse.org/legal/epl-v10.html
-@rem
-@rem Contributors:
-@rem Marc-Andre Laperle - initial API and implementation
-@rem ***************************************************************************
-
+@rem ***************************************************************************
+@rem Copyright (c) 2011 Marc-Andre Laperle and others.
+@rem All rights reserved. This program and the accompanying materials
+@rem are made available under the terms of the Eclipse Public License v1.0
+@rem which accompanies this distribution, and is available at
+@rem http://www.eclipse.org/legal/epl-v10.html
+@rem
+@rem Contributors:
+@rem Marc-Andre Laperle - initial API and implementation
+@rem ***************************************************************************
+
nmake /f Makefile_x86_64.mk /NOLOGO install clean \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/cdt-win32.sln b/core/org.eclipse.cdt.core.win32/library/cdt-win32.sln
index 5367a43acb..01d10abe31 100644
--- a/core/org.eclipse.cdt.core.win32/library/cdt-win32.sln
+++ b/core/org.eclipse.cdt.core.win32/library/cdt-win32.sln
@@ -1,33 +1,33 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winreg", "winreg\winreg.vcxproj", "{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Mixed Platforms = Debug|Mixed Platforms
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Mixed Platforms = Release|Mixed Platforms
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.Build.0 = Debug|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.ActiveCfg = Debug|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.Build.0 = Debug|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|x64.ActiveCfg = Debug|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.ActiveCfg = Release|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.Build.0 = Release|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.ActiveCfg = Release|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.Build.0 = Release|Win32
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.ActiveCfg = Release|x64
- {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winreg", "winreg\winreg.vcxproj", "{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.Build.0 = Debug|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|x64.ActiveCfg = Debug|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.ActiveCfg = Release|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.Build.0 = Release|Win32
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.ActiveCfg = Release|x64
+ {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp b/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp
index ace4d4df66..f231562921 100644
--- a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp
+++ b/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp
@@ -1,18 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2002 - 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-// stdafx.cpp : source file that includes just the standard includes
-// ProcList.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+/*******************************************************************************
+ * Copyright (c) 2002 - 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+// stdafx.cpp : source file that includes just the standard includes
+// ProcList.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h b/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h
index 3eebdec814..f51c2a6b60 100644
--- a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h
+++ b/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h
@@ -1,29 +1,29 @@
-/*******************************************************************************
- * Copyright (c) 2002 - 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_)
-#define AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-
-// TODO: reference additional headers your program requires here
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_)
+/*******************************************************************************
+ * Copyright (c) 2002 - 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_)
+#define AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+// TODO: reference additional headers your program requires here
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_)
diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp
index c6a626c26d..bdfc126abb 100644
--- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp
+++ b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp
@@ -1,346 +1,346 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2011 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-// ProcList.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include "listtasks.h"
-#include <tlhelp32.h>
-#include <vdmdbg.h>
-#include <iostream>
-#include <iomanip>
-
-using namespace std;
-
-typedef struct
-{
- DWORD dwPID ;
- PROCENUMPROC lpProc ;
- DWORD lParam ;
- BOOL bEnd ;
-} EnumInfoStruct ;
-
-BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16,
- PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) ;
-
-BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) ;
-
-int main(int argc, char* argv[])
-{
- EnumProcs(OutProcInfo, 0);
- return 0;
-}
-
-
-
-/*********************
-EnumProc.cpp
-*********************/
-
-// The EnumProcs function takes a pointer to a callback function
-// that will be called once per process in the system providing
-// process EXE filename and process ID.
-// Callback function definition:
-// BOOL CALLBACK Proc( DWORD dw, LPCSTR lpstr, LPARAM lParam ) ;
-//
-// lpProc -- Address of callback routine.
-//
-// lParam -- A user-defined LPARAM value to be passed to
-// the callback routine.
-BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam )
-{
- OSVERSIONINFO osver ;
- HINSTANCE hInstLib ;
- HINSTANCE hInstLib2 ;
- HANDLE hSnapShot ;
- PROCESSENTRY32 procentry ;
- BOOL bFlag ;
- LPDWORD lpdwPIDs ;
- DWORD dwSize, dwSize2, dwIndex ;
- HMODULE hMod ;
- HANDLE hProcess ;
- char szFileName[ MAX_PATH ] ;
- EnumInfoStruct sInfo ;
-
- // ToolHelp Function Pointers.
- HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ;
- BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ;
- BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ;
-
- // PSAPI Function Pointers.
- BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * );
- BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *,
- DWORD, LPDWORD );
- DWORD (WINAPI *lpfGetModuleFileNameEx)( HANDLE, HMODULE,
- LPTSTR, DWORD );
-
- // VDMDBG Function Pointers.
- INT (WINAPI *lpfVDMEnumTaskWOWEx)( DWORD,
- TASKENUMPROCEX fp, LPARAM );
-
-
- // Check to see if were running under Windows95 or
- // Windows NT.
- osver.dwOSVersionInfoSize = sizeof( osver ) ;
- if( !GetVersionEx( &osver ) )
- {
- return FALSE ;
- }
-
- // If Windows NT:
- if( osver.dwPlatformId == VER_PLATFORM_WIN32_NT )
- {
-
- // Load library and get the procedures explicitly. We do
- // this so that we don't have to worry about modules using
- // this code failing to load under Windows 95, because
- // it can't resolve references to the PSAPI.DLL.
- hInstLib = LoadLibraryA( "PSAPI.DLL" ) ;
- if( hInstLib == NULL )
- return FALSE ;
-
- SYSTEM_INFO systemInfo;
-
- GetSystemInfo(&systemInfo);
- bool isWin64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
-
- if(!isWin64)
- {
- hInstLib2 = LoadLibraryA( "VDMDBG.DLL" ) ;
- if( hInstLib2 == NULL )
- return FALSE ;
- }
-
- // Get procedure addresses.
- lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*))
- GetProcAddress( hInstLib, "EnumProcesses" ) ;
- lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *,
- DWORD, LPDWORD)) GetProcAddress( hInstLib,
- "EnumProcessModules" ) ;
- lpfGetModuleFileNameEx =(DWORD (WINAPI *)(HANDLE, HMODULE,
- LPTSTR, DWORD )) GetProcAddress( hInstLib,
- "GetModuleFileNameExA" ) ;
- if(!isWin64)
- {
- lpfVDMEnumTaskWOWEx =(INT(WINAPI *)( DWORD, TASKENUMPROCEX,
- LPARAM))GetProcAddress( hInstLib2, "VDMEnumTaskWOWEx" );
- }
- if( lpfEnumProcesses == NULL ||
- lpfEnumProcessModules == NULL ||
- lpfGetModuleFileNameEx == NULL ||
- (!isWin64 && lpfVDMEnumTaskWOWEx == NULL))
- {
- FreeLibrary( hInstLib ) ;
- if(!isWin64)
- {
- FreeLibrary( hInstLib2 ) ;
- }
- return FALSE ;
- }
-
- // Call the PSAPI function EnumProcesses to get all of the
- // ProcID's currently in the system.
- // NOTE: In the documentation, the third parameter of
- // EnumProcesses is named cbNeeded, which implies that you
- // can call the function once to find out how much space to
- // allocate for a buffer and again to fill the buffer.
- // This is not the case. The cbNeeded parameter returns
- // the number of PIDs returned, so if your buffer size is
- // zero cbNeeded returns zero.
- // NOTE: The "HeapAlloc" loop here ensures that we
- // actually allocate a buffer large enough for all the
- // PIDs in the system.
- dwSize2 = 256 * sizeof( DWORD ) ;
- lpdwPIDs = NULL ;
- do
- {
- if( lpdwPIDs )
- {
- HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
- dwSize2 *= 2 ;
- }
- lpdwPIDs = (LPDWORD)HeapAlloc( GetProcessHeap(), 0, dwSize2 );
- if( lpdwPIDs == NULL )
- {
- FreeLibrary( hInstLib ) ;
- if(!isWin64)
- {
- FreeLibrary( hInstLib2 ) ;
- }
- return FALSE ;
- }
- if( !lpfEnumProcesses( lpdwPIDs, dwSize2, &dwSize ) )
- {
- HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
- FreeLibrary( hInstLib ) ;
- if(!isWin64)
- {
- FreeLibrary( hInstLib2 ) ;
- }
- return FALSE ;
- }
- }while( dwSize == dwSize2 ) ;
-
- // How many ProcID's did we get?
- dwSize /= sizeof( DWORD ) ;
-
- // Loop through each ProcID.
- for( dwIndex = 0 ; dwIndex < dwSize ; dwIndex++ )
- {
- szFileName[0] = 0 ;
- // Open the process (if we can... security does not
- // permit every process in the system).
- hProcess = OpenProcess(
- PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
- FALSE, lpdwPIDs[ dwIndex ] ) ;
- if( hProcess != NULL )
- {
- // Here we call EnumProcessModules to get only the
- // first module in the process this is important,
- // because this will be the .EXE module for which we
- // will retrieve the full path name in a second.
- if( lpfEnumProcessModules( hProcess, &hMod,
- sizeof( hMod ), &dwSize2 ) )
- {
- // Get Full pathname:
- if( !lpfGetModuleFileNameEx( hProcess, hMod,
- szFileName, sizeof( szFileName ) ) )
- {
- szFileName[0] = 0 ;
- }
- }
- CloseHandle( hProcess ) ;
- }
- // Regardless of OpenProcess success or failure, we
- // still call the enum func with the ProcID.
- if(!lpProc( lpdwPIDs[dwIndex], 0, szFileName, lParam))
- break ;
-
- // Did we just bump into an NTVDM?
- if(!isWin64 && _stricmp( szFileName+(strlen(szFileName)-9),
- "NTVDM.EXE")==0)
- {
- // Fill in some info for the 16-bit enum proc.
- sInfo.dwPID = lpdwPIDs[dwIndex] ;
- sInfo.lpProc = lpProc ;
- sInfo.lParam = lParam ;
- sInfo.bEnd = FALSE ;
- // Enum the 16-bit stuff.
- lpfVDMEnumTaskWOWEx( lpdwPIDs[dwIndex],
- (TASKENUMPROCEX) Enum16,
- (LPARAM) &sInfo);
-
- // Did our main enum func say quit?
- if(sInfo.bEnd)
- break ;
- }
- }
-
- HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
- if(!isWin64)
- {
- FreeLibrary( hInstLib2 ) ;
- }
-
- // If Windows 95:
- }else if( osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
- {
-
-
- hInstLib = LoadLibraryA( "Kernel32.DLL" ) ;
- if( hInstLib == NULL )
- return FALSE ;
-
- // Get procedure addresses.
- // We are linking to these functions of Kernel32
- // explicitly, because otherwise a module using
- // this code would fail to load under Windows NT,
- // which does not have the Toolhelp32
- // functions in the Kernel 32.
- lpfCreateToolhelp32Snapshot=
- (HANDLE(WINAPI *)(DWORD,DWORD))
- GetProcAddress( hInstLib,
- "CreateToolhelp32Snapshot" ) ;
- lpfProcess32First=
- (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
- GetProcAddress( hInstLib, "Process32First" ) ;
- lpfProcess32Next=
- (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
- GetProcAddress( hInstLib, "Process32Next" ) ;
- if( lpfProcess32Next == NULL ||
- lpfProcess32First == NULL ||
- lpfCreateToolhelp32Snapshot == NULL )
- {
- FreeLibrary( hInstLib ) ;
- return FALSE ;
- }
-
- // Get a handle to a Toolhelp snapshot of the systems
- // processes.
- hSnapShot = lpfCreateToolhelp32Snapshot(
- TH32CS_SNAPPROCESS, 0 ) ;
- if( hSnapShot == INVALID_HANDLE_VALUE )
- {
- FreeLibrary( hInstLib ) ;
- return FALSE ;
- }
-
- // Get the first process' information.
- procentry.dwSize = sizeof(PROCESSENTRY32) ;
- bFlag = lpfProcess32First( hSnapShot, &procentry ) ;
-
- // While there are processes, keep looping.
- while( bFlag )
- {
- // Call the enum func with the filename and ProcID.
- if(lpProc( procentry.th32ProcessID, 0,
- procentry.szExeFile, lParam ))
- {
- procentry.dwSize = sizeof(PROCESSENTRY32) ;
- bFlag = lpfProcess32Next( hSnapShot, &procentry );
- }else
- bFlag = FALSE ;
- }
-
-
- }else
- return FALSE ;
-
- // Free the library.
- FreeLibrary( hInstLib ) ;
-
- return TRUE ;
-}
-
-BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16,
- PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined )
-{
- BOOL bRet ;
-
- EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined ;
-
- bRet = psInfo->lpProc( psInfo->dwPID, hTask16, pszFileName,
- psInfo->lParam ) ;
-
- if(!bRet)
- {
- psInfo->bEnd = TRUE ;
- }
-
- return !bRet;
-}
-
-BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM )
-{
- cout << setw(10) << pid << '\t' << procName << '\n';
- return TRUE;
-}
+/*******************************************************************************
+ * Copyright (c) 2002, 2011 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+// ProcList.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include "listtasks.h"
+#include <tlhelp32.h>
+#include <vdmdbg.h>
+#include <iostream>
+#include <iomanip>
+
+using namespace std;
+
+typedef struct
+{
+ DWORD dwPID ;
+ PROCENUMPROC lpProc ;
+ DWORD lParam ;
+ BOOL bEnd ;
+} EnumInfoStruct ;
+
+BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16,
+ PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) ;
+
+BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) ;
+
+int main(int argc, char* argv[])
+{
+ EnumProcs(OutProcInfo, 0);
+ return 0;
+}
+
+
+
+/*********************
+EnumProc.cpp
+*********************/
+
+// The EnumProcs function takes a pointer to a callback function
+// that will be called once per process in the system providing
+// process EXE filename and process ID.
+// Callback function definition:
+// BOOL CALLBACK Proc( DWORD dw, LPCSTR lpstr, LPARAM lParam ) ;
+//
+// lpProc -- Address of callback routine.
+//
+// lParam -- A user-defined LPARAM value to be passed to
+// the callback routine.
+BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam )
+{
+ OSVERSIONINFO osver ;
+ HINSTANCE hInstLib ;
+ HINSTANCE hInstLib2 ;
+ HANDLE hSnapShot ;
+ PROCESSENTRY32 procentry ;
+ BOOL bFlag ;
+ LPDWORD lpdwPIDs ;
+ DWORD dwSize, dwSize2, dwIndex ;
+ HMODULE hMod ;
+ HANDLE hProcess ;
+ char szFileName[ MAX_PATH ] ;
+ EnumInfoStruct sInfo ;
+
+ // ToolHelp Function Pointers.
+ HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ;
+ BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ;
+ BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ;
+
+ // PSAPI Function Pointers.
+ BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * );
+ BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *,
+ DWORD, LPDWORD );
+ DWORD (WINAPI *lpfGetModuleFileNameEx)( HANDLE, HMODULE,
+ LPTSTR, DWORD );
+
+ // VDMDBG Function Pointers.
+ INT (WINAPI *lpfVDMEnumTaskWOWEx)( DWORD,
+ TASKENUMPROCEX fp, LPARAM );
+
+
+ // Check to see if were running under Windows95 or
+ // Windows NT.
+ osver.dwOSVersionInfoSize = sizeof( osver ) ;
+ if( !GetVersionEx( &osver ) )
+ {
+ return FALSE ;
+ }
+
+ // If Windows NT:
+ if( osver.dwPlatformId == VER_PLATFORM_WIN32_NT )
+ {
+
+ // Load library and get the procedures explicitly. We do
+ // this so that we don't have to worry about modules using
+ // this code failing to load under Windows 95, because
+ // it can't resolve references to the PSAPI.DLL.
+ hInstLib = LoadLibraryA( "PSAPI.DLL" ) ;
+ if( hInstLib == NULL )
+ return FALSE ;
+
+ SYSTEM_INFO systemInfo;
+
+ GetSystemInfo(&systemInfo);
+ bool isWin64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
+
+ if(!isWin64)
+ {
+ hInstLib2 = LoadLibraryA( "VDMDBG.DLL" ) ;
+ if( hInstLib2 == NULL )
+ return FALSE ;
+ }
+
+ // Get procedure addresses.
+ lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*))
+ GetProcAddress( hInstLib, "EnumProcesses" ) ;
+ lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *,
+ DWORD, LPDWORD)) GetProcAddress( hInstLib,
+ "EnumProcessModules" ) ;
+ lpfGetModuleFileNameEx =(DWORD (WINAPI *)(HANDLE, HMODULE,
+ LPTSTR, DWORD )) GetProcAddress( hInstLib,
+ "GetModuleFileNameExA" ) ;
+ if(!isWin64)
+ {
+ lpfVDMEnumTaskWOWEx =(INT(WINAPI *)( DWORD, TASKENUMPROCEX,
+ LPARAM))GetProcAddress( hInstLib2, "VDMEnumTaskWOWEx" );
+ }
+ if( lpfEnumProcesses == NULL ||
+ lpfEnumProcessModules == NULL ||
+ lpfGetModuleFileNameEx == NULL ||
+ (!isWin64 && lpfVDMEnumTaskWOWEx == NULL))
+ {
+ FreeLibrary( hInstLib ) ;
+ if(!isWin64)
+ {
+ FreeLibrary( hInstLib2 ) ;
+ }
+ return FALSE ;
+ }
+
+ // Call the PSAPI function EnumProcesses to get all of the
+ // ProcID's currently in the system.
+ // NOTE: In the documentation, the third parameter of
+ // EnumProcesses is named cbNeeded, which implies that you
+ // can call the function once to find out how much space to
+ // allocate for a buffer and again to fill the buffer.
+ // This is not the case. The cbNeeded parameter returns
+ // the number of PIDs returned, so if your buffer size is
+ // zero cbNeeded returns zero.
+ // NOTE: The "HeapAlloc" loop here ensures that we
+ // actually allocate a buffer large enough for all the
+ // PIDs in the system.
+ dwSize2 = 256 * sizeof( DWORD ) ;
+ lpdwPIDs = NULL ;
+ do
+ {
+ if( lpdwPIDs )
+ {
+ HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
+ dwSize2 *= 2 ;
+ }
+ lpdwPIDs = (LPDWORD)HeapAlloc( GetProcessHeap(), 0, dwSize2 );
+ if( lpdwPIDs == NULL )
+ {
+ FreeLibrary( hInstLib ) ;
+ if(!isWin64)
+ {
+ FreeLibrary( hInstLib2 ) ;
+ }
+ return FALSE ;
+ }
+ if( !lpfEnumProcesses( lpdwPIDs, dwSize2, &dwSize ) )
+ {
+ HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
+ FreeLibrary( hInstLib ) ;
+ if(!isWin64)
+ {
+ FreeLibrary( hInstLib2 ) ;
+ }
+ return FALSE ;
+ }
+ }while( dwSize == dwSize2 ) ;
+
+ // How many ProcID's did we get?
+ dwSize /= sizeof( DWORD ) ;
+
+ // Loop through each ProcID.
+ for( dwIndex = 0 ; dwIndex < dwSize ; dwIndex++ )
+ {
+ szFileName[0] = 0 ;
+ // Open the process (if we can... security does not
+ // permit every process in the system).
+ hProcess = OpenProcess(
+ PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+ FALSE, lpdwPIDs[ dwIndex ] ) ;
+ if( hProcess != NULL )
+ {
+ // Here we call EnumProcessModules to get only the
+ // first module in the process this is important,
+ // because this will be the .EXE module for which we
+ // will retrieve the full path name in a second.
+ if( lpfEnumProcessModules( hProcess, &hMod,
+ sizeof( hMod ), &dwSize2 ) )
+ {
+ // Get Full pathname:
+ if( !lpfGetModuleFileNameEx( hProcess, hMod,
+ szFileName, sizeof( szFileName ) ) )
+ {
+ szFileName[0] = 0 ;
+ }
+ }
+ CloseHandle( hProcess ) ;
+ }
+ // Regardless of OpenProcess success or failure, we
+ // still call the enum func with the ProcID.
+ if(!lpProc( lpdwPIDs[dwIndex], 0, szFileName, lParam))
+ break ;
+
+ // Did we just bump into an NTVDM?
+ if(!isWin64 && _stricmp( szFileName+(strlen(szFileName)-9),
+ "NTVDM.EXE")==0)
+ {
+ // Fill in some info for the 16-bit enum proc.
+ sInfo.dwPID = lpdwPIDs[dwIndex] ;
+ sInfo.lpProc = lpProc ;
+ sInfo.lParam = lParam ;
+ sInfo.bEnd = FALSE ;
+ // Enum the 16-bit stuff.
+ lpfVDMEnumTaskWOWEx( lpdwPIDs[dwIndex],
+ (TASKENUMPROCEX) Enum16,
+ (LPARAM) &sInfo);
+
+ // Did our main enum func say quit?
+ if(sInfo.bEnd)
+ break ;
+ }
+ }
+
+ HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
+ if(!isWin64)
+ {
+ FreeLibrary( hInstLib2 ) ;
+ }
+
+ // If Windows 95:
+ }else if( osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
+ {
+
+
+ hInstLib = LoadLibraryA( "Kernel32.DLL" ) ;
+ if( hInstLib == NULL )
+ return FALSE ;
+
+ // Get procedure addresses.
+ // We are linking to these functions of Kernel32
+ // explicitly, because otherwise a module using
+ // this code would fail to load under Windows NT,
+ // which does not have the Toolhelp32
+ // functions in the Kernel 32.
+ lpfCreateToolhelp32Snapshot=
+ (HANDLE(WINAPI *)(DWORD,DWORD))
+ GetProcAddress( hInstLib,
+ "CreateToolhelp32Snapshot" ) ;
+ lpfProcess32First=
+ (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
+ GetProcAddress( hInstLib, "Process32First" ) ;
+ lpfProcess32Next=
+ (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
+ GetProcAddress( hInstLib, "Process32Next" ) ;
+ if( lpfProcess32Next == NULL ||
+ lpfProcess32First == NULL ||
+ lpfCreateToolhelp32Snapshot == NULL )
+ {
+ FreeLibrary( hInstLib ) ;
+ return FALSE ;
+ }
+
+ // Get a handle to a Toolhelp snapshot of the systems
+ // processes.
+ hSnapShot = lpfCreateToolhelp32Snapshot(
+ TH32CS_SNAPPROCESS, 0 ) ;
+ if( hSnapShot == INVALID_HANDLE_VALUE )
+ {
+ FreeLibrary( hInstLib ) ;
+ return FALSE ;
+ }
+
+ // Get the first process' information.
+ procentry.dwSize = sizeof(PROCESSENTRY32) ;
+ bFlag = lpfProcess32First( hSnapShot, &procentry ) ;
+
+ // While there are processes, keep looping.
+ while( bFlag )
+ {
+ // Call the enum func with the filename and ProcID.
+ if(lpProc( procentry.th32ProcessID, 0,
+ procentry.szExeFile, lParam ))
+ {
+ procentry.dwSize = sizeof(PROCESSENTRY32) ;
+ bFlag = lpfProcess32Next( hSnapShot, &procentry );
+ }else
+ bFlag = FALSE ;
+ }
+
+
+ }else
+ return FALSE ;
+
+ // Free the library.
+ FreeLibrary( hInstLib ) ;
+
+ return TRUE ;
+}
+
+BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16,
+ PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined )
+{
+ BOOL bRet ;
+
+ EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined ;
+
+ bRet = psInfo->lpProc( psInfo->dwPID, hTask16, pszFileName,
+ psInfo->lParam ) ;
+
+ if(!bRet)
+ {
+ psInfo->bEnd = TRUE ;
+ }
+
+ return !bRet;
+}
+
+BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM )
+{
+ cout << setw(10) << pid << '\t' << procName << '\n';
+ return TRUE;
+}
diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp
index d14d3c49bc..da100f1a4e 100644
--- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp
+++ b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp
@@ -1,117 +1,117 @@
-# Microsoft Developer Studio Project File - Name="listtasks" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=listtasks - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "listtasks.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "listtasks.mak" CFG="listtasks - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "listtasks - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "listtasks - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "listtasks - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "listtasks - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "listtasks - Win32 Release"
-# Name "listtasks - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\listtasks.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"stdafx.h"
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\listtasks.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\ReadMe.txt
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="listtasks" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=listtasks - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "listtasks.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "listtasks.mak" CFG="listtasks - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "listtasks - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "listtasks - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "listtasks - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "listtasks - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "listtasks - Win32 Release"
+# Name "listtasks - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\listtasks.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\listtasks.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw
index 329bd2f44e..914555a178 100644
--- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw
+++ b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "listtasks"=.\listtasks.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "listtasks"=.\listtasks.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h
index ded4503f79..67cf3be123 100644
--- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h
+++ b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h
@@ -1,22 +1,22 @@
-/*******************************************************************************
- * Copyright (c) 2002 - 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-#include <windows.h>
-
-#ifndef __LISTTASKS_H
-#define __LISTTASKS_H
-
-typedef BOOL (CALLBACK *PROCENUMPROC)( DWORD, WORD, LPSTR,
- LPARAM ) ;
-
-BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) ;
-
-
+/*******************************************************************************
+ * Copyright (c) 2002 - 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+#include <windows.h>
+
+#ifndef __LISTTASKS_H
+#define __LISTTASKS_H
+
+typedef BOOL (CALLBACK *PROCENUMPROC)( DWORD, WORD, LPSTR,
+ LPARAM ) ;
+
+BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) ;
+
+
#endif \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTY.h b/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTY.h
index 5c80c5793c..d73d5c00e1 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTY.h
+++ b/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTY.h
@@ -1,45 +1,45 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_eclipse_cdt_utils_pty_PTY */
-
-#ifndef _Included_org_eclipse_cdt_utils_pty_PTY
-#define _Included_org_eclipse_cdt_utils_pty_PTY
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_eclipse_cdt_utils_pty_PTY
- * Method: openMaster
- * Signature: (Z)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster
- (JNIEnv *, jobject, jboolean);
-
-/*
- * Class: org_eclipse_cdt_utils_pty_PTY
- * Method: change_window_size
- * Signature: (III)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size
- (JNIEnv *, jobject, jint, jint, jint);
-
-/*
- * Class: org_eclipse_cdt_utils_pty_PTY
- * Method: exec2
- * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILjava/lang/String;IZ)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2
- (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray, jstring, jint, jboolean);
-
-/*
- * Class: org_eclipse_cdt_utils_pty_PTY
- * Method: waitFor
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor
- (JNIEnv *, jobject, jint, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_eclipse_cdt_utils_pty_PTY */
+
+#ifndef _Included_org_eclipse_cdt_utils_pty_PTY
+#define _Included_org_eclipse_cdt_utils_pty_PTY
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTY
+ * Method: openMaster
+ * Signature: (Z)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster
+ (JNIEnv *, jobject, jboolean);
+
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTY
+ * Method: change_window_size
+ * Signature: (III)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size
+ (JNIEnv *, jobject, jint, jint, jint);
+
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTY
+ * Method: exec2
+ * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILjava/lang/String;IZ)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2
+ (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray, jstring, jint, jboolean);
+
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTY
+ * Method: waitFor
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor
+ (JNIEnv *, jobject, jint, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYInputStream.h b/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYInputStream.h
index 86cd5bdd24..7767be6bd8 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYInputStream.h
+++ b/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYInputStream.h
@@ -1,31 +1,31 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */
-
-#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream
-#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream
-#ifdef __cplusplus
-extern "C" {
-#endif
-#undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE
-#define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE 2048L
-/*
- * Class: org_eclipse_cdt_utils_pty_PTYInputStream
- * Method: read0
- * Signature: (I[BI)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0
- (JNIEnv *, jobject, jint, jbyteArray, jint);
-
-/*
- * Class: org_eclipse_cdt_utils_pty_PTYInputStream
- * Method: close0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0
- (JNIEnv *, jobject, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */
+
+#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream
+#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE
+#define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE 2048L
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTYInputStream
+ * Method: read0
+ * Signature: (I[BI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0
+ (JNIEnv *, jobject, jint, jbyteArray, jint);
+
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTYInputStream
+ * Method: close0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0
+ (JNIEnv *, jobject, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYOutputStream.h b/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYOutputStream.h
index 108ef248d8..fb28491060 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYOutputStream.h
+++ b/core/org.eclipse.cdt.core.win32/library/pty/jni/include/PTYOutputStream.h
@@ -1,29 +1,29 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */
-
-#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream
-#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
- * Method: write0
- * Signature: (I[BI)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0
- (JNIEnv *, jobject, jint, jbyteArray, jint);
-
-/*
- * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
- * Method: close0
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0
- (JNIEnv *, jobject, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */
+
+#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream
+#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
+ * Method: write0
+ * Signature: (I[BI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0
+ (JNIEnv *, jobject, jint, jbyteArray, jint);
+
+/*
+ * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
+ * Method: close0
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0
+ (JNIEnv *, jobject, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/pty.sln b/core/org.eclipse.cdt.core.win32/library/pty/pty.sln
index bd82345255..220c281aad 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/pty.sln
+++ b/core/org.eclipse.cdt.core.win32/library/pty/pty.sln
@@ -1,46 +1,46 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C++ Express 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pty", "pty.vcxproj", "{5589D515-1C56-4641-97CF-3C4561109258}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty", "winpty.vcxproj", "{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty-agent", "winpty-agent.vcxproj", "{E7A42398-12E7-4BC1-B72B-5D62B71E9816}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.ActiveCfg = Debug|Win32
- {5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.Build.0 = Debug|Win32
- {5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.ActiveCfg = Debug|x64
- {5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.Build.0 = Debug|x64
- {5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.ActiveCfg = Release|Win32
- {5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.Build.0 = Release|Win32
- {5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.ActiveCfg = Release|x64
- {5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.Build.0 = Release|x64
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.ActiveCfg = Debug|Win32
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.Build.0 = Debug|Win32
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.ActiveCfg = Debug|x64
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.Build.0 = Debug|x64
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.ActiveCfg = Release|Win32
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.Build.0 = Release|Win32
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.ActiveCfg = Release|x64
- {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.Build.0 = Release|x64
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.ActiveCfg = Debug|Win32
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.Build.0 = Debug|Win32
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.ActiveCfg = Debug|x64
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.Build.0 = Debug|x64
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.ActiveCfg = Release|Win32
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.Build.0 = Release|Win32
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.ActiveCfg = Release|x64
- {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pty", "pty.vcxproj", "{5589D515-1C56-4641-97CF-3C4561109258}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty", "winpty.vcxproj", "{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty-agent", "winpty-agent.vcxproj", "{E7A42398-12E7-4BC1-B72B-5D62B71E9816}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.Build.0 = Debug|Win32
+ {5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.ActiveCfg = Debug|x64
+ {5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.Build.0 = Debug|x64
+ {5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.ActiveCfg = Release|Win32
+ {5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.Build.0 = Release|Win32
+ {5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.ActiveCfg = Release|x64
+ {5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.Build.0 = Release|x64
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.Build.0 = Debug|Win32
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.ActiveCfg = Debug|x64
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.Build.0 = Debug|x64
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.ActiveCfg = Release|Win32
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.Build.0 = Release|Win32
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.ActiveCfg = Release|x64
+ {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.Build.0 = Release|x64
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.Build.0 = Debug|Win32
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.ActiveCfg = Debug|x64
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.Build.0 = Debug|x64
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.ActiveCfg = Release|Win32
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.Build.0 = Release|Win32
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.ActiveCfg = Release|x64
+ {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj b/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj
index 29311ce2b0..7d526ce88b 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj
+++ b/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj
@@ -1,177 +1,177 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{5589D515-1C56-4641-97CF-3C4561109258}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>pty</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <LinkIncremental>true</LinkIncremental>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <LinkIncremental>false</LinkIncremental>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
- <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
- <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
- <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
- <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClInclude Include="jni\include\PTY.h" />
- <ClInclude Include="jni\include\PTYInputStream.h" />
- <ClInclude Include="jni\include\PTYOutputStream.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="jni\src\dllmain.cpp" />
- <ClCompile Include="jni\src\pty.cpp" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{5589D515-1C56-4641-97CF-3C4561109258}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>pty</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
+ <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
+ <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
+ <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
+ <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="jni\include\PTY.h" />
+ <ClInclude Include="jni\include\PTYInputStream.h" />
+ <ClInclude Include="jni\include\PTYOutputStream.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="jni\src\dllmain.cpp" />
+ <ClCompile Include="jni\src\pty.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj.filters b/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj.filters
index 4c428115fd..b92d3375bf 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj.filters
+++ b/core/org.eclipse.cdt.core.win32/library/pty/pty.vcxproj.filters
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="include">
- <UniqueIdentifier>{679c3039-d4a8-48db-9a3b-33f73f3b44c0}</UniqueIdentifier>
- </Filter>
- <Filter Include="src">
- <UniqueIdentifier>{b7f98685-8f42-40d2-bd2b-65bcbac17645}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="jni\include\PTY.h">
- <Filter>include</Filter>
- </ClInclude>
- <ClInclude Include="jni\include\PTYInputStream.h">
- <Filter>include</Filter>
- </ClInclude>
- <ClInclude Include="jni\include\PTYOutputStream.h">
- <Filter>include</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="jni\src\pty.cpp">
- <Filter>src</Filter>
- </ClCompile>
- <ClCompile Include="jni\src\dllmain.cpp">
- <Filter>src</Filter>
- </ClCompile>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="include">
+ <UniqueIdentifier>{679c3039-d4a8-48db-9a3b-33f73f3b44c0}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="src">
+ <UniqueIdentifier>{b7f98685-8f42-40d2-bd2b-65bcbac17645}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="jni\include\PTY.h">
+ <Filter>include</Filter>
+ </ClInclude>
+ <ClInclude Include="jni\include\PTYInputStream.h">
+ <Filter>include</Filter>
+ </ClInclude>
+ <ClInclude Include="jni\include\PTYOutputStream.h">
+ <Filter>include</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="jni\src\pty.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ <ClCompile Include="jni\src\dllmain.cpp">
+ <Filter>src</Filter>
+ </ClCompile>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj b/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj
index 69e8ac3b00..0eef37a090 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj
+++ b/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj
@@ -1,185 +1,185 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{E7A42398-12E7-4BC1-B72B-5D62B71E9816}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>winptyagent</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <LinkIncremental>true</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClInclude Include="..\winpty\agent\Agent.h" />
- <ClInclude Include="..\winpty\agent\AgentAssert.h" />
- <ClInclude Include="..\winpty\agent\ConsoleInput.h" />
- <ClInclude Include="..\winpty\agent\Coord.h" />
- <ClInclude Include="..\winpty\agent\DsrSender.h" />
- <ClInclude Include="..\winpty\agent\EventLoop.h" />
- <ClInclude Include="..\winpty\agent\NamedPipe.h" />
- <ClInclude Include="..\winpty\agent\SmallRect.h" />
- <ClInclude Include="..\winpty\agent\Terminal.h" />
- <ClInclude Include="..\winpty\agent\Win32Console.h" />
- <ClInclude Include="..\winpty\shared\AgentMsg.h" />
- <ClInclude Include="..\winpty\shared\Buffer.h" />
- <ClInclude Include="..\winpty\shared\c99_snprintf.h" />
- <ClInclude Include="..\winpty\shared\DebugClient.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\winpty\agent\Agent.cc" />
- <ClCompile Include="..\winpty\agent\AgentAssert.cc" />
- <ClCompile Include="..\winpty\agent\ConsoleInput.cc" />
- <ClCompile Include="..\winpty\agent\Coord.cc" />
- <ClCompile Include="..\winpty\agent\EventLoop.cc" />
- <ClCompile Include="..\winpty\agent\main.cc" />
- <ClCompile Include="..\winpty\agent\NamedPipe.cc" />
- <ClCompile Include="..\winpty\agent\SmallRect.cc" />
- <ClCompile Include="..\winpty\agent\Terminal.cc" />
- <ClCompile Include="..\winpty\agent\Win32Console.cc" />
- <ClCompile Include="..\winpty\shared\DebugClient.cc" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{E7A42398-12E7-4BC1-B72B-5D62B71E9816}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>winptyagent</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\winpty\agent\Agent.h" />
+ <ClInclude Include="..\winpty\agent\AgentAssert.h" />
+ <ClInclude Include="..\winpty\agent\ConsoleInput.h" />
+ <ClInclude Include="..\winpty\agent\Coord.h" />
+ <ClInclude Include="..\winpty\agent\DsrSender.h" />
+ <ClInclude Include="..\winpty\agent\EventLoop.h" />
+ <ClInclude Include="..\winpty\agent\NamedPipe.h" />
+ <ClInclude Include="..\winpty\agent\SmallRect.h" />
+ <ClInclude Include="..\winpty\agent\Terminal.h" />
+ <ClInclude Include="..\winpty\agent\Win32Console.h" />
+ <ClInclude Include="..\winpty\shared\AgentMsg.h" />
+ <ClInclude Include="..\winpty\shared\Buffer.h" />
+ <ClInclude Include="..\winpty\shared\c99_snprintf.h" />
+ <ClInclude Include="..\winpty\shared\DebugClient.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\winpty\agent\Agent.cc" />
+ <ClCompile Include="..\winpty\agent\AgentAssert.cc" />
+ <ClCompile Include="..\winpty\agent\ConsoleInput.cc" />
+ <ClCompile Include="..\winpty\agent\Coord.cc" />
+ <ClCompile Include="..\winpty\agent\EventLoop.cc" />
+ <ClCompile Include="..\winpty\agent\main.cc" />
+ <ClCompile Include="..\winpty\agent\NamedPipe.cc" />
+ <ClCompile Include="..\winpty\agent\SmallRect.cc" />
+ <ClCompile Include="..\winpty\agent\Terminal.cc" />
+ <ClCompile Include="..\winpty\agent\Win32Console.cc" />
+ <ClCompile Include="..\winpty\shared\DebugClient.cc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj.filters b/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj.filters
index 1740186662..46cdf6beaa 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj.filters
+++ b/core/org.eclipse.cdt.core.win32/library/pty/winpty-agent.vcxproj.filters
@@ -1,90 +1,90 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="agent">
- <UniqueIdentifier>{a7174beb-334f-4496-868c-348a80e5f4d8}</UniqueIdentifier>
- </Filter>
- <Filter Include="shared">
- <UniqueIdentifier>{0c9e153d-99b4-4f47-ba3c-57e53e1c71b7}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\winpty\shared\AgentMsg.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\shared\Buffer.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\shared\c99_snprintf.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\shared\DebugClient.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\Agent.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\AgentAssert.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\ConsoleInput.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\Coord.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\DsrSender.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\EventLoop.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\NamedPipe.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\SmallRect.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\Terminal.h">
- <Filter>agent</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\agent\Win32Console.h">
- <Filter>agent</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\winpty\shared\DebugClient.cc">
- <Filter>shared</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\Agent.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\AgentAssert.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\ConsoleInput.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\Coord.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\EventLoop.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\main.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\NamedPipe.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\SmallRect.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\Terminal.cc">
- <Filter>agent</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\agent\Win32Console.cc">
- <Filter>agent</Filter>
- </ClCompile>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="agent">
+ <UniqueIdentifier>{a7174beb-334f-4496-868c-348a80e5f4d8}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="shared">
+ <UniqueIdentifier>{0c9e153d-99b4-4f47-ba3c-57e53e1c71b7}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\winpty\shared\AgentMsg.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\shared\Buffer.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\shared\c99_snprintf.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\shared\DebugClient.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\Agent.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\AgentAssert.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\ConsoleInput.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\Coord.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\DsrSender.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\EventLoop.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\NamedPipe.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\SmallRect.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\Terminal.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\agent\Win32Console.h">
+ <Filter>agent</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\winpty\shared\DebugClient.cc">
+ <Filter>shared</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\Agent.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\AgentAssert.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\ConsoleInput.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\Coord.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\EventLoop.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\main.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\NamedPipe.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\SmallRect.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\Terminal.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\agent\Win32Console.cc">
+ <Filter>agent</Filter>
+ </ClCompile>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj b/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj
index bf4fabb5b4..e83366bc90 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj
+++ b/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj
@@ -1,167 +1,167 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>winpty</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>Windows7.1SDK</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <LinkIncremental>true</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;NOMINMAX;_DEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NOMINMAX;NDEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClInclude Include="..\winpty\include\winpty.h" />
- <ClInclude Include="..\winpty\shared\AgentMsg.h" />
- <ClInclude Include="..\winpty\shared\Buffer.h" />
- <ClInclude Include="..\winpty\shared\c99_snprintf.h" />
- <ClInclude Include="..\winpty\shared\DebugClient.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\winpty\libwinpty\winpty.cc" />
- <ClCompile Include="..\winpty\shared\DebugClient.cc" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>winpty</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;NOMINMAX;_DEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NOMINMAX;NDEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WINPTY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\winpty\include\winpty.h" />
+ <ClInclude Include="..\winpty\shared\AgentMsg.h" />
+ <ClInclude Include="..\winpty\shared\Buffer.h" />
+ <ClInclude Include="..\winpty\shared\c99_snprintf.h" />
+ <ClInclude Include="..\winpty\shared\DebugClient.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\winpty\libwinpty\winpty.cc" />
+ <ClCompile Include="..\winpty\shared\DebugClient.cc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj.filters b/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj.filters
index ad2b6019f7..86016e3024 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj.filters
+++ b/core/org.eclipse.cdt.core.win32/library/pty/winpty.vcxproj.filters
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="include">
- <UniqueIdentifier>{6f8f9f7f-1797-423e-9189-990b2baff405}</UniqueIdentifier>
- </Filter>
- <Filter Include="libwinpty">
- <UniqueIdentifier>{6fa1f334-3a7c-4a8c-970b-15c2a6a08ba2}</UniqueIdentifier>
- </Filter>
- <Filter Include="shared">
- <UniqueIdentifier>{84962cba-90e7-4b83-8656-6563b933bb73}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\winpty\shared\AgentMsg.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\shared\Buffer.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\shared\c99_snprintf.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\shared\DebugClient.h">
- <Filter>shared</Filter>
- </ClInclude>
- <ClInclude Include="..\winpty\include\winpty.h">
- <Filter>include</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\winpty\shared\DebugClient.cc">
- <Filter>shared</Filter>
- </ClCompile>
- <ClCompile Include="..\winpty\libwinpty\winpty.cc">
- <Filter>libwinpty</Filter>
- </ClCompile>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="include">
+ <UniqueIdentifier>{6f8f9f7f-1797-423e-9189-990b2baff405}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="libwinpty">
+ <UniqueIdentifier>{6fa1f334-3a7c-4a8c-970b-15c2a6a08ba2}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="shared">
+ <UniqueIdentifier>{84962cba-90e7-4b83-8656-6563b933bb73}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\winpty\shared\AgentMsg.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\shared\Buffer.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\shared\c99_snprintf.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\shared\DebugClient.h">
+ <Filter>shared</Filter>
+ </ClInclude>
+ <ClInclude Include="..\winpty\include\winpty.h">
+ <Filter>include</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\winpty\shared\DebugClient.cc">
+ <Filter>shared</Filter>
+ </ClCompile>
+ <ClCompile Include="..\winpty\libwinpty\winpty.cc">
+ <Filter>libwinpty</Filter>
+ </ClCompile>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/dllmain.cpp b/core/org.eclipse.cdt.core.win32/library/winreg/dllmain.cpp
index 6e297985f3..fb210e2a52 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/dllmain.cpp
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/dllmain.cpp
@@ -1,28 +1,28 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-#include "stdafx.h"
-
-BOOL APIENTRY DllMain( HMODULE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+/*******************************************************************************
+ * Copyright (c) 2015 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.cpp b/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.cpp
index c97de4cd23..74d5be2a88 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.cpp
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.cpp
@@ -1,14 +1,14 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+/*******************************************************************************
+ * Copyright (c) 2015 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.h b/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.h
index 0babced30e..d3a8b238d5 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.h
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/stdafx.h
@@ -1,22 +1,22 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-#pragma once
-
-#include "targetver.h"
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-#include <jni.h>
-
-
-
-// TODO: reference additional headers your program requires here
+/*******************************************************************************
+ * Copyright (c) 2015 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+#include <jni.h>
+
+
+
+// TODO: reference additional headers your program requires here
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/targetver.h b/core/org.eclipse.cdt.core.win32/library/winreg/targetver.h
index d27181a16d..061a668b8c 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/targetver.h
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/targetver.h
@@ -1,18 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>
+/*******************************************************************************
+ * Copyright (c) 2015 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+#pragma once
+
+// Including SDKDDKVer.h defines the highest available Windows platform.
+
+// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
+// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
+
+#include <SDKDDKVer.h>
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/winreg.cpp b/core/org.eclipse.cdt.core.win32/library/winreg/winreg.cpp
index 231910a1f7..c64a43ae87 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/winreg.cpp
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/winreg.cpp
@@ -1,151 +1,151 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-#include "stdafx.h"
-
-static jstring getValue(JNIEnv * env, HKEY key, jstring subkey, jstring name) {
- const jchar * csubkey = env->GetStringChars(subkey, NULL);
- const jchar * cname = env->GetStringChars(name, NULL);
- jstring result = NULL;
-
- HKEY skey;
- LONG rc = RegOpenKeyEx(key, (const wchar_t *)csubkey, 0, KEY_READ, &skey);
- if (rc == ERROR_SUCCESS) {
- DWORD type;
- wchar_t buffer[256];
- DWORD len = sizeof(buffer);
- rc = RegQueryValueEx(skey, (const wchar_t *)cname, NULL, &type, (BYTE *)&buffer, &len);
- if (rc == ERROR_SUCCESS) {
- result = env->NewString((jchar *) buffer, (jsize) wcslen(buffer));
- }
- RegCloseKey(skey);
- }
-
- env->ReleaseStringChars(subkey, csubkey);
- env->ReleaseStringChars(name, cname);
-
- return result;
-}
-
-extern "C"
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValue(
-JNIEnv * env, jobject obj, jstring subkey, jstring name)
-{
- return getValue(env, HKEY_LOCAL_MACHINE, subkey, name);
-}
-
-extern "C"
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getCurrentUserValue(
-JNIEnv * env, jobject obj, jstring subkey, jstring name)
-{
- return getValue(env, HKEY_CURRENT_USER, subkey, name);
-}
-
-/*
-* Given a subkey (string) under HKEY_LOCAL_MACHINE, and an index (starting from 0)
-* to the key's array of values, return the name of the indexed value.
-* The return value is null on any error or when the index is invalid.
-*/
-
-static jstring getValueName(JNIEnv * env, HKEY key, jstring subkey, jint index) {
- const jchar * csubkey = env->GetStringChars(subkey, NULL);
- jstring result = NULL;
-
- HKEY skey;
- LONG rc = RegOpenKeyEx(key, (const wchar_t *)csubkey, 0, KEY_READ, &skey);
- if (rc != ERROR_SUCCESS)
- return NULL;
-
- wchar_t valueName[256];
- DWORD nameSize = sizeof(valueName) + 2;
-
- rc = RegEnumValue(skey, index,
- valueName, // UNICODE string
- &nameSize,
- NULL, NULL,
- NULL, // data string
- NULL); // size in BYTE of data.
-
- if (rc == ERROR_SUCCESS)
- {
- result = env->NewString((jchar *)valueName, nameSize);
- }
-
- RegCloseKey(skey);
-
- env->ReleaseStringChars(subkey, csubkey);
-
- return result;
-}
-
-extern "C"
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValueName(
-JNIEnv * env, jobject obj, jstring subkey, jint index)
-{
- return getValueName(env, HKEY_LOCAL_MACHINE, subkey, index);
-}
-
-extern "C"
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getCurrentUserValueName(
-JNIEnv * env, jobject obj, jstring subkey, jint index)
-{
- return getValueName(env, HKEY_CURRENT_USER, subkey, index);
-}
-
-/*
-* Given a subkey (string) under HKEY_LOCAL_MACHINE, and an index (starting from 0)
-* to the key's array of keys, return the name of the indexed key.
-* The return value is null on any error or when the index is invalid.
-*/
-
-static jstring getKeyName(JNIEnv * env, HKEY key, jstring subkey, jint index) {
- const jchar * csubkey = env->GetStringChars(subkey, NULL);
- jstring result = NULL;
-
- HKEY skey;
- LONG rc = RegOpenKeyEx(key, (const wchar_t *)csubkey, 0, KEY_READ, &skey);
- if (rc != ERROR_SUCCESS)
- return NULL;
-
- wchar_t keyName[256];
- DWORD nameSize = sizeof(keyName) + 2;
-
- rc = RegEnumKeyEx(skey, index,
- keyName, // UNICODE string
- &nameSize,
- NULL, NULL,
- NULL,
- NULL); // size in BYTE of data.
-
- if (rc == ERROR_SUCCESS)
- {
- result = env->NewString((jchar *)keyName, nameSize);
- }
-
- RegCloseKey(skey);
-
- env->ReleaseStringChars(subkey, csubkey);
-
- return result;
-}
-
-extern "C"
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineKeyName(
-JNIEnv * env, jobject obj, jstring subkey, jint index)
-{
- return getKeyName(env, HKEY_LOCAL_MACHINE, subkey, index);
-}
-
-extern "C"
-JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getCurrentUserKeyName(
-JNIEnv * env, jobject obj, jstring subkey, jint index)
-{
- return getKeyName(env, HKEY_CURRENT_USER, subkey, index);
-}
+/*******************************************************************************
+ * Copyright (c) 2015 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+#include "stdafx.h"
+
+static jstring getValue(JNIEnv * env, HKEY key, jstring subkey, jstring name) {
+ const jchar * csubkey = env->GetStringChars(subkey, NULL);
+ const jchar * cname = env->GetStringChars(name, NULL);
+ jstring result = NULL;
+
+ HKEY skey;
+ LONG rc = RegOpenKeyEx(key, (const wchar_t *)csubkey, 0, KEY_READ, &skey);
+ if (rc == ERROR_SUCCESS) {
+ DWORD type;
+ wchar_t buffer[256];
+ DWORD len = sizeof(buffer);
+ rc = RegQueryValueEx(skey, (const wchar_t *)cname, NULL, &type, (BYTE *)&buffer, &len);
+ if (rc == ERROR_SUCCESS) {
+ result = env->NewString((jchar *) buffer, (jsize) wcslen(buffer));
+ }
+ RegCloseKey(skey);
+ }
+
+ env->ReleaseStringChars(subkey, csubkey);
+ env->ReleaseStringChars(name, cname);
+
+ return result;
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValue(
+JNIEnv * env, jobject obj, jstring subkey, jstring name)
+{
+ return getValue(env, HKEY_LOCAL_MACHINE, subkey, name);
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getCurrentUserValue(
+JNIEnv * env, jobject obj, jstring subkey, jstring name)
+{
+ return getValue(env, HKEY_CURRENT_USER, subkey, name);
+}
+
+/*
+* Given a subkey (string) under HKEY_LOCAL_MACHINE, and an index (starting from 0)
+* to the key's array of values, return the name of the indexed value.
+* The return value is null on any error or when the index is invalid.
+*/
+
+static jstring getValueName(JNIEnv * env, HKEY key, jstring subkey, jint index) {
+ const jchar * csubkey = env->GetStringChars(subkey, NULL);
+ jstring result = NULL;
+
+ HKEY skey;
+ LONG rc = RegOpenKeyEx(key, (const wchar_t *)csubkey, 0, KEY_READ, &skey);
+ if (rc != ERROR_SUCCESS)
+ return NULL;
+
+ wchar_t valueName[256];
+ DWORD nameSize = sizeof(valueName) + 2;
+
+ rc = RegEnumValue(skey, index,
+ valueName, // UNICODE string
+ &nameSize,
+ NULL, NULL,
+ NULL, // data string
+ NULL); // size in BYTE of data.
+
+ if (rc == ERROR_SUCCESS)
+ {
+ result = env->NewString((jchar *)valueName, nameSize);
+ }
+
+ RegCloseKey(skey);
+
+ env->ReleaseStringChars(subkey, csubkey);
+
+ return result;
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValueName(
+JNIEnv * env, jobject obj, jstring subkey, jint index)
+{
+ return getValueName(env, HKEY_LOCAL_MACHINE, subkey, index);
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getCurrentUserValueName(
+JNIEnv * env, jobject obj, jstring subkey, jint index)
+{
+ return getValueName(env, HKEY_CURRENT_USER, subkey, index);
+}
+
+/*
+* Given a subkey (string) under HKEY_LOCAL_MACHINE, and an index (starting from 0)
+* to the key's array of keys, return the name of the indexed key.
+* The return value is null on any error or when the index is invalid.
+*/
+
+static jstring getKeyName(JNIEnv * env, HKEY key, jstring subkey, jint index) {
+ const jchar * csubkey = env->GetStringChars(subkey, NULL);
+ jstring result = NULL;
+
+ HKEY skey;
+ LONG rc = RegOpenKeyEx(key, (const wchar_t *)csubkey, 0, KEY_READ, &skey);
+ if (rc != ERROR_SUCCESS)
+ return NULL;
+
+ wchar_t keyName[256];
+ DWORD nameSize = sizeof(keyName) + 2;
+
+ rc = RegEnumKeyEx(skey, index,
+ keyName, // UNICODE string
+ &nameSize,
+ NULL, NULL,
+ NULL,
+ NULL); // size in BYTE of data.
+
+ if (rc == ERROR_SUCCESS)
+ {
+ result = env->NewString((jchar *)keyName, nameSize);
+ }
+
+ RegCloseKey(skey);
+
+ env->ReleaseStringChars(subkey, csubkey);
+
+ return result;
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineKeyName(
+JNIEnv * env, jobject obj, jstring subkey, jint index)
+{
+ return getKeyName(env, HKEY_LOCAL_MACHINE, subkey, index);
+}
+
+extern "C"
+JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getCurrentUserKeyName(
+JNIEnv * env, jobject obj, jstring subkey, jint index)
+{
+ return getKeyName(env, HKEY_CURRENT_USER, subkey, index);
+}
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj b/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj
index 994ba556f5..0c82aec90f 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj
@@ -1,175 +1,175 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>winreg</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v120</PlatformToolset>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v120</PlatformToolset>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v120</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v120</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <LinkIncremental>true</LinkIncremental>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)..\..\org.eclipse.cdt.core.win32.x86\os\win32\x86\</OutDir>
- <IntDir />
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)..\..\org.eclipse.cdt.core.win32.x86_64\os\win32\x86_64\</OutDir>
- <IntDir />
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>C:\Program Files\Java\jdk1.8.0_31\include;C:\Program Files\Java\jdk1.8.0_31\include\win32</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>C:\Program Files\Java\jdk1.8.0_31\include;C:\Program Files\Java\jdk1.8.0_31\include\win32</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClInclude Include="stdafx.h" />
- <ClInclude Include="targetver.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="dllmain.cpp">
- <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
- <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- </PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- </PrecompiledHeader>
- <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
- <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- </PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- </PrecompiledHeader>
- </ClCompile>
- <ClCompile Include="stdafx.cpp">
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
- </ClCompile>
- <ClCompile Include="winreg.cpp" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>winreg</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v120</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\org.eclipse.cdt.core.win32.x86\os\win32\x86\</OutDir>
+ <IntDir />
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)..\..\org.eclipse.cdt.core.win32.x86_64\os\win32\x86_64\</OutDir>
+ <IntDir />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>C:\Program Files\Java\jdk1.8.0_31\include;C:\Program Files\Java\jdk1.8.0_31\include\win32</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINREG_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>C:\Program Files\Java\jdk1.8.0_31\include;C:\Program Files\Java\jdk1.8.0_31\include\win32</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="dllmain.cpp">
+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ </PrecompiledHeader>
+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ </PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="stdafx.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="winreg.cpp" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj.filters b/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj.filters
index 41d9984923..afa4a0f572 100644
--- a/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj.filters
+++ b/core/org.eclipse.cdt.core.win32/library/winreg/winreg.vcxproj.filters
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="stdafx.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="targetver.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="stdafx.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="winreg.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="dllmain.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="stdafx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="targetver.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="stdafx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="winreg.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dllmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.core.win32/plugin.properties b/core/org.eclipse.cdt.core.win32/plugin.properties
index 0b31b3ca94..9dec4fd06a 100644
--- a/core/org.eclipse.cdt.core.win32/plugin.properties
+++ b/core/org.eclipse.cdt.core.win32/plugin.properties
@@ -1,2 +1,2 @@
-fragmentName.linux=C/C++ Development Tools Core for Windows
-providerName=Eclipse CDT
+fragmentName.linux=C/C++ Development Tools Core for Windows
+providerName=Eclipse CDT
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ILanguageSettingsProvidersKeeper.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ILanguageSettingsProvidersKeeper.java
index fb9be5d5ae..0d2a44c9b6 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ILanguageSettingsProvidersKeeper.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ILanguageSettingsProvidersKeeper.java
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2013 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.util.List;
-
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-/**
- * Interface to express ability (of a configuration description) to handle Language Settings
- * Providers.
- * @see ILanguageSettingsProvider
- *
- * @since 5.4
- *
- */
-public interface ILanguageSettingsProvidersKeeper {
- /**
- * Sets the list of language settings providers. Language settings providers are
- * used to supply language settings {@link ICLanguageSettingEntry} such as include paths
- * or preprocessor macros.
- *
- * @param providers - the list of providers to assign to the owner (configuration description).
- * This method clones the internal list or otherwise ensures immutability of the internal
- * list before actual addition to the project model. That is to ensure that there is no
- * back-door access and all changes in the list done by this method which fires notifications
- * to the registered listeners about the accompanied changes in settings entries, see
- * {@link LanguageSettingsManager#registerLanguageSettingsChangeListener(ILanguageSettingsChangeListener)}.
- */
- public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers);
-
- /**
- * Returns the list of language settings providers. Language settings providers are
- * used to supply language settings {@link ICLanguageSettingEntry} such as include paths
- * or preprocessor macros.
- *
- * @return the list of providers to assign to the owner (configuration description). This
- * returns immutable list. Use {@link #setLanguageSettingProviders(List)} to change.
- * This method does not return {@code null}.
- */
- public List<ILanguageSettingsProvider> getLanguageSettingProviders();
-
- /**
- * Sets the list of IDs of default language settings providers.
- * <br><br>
- * The method is intended to be used by MBS to set the list from tool-chain definition.
- * The default list from the tool-chain is used, for example, while resetting
- * configuration providers to default in UI.
- *
- * @param ids - default provider IDs specified in the tool-chain.
- */
- public void setDefaultLanguageSettingsProvidersIds(String[] ids);
-
- /**
- * Retrieve the list of IDs of default language settings providers.
- * Normally the list would come from the tool-chain definition.
- *
- * @return default provider IDs or {@code null} if default providers are not defined.
- */
- public String[] getDefaultLanguageSettingsProvidersIds();
-
-}
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.util.List;
+
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+/**
+ * Interface to express ability (of a configuration description) to handle Language Settings
+ * Providers.
+ * @see ILanguageSettingsProvider
+ *
+ * @since 5.4
+ *
+ */
+public interface ILanguageSettingsProvidersKeeper {
+ /**
+ * Sets the list of language settings providers. Language settings providers are
+ * used to supply language settings {@link ICLanguageSettingEntry} such as include paths
+ * or preprocessor macros.
+ *
+ * @param providers - the list of providers to assign to the owner (configuration description).
+ * This method clones the internal list or otherwise ensures immutability of the internal
+ * list before actual addition to the project model. That is to ensure that there is no
+ * back-door access and all changes in the list done by this method which fires notifications
+ * to the registered listeners about the accompanied changes in settings entries, see
+ * {@link LanguageSettingsManager#registerLanguageSettingsChangeListener(ILanguageSettingsChangeListener)}.
+ */
+ public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers);
+
+ /**
+ * Returns the list of language settings providers. Language settings providers are
+ * used to supply language settings {@link ICLanguageSettingEntry} such as include paths
+ * or preprocessor macros.
+ *
+ * @return the list of providers to assign to the owner (configuration description). This
+ * returns immutable list. Use {@link #setLanguageSettingProviders(List)} to change.
+ * This method does not return {@code null}.
+ */
+ public List<ILanguageSettingsProvider> getLanguageSettingProviders();
+
+ /**
+ * Sets the list of IDs of default language settings providers.
+ * <br><br>
+ * The method is intended to be used by MBS to set the list from tool-chain definition.
+ * The default list from the tool-chain is used, for example, while resetting
+ * configuration providers to default in UI.
+ *
+ * @param ids - default provider IDs specified in the tool-chain.
+ */
+ public void setDefaultLanguageSettingsProvidersIds(String[] ids);
+
+ /**
+ * Retrieve the list of IDs of default language settings providers.
+ * Normally the list would come from the tool-chain definition.
+ *
+ * @return default provider IDs or {@code null} if default providers are not defined.
+ */
+ public String[] getDefaultLanguageSettingsProvidersIds();
+
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/IWorkingDirectoryTracker.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/IWorkingDirectoryTracker.java
index 6bf62071aa..4f64bc39cd 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/IWorkingDirectoryTracker.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/IWorkingDirectoryTracker.java
@@ -1,28 +1,28 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.net.URI;
-
-/**
- * Interface for console parsers able to track current working directory for build.
- *
- * @since 5.4
- */
-public interface IWorkingDirectoryTracker {
- /**
- * Returns current working directory for the current build command as determined from
- * build output.
- *
- * @return URI of current working directory or {@code null}.
- */
- public URI getWorkingDirectoryURI();
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.net.URI;
+
+/**
+ * Interface for console parsers able to track current working directory for build.
+ *
+ * @since 5.4
+ */
+public interface IWorkingDirectoryTracker {
+ /**
+ * Returns current working directory for the current build command as determined from
+ * build output.
+ *
+ * @return URI of current working directory or {@code null}.
+ */
+ public URI getWorkingDirectoryURI();
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java
index 992ee4e709..a3e0e76468 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsStorage.java
@@ -1,266 +1,266 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2014 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2011, 2014 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
-import org.eclipse.cdt.internal.core.WeakHashSet;
-import org.eclipse.cdt.internal.core.WeakHashSetSynchronized;
-
-/**
- * The class representing the (in-memory) storage for language settings entries {@link ICLanguageSettingEntry}.
- *
- * @since 5.4
- */
-public class LanguageSettingsStorage implements Cloneable {
- /** Storage to keep settings entries. */
- protected Map<String, // languageId
- Map<String, // resource project path
- List<ICLanguageSettingEntry>>> fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>();
-
- /**
- * Pool of LSE lists implemented as WeakHashSet. That allows to gain memory savings
- * at the expense of CPU time. WeakHashSet handles garbage collection when a list is not
- * referenced anywhere else. See JavaDoc {@link java.lang.ref.WeakReference} about weak reference objects.
- */
- private static WeakHashSet<List<ICLanguageSettingEntry>> listPool = new WeakHashSetSynchronized<List<ICLanguageSettingEntry>>();
-
- /**
- * Returns the list of setting entries for the given resource and language.
- * <br> Note that this list is <b>unmodifiable</b>.
- *
- * @param rcProjectPath - path to the resource relative to the project.
- * @param languageId - language id.
- *
- * @return the list of setting entries or {@code null} if no settings defined.
- */
- public List<ICLanguageSettingEntry> getSettingEntries(String rcProjectPath, String languageId) {
- List<ICLanguageSettingEntry> entries = null;
- Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId);
- if (langMap!=null) {
- entries = langMap.get(rcProjectPath);
- }
- return entries;
- }
-
- /**
- * Some providers may collect entries in pretty much random order. For the intent of
- * predictability, UI usability and efficient storage the entries are sorted by kinds
- * and secondary by name for kinds where the secondary order is not significant.
- *
- * @param entries - list of entries to sort.
- * @return - sorted entries.
- */
- private List<ICLanguageSettingEntry> sortEntries(List<? extends ICLanguageSettingEntry> entries) {
- List<ICLanguageSettingEntry> sortedEntries = new ArrayList<>(entries);
- Collections.sort(sortedEntries, new Comparator<ICLanguageSettingEntry>() {
- /**
- * This comparator sorts by kinds first and the macros are sorted additionally by name.
- */
- @Override
- public int compare(ICLanguageSettingEntry entry0, ICLanguageSettingEntry entry1) {
- int kind0 = entry0.getKind();
- int kind1 = entry1.getKind();
- if (kind0 == ICSettingEntry.MACRO && kind1 == ICSettingEntry.MACRO) {
- return entry0.getName().compareTo(entry1.getName());
- }
-
- return kind0 - kind1;
- }});
-
- return sortedEntries;
- }
-
- /**
- * Sets language settings entries for the resource and language.
- *
- * @param rcProjectPath - path to the resource relative to the project. If {@code null} the entries are
- * considered to be being defined as default entries for resources.
- * @param languageId - language id. If {@code null}, then entries are considered
- * to be defined for the language scope.
- * @param entries - language settings entries to set.
- */
- public void setSettingEntries(String rcProjectPath, String languageId,
- List<? extends ICLanguageSettingEntry> entries) {
- synchronized (fStorage) {
- if (entries!=null) {
- Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId);
- if (langMap == null) {
- langMap = new HashMap<String, List<ICLanguageSettingEntry>>();
- fStorage.put(languageId, langMap);
- }
- List<ICLanguageSettingEntry> sortedEntries = getPooledList(sortEntries(entries), false);
- langMap.put(rcProjectPath, sortedEntries);
- } else {
- // reduct the empty maps in the tables
- Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId);
- if (langMap != null) {
- langMap.remove(rcProjectPath);
- if (langMap.isEmpty()) {
- fStorage.remove(languageId);
- }
- }
- }
- }
- }
-
- /**
- * @return {@code true} if the storage is empty or {@code false} otherwise.
- */
- public boolean isEmpty() {
- return fStorage.isEmpty();
- }
-
- /**
- * Clear all the entries for all resources and all languages.
- */
- public void clear() {
- synchronized (fStorage) {
- fStorage.clear();
- }
- }
-
- /**
- * @return set of all languages associated with the entries.
- * Note that the storage can keep default entries for the language scope
- * of the provider, so the set can contain {@code null}.
- */
- public Set<String> getLanguages() {
- return new HashSet<String>(fStorage.keySet());
- }
-
- /**
- * Returns set of paths for all resources associated with entries for given language.
- * The paths are project relative.
- *
- * @param languageId - language ID.
- * @return the set of resource paths associated with entries for the given language or empty set.
- * Note that the storage can keep default entries for resources, so the set can contain {@code null}.
- */
- public Set<String> getResourcePaths(String languageId) {
- Map<String, List<ICLanguageSettingEntry>> rcPathsMap = fStorage.get(languageId);
- if (rcPathsMap == null) {
- return new HashSet<String>();
- }
- return new HashSet<String>(rcPathsMap.keySet());
- }
-
- /**
- * Find and return the equal list of entries from the pool.
- *
- * @param entries - list of entries to pool.
- * @param copy - specify {@code true} to copy the list in order to prevent
- * back-door modification on the original list changes.
- * @return returns the list of entries from the pool.
- */
- private static List<ICLanguageSettingEntry> getPooledList(List<ICLanguageSettingEntry> entries, boolean copy) {
- if (entries == null)
- return null;
-
- List<ICLanguageSettingEntry> pooledList = listPool.get(entries);
- if (pooledList != null) {
- return pooledList;
- }
-
- if (entries.size() == 0) {
- return getPooledEmptyList();
- }
-
- if (copy) {
- entries = new ArrayList<ICLanguageSettingEntry>(entries);
- }
- pooledList = Collections.unmodifiableList(entries);
- return listPool.add(pooledList);
- }
-
- /**
- * Find and return the equal list of entries from the pool to conserve the memory.
- *
- * @param entries - list of entries to pool.
- * @return returns the list of entries from the pool.
- */
- public static List<ICLanguageSettingEntry> getPooledList(List<ICLanguageSettingEntry> entries) {
- return getPooledList(entries, true);
- }
-
- /**
- * @return Returns the empty immutable list which is pooled. Use this call rather than creating
- * new empty array to ensure that faster shallow operator '==' can be used instead of equals()
- * which goes deep on HashMaps.
- */
- public static List<ICLanguageSettingEntry> getPooledEmptyList() {
- List<ICLanguageSettingEntry> pooledEmptyList = Collections.emptyList();
- return listPool.add(pooledEmptyList);
- }
-
- /**
- * Clone storage for the entries. Copies references for lists of entries as a whole.
- * Note that that is OK as the lists kept in storage are unmodifiable and pooled.
- */
- @Override
- public LanguageSettingsStorage clone() throws CloneNotSupportedException {
- LanguageSettingsStorage storageClone = (LanguageSettingsStorage) super.clone();
- storageClone.fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>();
- synchronized (fStorage) {
- Set<Entry<String, Map<String, List<ICLanguageSettingEntry>>>> entrySetLang = fStorage.entrySet();
- for (Entry<String, Map<String, List<ICLanguageSettingEntry>>> entryLang : entrySetLang) {
- String langId = entryLang.getKey();
- Map<String, List<ICLanguageSettingEntry>> mapRc = entryLang.getValue();
- Map<String, List<ICLanguageSettingEntry>> mapRcClone = new HashMap<String, List<ICLanguageSettingEntry>>();
- Set<Entry<String, List<ICLanguageSettingEntry>>> entrySetRc = mapRc.entrySet();
- for (Entry<String, List<ICLanguageSettingEntry>> entryRc : entrySetRc) {
- String rcProjectPath = entryRc.getKey();
- List<ICLanguageSettingEntry> lsEntries = entryRc.getValue();
- // don't need to clone entries, they are from the LSE lists pool
- mapRcClone.put(rcProjectPath, lsEntries);
- }
- storageClone.fStorage.put(langId, mapRcClone);
- }
- }
- return storageClone;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fStorage == null) ? 0 : fStorage.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- LanguageSettingsStorage other = (LanguageSettingsStorage) obj;
- if (fStorage == null) {
- if (other.fStorage != null)
- return false;
- } else if (!fStorage.equals(other.fStorage))
- return false;
- return true;
- }
-
-}
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.internal.core.WeakHashSet;
+import org.eclipse.cdt.internal.core.WeakHashSetSynchronized;
+
+/**
+ * The class representing the (in-memory) storage for language settings entries {@link ICLanguageSettingEntry}.
+ *
+ * @since 5.4
+ */
+public class LanguageSettingsStorage implements Cloneable {
+ /** Storage to keep settings entries. */
+ protected Map<String, // languageId
+ Map<String, // resource project path
+ List<ICLanguageSettingEntry>>> fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>();
+
+ /**
+ * Pool of LSE lists implemented as WeakHashSet. That allows to gain memory savings
+ * at the expense of CPU time. WeakHashSet handles garbage collection when a list is not
+ * referenced anywhere else. See JavaDoc {@link java.lang.ref.WeakReference} about weak reference objects.
+ */
+ private static WeakHashSet<List<ICLanguageSettingEntry>> listPool = new WeakHashSetSynchronized<List<ICLanguageSettingEntry>>();
+
+ /**
+ * Returns the list of setting entries for the given resource and language.
+ * <br> Note that this list is <b>unmodifiable</b>.
+ *
+ * @param rcProjectPath - path to the resource relative to the project.
+ * @param languageId - language id.
+ *
+ * @return the list of setting entries or {@code null} if no settings defined.
+ */
+ public List<ICLanguageSettingEntry> getSettingEntries(String rcProjectPath, String languageId) {
+ List<ICLanguageSettingEntry> entries = null;
+ Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId);
+ if (langMap!=null) {
+ entries = langMap.get(rcProjectPath);
+ }
+ return entries;
+ }
+
+ /**
+ * Some providers may collect entries in pretty much random order. For the intent of
+ * predictability, UI usability and efficient storage the entries are sorted by kinds
+ * and secondary by name for kinds where the secondary order is not significant.
+ *
+ * @param entries - list of entries to sort.
+ * @return - sorted entries.
+ */
+ private List<ICLanguageSettingEntry> sortEntries(List<? extends ICLanguageSettingEntry> entries) {
+ List<ICLanguageSettingEntry> sortedEntries = new ArrayList<>(entries);
+ Collections.sort(sortedEntries, new Comparator<ICLanguageSettingEntry>() {
+ /**
+ * This comparator sorts by kinds first and the macros are sorted additionally by name.
+ */
+ @Override
+ public int compare(ICLanguageSettingEntry entry0, ICLanguageSettingEntry entry1) {
+ int kind0 = entry0.getKind();
+ int kind1 = entry1.getKind();
+ if (kind0 == ICSettingEntry.MACRO && kind1 == ICSettingEntry.MACRO) {
+ return entry0.getName().compareTo(entry1.getName());
+ }
+
+ return kind0 - kind1;
+ }});
+
+ return sortedEntries;
+ }
+
+ /**
+ * Sets language settings entries for the resource and language.
+ *
+ * @param rcProjectPath - path to the resource relative to the project. If {@code null} the entries are
+ * considered to be being defined as default entries for resources.
+ * @param languageId - language id. If {@code null}, then entries are considered
+ * to be defined for the language scope.
+ * @param entries - language settings entries to set.
+ */
+ public void setSettingEntries(String rcProjectPath, String languageId,
+ List<? extends ICLanguageSettingEntry> entries) {
+ synchronized (fStorage) {
+ if (entries!=null) {
+ Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId);
+ if (langMap == null) {
+ langMap = new HashMap<String, List<ICLanguageSettingEntry>>();
+ fStorage.put(languageId, langMap);
+ }
+ List<ICLanguageSettingEntry> sortedEntries = getPooledList(sortEntries(entries), false);
+ langMap.put(rcProjectPath, sortedEntries);
+ } else {
+ // reduct the empty maps in the tables
+ Map<String, List<ICLanguageSettingEntry>> langMap = fStorage.get(languageId);
+ if (langMap != null) {
+ langMap.remove(rcProjectPath);
+ if (langMap.isEmpty()) {
+ fStorage.remove(languageId);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @return {@code true} if the storage is empty or {@code false} otherwise.
+ */
+ public boolean isEmpty() {
+ return fStorage.isEmpty();
+ }
+
+ /**
+ * Clear all the entries for all resources and all languages.
+ */
+ public void clear() {
+ synchronized (fStorage) {
+ fStorage.clear();
+ }
+ }
+
+ /**
+ * @return set of all languages associated with the entries.
+ * Note that the storage can keep default entries for the language scope
+ * of the provider, so the set can contain {@code null}.
+ */
+ public Set<String> getLanguages() {
+ return new HashSet<String>(fStorage.keySet());
+ }
+
+ /**
+ * Returns set of paths for all resources associated with entries for given language.
+ * The paths are project relative.
+ *
+ * @param languageId - language ID.
+ * @return the set of resource paths associated with entries for the given language or empty set.
+ * Note that the storage can keep default entries for resources, so the set can contain {@code null}.
+ */
+ public Set<String> getResourcePaths(String languageId) {
+ Map<String, List<ICLanguageSettingEntry>> rcPathsMap = fStorage.get(languageId);
+ if (rcPathsMap == null) {
+ return new HashSet<String>();
+ }
+ return new HashSet<String>(rcPathsMap.keySet());
+ }
+
+ /**
+ * Find and return the equal list of entries from the pool.
+ *
+ * @param entries - list of entries to pool.
+ * @param copy - specify {@code true} to copy the list in order to prevent
+ * back-door modification on the original list changes.
+ * @return returns the list of entries from the pool.
+ */
+ private static List<ICLanguageSettingEntry> getPooledList(List<ICLanguageSettingEntry> entries, boolean copy) {
+ if (entries == null)
+ return null;
+
+ List<ICLanguageSettingEntry> pooledList = listPool.get(entries);
+ if (pooledList != null) {
+ return pooledList;
+ }
+
+ if (entries.size() == 0) {
+ return getPooledEmptyList();
+ }
+
+ if (copy) {
+ entries = new ArrayList<ICLanguageSettingEntry>(entries);
+ }
+ pooledList = Collections.unmodifiableList(entries);
+ return listPool.add(pooledList);
+ }
+
+ /**
+ * Find and return the equal list of entries from the pool to conserve the memory.
+ *
+ * @param entries - list of entries to pool.
+ * @return returns the list of entries from the pool.
+ */
+ public static List<ICLanguageSettingEntry> getPooledList(List<ICLanguageSettingEntry> entries) {
+ return getPooledList(entries, true);
+ }
+
+ /**
+ * @return Returns the empty immutable list which is pooled. Use this call rather than creating
+ * new empty array to ensure that faster shallow operator '==' can be used instead of equals()
+ * which goes deep on HashMaps.
+ */
+ public static List<ICLanguageSettingEntry> getPooledEmptyList() {
+ List<ICLanguageSettingEntry> pooledEmptyList = Collections.emptyList();
+ return listPool.add(pooledEmptyList);
+ }
+
+ /**
+ * Clone storage for the entries. Copies references for lists of entries as a whole.
+ * Note that that is OK as the lists kept in storage are unmodifiable and pooled.
+ */
+ @Override
+ public LanguageSettingsStorage clone() throws CloneNotSupportedException {
+ LanguageSettingsStorage storageClone = (LanguageSettingsStorage) super.clone();
+ storageClone.fStorage = new HashMap<String, Map<String, List<ICLanguageSettingEntry>>>();
+ synchronized (fStorage) {
+ Set<Entry<String, Map<String, List<ICLanguageSettingEntry>>>> entrySetLang = fStorage.entrySet();
+ for (Entry<String, Map<String, List<ICLanguageSettingEntry>>> entryLang : entrySetLang) {
+ String langId = entryLang.getKey();
+ Map<String, List<ICLanguageSettingEntry>> mapRc = entryLang.getValue();
+ Map<String, List<ICLanguageSettingEntry>> mapRcClone = new HashMap<String, List<ICLanguageSettingEntry>>();
+ Set<Entry<String, List<ICLanguageSettingEntry>>> entrySetRc = mapRc.entrySet();
+ for (Entry<String, List<ICLanguageSettingEntry>> entryRc : entrySetRc) {
+ String rcProjectPath = entryRc.getKey();
+ List<ICLanguageSettingEntry> lsEntries = entryRc.getValue();
+ // don't need to clone entries, they are from the LSE lists pool
+ mapRcClone.put(rcProjectPath, lsEntries);
+ }
+ storageClone.fStorage.put(langId, mapRcClone);
+ }
+ }
+ return storageClone;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((fStorage == null) ? 0 : fStorage.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ LanguageSettingsStorage other = (LanguageSettingsStorage) obj;
+ if (fStorage == null) {
+ if (other.fStorage != null)
+ return false;
+ } else if (!fStorage.equals(other.fStorage))
+ return false;
+ return true;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java
index ab7b58ea51..6159f1641e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/ScannerDiscoveryLegacySupport.java
@@ -1,289 +1,289 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2013 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
- * Sergey Prigogin (Google)
- *******************************************************************************/
-
-package org.eclipse.cdt.core.language.settings.providers;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.internal.core.LocalProjectScope;
-import org.eclipse.cdt.internal.core.language.settings.providers.ReferencedProjectsLanguageSettingsProvider;
-import org.eclipse.cdt.internal.core.language.settings.providers.ScannerInfoExtensionLanguageSettingsProvider;
-import org.eclipse.cdt.internal.core.model.PathEntryManager;
-import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Collection of utilities for legacy support of older Scanner Discovery functionality.
- * This class is temporary and not intended to be used by clients.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- *
- * @since 5.4
- */
-public class ScannerDiscoveryLegacySupport {
- /** ID of User language settings provider (from org.eclipse.cdt.ui) */
- public static final String USER_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.ui.UserLanguageSettingsProvider"; //$NON-NLS-1$
- /** ID of MBS language settings provider (from org.eclipse.cdt.managedbuilder.core) */
- public static final String MBS_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider"; //$NON-NLS-1$
-
- /**
- * ID of ScannerInfo language settings provider wrapping ScannerInfoProvider defined by org.eclipse.cdt.core.ScannerInfoProvider extension point
- * @since 5.5
- */
- public static final String SI_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.core.LegacyScannerInfoLanguageSettingsProvider"; //$NON-NLS-1$
-
- /**
- * ID of language settings provider wrapping {@link org.eclipse.cdt.core.resources.ScannerProvider} of {@link PathEntryManager} for 3.X projects
- * @since 5.5
- */
- public static final String PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.core.PathEntryScannerInfoLanguageSettingsProvider"; //$NON-NLS-1$
-
- private static String DISABLE_LSP_PREFERENCE = "language.settings.providers.disabled"; //$NON-NLS-1$
- private static boolean DISABLE_LSP_DEFAULT_PROJECT = false;
- private static boolean DISABLE_LSP_DEFAULT_WORKSPACE = false;
- private static final String PREFERENCES_QUALIFIER_CCORE = CCorePlugin.PLUGIN_ID;
-
- private static Map<String, String> legacyProfiles = null;
-
- /**
- * Get preferences node for org.eclipse.cdt.core.
- *
- * @param project - project to get preferences or {@code null} for workspace preferences
- * @return
- */
- private static Preferences getPreferences(IProject project) {
- if (project == null) {
- return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER_CCORE);
- } else {
- return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER_CCORE);
- }
- }
-
- /**
- * Checks if Language Settings functionality is defined for given project in preferences.
- *
- * @param project - project to check the preference or {@code null} for workspace preference
- * @return {@code true} if functionality is defined
- *
- * @noreference This method is temporary and not intended to be referenced by clients.
- *
- * @since 5.5
- */
- public static boolean isLanguageSettingsProvidersFunctionalityDefined(IProject project) {
- Preferences pref = getPreferences(project);
- String value = pref.get(DISABLE_LSP_PREFERENCE, null);
- return value != null;
- }
-
- /**
- * Checks if Language Settings functionality is enabled for given project.
- * Note that disabling on workspace level will disable it for all projects.
- *
- * @param project - project to check the preference or {@code null} for workspace preference
- * @return {@code true} if functionality is enabled
- *
- * @noreference This method is temporary and not intended to be referenced by clients.
- */
- public static boolean isLanguageSettingsProvidersFunctionalityEnabled(IProject project) {
- boolean isEnabledInWorkspace = !getPreferences(null).getBoolean(DISABLE_LSP_PREFERENCE, DISABLE_LSP_DEFAULT_WORKSPACE);
- if (isEnabledInWorkspace && project != null) {
- return !getPreferences(project).getBoolean(DISABLE_LSP_PREFERENCE, DISABLE_LSP_DEFAULT_PROJECT);
- }
- return isEnabledInWorkspace;
- }
-
- /**
- * Enable/disable Language Settings functionality for the given project.
- *
- * @param project or {@code null} for workspace preference
- * @param value {@code true} to enable or {@code false} to disable the functionality.
- *
- * @noreference This method is temporary and not intended to be referenced by clients.
- */
- public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) {
- Preferences pref = getPreferences(project);
- if (value == isLanguageSettingsProvidersFunctionalityEnabled(project))
- return;
- pref.putBoolean(DISABLE_LSP_PREFERENCE, !value);
- // Scanner info provider have changed - clear the cached copy (http://bugs.eclipse.org/413357).
- CCorePlugin.getDefault().resetCachedScannerInfoProvider(project);
- try {
- pref.flush();
- } catch (BackingStoreException e) {
- CCorePlugin.log(e);
- }
- }
-
- /**
- * Check if legacy Scanner Discovery in MBS should be active.
- * @noreference This is internal helper method to support compatibility with previous versions
- * which is not intended to be referenced by clients.
- */
- public static boolean isMbsLanguageSettingsProviderOn(ICConfigurationDescription cfgDescription) {
- if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
- List<ILanguageSettingsProvider> lsProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
- for (ILanguageSettingsProvider lsp : lsProviders) {
- if (MBS_LANGUAGE_SETTINGS_PROVIDER_ID.equals(lsp.getId())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Check if legacy Scanner Discovery should be active.
- * which is not intended to be referenced by clients.
- */
- private static boolean isLegacyProviderOn(ICConfigurationDescription cfgDescription) {
- if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
- List<ILanguageSettingsProvider> lsProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
- for (ILanguageSettingsProvider lsp : lsProviders) {
- String id = lsp.getId();
- if (MBS_LANGUAGE_SETTINGS_PROVIDER_ID.equals(id) || SI_LANGUAGE_SETTINGS_PROVIDER_ID.equals(id) || PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID.equals(id)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * @noreference This is internal helper method to support compatibility with previous versions
- * which is not intended to be referenced by clients.
- */
- public static boolean isLegacyScannerDiscoveryOn(ICConfigurationDescription cfgDescription) {
- IProject project = null;
- if (cfgDescription != null) {
- ICProjectDescription prjDescription = cfgDescription.getProjectDescription();
- if (prjDescription != null) {
- project = prjDescription.getProject();
- }
- }
- return !isLanguageSettingsProvidersFunctionalityEnabled(project) || isLegacyProviderOn(cfgDescription);
- }
-
- /**
- * @noreference This is internal helper method to support compatibility with previous versions
- * which is not intended to be referenced by clients.
- */
- public static boolean isLegacyScannerDiscoveryOn(IProject project) {
- ICConfigurationDescription cfgDescription = null;
- ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project);
- if (prjDescription != null) {
- cfgDescription = prjDescription.getActiveConfiguration();
- }
- return !isLanguageSettingsProvidersFunctionalityEnabled(project) || isLegacyProviderOn(cfgDescription);
- }
-
- /**
- * Return list containing User provider and one of wrapper providers to support legacy projects (backward compatibility).
- *
- * @noreference This is internal helper method to support compatibility with previous versions
- * which is not intended to be referenced by clients.
- * @since 5.5
- */
- public static String[] getDefaultProviderIdsLegacy(ICConfigurationDescription cfgDescription) {
- boolean useScannerInfoProviderExtension = new ScannerInfoExtensionLanguageSettingsProvider().getScannerInfoProvider(cfgDescription) != null;
- String legacyProviderId;
- if (useScannerInfoProviderExtension) {
- legacyProviderId = SI_LANGUAGE_SETTINGS_PROVIDER_ID;
- } else if (CProjectDescriptionManager.getInstance().isNewStyleCfg(cfgDescription)) {
- legacyProviderId = MBS_LANGUAGE_SETTINGS_PROVIDER_ID;
- } else {
- legacyProviderId = PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID;
- }
-
- return new String[] {USER_LANGUAGE_SETTINGS_PROVIDER_ID, ReferencedProjectsLanguageSettingsProvider.ID, legacyProviderId};
- }
-
- /**
- * Checks if the provider is applicable for configuration from backward compatibility point of view
- *
- * @noreference This is internal helper method to support compatibility with previous versions
- * which is not intended to be referenced by clients.
- * @since 5.5
- */
- public static boolean isProviderCompatible(String providerId, ICConfigurationDescription cfgDescription) {
- if (cfgDescription != null) {
- boolean useScannerInfoProviderExtension = new ScannerInfoExtensionLanguageSettingsProvider().getScannerInfoProvider(cfgDescription) != null;
- if (SI_LANGUAGE_SETTINGS_PROVIDER_ID.equals(providerId)) {
- return useScannerInfoProviderExtension;
- }
-
- boolean isNewStyleCfg = CProjectDescriptionManager.getInstance().isNewStyleCfg(cfgDescription);
- if (MBS_LANGUAGE_SETTINGS_PROVIDER_ID.equals(providerId)) {
- return !useScannerInfoProviderExtension && isNewStyleCfg;
- }
-
- if (PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID.equals(providerId)) {
- return !useScannerInfoProviderExtension && !isNewStyleCfg;
- }
- }
-
- return true;
- }
-
- /**
- * If not defined yet, define property that controls if language settings providers functionality enabled for a given project.
- * Workspace preference is checked and the project property is set to match it.
- *
- * @param project - project to define enablement.
- * @since 5.5
- */
- public static void defineLanguageSettingsEnablement(IProject project) {
- if (project != null && ! ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityDefined(project)) {
- boolean isPreferenceEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null);
- ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isPreferenceEnabled);
- }
- }
-
- /**
- * Returns the values of scanner discovery profiles (scannerConfigDiscoveryProfileId) which were deprecated
- * and replaced with language settings providers in plugin.xml.
- * This (temporary) function serves as fail-safe switch during the transition.
- *
- * @param id - can be id of either org.eclipse.cdt.managedbuilder.internal.core.InputType
- * or org.eclipse.cdt.managedbuilder.internal.core.ToolChain.
- * @return legacy scannerConfigDiscoveryProfileId.
- */
- @SuppressWarnings("nls")
- public static String getDeprecatedLegacyProfiles(String id) {
- if (legacyProfiles == null) {
- legacyProfiles = new HashMap<String, String>();
-
- // InputTypes
- legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
- legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
- legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC");
- legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP");
- legacyProfiles.put("cdt.managedbuild.tool.xlc.c.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile");
- legacyProfiles.put("cdt.managedbuild.tool.xlc.cpp.c.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile");
- legacyProfiles.put("cdt.managedbuild.tool.xlc.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP");
-
- // Toolchains
- }
-
- return legacyProfiles.get(id);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
+ * Sergey Prigogin (Google)
+ *******************************************************************************/
+
+package org.eclipse.cdt.core.language.settings.providers;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.internal.core.LocalProjectScope;
+import org.eclipse.cdt.internal.core.language.settings.providers.ReferencedProjectsLanguageSettingsProvider;
+import org.eclipse.cdt.internal.core.language.settings.providers.ScannerInfoExtensionLanguageSettingsProvider;
+import org.eclipse.cdt.internal.core.model.PathEntryManager;
+import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+/**
+ * Collection of utilities for legacy support of older Scanner Discovery functionality.
+ * This class is temporary and not intended to be used by clients.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ *
+ * @since 5.4
+ */
+public class ScannerDiscoveryLegacySupport {
+ /** ID of User language settings provider (from org.eclipse.cdt.ui) */
+ public static final String USER_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.ui.UserLanguageSettingsProvider"; //$NON-NLS-1$
+ /** ID of MBS language settings provider (from org.eclipse.cdt.managedbuilder.core) */
+ public static final String MBS_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider"; //$NON-NLS-1$
+
+ /**
+ * ID of ScannerInfo language settings provider wrapping ScannerInfoProvider defined by org.eclipse.cdt.core.ScannerInfoProvider extension point
+ * @since 5.5
+ */
+ public static final String SI_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.core.LegacyScannerInfoLanguageSettingsProvider"; //$NON-NLS-1$
+
+ /**
+ * ID of language settings provider wrapping {@link org.eclipse.cdt.core.resources.ScannerProvider} of {@link PathEntryManager} for 3.X projects
+ * @since 5.5
+ */
+ public static final String PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.core.PathEntryScannerInfoLanguageSettingsProvider"; //$NON-NLS-1$
+
+ private static String DISABLE_LSP_PREFERENCE = "language.settings.providers.disabled"; //$NON-NLS-1$
+ private static boolean DISABLE_LSP_DEFAULT_PROJECT = false;
+ private static boolean DISABLE_LSP_DEFAULT_WORKSPACE = false;
+ private static final String PREFERENCES_QUALIFIER_CCORE = CCorePlugin.PLUGIN_ID;
+
+ private static Map<String, String> legacyProfiles = null;
+
+ /**
+ * Get preferences node for org.eclipse.cdt.core.
+ *
+ * @param project - project to get preferences or {@code null} for workspace preferences
+ * @return
+ */
+ private static Preferences getPreferences(IProject project) {
+ if (project == null) {
+ return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER_CCORE);
+ } else {
+ return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER_CCORE);
+ }
+ }
+
+ /**
+ * Checks if Language Settings functionality is defined for given project in preferences.
+ *
+ * @param project - project to check the preference or {@code null} for workspace preference
+ * @return {@code true} if functionality is defined
+ *
+ * @noreference This method is temporary and not intended to be referenced by clients.
+ *
+ * @since 5.5
+ */
+ public static boolean isLanguageSettingsProvidersFunctionalityDefined(IProject project) {
+ Preferences pref = getPreferences(project);
+ String value = pref.get(DISABLE_LSP_PREFERENCE, null);
+ return value != null;
+ }
+
+ /**
+ * Checks if Language Settings functionality is enabled for given project.
+ * Note that disabling on workspace level will disable it for all projects.
+ *
+ * @param project - project to check the preference or {@code null} for workspace preference
+ * @return {@code true} if functionality is enabled
+ *
+ * @noreference This method is temporary and not intended to be referenced by clients.
+ */
+ public static boolean isLanguageSettingsProvidersFunctionalityEnabled(IProject project) {
+ boolean isEnabledInWorkspace = !getPreferences(null).getBoolean(DISABLE_LSP_PREFERENCE, DISABLE_LSP_DEFAULT_WORKSPACE);
+ if (isEnabledInWorkspace && project != null) {
+ return !getPreferences(project).getBoolean(DISABLE_LSP_PREFERENCE, DISABLE_LSP_DEFAULT_PROJECT);
+ }
+ return isEnabledInWorkspace;
+ }
+
+ /**
+ * Enable/disable Language Settings functionality for the given project.
+ *
+ * @param project or {@code null} for workspace preference
+ * @param value {@code true} to enable or {@code false} to disable the functionality.
+ *
+ * @noreference This method is temporary and not intended to be referenced by clients.
+ */
+ public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) {
+ Preferences pref = getPreferences(project);
+ if (value == isLanguageSettingsProvidersFunctionalityEnabled(project))
+ return;
+ pref.putBoolean(DISABLE_LSP_PREFERENCE, !value);
+ // Scanner info provider have changed - clear the cached copy (http://bugs.eclipse.org/413357).
+ CCorePlugin.getDefault().resetCachedScannerInfoProvider(project);
+ try {
+ pref.flush();
+ } catch (BackingStoreException e) {
+ CCorePlugin.log(e);
+ }
+ }
+
+ /**
+ * Check if legacy Scanner Discovery in MBS should be active.
+ * @noreference This is internal helper method to support compatibility with previous versions
+ * which is not intended to be referenced by clients.
+ */
+ public static boolean isMbsLanguageSettingsProviderOn(ICConfigurationDescription cfgDescription) {
+ if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List<ILanguageSettingsProvider> lsProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ for (ILanguageSettingsProvider lsp : lsProviders) {
+ if (MBS_LANGUAGE_SETTINGS_PROVIDER_ID.equals(lsp.getId())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check if legacy Scanner Discovery should be active.
+ * which is not intended to be referenced by clients.
+ */
+ private static boolean isLegacyProviderOn(ICConfigurationDescription cfgDescription) {
+ if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
+ List<ILanguageSettingsProvider> lsProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ for (ILanguageSettingsProvider lsp : lsProviders) {
+ String id = lsp.getId();
+ if (MBS_LANGUAGE_SETTINGS_PROVIDER_ID.equals(id) || SI_LANGUAGE_SETTINGS_PROVIDER_ID.equals(id) || PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID.equals(id)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @noreference This is internal helper method to support compatibility with previous versions
+ * which is not intended to be referenced by clients.
+ */
+ public static boolean isLegacyScannerDiscoveryOn(ICConfigurationDescription cfgDescription) {
+ IProject project = null;
+ if (cfgDescription != null) {
+ ICProjectDescription prjDescription = cfgDescription.getProjectDescription();
+ if (prjDescription != null) {
+ project = prjDescription.getProject();
+ }
+ }
+ return !isLanguageSettingsProvidersFunctionalityEnabled(project) || isLegacyProviderOn(cfgDescription);
+ }
+
+ /**
+ * @noreference This is internal helper method to support compatibility with previous versions
+ * which is not intended to be referenced by clients.
+ */
+ public static boolean isLegacyScannerDiscoveryOn(IProject project) {
+ ICConfigurationDescription cfgDescription = null;
+ ICProjectDescription prjDescription = CoreModel.getDefault().getProjectDescription(project);
+ if (prjDescription != null) {
+ cfgDescription = prjDescription.getActiveConfiguration();
+ }
+ return !isLanguageSettingsProvidersFunctionalityEnabled(project) || isLegacyProviderOn(cfgDescription);
+ }
+
+ /**
+ * Return list containing User provider and one of wrapper providers to support legacy projects (backward compatibility).
+ *
+ * @noreference This is internal helper method to support compatibility with previous versions
+ * which is not intended to be referenced by clients.
+ * @since 5.5
+ */
+ public static String[] getDefaultProviderIdsLegacy(ICConfigurationDescription cfgDescription) {
+ boolean useScannerInfoProviderExtension = new ScannerInfoExtensionLanguageSettingsProvider().getScannerInfoProvider(cfgDescription) != null;
+ String legacyProviderId;
+ if (useScannerInfoProviderExtension) {
+ legacyProviderId = SI_LANGUAGE_SETTINGS_PROVIDER_ID;
+ } else if (CProjectDescriptionManager.getInstance().isNewStyleCfg(cfgDescription)) {
+ legacyProviderId = MBS_LANGUAGE_SETTINGS_PROVIDER_ID;
+ } else {
+ legacyProviderId = PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID;
+ }
+
+ return new String[] {USER_LANGUAGE_SETTINGS_PROVIDER_ID, ReferencedProjectsLanguageSettingsProvider.ID, legacyProviderId};
+ }
+
+ /**
+ * Checks if the provider is applicable for configuration from backward compatibility point of view
+ *
+ * @noreference This is internal helper method to support compatibility with previous versions
+ * which is not intended to be referenced by clients.
+ * @since 5.5
+ */
+ public static boolean isProviderCompatible(String providerId, ICConfigurationDescription cfgDescription) {
+ if (cfgDescription != null) {
+ boolean useScannerInfoProviderExtension = new ScannerInfoExtensionLanguageSettingsProvider().getScannerInfoProvider(cfgDescription) != null;
+ if (SI_LANGUAGE_SETTINGS_PROVIDER_ID.equals(providerId)) {
+ return useScannerInfoProviderExtension;
+ }
+
+ boolean isNewStyleCfg = CProjectDescriptionManager.getInstance().isNewStyleCfg(cfgDescription);
+ if (MBS_LANGUAGE_SETTINGS_PROVIDER_ID.equals(providerId)) {
+ return !useScannerInfoProviderExtension && isNewStyleCfg;
+ }
+
+ if (PATH_ENTRY_MANAGER_LANGUAGE_SETTINGS_PROVIDER_ID.equals(providerId)) {
+ return !useScannerInfoProviderExtension && !isNewStyleCfg;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * If not defined yet, define property that controls if language settings providers functionality enabled for a given project.
+ * Workspace preference is checked and the project property is set to match it.
+ *
+ * @param project - project to define enablement.
+ * @since 5.5
+ */
+ public static void defineLanguageSettingsEnablement(IProject project) {
+ if (project != null && ! ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityDefined(project)) {
+ boolean isPreferenceEnabled = ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null);
+ ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, isPreferenceEnabled);
+ }
+ }
+
+ /**
+ * Returns the values of scanner discovery profiles (scannerConfigDiscoveryProfileId) which were deprecated
+ * and replaced with language settings providers in plugin.xml.
+ * This (temporary) function serves as fail-safe switch during the transition.
+ *
+ * @param id - can be id of either org.eclipse.cdt.managedbuilder.internal.core.InputType
+ * or org.eclipse.cdt.managedbuilder.internal.core.ToolChain.
+ * @return legacy scannerConfigDiscoveryProfileId.
+ */
+ @SuppressWarnings("nls")
+ public static String getDeprecatedLegacyProfiles(String id) {
+ if (legacyProfiles == null) {
+ legacyProfiles = new HashMap<String, String>();
+
+ // InputTypes
+ legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
+ legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
+ legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC");
+ legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP");
+ legacyProfiles.put("cdt.managedbuild.tool.xlc.c.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile");
+ legacyProfiles.put("cdt.managedbuild.tool.xlc.cpp.c.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile");
+ legacyProfiles.put("cdt.managedbuild.tool.xlc.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP");
+
+ // Toolchains
+ }
+
+ return legacyProfiles.get(id);
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java
index 1cb99ec7ee..be3ed312b7 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java
@@ -1,437 +1,437 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2014 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- * Anton Leherbauer (Wind River Systems)
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Anton Leherbauer (Wind River Systems)
*******************************************************************************/
-package org.eclipse.cdt.core.model;
-
-import java.net.URI;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Common protocol for all elements provided by the C model.
- *
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface ICElement extends IAdaptable {
- /** @since 5.6 */
- public static final ICElement[] EMPTY_ARRAY = {};
-
- /**
- * IResource from 10-20
- */
-
- /**
- * Constant representing a C Root workspace (IWorkspaceRoot object).
- * A C element with this type can be safely cast to <code>ICModel</code>.
- */
- static final int C_MODEL = 10;
-
- /**
- * Constant representing a C project (IProject object).
- * A C element with this type can be safely cast to <code>ICProject</code>.
- */
- static final int C_PROJECT = 11;
-
- /**
- * Constant representing a folder (ICContainer object).
- * A C element with this type can be safely cast to <code>ICContainer</code>.
- */
- static final int C_CCONTAINER = 12;
-
- static final int C_BINARY = 14;
-
- static final int C_ARCHIVE = 18;
- /**
- * Virtual container serving as a place holder.
- */
- static final int C_VCONTAINER = 30;
-
- /**
- * Constant representing a C/C++ children of a Translation Unit
- */
- static final int C_UNIT = 60;
-
- /**
- * Namespace.
- */
- static final int C_NAMESPACE = 61;
-
- /**
- * Using.
- */
- static final int C_USING = 62;
-
- /**
- * Enumeration.
- */
- static final int C_ENUMERATION = 63;
-
- /**
- * Declaration of a class without the definition.
- * class C;
- */
- static final int C_CLASS_DECLARATION = 64;
-
- /**
- * Constant representing a class structure.
- */
- static final int C_CLASS = 65;
-
- /**
- * Declaration of a structure without the definition.
- * struct C;
- */
- static final int C_STRUCT_DECLARATION = 66;
-
- /**
- * Constant representing a struct structure.
- */
- static final int C_STRUCT = 67;
-
- /**
- * Declaration of a union without the definition.
- * struct C;
- */
- static final int C_UNION_DECLARATION = 68;
-
- /**
- * Constant representing a union structure.
- */
- static final int C_UNION = 69;
-
- /**
- * A method definition part of a structure(class, struct, union).
- */
- static final int C_METHOD = 70;
-
- /**
- * A method declaration part of a structure(class, struct, union).
- */
- static final int C_METHOD_DECLARATION = 71;
-
- /**
- * A Field definition part of a structure(class, struct, union).
- */
- static final int C_FIELD = 72;
-
- /**
- * a C/C++ function prototype.
- */
- static final int C_FUNCTION_DECLARATION = 73;
-
- /**
- * a C/C++ function definition.
- */
- static final int C_FUNCTION = 74;
-
- /**
- * Preprocessor #include directive.
- */
- static final int C_INCLUDE = 75;
-
- /**
- * Global variable.
- */
- static final int C_VARIABLE = 76;
-
- /**
- * variable Declaration.
- */
- static final int C_VARIABLE_DECLARATION = 77;
-
- /**
- * Local Variable.
- */
- static final int C_VARIABLE_LOCAL = 78;
-
- /**
- * A preprocessor macro.
- */
- static final int C_MACRO = 79;
-
- /**
- * a Typedef.
- */
- static final int C_TYPEDEF = 80;
-
- /**
- * Enumerator.
- */
- static final int C_ENUMERATOR = 81;
-
- /**
- * C++ template class declaration without a definition.
- */
- static final int C_TEMPLATE_CLASS_DECLARATION = 82;
-
- /**
- * C++ template class with definition.
- */
- static final int C_TEMPLATE_CLASS = 83;
-
- /**
- * C++ template struct.
- */
- static final int C_TEMPLATE_STRUCT_DECLARATION = 84;
-
- /**
- * C++ template struct.
- */
- static final int C_TEMPLATE_STRUCT = 85;
-
- /**
- * C++ template union.
- */
- static final int C_TEMPLATE_UNION_DECLARATION = 86;
-
- /**
- * C++ template union.
- */
- static final int C_TEMPLATE_UNION = 87;
-
- /**
- * C++ template function declaration.
- */
- static final int C_TEMPLATE_FUNCTION_DECLARATION = 88;
-
- /**
- * C++ template function.
- */
- static final int C_TEMPLATE_FUNCTION = 89;
-
- /**
- * C++ template method.
- */
- static final int C_TEMPLATE_METHOD_DECLARATION = 90;
-
- /**
- * C++ template method.
- */
- static final int C_TEMPLATE_METHOD = 91;
-
- /**
- * C++ template variable.
- */
- static final int C_TEMPLATE_VARIABLE = 92;
-
- /**
- * An unknown ICElement. Mainly used to determine what elements are not yet implemented.
- * i.e. the new DOM Parser supports open declaration on labels, while the old parser did not
- */
- static final int C_UNKNOWN_DECLARATION = 93;
-
- /**
- * Assembly label.
- *
- * @since 5.0
- */
- static final int ASM_LABEL= 94;
-
- /**
- * @deprecated use {@link IMethodDeclaration#isConstructor()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int C_CLASS_CTOR = 0x100;
-
- /**
- * @deprecated use {@link IMethodDeclaration#isDestructor()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int C_CLASS_DTOR = 0x200;
-
- /**
- * @deprecated use {@link IDeclaration#isStatic()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int C_STORAGE_STATIC = 0x400;
-
- /**
- * @deprecated not used anymore
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int C_STORAGE_EXTERN = 0x800;
-
- /**
- * @deprecated use {@link IMember#getVisibility()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int CPP_PRIVATE = 0x1000;
-
- /**
- * @deprecated use {@link IMember#getVisibility()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int CPP_PUBLIC = 0x2000;
-
- /**
- * @deprecated use {@link IMember#getVisibility()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int CPP_PROTECTED = 0x4000;
- /**
- * @deprecated use {@link IMethodDeclaration#isFriend()}
- * @noreference This field is not intended to be referenced by clients.
- */
- @Deprecated
- static final int CPP_FRIEND = 0x8000;
-
- /**
- * Returns whether this C element exists in the model.
- *
- * @return {@code true} if this element exists in the C model
- */
- boolean exists();
-
- /**
- * Returns the first ancestor of this C element that has the given type.
- * Returns {@code null} if no such an ancestor can be found.
- * This is a handle-only method.
- *
- * @param ancestorType the given type
- * @return the first ancestor of this C element that has the given type, {@code null} if no such
- * an ancestor can be found
- * @since 2.0
- */
- ICElement getAncestor(int ancestorType);
-
- /**
- * Returns the name of this element.
- *
- * @return the element name
- */
- String getElementName();
-
- /**
- * Returns this element's kind encoded as an integer.
- * This is a handle-only method.
- *
- * @return the kind of element; one of the constants declared in {@link ICElement}
- */
- int getElementType();
-
- /**
- * Returns the C model.
- *
- * @return the C model
- */
- ICModel getCModel();
-
- /**
- * Returns the C project this element is contained in, or {@code null} if this element
- * is not contained in any C project
- *
- * @return the containing C project, or {@code null} if this element is
- * not contained in a C project
- */
- ICProject getCProject();
-
- /**
- * Returns the element directly containing this element,
- * or {@code null} if this element has no parent.
- *
- * @return the parent element, or {@code null} if this element has no parent
- */
- ICElement getParent();
-
- /**
- * Returns the path to the innermost resource enclosing this element.
- * If this element is not included in an external archive,
- * the path returned is the full, absolute path to the underlying resource,
- * relative to the workbench.
- * If this element is included in an external archive,
- * the path returned is the absolute path to the archive in the file system.
- * This is a handle-only method.
- */
- IPath getPath();
-
- /**
- * Returns an absolute URI corresponding to the innermost file enclosing this element.
- *
- * @since 5.0
- * @return the URI corresponding to the location
- */
- URI getLocationURI();
-
- /**
- * Returns the underlying resource that contains this element, or {@code null} if this element
- * is not contained in a resource.
- *
- * @return the underlying resource, or {@code null} if none
- */
- IResource getUnderlyingResource();
-
- /**
- * Returns the corresponding resource for this element, or {@code null} if this element
- * does not have a corresponding resource.
- *
- * @return the corresponding resource, or {@code null} if none
- */
- IResource getResource();
-
- /**
- * Returns whether this C element is read-only. An element is read-only
- * if its structure cannot be modified by the C model.
- *
- * @return {@code true} if this element is read-only
- */
- boolean isReadOnly();
-
- /**
- * Returns whether the structure of this element is known. For example, for a
- * translation unit that could not be parsed, {@code false} is returned.
- * If the structure of an element is unknown, navigations will return reasonable
- * defaults. For example, {@code getChildren} will return an empty collection.
- * <p>
- * Note: This does not imply anything about consistency with the
- * underlying resource/buffer contents.
- *
- * @return {@code true} if the structure of this element is known
- * @exception CModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
- */
- boolean isStructureKnown() throws CModelException;
-
- /**
- * Accept a visitor and walk the ICElement tree with it.
- *
- * @param visitor
- * @throws CModelException
- */
- void accept(ICElementVisitor visitor) throws CoreException;
-
- /**
- * Returns a string representation of this element handle. The format of the
- * string is not specified; however, the identifier is stable across
- * workspace sessions, and can be used to recreate this handle via the
- * <code>CoreModel.create(String)</code> method.
- * <p>
- * Some element types, like binaries, do not support handle identifiers and
- * return {@code null}.
- *
- * @return the string handle identifier, or {@code null} if the element type is not supported
- * @see CoreModel#create(java.lang.String)
- *
- * @since 5.0
- */
- String getHandleIdentifier();
-}
+package org.eclipse.cdt.core.model;
+
+import java.net.URI;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Common protocol for all elements provided by the C model.
+ *
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface ICElement extends IAdaptable {
+ /** @since 5.6 */
+ public static final ICElement[] EMPTY_ARRAY = {};
+
+ /**
+ * IResource from 10-20
+ */
+
+ /**
+ * Constant representing a C Root workspace (IWorkspaceRoot object).
+ * A C element with this type can be safely cast to <code>ICModel</code>.
+ */
+ static final int C_MODEL = 10;
+
+ /**
+ * Constant representing a C project (IProject object).
+ * A C element with this type can be safely cast to <code>ICProject</code>.
+ */
+ static final int C_PROJECT = 11;
+
+ /**
+ * Constant representing a folder (ICContainer object).
+ * A C element with this type can be safely cast to <code>ICContainer</code>.
+ */
+ static final int C_CCONTAINER = 12;
+
+ static final int C_BINARY = 14;
+
+ static final int C_ARCHIVE = 18;
+ /**
+ * Virtual container serving as a place holder.
+ */
+ static final int C_VCONTAINER = 30;
+
+ /**
+ * Constant representing a C/C++ children of a Translation Unit
+ */
+ static final int C_UNIT = 60;
+
+ /**
+ * Namespace.
+ */
+ static final int C_NAMESPACE = 61;
+
+ /**
+ * Using.
+ */
+ static final int C_USING = 62;
+
+ /**
+ * Enumeration.
+ */
+ static final int C_ENUMERATION = 63;
+
+ /**
+ * Declaration of a class without the definition.
+ * class C;
+ */
+ static final int C_CLASS_DECLARATION = 64;
+
+ /**
+ * Constant representing a class structure.
+ */
+ static final int C_CLASS = 65;
+
+ /**
+ * Declaration of a structure without the definition.
+ * struct C;
+ */
+ static final int C_STRUCT_DECLARATION = 66;
+
+ /**
+ * Constant representing a struct structure.
+ */
+ static final int C_STRUCT = 67;
+
+ /**
+ * Declaration of a union without the definition.
+ * struct C;
+ */
+ static final int C_UNION_DECLARATION = 68;
+
+ /**
+ * Constant representing a union structure.
+ */
+ static final int C_UNION = 69;
+
+ /**
+ * A method definition part of a structure(class, struct, union).
+ */
+ static final int C_METHOD = 70;
+
+ /**
+ * A method declaration part of a structure(class, struct, union).
+ */
+ static final int C_METHOD_DECLARATION = 71;
+
+ /**
+ * A Field definition part of a structure(class, struct, union).
+ */
+ static final int C_FIELD = 72;
+
+ /**
+ * a C/C++ function prototype.
+ */
+ static final int C_FUNCTION_DECLARATION = 73;
+
+ /**
+ * a C/C++ function definition.
+ */
+ static final int C_FUNCTION = 74;
+
+ /**
+ * Preprocessor #include directive.
+ */
+ static final int C_INCLUDE = 75;
+
+ /**
+ * Global variable.
+ */
+ static final int C_VARIABLE = 76;
+
+ /**
+ * variable Declaration.
+ */
+ static final int C_VARIABLE_DECLARATION = 77;
+
+ /**
+ * Local Variable.
+ */
+ static final int C_VARIABLE_LOCAL = 78;
+
+ /**
+ * A preprocessor macro.
+ */
+ static final int C_MACRO = 79;
+
+ /**
+ * a Typedef.
+ */
+ static final int C_TYPEDEF = 80;
+
+ /**
+ * Enumerator.
+ */
+ static final int C_ENUMERATOR = 81;
+
+ /**
+ * C++ template class declaration without a definition.
+ */
+ static final int C_TEMPLATE_CLASS_DECLARATION = 82;
+
+ /**
+ * C++ template class with definition.
+ */
+ static final int C_TEMPLATE_CLASS = 83;
+
+ /**
+ * C++ template struct.
+ */
+ static final int C_TEMPLATE_STRUCT_DECLARATION = 84;
+
+ /**
+ * C++ template struct.
+ */
+ static final int C_TEMPLATE_STRUCT = 85;
+
+ /**
+ * C++ template union.
+ */
+ static final int C_TEMPLATE_UNION_DECLARATION = 86;
+
+ /**
+ * C++ template union.
+ */
+ static final int C_TEMPLATE_UNION = 87;
+
+ /**
+ * C++ template function declaration.
+ */
+ static final int C_TEMPLATE_FUNCTION_DECLARATION = 88;
+
+ /**
+ * C++ template function.
+ */
+ static final int C_TEMPLATE_FUNCTION = 89;
+
+ /**
+ * C++ template method.
+ */
+ static final int C_TEMPLATE_METHOD_DECLARATION = 90;
+
+ /**
+ * C++ template method.
+ */
+ static final int C_TEMPLATE_METHOD = 91;
+
+ /**
+ * C++ template variable.
+ */
+ static final int C_TEMPLATE_VARIABLE = 92;
+
+ /**
+ * An unknown ICElement. Mainly used to determine what elements are not yet implemented.
+ * i.e. the new DOM Parser supports open declaration on labels, while the old parser did not
+ */
+ static final int C_UNKNOWN_DECLARATION = 93;
+
+ /**
+ * Assembly label.
+ *
+ * @since 5.0
+ */
+ static final int ASM_LABEL= 94;
+
+ /**
+ * @deprecated use {@link IMethodDeclaration#isConstructor()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int C_CLASS_CTOR = 0x100;
+
+ /**
+ * @deprecated use {@link IMethodDeclaration#isDestructor()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int C_CLASS_DTOR = 0x200;
+
+ /**
+ * @deprecated use {@link IDeclaration#isStatic()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int C_STORAGE_STATIC = 0x400;
+
+ /**
+ * @deprecated not used anymore
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int C_STORAGE_EXTERN = 0x800;
+
+ /**
+ * @deprecated use {@link IMember#getVisibility()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int CPP_PRIVATE = 0x1000;
+
+ /**
+ * @deprecated use {@link IMember#getVisibility()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int CPP_PUBLIC = 0x2000;
+
+ /**
+ * @deprecated use {@link IMember#getVisibility()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int CPP_PROTECTED = 0x4000;
+ /**
+ * @deprecated use {@link IMethodDeclaration#isFriend()}
+ * @noreference This field is not intended to be referenced by clients.
+ */
+ @Deprecated
+ static final int CPP_FRIEND = 0x8000;
+
+ /**
+ * Returns whether this C element exists in the model.
+ *
+ * @return {@code true} if this element exists in the C model
+ */
+ boolean exists();
+
+ /**
+ * Returns the first ancestor of this C element that has the given type.
+ * Returns {@code null} if no such an ancestor can be found.
+ * This is a handle-only method.
+ *
+ * @param ancestorType the given type
+ * @return the first ancestor of this C element that has the given type, {@code null} if no such
+ * an ancestor can be found
+ * @since 2.0
+ */
+ ICElement getAncestor(int ancestorType);
+
+ /**
+ * Returns the name of this element.
+ *
+ * @return the element name
+ */
+ String getElementName();
+
+ /**
+ * Returns this element's kind encoded as an integer.
+ * This is a handle-only method.
+ *
+ * @return the kind of element; one of the constants declared in {@link ICElement}
+ */
+ int getElementType();
+
+ /**
+ * Returns the C model.
+ *
+ * @return the C model
+ */
+ ICModel getCModel();
+
+ /**
+ * Returns the C project this element is contained in, or {@code null} if this element
+ * is not contained in any C project
+ *
+ * @return the containing C project, or {@code null} if this element is
+ * not contained in a C project
+ */
+ ICProject getCProject();
+
+ /**
+ * Returns the element directly containing this element,
+ * or {@code null} if this element has no parent.
+ *
+ * @return the parent element, or {@code null} if this element has no parent
+ */
+ ICElement getParent();
+
+ /**
+ * Returns the path to the innermost resource enclosing this element.
+ * If this element is not included in an external archive,
+ * the path returned is the full, absolute path to the underlying resource,
+ * relative to the workbench.
+ * If this element is included in an external archive,
+ * the path returned is the absolute path to the archive in the file system.
+ * This is a handle-only method.
+ */
+ IPath getPath();
+
+ /**
+ * Returns an absolute URI corresponding to the innermost file enclosing this element.
+ *
+ * @since 5.0
+ * @return the URI corresponding to the location
+ */
+ URI getLocationURI();
+
+ /**
+ * Returns the underlying resource that contains this element, or {@code null} if this element
+ * is not contained in a resource.
+ *
+ * @return the underlying resource, or {@code null} if none
+ */
+ IResource getUnderlyingResource();
+
+ /**
+ * Returns the corresponding resource for this element, or {@code null} if this element
+ * does not have a corresponding resource.
+ *
+ * @return the corresponding resource, or {@code null} if none
+ */
+ IResource getResource();
+
+ /**
+ * Returns whether this C element is read-only. An element is read-only
+ * if its structure cannot be modified by the C model.
+ *
+ * @return {@code true} if this element is read-only
+ */
+ boolean isReadOnly();
+
+ /**
+ * Returns whether the structure of this element is known. For example, for a
+ * translation unit that could not be parsed, {@code false} is returned.
+ * If the structure of an element is unknown, navigations will return reasonable
+ * defaults. For example, {@code getChildren} will return an empty collection.
+ * <p>
+ * Note: This does not imply anything about consistency with the
+ * underlying resource/buffer contents.
+ *
+ * @return {@code true} if the structure of this element is known
+ * @exception CModelException if this element does not exist or if an
+ * exception occurs while accessing its corresponding resource
+ */
+ boolean isStructureKnown() throws CModelException;
+
+ /**
+ * Accept a visitor and walk the ICElement tree with it.
+ *
+ * @param visitor
+ * @throws CModelException
+ */
+ void accept(ICElementVisitor visitor) throws CoreException;
+
+ /**
+ * Returns a string representation of this element handle. The format of the
+ * string is not specified; however, the identifier is stable across
+ * workspace sessions, and can be used to recreate this handle via the
+ * <code>CoreModel.create(String)</code> method.
+ * <p>
+ * Some element types, like binaries, do not support handle identifiers and
+ * return {@code null}.
+ *
+ * @return the string handle identifier, or {@code null} if the element type is not supported
+ * @see CoreModel#create(java.lang.String)
+ *
+ * @since 5.0
+ */
+ String getHandleIdentifier();
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICFileDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICFileDescription.java
index 74fef6b726..298098dd9e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICFileDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICFileDescription.java
@@ -1,15 +1,15 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Intel Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Intel Corporation - Initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Intel Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Intel Corporation - Initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.core.settings.model;
-
-public interface ICFileDescription extends ICResourceDescription {
- ICLanguageSetting getLanguageSetting();
-}
+package org.eclipse.cdt.core.settings.model;
+
+public interface ICFileDescription extends ICResourceDescription {
+ ICLanguageSetting getLanguageSetting();
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java
index 5aef361448..282be48054 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsDelta.java
@@ -1,116 +1,116 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.core.language.settings.providers;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-
-
-/**
- * Contains the delta of changes that occurred as a result of modifying
- * language settings entries {@link ICLanguageSettingEntry}. The delta is
- * associated with a configuration description.
- *
- * <p>
- * <strong>EXPERIMENTAL</strong>. This class interface is not stable yet as
- * it is not currently clear how it may need to be used in future. Only bare
- * minimum is provided here at this point (CDT 8.1, Juno).
- * There is no guarantee that this API will work or that it will remain the same.
- * Please do not use this API without consulting with the CDT team.
- * </p>
- *
- * @noextend This interface is not intended to be extended by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class LanguageSettingsDelta {
- // maps are ordered by providers
- private LinkedHashMap<String/*providerId*/, LanguageSettingsStorage> oldLanguageSettingsState;
- private LinkedHashMap<String/*providerId*/, LanguageSettingsStorage> newLanguageSettingsState;
-
- private Set<String> paths = null;
-
- /**
- * Constructor.
- *
- * @param oldState - old language settings storage state.
- * @param newState - new language settings storage state.
- */
- public LanguageSettingsDelta(LinkedHashMap<String, LanguageSettingsStorage> oldState, LinkedHashMap<String, LanguageSettingsStorage> newState) {
- oldLanguageSettingsState = oldState;
- newLanguageSettingsState = newState;
- }
-
- /**
- * @return resource paths affected by changes represented by this delta.
- */
- public Set<String> getAffectedResourcePaths() {
- if (paths != null) {
- return paths;
- }
-
- paths = new TreeSet<String>();
-
- LanguageSettingsStorage oldCombinedStorage = combineStorage(oldLanguageSettingsState);
- LanguageSettingsStorage newCombinedStorage = combineStorage(newLanguageSettingsState);
-
- for (String lang : oldCombinedStorage.getLanguages()) {
- for (String path : oldCombinedStorage.getResourcePaths(lang)) {
- if (oldCombinedStorage.getSettingEntries(path, lang) != newCombinedStorage.getSettingEntries(path, lang)) {
- if (path == null) {
- // add path of the project
- path = ""; //$NON-NLS-1$
- }
- paths.add(path);
- }
- }
- }
-
- for (String lang : newCombinedStorage.getLanguages()) {
- for (String path : newCombinedStorage.getResourcePaths(lang)) {
- if (newCombinedStorage.getSettingEntries(path, lang) != oldCombinedStorage.getSettingEntries(path, lang)) {
- if (path == null) {
- // add path of the project
- path = ""; //$NON-NLS-1$
- }
- paths.add(path);
- }
- }
- }
-
- return paths;
- }
-
- /**
- * Language settings entries from different providers can overlap. This method resolves all overlapping
- * ones combining entries into one aggregate storage.
- */
- private LanguageSettingsStorage combineStorage(LinkedHashMap<String, LanguageSettingsStorage> state) {
- LanguageSettingsStorage combinedStore = new LanguageSettingsStorage();
- for (LanguageSettingsStorage providerStore : state.values()) {
- for (String lang : providerStore.getLanguages()) {
- for (String path : providerStore.getResourcePaths(lang)) {
- // provider (store) higher on the list overrides others below
- if (combinedStore.getSettingEntries(path, lang) == null) {
- List<ICLanguageSettingEntry> entries = providerStore.getSettingEntries(path, lang);
- combinedStore.setSettingEntries(path, lang, entries);
- }
- }
- }
- }
-
- return combinedStore;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.core.language.settings.providers;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+
+
+/**
+ * Contains the delta of changes that occurred as a result of modifying
+ * language settings entries {@link ICLanguageSettingEntry}. The delta is
+ * associated with a configuration description.
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This class interface is not stable yet as
+ * it is not currently clear how it may need to be used in future. Only bare
+ * minimum is provided here at this point (CDT 8.1, Juno).
+ * There is no guarantee that this API will work or that it will remain the same.
+ * Please do not use this API without consulting with the CDT team.
+ * </p>
+ *
+ * @noextend This interface is not intended to be extended by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class LanguageSettingsDelta {
+ // maps are ordered by providers
+ private LinkedHashMap<String/*providerId*/, LanguageSettingsStorage> oldLanguageSettingsState;
+ private LinkedHashMap<String/*providerId*/, LanguageSettingsStorage> newLanguageSettingsState;
+
+ private Set<String> paths = null;
+
+ /**
+ * Constructor.
+ *
+ * @param oldState - old language settings storage state.
+ * @param newState - new language settings storage state.
+ */
+ public LanguageSettingsDelta(LinkedHashMap<String, LanguageSettingsStorage> oldState, LinkedHashMap<String, LanguageSettingsStorage> newState) {
+ oldLanguageSettingsState = oldState;
+ newLanguageSettingsState = newState;
+ }
+
+ /**
+ * @return resource paths affected by changes represented by this delta.
+ */
+ public Set<String> getAffectedResourcePaths() {
+ if (paths != null) {
+ return paths;
+ }
+
+ paths = new TreeSet<String>();
+
+ LanguageSettingsStorage oldCombinedStorage = combineStorage(oldLanguageSettingsState);
+ LanguageSettingsStorage newCombinedStorage = combineStorage(newLanguageSettingsState);
+
+ for (String lang : oldCombinedStorage.getLanguages()) {
+ for (String path : oldCombinedStorage.getResourcePaths(lang)) {
+ if (oldCombinedStorage.getSettingEntries(path, lang) != newCombinedStorage.getSettingEntries(path, lang)) {
+ if (path == null) {
+ // add path of the project
+ path = ""; //$NON-NLS-1$
+ }
+ paths.add(path);
+ }
+ }
+ }
+
+ for (String lang : newCombinedStorage.getLanguages()) {
+ for (String path : newCombinedStorage.getResourcePaths(lang)) {
+ if (newCombinedStorage.getSettingEntries(path, lang) != oldCombinedStorage.getSettingEntries(path, lang)) {
+ if (path == null) {
+ // add path of the project
+ path = ""; //$NON-NLS-1$
+ }
+ paths.add(path);
+ }
+ }
+ }
+
+ return paths;
+ }
+
+ /**
+ * Language settings entries from different providers can overlap. This method resolves all overlapping
+ * ones combining entries into one aggregate storage.
+ */
+ private LanguageSettingsStorage combineStorage(LinkedHashMap<String, LanguageSettingsStorage> state) {
+ LanguageSettingsStorage combinedStore = new LanguageSettingsStorage();
+ for (LanguageSettingsStorage providerStore : state.values()) {
+ for (String lang : providerStore.getLanguages()) {
+ for (String path : providerStore.getResourcePaths(lang)) {
+ // provider (store) higher on the list overrides others below
+ if (combinedStore.getSettingEntries(path, lang) == null) {
+ List<ICLanguageSettingEntry> entries = providerStore.getSettingEntries(path, lang);
+ combinedStore.setSettingEntries(path, lang, entries);
+ }
+ }
+ }
+ }
+
+ return combinedStore;
+ }
+}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java
index 5e5cbeea77..a74154de47 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsSerializableStorage.java
@@ -1,228 +1,228 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andrew Gvozdev - initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - initial API and implementation
*******************************************************************************/
-package org.eclipse.cdt.internal.core.language.settings.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
-import org.eclipse.cdt.core.settings.model.util.CDataUtil;
-import org.eclipse.cdt.core.settings.model.util.LanguageSettingEntriesSerializer;
-import org.eclipse.cdt.internal.core.XmlUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * The class representing persistent storage for language settings entries {@link ICLanguageSettingEntry}.
- */
-public class LanguageSettingsSerializableStorage extends LanguageSettingsStorage {
- private static final String ELEM_LANGUAGE = "language"; //$NON-NLS-1$
- private static final String ATTR_LANGUAGE_ID = "id"; //$NON-NLS-1$
- private static final String ELEM_RESOURCE = "resource"; //$NON-NLS-1$
- private static final String ATTR_PROJECT_PATH = "project-relative-path"; //$NON-NLS-1$
-
- private static final String ELEM_ENTRY = LanguageSettingsExtensionManager.ELEM_ENTRY;
- private static final String ATTR_ENTRY_KIND = LanguageSettingsExtensionManager.ATTR_ENTRY_KIND;
- private static final String ATTR_ENTRY_NAME = LanguageSettingsExtensionManager.ATTR_ENTRY_NAME;
- private static final String ATTR_ENTRY_VALUE = LanguageSettingsExtensionManager.ATTR_ENTRY_VALUE;
- private static final String ELEM_ENTRY_FLAG = LanguageSettingsExtensionManager.ELEM_ENTRY_FLAG;
-
- /**
- * Serialize the provider entries under parent XML element.
- *
- * @param elementProvider - element where to serialize the entries.
- */
- public void serializeEntries(Element elementProvider) {
- synchronized (fStorage) {
- for (Entry<String, Map<String, List<ICLanguageSettingEntry>>> entryLang : fStorage.entrySet()) {
- serializeLanguage(elementProvider, entryLang.getKey(), entryLang.getValue());
- }
- }
- }
-
- /**
- * Serialize the provider entries for a given language list.
- */
- private void serializeLanguage(Element parentElement, String langId, Map<String, List<ICLanguageSettingEntry>> langMap) {
- if (langId!=null) {
- Element elementLanguage = XmlUtil.appendElement(parentElement, ELEM_LANGUAGE, new String[] {ATTR_LANGUAGE_ID, langId});
- parentElement = elementLanguage;
- }
- for (Entry<String, List<ICLanguageSettingEntry>> entryRc : langMap.entrySet()) {
- serializeResource(parentElement, entryRc.getKey(), entryRc.getValue());
- }
- }
-
- /**
- * Serialize the provider entries for a given resource list.
- */
- private void serializeResource(Element parentElement, String rcProjectPath, List<ICLanguageSettingEntry> rcList) {
- if (rcProjectPath!=null) {
- Element elementRc = XmlUtil.appendElement(parentElement, ELEM_RESOURCE, new String[] {ATTR_PROJECT_PATH, rcProjectPath});
- parentElement = elementRc;
- }
- serializeSettingEntries(parentElement, rcList);
- }
-
- /**
- * Serialize given settings entries.
- */
- private void serializeSettingEntries(Element parentElement, List<ICLanguageSettingEntry> settingEntries) {
- for (ICLanguageSettingEntry entry : settingEntries) {
- Element elementSettingEntry = XmlUtil.appendElement(parentElement, ELEM_ENTRY, new String[] {
- ATTR_ENTRY_KIND, LanguageSettingEntriesSerializer.kindToString(entry.getKind()),
- ATTR_ENTRY_NAME, entry.getName(),
- });
- switch (entry.getKind()) {
- case ICSettingEntry.MACRO:
- elementSettingEntry.setAttribute(ATTR_ENTRY_VALUE, entry.getValue());
- break;
-// case ICLanguageSettingEntry.LIBRARY_FILE:
-// // YAGNI: sourceAttachment fields may need to be covered
-// break;
- }
- int flags = entry.getFlags();
- if (flags != 0) {
- // Element elementFlag =
- XmlUtil.appendElement(elementSettingEntry, ELEM_ENTRY_FLAG, new String[] {
- ATTR_ENTRY_VALUE, LanguageSettingEntriesSerializer.composeFlagsString(entry.getFlags())
- });
- }
- }
- }
-
- /**
- * Load provider entries from XML provider element.
- *
- * @param providerNode - parent XML element "provider" where entries are defined.
- */
- public void loadEntries(Element providerNode) {
- List<ICLanguageSettingEntry> settings = new ArrayList<ICLanguageSettingEntry>();
- NodeList nodes = providerNode.getChildNodes();
- for (int i=0;i<nodes.getLength();i++) {
- Node elementNode = nodes.item(i);
- if (elementNode.getNodeType() != Node.ELEMENT_NODE)
- continue;
-
- if (ELEM_LANGUAGE.equals(elementNode.getNodeName())) {
- loadLanguageElement(elementNode, null);
- } else if (ELEM_RESOURCE.equals(elementNode.getNodeName())) {
- loadResourceElement(elementNode, null, null);
- } else if (ELEM_ENTRY.equals(elementNode.getNodeName())) {
- ICLanguageSettingEntry entry = loadSettingEntry(elementNode);
- if (entry!=null) {
- settings.add(entry);
- }
- }
- }
- // set settings
- if (settings.size() > 0) {
- setSettingEntries(null, null, settings);
- }
- }
-
- /**
- * Load a setting entry from XML element.
- */
- private ICLanguageSettingEntry loadSettingEntry(Node parentElement) {
- String settingKind = XmlUtil.determineAttributeValue(parentElement, ATTR_ENTRY_KIND);
- String settingName = XmlUtil.determineAttributeValue(parentElement, ATTR_ENTRY_NAME);
-
- NodeList flagNodes = parentElement.getChildNodes();
- int flags = 0;
- for (int i=0;i<flagNodes.getLength();i++) {
- Node flagNode = flagNodes.item(i);
- if (flagNode.getNodeType() != Node.ELEMENT_NODE || !ELEM_ENTRY_FLAG.equals(flagNode.getNodeName()))
- continue;
-
- String settingFlags = XmlUtil.determineAttributeValue(flagNode, ATTR_ENTRY_VALUE);
- int bitFlag = LanguageSettingEntriesSerializer.composeFlags(settingFlags);
- flags |= bitFlag;
-
- }
-
- String settingValue = null;
- int kind = LanguageSettingEntriesSerializer.stringToKind(settingKind);
- if (kind == ICSettingEntry.MACRO)
- settingValue = XmlUtil.determineAttributeValue(parentElement, ATTR_ENTRY_VALUE);
- ICLanguageSettingEntry entry = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, settingName, settingValue, null, flags);
- return entry;
- }
-
- /**
- * Load entries defined in language element.
- */
- private void loadLanguageElement(Node parentNode, String cfgId) {
- String langId = XmlUtil.determineAttributeValue(parentNode, ATTR_LANGUAGE_ID);
- if (langId.length() == 0) {
- langId=null;
- }
-
- List<ICLanguageSettingEntry> settings = new ArrayList<ICLanguageSettingEntry>();
- NodeList nodes = parentNode.getChildNodes();
- for (int i=0;i<nodes.getLength();i++) {
- Node elementNode = nodes.item(i);
- if (elementNode.getNodeType() != Node.ELEMENT_NODE)
- continue;
-
- if (ELEM_RESOURCE.equals(elementNode.getNodeName())) {
- loadResourceElement(elementNode, cfgId, langId);
- } else if (ELEM_ENTRY.equals(elementNode.getNodeName())) {
- ICLanguageSettingEntry entry = loadSettingEntry(elementNode);
- if (entry!=null) {
- settings.add(entry);
- }
- }
- }
- // set settings
- if (settings.size() > 0) {
- setSettingEntries(null, langId, settings);
- }
- }
-
- /**
- * Load entries defined in resource element.
- */
- private void loadResourceElement(Node parentNode, String cfgId, String langId) {
- String rcProjectPath = XmlUtil.determineAttributeValue(parentNode, ATTR_PROJECT_PATH);
-
- List<ICLanguageSettingEntry> settings = new ArrayList<ICLanguageSettingEntry>();
- NodeList nodes = parentNode.getChildNodes();
- for (int i=0;i<nodes.getLength();i++) {
- Node elementNode = nodes.item(i);
- if (elementNode.getNodeType() != Node.ELEMENT_NODE)
- continue;
-
- if (ELEM_ENTRY.equals(elementNode.getNodeName())) {
- ICLanguageSettingEntry entry = loadSettingEntry(elementNode);
- if (entry!=null) {
- settings.add(entry);
- }
- }
- }
-
- // set settings
- if (settings.size() > 0) {
- setSettingEntries(rcProjectPath, langId, settings);
- }
- }
-
- @Override
- public LanguageSettingsSerializableStorage clone() throws CloneNotSupportedException {
- return (LanguageSettingsSerializableStorage) super.clone();
- }
-
-}
+package org.eclipse.cdt.internal.core.language.settings.providers;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.core.settings.model.util.CDataUtil;
+import org.eclipse.cdt.core.settings.model.util.LanguageSettingEntriesSerializer;
+import org.eclipse.cdt.internal.core.XmlUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * The class representing persistent storage for language settings entries {@link ICLanguageSettingEntry}.
+ */
+public class LanguageSettingsSerializableStorage extends LanguageSettingsStorage {
+ private static final String ELEM_LANGUAGE = "language"; //$NON-NLS-1$
+ private static final String ATTR_LANGUAGE_ID = "id"; //$NON-NLS-1$
+ private static final String ELEM_RESOURCE = "resource"; //$NON-NLS-1$
+ private static final String ATTR_PROJECT_PATH = "project-relative-path"; //$NON-NLS-1$
+
+ private static final String ELEM_ENTRY = LanguageSettingsExtensionManager.ELEM_ENTRY;
+ private static final String ATTR_ENTRY_KIND = LanguageSettingsExtensionManager.ATTR_ENTRY_KIND;
+ private static final String ATTR_ENTRY_NAME = LanguageSettingsExtensionManager.ATTR_ENTRY_NAME;
+ private static final String ATTR_ENTRY_VALUE = LanguageSettingsExtensionManager.ATTR_ENTRY_VALUE;
+ private static final String ELEM_ENTRY_FLAG = LanguageSettingsExtensionManager.ELEM_ENTRY_FLAG;
+
+ /**
+ * Serialize the provider entries under parent XML element.
+ *
+ * @param elementProvider - element where to serialize the entries.
+ */
+ public void serializeEntries(Element elementProvider) {
+ synchronized (fStorage) {
+ for (Entry<String, Map<String, List<ICLanguageSettingEntry>>> entryLang : fStorage.entrySet()) {
+ serializeLanguage(elementProvider, entryLang.getKey(), entryLang.getValue());
+ }
+ }
+ }
+
+ /**
+ * Serialize the provider entries for a given language list.
+ */
+ private void serializeLanguage(Element parentElement, String langId, Map<String, List<ICLanguageSettingEntry>> langMap) {
+ if (langId!=null) {
+ Element elementLanguage = XmlUtil.appendElement(parentElement, ELEM_LANGUAGE, new String[] {ATTR_LANGUAGE_ID, langId});
+ parentElement = elementLanguage;
+ }
+ for (Entry<String, List<ICLanguageSettingEntry>> entryRc : langMap.entrySet()) {
+ serializeResource(parentElement, entryRc.getKey(), entryRc.getValue());
+ }
+ }
+
+ /**
+ * Serialize the provider entries for a given resource list.
+ */
+ private void serializeResource(Element parentElement, String rcProjectPath, List<ICLanguageSettingEntry> rcList) {
+ if (rcProjectPath!=null) {
+ Element elementRc = XmlUtil.appendElement(parentElement, ELEM_RESOURCE, new String[] {ATTR_PROJECT_PATH, rcProjectPath});
+ parentElement = elementRc;
+ }
+ serializeSettingEntries(parentElement, rcList);
+ }
+
+ /**
+ * Serialize given settings entries.
+ */
+ private void serializeSettingEntries(Element parentElement, List<ICLanguageSettingEntry> settingEntries) {
+ for (ICLanguageSettingEntry entry : settingEntries) {
+ Element elementSettingEntry = XmlUtil.appendElement(parentElement, ELEM_ENTRY, new String[] {
+ ATTR_ENTRY_KIND, LanguageSettingEntriesSerializer.kindToString(entry.getKind()),
+ ATTR_ENTRY_NAME, entry.getName(),
+ });
+ switch (entry.getKind()) {
+ case ICSettingEntry.MACRO:
+ elementSettingEntry.setAttribute(ATTR_ENTRY_VALUE, entry.getValue());
+ break;
+// case ICLanguageSettingEntry.LIBRARY_FILE:
+// // YAGNI: sourceAttachment fields may need to be covered
+// break;
+ }
+ int flags = entry.getFlags();
+ if (flags != 0) {
+ // Element elementFlag =
+ XmlUtil.appendElement(elementSettingEntry, ELEM_ENTRY_FLAG, new String[] {
+ ATTR_ENTRY_VALUE, LanguageSettingEntriesSerializer.composeFlagsString(entry.getFlags())
+ });
+ }
+ }
+ }
+
+ /**
+ * Load provider entries from XML provider element.
+ *
+ * @param providerNode - parent XML element "provider" where entries are defined.
+ */
+ public void loadEntries(Element providerNode) {
+ List<ICLang