1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 568079: Reformat source code using clang-format

This will enforce formatting when building the native code

Change-Id: I6c047f4c0672609df322b7ba716fc786f0e3aab4
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
This commit is contained in:
Torbjörn Svensson 2020-10-31 20:54:44 +01:00 committed by Jonah Graham
parent 7f10dce12f
commit 6431307e70
46 changed files with 2707 additions and 3505 deletions

12
.clang-format Normal file
View file

@ -0,0 +1,12 @@
BasedOnStyle: LLVM
# Set column width to 120
ColumnLimit: 120
# Sorting include statements will put "windows.h" last and result in build error.
# To avoid unpredictable build errors, disable sorting.
SortIncludes: false
# Use 4 spaces as indentation
IndentWidth: 4
UseTab: Never

1
.gitattributes vendored
View file

@ -135,6 +135,7 @@ test_commands text
# Other special files # Other special files
cdtOptions text cdtOptions text
.clang-format text
.contentsettings text .contentsettings text
*.csv text *.csv text
*.dia binary *.dia binary

View file

@ -1,189 +0,0 @@
eclipse.preferences.version=1
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_assignment=16
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.cdt.core.formatter.alignment_for_compact_if=16
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=34
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18
org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=0
org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16
org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48
org.eclipse.cdt.core.formatter.alignment_for_expression_list=0
org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.cdt.core.formatter.alignment_for_lambda_expression=20
org.eclipse.cdt.core.formatter.alignment_for_member_access=0
org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16
org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_linkage_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.cdt.core.formatter.comment.line_up_line_comment_in_blocks_on_first_column=false
org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1
org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column=true
org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true
org.eclipse.cdt.core.formatter.comment_formatter_off_tag=@formatter\:off
org.eclipse.cdt.core.formatter.comment_formatter_on_tag=@formatter\:on
org.eclipse.cdt.core.formatter.compact_else_if=true
org.eclipse.cdt.core.formatter.continuation_indentation=2
org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.cdt.core.formatter.format_block_comment=true
org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.cdt.core.formatter.format_header_comment=true
org.eclipse.cdt.core.formatter.format_line_comment=true
org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false
org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_linkage=false
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false
org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false
org.eclipse.cdt.core.formatter.indent_empty_lines=false
org.eclipse.cdt.core.formatter.indent_label_compare_to_statements=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.cdt.core.formatter.indentation.size=4
org.eclipse.cdt.core.formatter.insert_new_line_after_colon_in_constructor_initializer_list=insert
org.eclipse.cdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_linkage_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_ref_qualifier_in_structured_binding=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.join_wrapped_lines=true
org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.cdt.core.formatter.lineSplit=120
org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.cdt.core.formatter.tabulation.char=tab
org.eclipse.cdt.core.formatter.tabulation.size=4
org.eclipse.cdt.core.formatter.use_comment_formatter_tag=true
org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false

View file

@ -1,3 +0,0 @@
eclipse.preferences.version=1
formatter_profile=_Unmanaged profile 'CDT'
formatter_settings_version=1

View file

@ -12,32 +12,30 @@ extern "C" {
* Method: openMaster * Method: openMaster
* Signature: (Z)Ljava/lang/String; * Signature: (Z)Ljava/lang/String;
*/ */
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *, jobject, jboolean);
(JNIEnv *, jobject, jboolean);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: change_window_size * Method: change_window_size
* Signature: (III)I * Signature: (III)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size(JNIEnv *, jobject, jint, jint, jint);
(JNIEnv *, jobject, jint, jint, jint);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: exec2 * Method: exec2
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;Ljava/lang/String;IZ)I * Signature:
* ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;Ljava/lang/String;IZ)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring,
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jobjectArray, jstring, jint, jboolean); jobjectArray, jstring, jint, jboolean);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: waitFor * Method: waitFor
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor(JNIEnv *, jobject, jint, jint);
(JNIEnv *, jobject, jint, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -18,16 +18,14 @@ extern "C" {
* Method: read0 * Method: read0
* Signature: (I[BI)I * Signature: (I[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv *, jobject, jint, jbyteArray, jint);
(JNIEnv *, jobject, jint, jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTYInputStream * Class: org_eclipse_cdt_utils_pty_PTYInputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv *, jobject, jint);
(JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -14,16 +14,14 @@ extern "C" {
* Method: write0 * Method: write0
* Signature: (I[BI)I * Signature: (I[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv *, jobject, jint, jbyteArray, jint);
(JNIEnv *, jobject, jint, jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTYOutputStream * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv *, jobject, jint);
(JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -10,42 +10,42 @@ extern "C" {
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: exec0 * Method: exec0
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I * Signature:
* ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *, jobject, jobjectArray, jobjectArray,
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jobjectArray); jstring, jobjectArray);
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: exec1 * Method: exec1
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)I * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *, jobject, jobjectArray, jobjectArray,
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring); jstring);
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: exec2 * Method: exec2
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;Ljava/lang/String;IZ)I * Signature:
* ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;Ljava/lang/String;IZ)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2(JNIEnv *, jobject, jobjectArray, jobjectArray,
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jobjectArray, jstring, jint, jboolean); jstring, jobjectArray, jstring, jint, jboolean);
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: raise * Method: raise
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *, jobject, jint, jint);
(JNIEnv *, jobject, jint, jint);
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: waitFor * Method: waitFor
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv *, jobject, jint);
(JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -18,24 +18,22 @@ extern "C" {
* Method: read0 * Method: read0
* Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;[BI)I * Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv *, jobject, jobject,
(JNIEnv *, jobject, jobject, jbyteArray, jint); jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
* Method: close0 * Method: close0
* Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I * Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv *, jobject, jobject);
(JNIEnv *, jobject, jobject);
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
* Method: available0 * Method: available0
* Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I * Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_available0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_available0(JNIEnv *, jobject, jobject);
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -12,16 +12,15 @@ extern "C" {
* Method: write0 * Method: write0
* Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;[BI)I * Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv *, jobject, jobject,
(JNIEnv *, jobject, jobject, jbyteArray, jint); jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
* Method: close0 * Method: close0
* Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I * Signature: (Lorg/eclipse/cdt/utils/spawner/Spawner/IChannel;)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv *, jobject, jobject);
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -58,8 +58,7 @@ pid_t exec_pty(const char *path, char *const argv[], char *const envp[], const c
childpid = fork(); childpid = fork();
if (childpid < 0) { if (childpid < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __func__, fprintf(stderr, "%s(%d): returning due to error: %s\n", __func__, __LINE__, strerror(errno));
__LINE__, strerror(errno));
free(full_path); free(full_path);
return -1; return -1;
} else if (childpid == 0) { /* child */ } else if (childpid == 0) { /* child */

View file

@ -45,8 +45,7 @@ pid_t exec0(const char *path, char *const argv[], char *const envp[], const char
*/ */
if (channels != NULL) { if (channels != NULL) {
if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) { if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) {
fprintf(stderr, "%s(%d): returning due to error.\n", __func__, fprintf(stderr, "%s(%d): returning due to error.\n", __func__, __LINE__);
__LINE__);
free(full_path); free(full_path);
return -1; return -1;
} }

View file

@ -54,8 +54,8 @@ static int channelToFileDesc(JNIEnv *env, jobject channel) {
return fd; return fd;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv *env, jobject jobj,
Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv *env, jobject jobj, jobject channel, jbyteArray buf, jobject channel, jbyteArray buf,
jint buf_len) { jint buf_len) {
int fd; int fd;
int status; int status;
@ -85,15 +85,15 @@ Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv *env, jobject
return status; return status;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv *env, jobject jobj,
Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv *env, jobject jobj, jobject channel) { jobject channel) {
int fd = channelToFileDesc(env, channel); int fd = channelToFileDesc(env, channel);
return close(fd); return close(fd);
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv *env, jobject jobj,
Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv *env, jobject jobj, jobject channel, jobject channel, jbyteArray buf,
jbyteArray buf, jint buf_len) { jint buf_len) {
int status; int status;
int fd; int fd;
jbyte *data; jbyte *data;
@ -109,8 +109,8 @@ Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv *env, jobje
return status; return status;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv *env, jobject jobj,
Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv *env, jobject jobj, jobject channel) { jobject channel) {
int fd = channelToFileDesc(env, channel); int fd = channelToFileDesc(env, channel);
return close(fd); return close(fd);
} }

View file

@ -99,8 +99,7 @@ char* pfind(const char *name, char *const envp[]) {
} }
#ifdef BUILD_WITH_MAIN #ifdef BUILD_WITH_MAIN
int main(int argc, char **argv) int main(int argc, char **argv) {
{
int i; int i;
char *fullpath; char *fullpath;

View file

@ -21,8 +21,7 @@
* Method: forkpty * Method: forkpty
* Signature: ()I * Signature: ()I
*/ */
JNIEXPORT jstring JNICALL JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *env, jobject jobj, jboolean console) {
Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *env, jobject jobj, jboolean console) {
jfieldID fid; /* Store the field ID */ jfieldID fid; /* Store the field ID */
jstring jstr = NULL; jstring jstr = NULL;
int master = -1; int master = -1;
@ -70,4 +69,3 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size(J
return 0; return 0;
#endif #endif
} }

View file

@ -25,8 +25,8 @@
* Method: read0 * Method: read0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv *env, jobject jobj, jint jfd,
Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv *env, jobject jobj, jint jfd, jbyteArray buf, jint buf_len) { jbyteArray buf, jint buf_len) {
int fd; int fd;
int status; int status;
jbyte *data; jbyte *data;
@ -63,8 +63,7 @@ Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv *env, jobject jobj, j
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv *env, jobject jobj, jint fd) {
Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv *env, jobject jobj, jint fd) {
return close(fd); return close(fd);
} }
@ -73,8 +72,8 @@ Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv *env, jobject jobj,
* Method: write0 * Method: write0
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv *env, jobject jobj, jint jfd,
Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv *env, jobject jobj, jint jfd, jbyteArray buf, jint buf_len) { jbyteArray buf, jint buf_len) {
int status; int status;
int fd; int fd;
jbyte *data; jbyte *data;
@ -95,7 +94,6 @@ Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv *env, jobject jobj,
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv *env, jobject jobj, jint fd) {
Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv *env, jobject jobj, jint fd) {
return close(fd); return close(fd);
} }

View file

@ -74,7 +74,9 @@ static void free_c_array(char **c_array) {
} }
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2(JNIEnv *env, jobject jobj, jobjectArray jcmd, JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2(JNIEnv *env, jobject jobj, jobjectArray jcmd,
jobjectArray jenv, jstring jdir, jobjectArray jchannels, jstring jslaveName, jint masterFD, jboolean console) { jobjectArray jenv, jstring jdir,
jobjectArray jchannels, jstring jslaveName,
jint masterFD, jboolean console) {
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL); const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL);
char **cmd = NULL; char **cmd = NULL;
@ -117,16 +119,16 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2(JNIEnv *
(*env)->SetObjectArrayElement(env, jchannels, i, chan); (*env)->SetObjectArrayElement(env, jchannels, i, chan);
} }
bail_out: (*env)->ReleaseStringUTFChars(env, jdir, dirpath); bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath);
(*env)->ReleaseStringUTFChars(env, jslaveName, pts_name); (*env)->ReleaseStringUTFChars(env, jslaveName, pts_name);
free_c_array(cmd); free_c_array(cmd);
free_c_array(envp); free_c_array(envp);
return pid; return pid;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *env, jobject jobj, jobjectArray jcmd,
Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jobjectArray jenv, jstring jdir) {
jstring jdir) {
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **cmd = NULL; char **cmd = NULL;
char **envp = NULL; char **envp = NULL;
@ -155,15 +157,16 @@ Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *env, jobject jobj, jobj
goto bail_out; goto bail_out;
} }
bail_out: (*env)->ReleaseStringUTFChars(env, jdir, dirpath); bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath);
free_c_array(cmd); free_c_array(cmd);
free_c_array(envp); free_c_array(envp);
return pid; return pid;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *env, jobject jobj, jobjectArray jcmd,
Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jobjectArray jenv, jstring jdir,
jstring jdir, jobjectArray jchannels) { jobjectArray jchannels) {
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **cmd = NULL; char **cmd = NULL;
char **envp = NULL; char **envp = NULL;
@ -213,7 +216,8 @@ Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *env, jobject jobj, jobj
(*env)->SetObjectArrayElement(env, jchannels, i, chan); (*env)->SetObjectArrayElement(env, jchannels, i, chan);
} }
bail_out: (*env)->ReleaseStringUTFChars(env, jdir, dirpath); bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath);
free_c_array(cmd); free_c_array(cmd);
free_c_array(envp); free_c_array(envp);
return pid; return pid;
@ -224,8 +228,7 @@ Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *env, jobject jobj, jobj
* Method: raise * Method: raise
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *env, jobject jobj, jint pid, jint sig) {
Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *env, jobject jobj, jint pid, jint sig) {
int status = -1; int status = -1;
switch (sig) { switch (sig) {
@ -273,7 +276,6 @@ Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *env, jobject jobj, jint
* Method: waitFor * Method: waitFor
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv *env, jobject jobj, jint pid) {
Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv *env, jobject jobj, jint pid) {
return wait0(pid); return wait0(pid);
} }

View file

@ -41,11 +41,15 @@ typedef struct _procInfo {
// (actually this impossible from OS point of view but it is still possible // (actually this impossible from OS point of view but it is still possible
// a clash of new created and already finished process with one and the same PID. // a clash of new created and already finished process with one and the same PID.
// 4 events connected to this process (see starter) // 4 events connected to this process (see starter)
HANDLE eventBreak;// signaled when Spawner.interrupt() is called; mildest of the terminate requests (SIGINT signal in UNIX world) HANDLE eventBreak; // signaled when Spawner.interrupt() is called; mildest of the terminate requests (SIGINT signal
// in UNIX world)
HANDLE eventWait; HANDLE eventWait;
HANDLE eventTerminate;// signaled when Spawner.terminate() is called; more forceful terminate request (SIGTERM signal in UNIX world) HANDLE eventTerminate; // signaled when Spawner.terminate() is called; more forceful terminate request (SIGTERM
HANDLE eventKill;// signaled when Spawner.kill() is called; most forceful terminate request (SIGKILL signal in UNIX world) // signal in UNIX world)
HANDLE eventCtrlc;// signaled when Spawner.interruptCTRLC() is called; like interrupt() but sends CTRL-C in all cases, even when inferior is a Cygwin program HANDLE eventKill; // signaled when Spawner.kill() is called; most forceful terminate request (SIGKILL signal in UNIX
// world)
HANDLE eventCtrlc; // signaled when Spawner.interruptCTRLC() is called; like interrupt() but sends CTRL-C in all
// cases, even when inferior is a Cygwin program
} procInfo_t, *pProcInfo_t; } procInfo_t, *pProcInfo_t;
static int procCounter = 0; // Number of running processes static int procCounter = 0; // Number of running processes
@ -100,9 +104,10 @@ static int nCounter = 0; // We use it to build unique synchronization object nam
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2(JNIEnv *env, jobject process, JNIEXPORT jint JNICALL
jobjectArray cmdarray, jobjectArray envp, jstring dir, jobjectArray channels, jstring slaveName, jint fdm, Java_org_eclipse_cdt_utils_spawner_Spawner_exec2(JNIEnv *env, jobject process, jobjectArray cmdarray,
jboolean console) { jobjectArray envp, jstring dir, jobjectArray channels,
jstring slaveName, jint fdm, jboolean console) {
return -1; return -1;
} }
@ -125,8 +130,9 @@ void ensureSize(wchar_t **ptr, int *psize, int requiredLength) {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *env, jobject process, JNIEXPORT jint JNICALL
jobjectArray cmdarray, jobjectArray envp, jstring dir, jobjectArray channels) { Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *env, jobject process, jobjectArray cmdarray,
jobjectArray envp, jstring dir, jobjectArray channels) {
HANDLE stdHandles[3]; HANDLE stdHandles[3];
PROCESS_INFORMATION pi = {0}, *piCopy; PROCESS_INFORMATION pi = {0}, *piCopy;
STARTUPINFOW si; STARTUPINFOW si;
@ -204,18 +210,17 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
++nCounter; ++nCounter;
LeaveCriticalSection(&cs); LeaveCriticalSection(&cs);
if ((INVALID_HANDLE_VALUE if ((INVALID_HANDLE_VALUE == (stdHandles[0] = CreateNamedPipeW(
== (stdHandles[0] = CreateNamedPipeW(inPipeName, PIPE_ACCESS_OUTBOUND, inPipeName, PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, PIPE_SIZE, PIPE_SIZE, PIPE_UNLIMITED_INSTANCES, PIPE_SIZE, PIPE_SIZE, PIPE_TIMEOUT, NULL))) ||
PIPE_TIMEOUT, NULL))) (INVALID_HANDLE_VALUE ==
|| (INVALID_HANDLE_VALUE (stdHandles[1] = CreateNamedPipeW(outPipeName, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
== (stdHandles[1] = CreateNamedPipeW(outPipeName, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, PIPE_SIZE, PIPE_SIZE, PIPE_SIZE, PIPE_TIMEOUT, NULL))) ||
PIPE_SIZE, PIPE_TIMEOUT, NULL))) (INVALID_HANDLE_VALUE ==
|| (INVALID_HANDLE_VALUE (stdHandles[2] = CreateNamedPipeW(errPipeName, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
== (stdHandles[2] = CreateNamedPipeW(errPipeName, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, PIPE_SIZE, PIPE_SIZE, PIPE_SIZE, PIPE_TIMEOUT, NULL)))) {
PIPE_SIZE, PIPE_TIMEOUT, NULL)))) {
CloseHandle(stdHandles[0]); CloseHandle(stdHandles[0]);
CloseHandle(stdHandles[1]); CloseHandle(stdHandles[1]);
CloseHandle(stdHandles[2]); CloseHandle(stdHandles[2]);
@ -224,7 +229,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
} }
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Opened pipes: %s, %s, %s\n"), inPipeName, outPipeName, errPipeName); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Opened pipes: %s, %s, %s\n"), inPipeName, outPipeName,
errPipeName);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
@ -313,10 +319,10 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
return 0; return 0;
} }
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Realloc environment block; new length is %i \n"), nBlkSize); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]),
_T("Realloc environment block; new length is %i \n"), nBlkSize);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
} }
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("%s\n"), str); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("%s\n"), str);
@ -427,13 +433,11 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
#endif #endif
} }
LeaveCriticalSection(&cs); LeaveCriticalSection(&cs);
} }
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
return ret; return ret;
} }
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
@ -446,8 +450,9 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *env, jobject process, JNIEXPORT jint JNICALL
jobjectArray cmdarray, jobjectArray envp, jstring dir) { Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *env, jobject process, jobjectArray cmdarray,
jobjectArray envp, jstring dir) {
SECURITY_ATTRIBUTES sa; SECURITY_ATTRIBUTES sa;
PROCESS_INFORMATION pi = {0}; PROCESS_INFORMATION pi = {0};
@ -583,7 +588,6 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
} }
return ret; return ret;
} }
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
@ -595,8 +599,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *env, jobject process, jint uid, JNIEXPORT jint JNICALL
jint signal) { Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *env, jobject process, jint uid, jint signal) {
jint ret = 0; jint ret = 0;
HANDLE hProc; HANDLE hProc;
@ -613,7 +617,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *
} }
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Spawner received signal %i for process %i\n"), signal, pCurProcInfo -> pid); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Spawner received signal %i for process %i\n"), signal,
pCurProcInfo->pid);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
@ -673,7 +678,6 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *
CloseHandle(hProc); CloseHandle(hProc);
return ret; return ret;
} }
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
@ -684,7 +688,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv *env, jobject process, jint uid) { JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv *env, jobject process, jint uid) {
DWORD exit_code = -1; DWORD exit_code = -1;
int what = 0; int what = 0;
HANDLE hProc; HANDLE hProc;
@ -887,8 +892,8 @@ int copyTo(wchar_t *target, const wchar_t *source, int cpyLength, int availSpace
bSlash = TRUE; bSlash = TRUE;
} else { } else {
// Don't escape embracing quotation marks // Don't escape embracing quotation marks
if ((source[i] == _T('\"')) if ((source[i] == _T('\"')) &&
&& !((nQuotationMode == QUOTATION_DONE) && ((i == 0) || (i == (cpyLength - 1))))) { !((nQuotationMode == QUOTATION_DONE) && ((i == 0) || (i == (cpyLength - 1))))) {
if (!bSlash) { // If still not escaped if (!bSlash) { // If still not escaped
if (j == availSpace) { if (j == availSpace) {
return -1; return -1;

View file

@ -55,8 +55,9 @@ static HANDLE channelToHandle(JNIEnv *env, jobject channel) {
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv *env, jobject proc, JNIEXPORT jint JNICALL
jobject channel, jbyteArray buf, jint len) { Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv *env, jobject proc, jobject channel,
jbyteArray buf, jint len) {
jbyte tmpBuf[BUFF_SIZE]; jbyte tmpBuf[BUFF_SIZE];
int nBuffOffset = 0; int nBuffOffset = 0;
HANDLE handle = channelToHandle(env, channel); HANDLE handle = channelToHandle(env, channel);
@ -113,9 +114,10 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_rea
_stprintf(buffer, _T("Read failed - %i, error %i\n"), fd, err); _stprintf(buffer, _T("Read failed - %i, error %i\n"), fd, err);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
if (err != ERROR_MORE_DATA) { // Otherwise error means just that there are more data than buffer can accept if (err !=
FormatMessage( ERROR_MORE_DATA) { // Otherwise error means just that there are more data than buffer can accept
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(wchar_t *)&lpMsgBuf, 0, NULL); (wchar_t *)&lpMsgBuf, 0, NULL);
@ -160,14 +162,13 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_rea
#endif #endif
#endif #endif
return nBuffOffset; // This is a real full readed length return nBuffOffset; // This is a real full readed length
} }
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv *env, jobject proc, JNIEXPORT jint JNICALL
jobject channel) { Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv *env, jobject proc, jobject channel) {
int rc; int rc;
HANDLE handle = channelToHandle(env, channel); HANDLE handle = channelToHandle(env, channel);
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
@ -186,8 +187,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_clo
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_available0(JNIEnv *env, jobject proc, JNIEXPORT jint JNICALL
jobject channel) { Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_available0(JNIEnv *env, jobject proc, jobject channel) {
DWORD nAvail = 0; DWORD nAvail = 0;
HANDLE handle = channelToHandle(env, channel); HANDLE handle = channelToHandle(env, channel);
@ -201,8 +202,9 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_ava
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv *env, jobject proc, JNIEXPORT jint JNICALL
jobject channel, jbyteArray buf, jint len) { Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv *env, jobject proc, jobject channel,
jbyteArray buf, jint len) {
jbyte tmpBuf[BUFF_SIZE]; jbyte tmpBuf[BUFF_SIZE];
int nBuffOffset = 0; int nBuffOffset = 0;
HANDLE handle = channelToHandle(env, channel); HANDLE handle = channelToHandle(env, channel);
@ -229,8 +231,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_wr
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv *env, jobject proc, JNIEXPORT jint JNICALL
jobject channel) { Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv *env, jobject proc, jobject channel) {
int rc; int rc;
HANDLE handle = channelToHandle(env, channel); HANDLE handle = channelToHandle(env, channel);
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR

View file

@ -282,7 +282,8 @@ static std::wstring argvToCommandLine(const std::vector<std::wstring> &argv) {
} }
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2(JNIEnv *env, jobject jobj, jobjectArray jcmd, JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2(JNIEnv *env, jobject jobj, jobjectArray jcmd,
jobjectArray jenv, jstring jdir, jobjectArray jchannels, jstring jslaveName, jint masterFD, jboolean console) { jobjectArray jenv, jstring jdir, jobjectArray jchannels,
jstring jslaveName, jint masterFD, jboolean console) {
int fd; int fd;
std::map<int, winpty_t *>::iterator fd2pty_Iter; std::map<int, winpty_t *>::iterator fd2pty_Iter;
@ -341,7 +342,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2(JNIEnv *env, job
} }
} }
bail_out: env->ReleaseStringChars(jdir, (const jchar*) cwdW); bail_out:
env->ReleaseStringChars(jdir, (const jchar *)cwdW);
env->ReleaseStringUTFChars(jslaveName, pts_name); env->ReleaseStringUTFChars(jslaveName, pts_name);
return pid; return pid;

View file

@ -31,8 +31,7 @@ static HWND consoleHWND;
// arg - process PID // arg - process PID
// Return : TRUE if yes // Return : TRUE if yes
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
static BOOL CALLBACK static BOOL CALLBACK find_child_console(HWND hwnd, LPARAM arg) {
find_child_console(HWND hwnd, LPARAM arg) {
DWORD process_id; DWORD process_id;
DWORD pid = arg; DWORD pid = arg;
@ -54,8 +53,7 @@ find_child_console(HWND hwnd, LPARAM arg) {
// defined to a Windows NT value, thus we don't get this. Can't assume // defined to a Windows NT value, thus we don't get this. Can't assume
// we're running on XP, anyway (or can we by now?) // we're running on XP, anyway (or can we by now?)
#if (_WIN32_WINNT < 0x0501) || defined(_MSC_VER) #if (_WIN32_WINNT < 0x0501) || defined(_MSC_VER)
typedef BOOL(WINAPI *DebugBreakProcessFunc) typedef BOOL(WINAPI *DebugBreakProcessFunc)(HANDLE);
(HANDLE);
#endif #endif
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
@ -80,8 +78,7 @@ int interruptProcess(int pid) {
if (procaddr != NULL) { if (procaddr != NULL) {
HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid); HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
if (proc != NULL) { if (proc != NULL) {
typedef BOOL WINAPI( *DebugBreakProcessFunc) typedef BOOL WINAPI (*DebugBreakProcessFunc)(HANDLE);
(HANDLE);
DebugBreakProcessFunc pDebugBreakProcess = (DebugBreakProcessFunc)procaddr; DebugBreakProcessFunc pDebugBreakProcess = (DebugBreakProcessFunc)procaddr;
success = (*pDebugBreakProcess)(proc); success = (*pDebugBreakProcess)(proc);
CloseHandle(proc); CloseHandle(proc);
@ -128,8 +125,8 @@ int interruptProcess(int pid) {
*/ */
DWORD foreground_thread, child_thread; DWORD foreground_thread, child_thread;
foreground_thread = GetWindowThreadProcessId(foreground_window, NULL); foreground_thread = GetWindowThreadProcessId(foreground_window, NULL);
if (foreground_thread == GetCurrentThreadId() if (foreground_thread == GetCurrentThreadId() ||
|| !AttachThreadInput(GetCurrentThreadId(), foreground_thread, TRUE)) { !AttachThreadInput(GetCurrentThreadId(), foreground_thread, TRUE)) {
foreground_thread = 0; foreground_thread = 0;
} }
@ -174,4 +171,3 @@ int interruptProcess(int pid) {
return rc; return rc;
} }

View file

@ -28,7 +28,8 @@ wchar_t path[MAX_PATH + 1] = { _T('\0') }; // Directory where spawner.dll is lo
#if __cplusplus #if __cplusplus
extern "C" extern "C"
#endif #endif
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { BOOL APIENTRY
DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
switch (ul_reason_for_call) { switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH: { case DLL_PROCESS_ATTACH: {
wchar_t *p; wchar_t *p;
@ -40,8 +41,7 @@ BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpRese
} else { } else {
wcscat(path, L"\\"); wcscat(path, L"\\");
} }
} } break;
break;
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH: case DLL_THREAD_DETACH:
break; break;
@ -51,4 +51,3 @@ BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpRese
} }
return TRUE; return TRUE;
} }

View file

@ -224,16 +224,15 @@ int main() {
sa.bInheritHandle = TRUE; sa.bInheritHandle = TRUE;
sa.lpSecurityDescriptor = NULL; sa.lpSecurityDescriptor = NULL;
if ((INVALID_HANDLE_VALUE if ((INVALID_HANDLE_VALUE ==
== (stdHandles[0] = CreateFileW(inPipeName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, &sa))) (stdHandles[0] = CreateFileW(inPipeName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, &sa))) ||
|| (INVALID_HANDLE_VALUE (INVALID_HANDLE_VALUE ==
== (stdHandles[1] = CreateFileW(outPipeName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, (stdHandles[1] = CreateFileW(outPipeName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, &sa))) ||
0, &sa))) (INVALID_HANDLE_VALUE ==
|| (INVALID_HANDLE_VALUE (stdHandles[2] = CreateFileW(errPipeName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, &sa)))) {
== (stdHandles[2] = CreateFileW(errPipeName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
0, &sa)))) {
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Failed to open pipe %i, %i, %i: %i\n"), stdHandles[0], stdHandles[1], stdHandles[2], GetLastError()); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Failed to open pipe %i, %i, %i: %i\n"), stdHandles[0],
stdHandles[1], stdHandles[2], GetLastError());
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
CloseHandle(stdHandles[0]); CloseHandle(stdHandles[0]);
@ -245,10 +244,11 @@ int main() {
SetHandleInformation(stdHandles[1], HANDLE_FLAG_INHERIT, TRUE); SetHandleInformation(stdHandles[1], HANDLE_FLAG_INHERIT, TRUE);
SetHandleInformation(stdHandles[2], HANDLE_FLAG_INHERIT, TRUE); SetHandleInformation(stdHandles[2], HANDLE_FLAG_INHERIT, TRUE);
if (!SetStdHandle(STD_INPUT_HANDLE, stdHandles[0]) || !SetStdHandle(STD_OUTPUT_HANDLE, stdHandles[1]) if (!SetStdHandle(STD_INPUT_HANDLE, stdHandles[0]) || !SetStdHandle(STD_OUTPUT_HANDLE, stdHandles[1]) ||
|| !SetStdHandle(STD_ERROR_HANDLE, stdHandles[2])) { !SetStdHandle(STD_ERROR_HANDLE, stdHandles[2])) {
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Failed to reassign standard streams: %i\n"), GetLastError()); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Failed to reassign standard streams: %i\n"),
GetLastError());
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
CloseHandle(stdHandles[0]); CloseHandle(stdHandles[0]);
@ -328,7 +328,8 @@ int main() {
if (NULL != hJob) { if (NULL != hJob) {
if (!AssignProcessToJobObject(hJob, pi.hProcess)) { if (!AssignProcessToJobObject(hJob, pi.hProcess)) {
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Cannot assign process %i to a job\n"), pi.dwProcessId); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Cannot assign process %i to a job\n"),
pi.dwProcessId);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
DisplayErrorMessage(); DisplayErrorMessage();
#endif #endif
@ -343,7 +344,8 @@ int main() {
case WAIT_OBJECT_0 + 0: // SIGINT case WAIT_OBJECT_0 + 0: // SIGINT
case WAIT_OBJECT_0 + 4: // CTRL-C case WAIT_OBJECT_0 + 4: // CTRL-C
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("starter (PID %i) received CTRL-C event\n"), currentPID); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("starter (PID %i) received CTRL-C event\n"),
currentPID);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
if ((event == (WAIT_OBJECT_0 + 0)) && isCygwin(h[1])) { if ((event == (WAIT_OBJECT_0 + 0)) && isCygwin(h[1])) {
@ -364,8 +366,8 @@ int main() {
case WAIT_OBJECT_0 + 1: // App terminated normally case WAIT_OBJECT_0 + 1: // App terminated normally
// Make it's exit code our exit code // Make it's exit code our exit code
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("starter: launched process has been terminated(PID %i)\n"), swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]),
pi.dwProcessId); _T("starter: launched process has been terminated(PID %i)\n"), pi.dwProcessId);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
GetExitCodeProcess(pi.hProcess, &dwExitCode); GetExitCodeProcess(pi.hProcess, &dwExitCode);
@ -381,7 +383,8 @@ int main() {
{ {
const wchar_t *signal = (event == WAIT_OBJECT_0 + 2) ? L"TERM" : L"KILL"; const wchar_t *signal = (event == WAIT_OBJECT_0 + 2) ? L"TERM" : L"KILL";
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("starter received %s event (PID %i)\n"), signal, currentPID); swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("starter received %s event (PID %i)\n"), signal,
currentPID);
OutputDebugStringW(buffer); OutputDebugStringW(buffer);
#endif #endif
if (isCygwin(h[1])) { if (isCygwin(h[1])) {
@ -419,7 +422,6 @@ int main() {
exitProc = TRUE; exitProc = TRUE;
break; break;
} }
} }
} else { } else {
#ifdef DEBUG_MONITOR #ifdef DEBUG_MONITOR
@ -482,8 +484,8 @@ int copyTo(wchar_t *target, const wchar_t *source, int cpyLength, int availSpace
bSlash = TRUE; bSlash = TRUE;
} else { } else {
// Don't escape embracing quotation marks // Don't escape embracing quotation marks
if ((source[i] == _T('\"')) if ((source[i] == _T('\"')) &&
&& !((nQuotationMode == QUOTATION_DONE) && ((i == 0) || (i == (cpyLength - 1))))) { !((nQuotationMode == QUOTATION_DONE) && ((i == 0) || (i == (cpyLength - 1))))) {
if (!bSlash) { if (!bSlash) {
if (j == availSpace) { if (j == availSpace) {
return -1; return -1;

View file

@ -1,192 +1,5 @@
#Wed Jun 06 11:37:01 EDT 2007
eclipse.preferences.version=1 eclipse.preferences.version=1
indexer/indexerId=org.eclipse.cdt.core.nullindexer indexer/indexerId=org.eclipse.cdt.core.nullindexer
indexerId=org.eclipse.cdt.core.nullindexer indexerId=org.eclipse.cdt.core.nullindexer
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_assignment=16
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.cdt.core.formatter.alignment_for_compact_if=16
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=34
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18
org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=0
org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16
org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48
org.eclipse.cdt.core.formatter.alignment_for_expression_list=0
org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.cdt.core.formatter.alignment_for_lambda_expression=20
org.eclipse.cdt.core.formatter.alignment_for_member_access=0
org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16
org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_linkage_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.cdt.core.formatter.comment.line_up_line_comment_in_blocks_on_first_column=false
org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1
org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column=true
org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true
org.eclipse.cdt.core.formatter.comment_formatter_off_tag=@formatter\:off
org.eclipse.cdt.core.formatter.comment_formatter_on_tag=@formatter\:on
org.eclipse.cdt.core.formatter.compact_else_if=true
org.eclipse.cdt.core.formatter.continuation_indentation=2
org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.cdt.core.formatter.format_block_comment=true
org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.cdt.core.formatter.format_header_comment=true
org.eclipse.cdt.core.formatter.format_line_comment=true
org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false
org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_linkage=false
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false
org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false
org.eclipse.cdt.core.formatter.indent_empty_lines=false
org.eclipse.cdt.core.formatter.indent_label_compare_to_statements=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.cdt.core.formatter.indentation.size=4
org.eclipse.cdt.core.formatter.insert_new_line_after_colon_in_constructor_initializer_list=insert
org.eclipse.cdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_linkage_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_ref_qualifier_in_structured_binding=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.join_wrapped_lines=true
org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.cdt.core.formatter.lineSplit=120
org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.cdt.core.formatter.tabulation.char=tab
org.eclipse.cdt.core.formatter.tabulation.size=4
org.eclipse.cdt.core.formatter.use_comment_formatter_tag=true
org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false

View file

@ -1,3 +0,0 @@
eclipse.preferences.version=1
formatter_profile=_Unmanaged profile 'CDT'
formatter_settings_version=1

View file

@ -1,189 +0,0 @@
eclipse.preferences.version=1
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_assignment=16
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.cdt.core.formatter.alignment_for_compact_if=16
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=34
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18
org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=0
org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16
org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48
org.eclipse.cdt.core.formatter.alignment_for_expression_list=0
org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.cdt.core.formatter.alignment_for_lambda_expression=20
org.eclipse.cdt.core.formatter.alignment_for_member_access=0
org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16
org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_linkage_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.cdt.core.formatter.comment.line_up_line_comment_in_blocks_on_first_column=false
org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1
org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column=true
org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true
org.eclipse.cdt.core.formatter.comment_formatter_off_tag=@formatter\:off
org.eclipse.cdt.core.formatter.comment_formatter_on_tag=@formatter\:on
org.eclipse.cdt.core.formatter.compact_else_if=true
org.eclipse.cdt.core.formatter.continuation_indentation=2
org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.cdt.core.formatter.format_block_comment=true
org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.cdt.core.formatter.format_header_comment=true
org.eclipse.cdt.core.formatter.format_line_comment=true
org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false
org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_linkage=false
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false
org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false
org.eclipse.cdt.core.formatter.indent_empty_lines=false
org.eclipse.cdt.core.formatter.indent_label_compare_to_statements=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.cdt.core.formatter.indentation.size=4
org.eclipse.cdt.core.formatter.insert_new_line_after_colon_in_constructor_initializer_list=insert
org.eclipse.cdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_linkage_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_ref_qualifier_in_structured_binding=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.join_wrapped_lines=true
org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.cdt.core.formatter.lineSplit=120
org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.cdt.core.formatter.tabulation.char=tab
org.eclipse.cdt.core.formatter.tabulation.size=4
org.eclipse.cdt.core.formatter.use_comment_formatter_tag=true
org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false

View file

@ -1,3 +0,0 @@
eclipse.preferences.version=1
formatter_profile=_Unmanaged profile 'CDT'
formatter_settings_version=1

View file

@ -1,189 +0,0 @@
eclipse.preferences.version=1
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_assignment=16
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.cdt.core.formatter.alignment_for_compact_if=16
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=34
org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18
org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=0
org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16
org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48
org.eclipse.cdt.core.formatter.alignment_for_expression_list=0
org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.cdt.core.formatter.alignment_for_lambda_expression=20
org.eclipse.cdt.core.formatter.alignment_for_member_access=0
org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16
org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_linkage_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.cdt.core.formatter.comment.line_up_line_comment_in_blocks_on_first_column=false
org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1
org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column=true
org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true
org.eclipse.cdt.core.formatter.comment_formatter_off_tag=@formatter\:off
org.eclipse.cdt.core.formatter.comment_formatter_on_tag=@formatter\:on
org.eclipse.cdt.core.formatter.compact_else_if=true
org.eclipse.cdt.core.formatter.continuation_indentation=2
org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.cdt.core.formatter.format_block_comment=true
org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.cdt.core.formatter.format_header_comment=true
org.eclipse.cdt.core.formatter.format_line_comment=true
org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false
org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_linkage=false
org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false
org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false
org.eclipse.cdt.core.formatter.indent_empty_lines=false
org.eclipse.cdt.core.formatter.indent_label_compare_to_statements=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.cdt.core.formatter.indentation.size=4
org.eclipse.cdt.core.formatter.insert_new_line_after_colon_in_constructor_initializer_list=insert
org.eclipse.cdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert
org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert
org.eclipse.cdt.core.formatter.insert_space_after_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_opening_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_pointer_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_closing_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_structured_binding_name_list=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_lambda_return=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_linkage_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.cdt.core.formatter.insert_space_before_opening_structured_binding_name_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_declarator_list=insert
org.eclipse.cdt.core.formatter.insert_space_before_pointer_in_method_declaration=insert
org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.cdt.core.formatter.insert_space_before_ref_qualifier_in_structured_binding=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.cdt.core.formatter.join_wrapped_lines=true
org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.cdt.core.formatter.lineSplit=120
org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.cdt.core.formatter.tabulation.char=tab
org.eclipse.cdt.core.formatter.tabulation.size=4
org.eclipse.cdt.core.formatter.use_comment_formatter_tag=true
org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false

View file

@ -1,3 +0,0 @@
eclipse.preferences.version=1
formatter_profile=_Unmanaged profile 'CDT'
formatter_settings_version=1

View file

@ -12,56 +12,50 @@ extern "C" {
* Method: open0 * Method: open0
* Signature: (Ljava/lang/String;IIII)J * Signature: (Ljava/lang/String;IIII)J
*/ */
JNIEXPORT jlong JNICALL Java_org_eclipse_cdt_serial_SerialPort_open0 JNIEXPORT jlong JNICALL Java_org_eclipse_cdt_serial_SerialPort_open0(JNIEnv *, jobject, jstring, jint, jint, jint,
(JNIEnv *, jobject, jstring, jint, jint, jint, jint); jint);
/* /*
* Class: org_eclipse_cdt_serial_SerialPort * Class: org_eclipse_cdt_serial_SerialPort
* Method: close0 * Method: close0
* Signature: (J)V * Signature: (J)V
*/ */
JNIEXPORT void JNICALL Java_org_eclipse_cdt_serial_SerialPort_close0 JNIEXPORT void JNICALL Java_org_eclipse_cdt_serial_SerialPort_close0(JNIEnv *, jobject, jlong);
(JNIEnv *, jobject, jlong);
/* /*
* Class: org_eclipse_cdt_serial_SerialPort * Class: org_eclipse_cdt_serial_SerialPort
* Method: read1 * Method: read1
* Signature: (J[BII)I * Signature: (J[BII)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_serial_SerialPort_read1 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_serial_SerialPort_read1(JNIEnv *, jobject, jlong, jbyteArray, jint, jint);
(JNIEnv *, jobject, jlong, jbyteArray, jint, jint);
/* /*
* Class: org_eclipse_cdt_serial_SerialPort * Class: org_eclipse_cdt_serial_SerialPort
* Method: available0 * Method: available0
* Signature: (J)I * Signature: (J)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_serial_SerialPort_available0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_serial_SerialPort_available0(JNIEnv *, jobject, jlong);
(JNIEnv *, jobject, jlong);
/* /*
* Class: org_eclipse_cdt_serial_SerialPort * Class: org_eclipse_cdt_serial_SerialPort
* Method: write0 * Method: write0
* Signature: (JI)V * Signature: (JI)V
*/ */
JNIEXPORT void JNICALL Java_org_eclipse_cdt_serial_SerialPort_write0 JNIEXPORT void JNICALL Java_org_eclipse_cdt_serial_SerialPort_write0(JNIEnv *, jobject, jlong, jint);
(JNIEnv *, jobject, jlong, jint);
/* /*
* Class: org_eclipse_cdt_serial_SerialPort * Class: org_eclipse_cdt_serial_SerialPort
* Method: write1 * Method: write1
* Signature: (J[BII)V * Signature: (J[BII)V
*/ */
JNIEXPORT void JNICALL Java_org_eclipse_cdt_serial_SerialPort_write1 JNIEXPORT void JNICALL Java_org_eclipse_cdt_serial_SerialPort_write1(JNIEnv *, jobject, jlong, jbyteArray, jint, jint);
(JNIEnv *, jobject, jlong, jbyteArray, jint, jint);
/* /*
* Class: org_eclipse_cdt_serial_SerialPort * Class: org_eclipse_cdt_serial_SerialPort
* Method: getPortName * Method: getPortName
* Signature: (I)Ljava/lang/String; * Signature: (I)Ljava/lang/String;
*/ */
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_serial_SerialPort_getPortName JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_serial_SerialPort_getPortName(JNIEnv *, jclass, jint);
(JNIEnv *, jclass, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -204,7 +204,8 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
} }
#else #else
// On OSX speed_t is simply the baud rate: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/cfsetispeed.3.html // On OSX speed_t is simply the baud rate:
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/cfsetispeed.3.html
cfsetispeed(&options, baudRate); cfsetispeed(&options, baudRate);
cfsetospeed(&options, baudRate); cfsetospeed(&options, baudRate);
#endif #endif
@ -224,7 +225,6 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
case 8: case 8:
options.c_cflag |= CS8; options.c_cflag |= CS8;
break; break;
} }
// set parity // set parity
@ -268,13 +268,8 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
return fd; return fd;
#else // __MINGW32__ #else // __MINGW32__
const wchar_t *cportName = (const wchar_t *)(*env)->GetStringChars(env, portName, NULL); const wchar_t *cportName = (const wchar_t *)(*env)->GetStringChars(env, portName, NULL);
HANDLE handle = CreateFile(cportName, HANDLE handle =
GENERIC_READ | GENERIC_WRITE, CreateFile(cportName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL);
(*env)->ReleaseStringChars(env, portName, cportName); (*env)->ReleaseStringChars(env, portName, cportName);
if (handle == INVALID_HANDLE_VALUE) { if (handle == INVALID_HANDLE_VALUE) {
@ -342,8 +337,7 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
#endif // __MINGW32__ #endif // __MINGW32__
} }
JNIEXPORT void JNICALL FUNC(close0) JNIEXPORT void JNICALL FUNC(close0)(JNIEnv *env, jobject jobj, jlong handle) {
(JNIEnv *env, jobject jobj, jlong handle) {
#ifndef __MINGW32__ #ifndef __MINGW32__
close(handle); close(handle);
#else #else
@ -434,8 +428,7 @@ JNIEXPORT jint JNICALL FUNC(read1)(JNIEnv *env, jobject jobj, jlong jhandle, jby
#endif #endif
} }
JNIEXPORT void JNICALL FUNC(write0) JNIEXPORT void JNICALL FUNC(write0)(JNIEnv *env, jobject jobj, jlong jhandle, jint b) {
(JNIEnv *env, jobject jobj, jlong jhandle, jint b) {
#ifndef __MINGW32__ #ifndef __MINGW32__
char buff = b; char buff = b;
write(jhandle, &buff, 1); write(jhandle, &buff, 1);
@ -459,8 +452,7 @@ JNIEXPORT void JNICALL FUNC(write0)
if (!WriteFile(handle, &buff, sizeof(buff), &nwritten, &olp)) { if (!WriteFile(handle, &buff, sizeof(buff), &nwritten, &olp)) {
if (GetLastError() != ERROR_IO_PENDING) { if (GetLastError() != ERROR_IO_PENDING) {
throwIOException(env, "Error writing to port"); throwIOException(env, "Error writing to port");
} } else {
else {
switch (WaitForSingleObject(olp.hEvent, INFINITE)) { switch (WaitForSingleObject(olp.hEvent, INFINITE)) {
case WAIT_OBJECT_0: case WAIT_OBJECT_0:
if (!GetOverlappedResult(handle, &olp, &nwritten, FALSE)) { if (!GetOverlappedResult(handle, &olp, &nwritten, FALSE)) {
@ -474,7 +466,8 @@ JNIEXPORT void JNICALL FUNC(write0)
#endif #endif
} }
JNIEXPORT void JNICALL FUNC(write1)(JNIEnv *env, jobject jobj, jlong jhandle, jbyteArray bytes, jint offset, jint size) { JNIEXPORT void JNICALL FUNC(write1)(JNIEnv *env, jobject jobj, jlong jhandle, jbyteArray bytes, jint offset,
jint size) {
#ifndef __MINGW32__ #ifndef __MINGW32__
while (size > 0) { while (size > 0) {
jbyte buff[256]; jbyte buff[256];
@ -529,8 +522,7 @@ JNIEXPORT void JNICALL FUNC(write1)(JNIEnv *env, jobject jobj, jlong jhandle, jb
} }
#ifdef __MINGW32__ #ifdef __MINGW32__
JNIEXPORT jstring FUNC(getPortName)(JNIEnv *env, jclass cls, jint i) JNIEXPORT jstring FUNC(getPortName)(JNIEnv *env, jclass cls, jint i) {
{
HKEY key; HKEY key;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_READ, &key) != ERROR_SUCCESS) { if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_READ, &key) != ERROR_SUCCESS) {

View file

@ -88,24 +88,6 @@ git ls-files -- \*\*/.project ":!$COREPROJECT/.project" | while read i ; do
else else
rm -f $d/.settings/org.eclipse.pde*.prefs rm -f $d/.settings/org.eclipse.pde*.prefs
fi fi
# CDT (native code)
if [[ $natures == *"org.eclipse.cdt.core.cnature"* ]]; then
cp $COREPROJECT/.settings/org.eclipse.cdt.*.prefs $d/.settings
if echo $i | grep -E '\.tests?[/\.]' > /dev/null; then
# Disable indexer for test plugins
sed -i '
/^eclipse.preferences.version/ {
p # Print line
i indexer/indexerId=org.eclipse.cdt.core.nullindexer
i indexerId=org.eclipse.cdt.core.nullindexer
i instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
d # Already printed
}' $d/.settings/org.eclipse.cdt.core.prefs
fi
else
rm -f $d/.settings/org.eclipse.cdt.*.prefs
fi
done done
## ##

View file

@ -23,14 +23,9 @@ for p in native/org.eclipse.cdt.native.serial core/org.eclipse.cdt.core.native;
exit 1 exit 1
fi fi
# Disabled until https://bugs.eclipse.org/bugs/show_bug.cgi?id=568137 is resolved # Need to apply format after header files are generated
# # Need to apply format after header files are generated echo "Applying enforcing formatting rules to $p native source files"
# tmpws=$(mktemp -d) clang-format -i --style=file $(git ls-files $p/native_src/\*\*/\*.{c,cpp,cc,h,hh,hpp})
# ${ECLIPSE:-~/buildtools/eclipse-cpp-2020-09/eclipse} \
# -consolelog -nosplash -application org.eclipse.cdt.core.CodeFormatter \
# -config $p/.settings/org.eclipse.cdt.core.prefs \
# $p/native_src -verbose -data $tmpws
# rm -rf $tmpws
echo "Rebuilding $p natives to make sure they match source" echo "Rebuilding $p natives to make sure they match source"
logfile=make-natives-${p//\//-}.log logfile=make-natives-${p//\//-}.log