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:
parent
7f10dce12f
commit
6431307e70
46 changed files with 2707 additions and 3505 deletions
12
.clang-format
Normal file
12
.clang-format
Normal 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
1
.gitattributes
vendored
|
@ -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
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
|
|
@ -1,3 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
formatter_profile=_Unmanaged profile 'CDT'
|
|
||||||
formatter_settings_version=1
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
/* from pfind.c */
|
/* from pfind.c */
|
||||||
extern char* pfind(const char *name, char *const envp[]);
|
extern char *pfind(const char *name, char *const envp[]);
|
||||||
|
|
||||||
pid_t exec_pty(const char *path, char *const argv[], char *const envp[], const char *dirpath, int channels[3],
|
pid_t exec_pty(const char *path, char *const argv[], char *const envp[], const char *dirpath, int channels[3],
|
||||||
const char *pts_name, int fdm, int console) {
|
const char *pts_name, int fdm, int console) {
|
||||||
|
@ -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 */
|
||||||
|
@ -154,7 +153,7 @@ pid_t exec_pty(const char *path, char *const argv[], char *const envp[], const c
|
||||||
#ifdef __STAND_ALONE__
|
#ifdef __STAND_ALONE__
|
||||||
int main(int argc, char **argv, char **envp) {
|
int main(int argc, char **argv, char **envp) {
|
||||||
const char *path = "./bufferring_test";
|
const char *path = "./bufferring_test";
|
||||||
int channels[3] = { -1, -1, -1};
|
int channels[3] = {-1, -1, -1};
|
||||||
int status;
|
int status;
|
||||||
FILE *app_stdin;
|
FILE *app_stdin;
|
||||||
FILE *app_stdout;
|
FILE *app_stdout;
|
||||||
|
@ -174,10 +173,10 @@ int main(int argc, char **argv, char **envp) {
|
||||||
} else {
|
} else {
|
||||||
fputs("foo\n", app_stdin);
|
fputs("foo\n", app_stdin);
|
||||||
fputs("bar\n", app_stdin);
|
fputs("bar\n", app_stdin);
|
||||||
while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
|
while (fgets(buffer, sizeof buffer, app_stdout) != NULL) {
|
||||||
fprintf(stdout, "STDOUT: %s\n", buffer);
|
fprintf(stdout, "STDOUT: %s\n", buffer);
|
||||||
}
|
}
|
||||||
while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
|
while (fgets(buffer, sizeof buffer, app_stderr) != NULL) {
|
||||||
fprintf(stdout, "STDERR: %s\n", buffer);
|
fprintf(stdout, "STDERR: %s\n", buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
/* from pfind.c */
|
/* from pfind.c */
|
||||||
extern char* pfind(const char *name, char *const envp[]);
|
extern char *pfind(const char *name, char *const envp[]);
|
||||||
|
|
||||||
pid_t exec0(const char *path, char *const argv[], char *const envp[], const char *dirpath, int channels[3]) {
|
pid_t exec0(const char *path, char *const argv[], char *const envp[], const char *dirpath, int channels[3]) {
|
||||||
int pipe0[2], pipe1[2], pipe2[2];
|
int pipe0[2], pipe1[2], pipe2[2];
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,11 +59,11 @@ int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct
|
||||||
#define TCSAFLUSH TCSETAF
|
#define TCSAFLUSH TCSETAF
|
||||||
#endif
|
#endif
|
||||||
if (termp) {
|
if (termp) {
|
||||||
(void) tcsetattr(*aslave, TCSAFLUSH, termp);
|
(void)tcsetattr(*aslave, TCSAFLUSH, termp);
|
||||||
}
|
}
|
||||||
#ifdef TIOCSWINSZ
|
#ifdef TIOCSWINSZ
|
||||||
if (winp) {
|
if (winp) {
|
||||||
(void) ioctl(*aslave, TIOCSWINSZ, (char *)winp);
|
(void)ioctl(*aslave, TIOCSWINSZ, (char *)winp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -91,7 +91,7 @@ int ptym_open(char *pts_name) {
|
||||||
|
|
||||||
strcpy(pts_name, "/dev/ptmx");
|
strcpy(pts_name, "/dev/ptmx");
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
fdm = posix_openpt(O_RDWR|O_NOCTTY);
|
fdm = posix_openpt(O_RDWR | O_NOCTTY);
|
||||||
#else
|
#else
|
||||||
fdm = getpt();
|
fdm = getpt();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define PATH_DEF "PATH="
|
#define PATH_DEF "PATH="
|
||||||
const int path_def_len = 5; /* strlen(PATH_DEF); */
|
const int path_def_len = 5; /* strlen(PATH_DEF); */
|
||||||
|
|
||||||
char* path_val(char *const envp[]) {
|
char *path_val(char *const envp[]) {
|
||||||
int i;
|
int i;
|
||||||
if (envp == NULL || envp[0] == NULL) {
|
if (envp == NULL || envp[0] == NULL) {
|
||||||
return getenv("PATH");
|
return getenv("PATH");
|
||||||
|
@ -48,7 +48,7 @@ char* path_val(char *const envp[]) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* pfind(const char *name, char *const envp[]) {
|
char *pfind(const char *name, char *const envp[]) {
|
||||||
char *tok;
|
char *tok;
|
||||||
char *sp;
|
char *sp;
|
||||||
char *path;
|
char *path;
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -46,7 +45,7 @@ Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *env, jobject jobj, jboolea
|
||||||
if (fid == NULL) {
|
if (fid == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
(*env)->SetIntField(env, jobj, fid, (jint) master);
|
(*env)->SetIntField(env, jobj, fid, (jint)master);
|
||||||
|
|
||||||
/* Create a new String for the slave. */
|
/* Create a new String for the slave. */
|
||||||
jstr = (*env)->NewStringUTF(env, line);
|
jstr = (*env)->NewStringUTF(env, line);
|
||||||
|
@ -70,4 +69,3 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size(J
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,10 @@ static void print_array(char **c_array) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char** alloc_c_array(JNIEnv *env, jobjectArray j_array) {
|
static char **alloc_c_array(JNIEnv *env, jobjectArray j_array) {
|
||||||
int i;
|
int i;
|
||||||
jint c_array_size = (*env)->GetArrayLength(env, j_array);
|
jint c_array_size = (*env)->GetArrayLength(env, j_array);
|
||||||
char **c_array = calloc(c_array_size + 1, sizeof(char*));
|
char **c_array = calloc(c_array_size + 1, sizeof(char *));
|
||||||
|
|
||||||
if (c_array == NULL) {
|
if (c_array == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -56,7 +56,7 @@ static char** alloc_c_array(JNIEnv *env, jobjectArray j_array) {
|
||||||
for (i = 0; i < c_array_size; i++) {
|
for (i = 0; i < c_array_size; i++) {
|
||||||
jstring j_str = (jstring)(*env)->GetObjectArrayElement(env, j_array, i);
|
jstring j_str = (jstring)(*env)->GetObjectArrayElement(env, j_array, i);
|
||||||
const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL);
|
const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL);
|
||||||
c_array[i] = (char*) strdup(c_str);
|
c_array[i] = (char *)strdup(c_str);
|
||||||
(*env)->ReleaseStringUTFChars(env, j_str, c_str);
|
(*env)->ReleaseStringUTFChars(env, j_str, c_str);
|
||||||
(*env)->DeleteLocalRef(env, j_str);
|
(*env)->DeleteLocalRef(env, j_str);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
@ -60,7 +64,7 @@ pProcInfo_t createProcInfo();
|
||||||
pProcInfo_t findProcInfo(int pid);
|
pProcInfo_t findProcInfo(int pid);
|
||||||
|
|
||||||
// We launch separate thread for each project to trap it termination
|
// We launch separate thread for each project to trap it termination
|
||||||
void _cdecl waitProcTermination(void* pv);
|
void _cdecl waitProcTermination(void *pv);
|
||||||
|
|
||||||
// This is a helper function to prevent losing of quotation marks
|
// This is a helper function to prevent losing of quotation marks
|
||||||
static int copyTo(wchar_t *target, const wchar_t *source, int cpyLenght, int availSpace);
|
static int copyTo(wchar_t *target, const wchar_t *source, int cpyLenght, int availSpace);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +118,7 @@ void ensureSize(wchar_t **ptr, int *psize, int requiredLength) {
|
||||||
if (size < requiredLength) {
|
if (size < requiredLength) {
|
||||||
size = requiredLength;
|
size = requiredLength;
|
||||||
}
|
}
|
||||||
*ptr = (wchar_t*) realloc(*ptr, size * sizeof(wchar_t));
|
*ptr = (wchar_t *)realloc(*ptr, size * sizeof(wchar_t));
|
||||||
if (NULL == *ptr) {
|
if (NULL == *ptr) {
|
||||||
*psize = 0;
|
*psize = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,10 +130,11 @@ 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;
|
||||||
DWORD flags = 0;
|
DWORD flags = 0;
|
||||||
wchar_t *cwd = NULL;
|
wchar_t *cwd = NULL;
|
||||||
|
@ -181,7 +187,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
|
||||||
}
|
}
|
||||||
|
|
||||||
nCmdLineLength = MAX_CMD_SIZE;
|
nCmdLineLength = MAX_CMD_SIZE;
|
||||||
szCmdLine = (wchar_t*) malloc(nCmdLineLength * sizeof(wchar_t));
|
szCmdLine = (wchar_t *)malloc(nCmdLineLength * sizeof(wchar_t));
|
||||||
szCmdLine[0] = _T('\0');
|
szCmdLine[0] = _T('\0');
|
||||||
if ((HIBYTE(LOWORD(GetVersion()))) & 0x80) {
|
if ((HIBYTE(LOWORD(GetVersion()))) & 0x80) {
|
||||||
ThrowByName(env, "java/io/IOException", "Does not support Windows 3.1/95/98/Me");
|
ThrowByName(env, "java/io/IOException", "Does not support Windows 3.1/95/98/Me");
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -267,7 +273,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
|
||||||
jstring item = (jstring)(*env)->GetObjectArrayElement(env, cmdarray, i);
|
jstring item = (jstring)(*env)->GetObjectArrayElement(env, cmdarray, i);
|
||||||
jsize len = (*env)->GetStringLength(env, item);
|
jsize len = (*env)->GetStringLength(env, item);
|
||||||
int nCpyLen;
|
int nCpyLen;
|
||||||
const wchar_t *str = (const wchar_t*) (*env)->GetStringChars(env, item, 0);
|
const wchar_t *str = (const wchar_t *)(*env)->GetStringChars(env, item, 0);
|
||||||
if (NULL != str) {
|
if (NULL != str) {
|
||||||
int requiredSize = nPos + len + 2;
|
int requiredSize = nPos + len + 2;
|
||||||
if (requiredSize > 32 * 1024) {
|
if (requiredSize > 32 * 1024) {
|
||||||
|
@ -287,56 +293,56 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
|
||||||
nPos += nCpyLen;
|
nPos += nCpyLen;
|
||||||
szCmdLine[nPos] = _T(' ');
|
szCmdLine[nPos] = _T(' ');
|
||||||
++nPos;
|
++nPos;
|
||||||
(*env)->ReleaseStringChars(env, item, (const jchar*) str);
|
(*env)->ReleaseStringChars(env, item, (const jchar *)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
szCmdLine[nPos] = _T('\0');
|
szCmdLine[nPos] = _T('\0');
|
||||||
|
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("There are %i environment variables \n"), nEnvVars);
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("There are %i environment variables \n"), nEnvVars);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
// Prepare environment block
|
// Prepare environment block
|
||||||
if (nEnvVars > 0) {
|
if (nEnvVars > 0) {
|
||||||
nPos = 0;
|
nPos = 0;
|
||||||
szEnvBlock = (wchar_t*) malloc(nBlkSize * sizeof(wchar_t));
|
szEnvBlock = (wchar_t *)malloc(nBlkSize * sizeof(wchar_t));
|
||||||
for (i = 0; i < nEnvVars; ++i) {
|
for (i = 0; i < nEnvVars; ++i) {
|
||||||
jstring item = (jstring)(*env)->GetObjectArrayElement(env, envp, i);
|
jstring item = (jstring)(*env)->GetObjectArrayElement(env, envp, i);
|
||||||
jsize len = (*env)->GetStringLength(env, item);
|
jsize len = (*env)->GetStringLength(env, item);
|
||||||
const wchar_t *str = (const wchar_t*) (*env)->GetStringChars(env, item, 0);
|
const wchar_t *str = (const wchar_t *)(*env)->GetStringChars(env, item, 0);
|
||||||
if (NULL != str) {
|
if (NULL != str) {
|
||||||
while ((nBlkSize - nPos) <= (len + 2)) { // +2 for two '\0'
|
while ((nBlkSize - nPos) <= (len + 2)) { // +2 for two '\0'
|
||||||
nBlkSize += MAX_ENV_SIZE;
|
nBlkSize += MAX_ENV_SIZE;
|
||||||
szEnvBlock = (wchar_t*) realloc(szEnvBlock, nBlkSize * sizeof(wchar_t));
|
szEnvBlock = (wchar_t *)realloc(szEnvBlock, nBlkSize * sizeof(wchar_t));
|
||||||
if (NULL == szEnvBlock) {
|
if (NULL == szEnvBlock) {
|
||||||
ThrowByName(env, "java/io/IOException", "Not enough memory");
|
ThrowByName(env, "java/io/IOException", "Not enough memory");
|
||||||
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);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
wcsncpy(szEnvBlock + nPos, str, len);
|
wcsncpy(szEnvBlock + nPos, str, len);
|
||||||
nPos += len;
|
nPos += len;
|
||||||
szEnvBlock[nPos] = _T('\0');
|
szEnvBlock[nPos] = _T('\0');
|
||||||
++nPos;
|
++nPos;
|
||||||
(*env)->ReleaseStringChars(env, item, (const jchar*) str);
|
(*env)->ReleaseStringChars(env, item, (const jchar *)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
szEnvBlock[nPos] = _T('\0');
|
szEnvBlock[nPos] = _T('\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir != 0) {
|
if (dir != 0) {
|
||||||
const wchar_t *str = (const wchar_t*) (*env)->GetStringChars(env, dir, 0);
|
const wchar_t *str = (const wchar_t *)(*env)->GetStringChars(env, dir, 0);
|
||||||
if (NULL != str) {
|
if (NULL != str) {
|
||||||
cwd = wcsdup(str);
|
cwd = wcsdup(str);
|
||||||
(*env)->ReleaseStringChars(env, dir, (const jchar*) str);
|
(*env)->ReleaseStringChars(env, dir, (const jchar *)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +386,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
|
||||||
CloseHandle(stdHandles[2]);
|
CloseHandle(stdHandles[2]);
|
||||||
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||||
(char*) &lpMsgBuf, 0, NULL);
|
(char *)&lpMsgBuf, 0, NULL);
|
||||||
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
||||||
// Free the buffer.
|
// Free the buffer.
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
|
@ -399,7 +405,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
|
||||||
what = WaitForMultipleObjects(2, h, FALSE, INFINITE);
|
what = WaitForMultipleObjects(2, h, FALSE, INFINITE);
|
||||||
if (what != WAIT_OBJECT_0) { // CreateProcess failed
|
if (what != WAIT_OBJECT_0) { // CreateProcess failed
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Process %i failed\n"), pi.dwProcessId);
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Process %i failed\n"), pi.dwProcessId);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
cleanUpProcBlock(pCurProcInfo);
|
cleanUpProcBlock(pCurProcInfo);
|
||||||
|
@ -408,32 +414,30 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv *
|
||||||
OutputDebugStringW(_T("Process failed\n"));
|
OutputDebugStringW(_T("Process failed\n"));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ret = (long) (pCurProcInfo->uid);
|
ret = (long)(pCurProcInfo->uid);
|
||||||
|
|
||||||
// Prepare stream handlers to return to java program
|
// Prepare stream handlers to return to java program
|
||||||
for (jsize i = 0; i < 3; i++) {
|
for (jsize i = 0; i < 3; i++) {
|
||||||
jobject chan = (*env)->NewObject(env, channelClass, channelConstructor, (jlong) stdHandles[i]);
|
jobject chan = (*env)->NewObject(env, channelClass, channelConstructor, (jlong)stdHandles[i]);
|
||||||
(*env)->SetObjectArrayElement(env, channels, i, chan);
|
(*env)->SetObjectArrayElement(env, channels, i, chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
// do the cleanup so launch the according thread
|
// do the cleanup so launch the according thread
|
||||||
// create a copy of the PROCESS_INFORMATION as this might get destroyed
|
// create a copy of the PROCESS_INFORMATION as this might get destroyed
|
||||||
piCopy = (PROCESS_INFORMATION*) malloc(sizeof(PROCESS_INFORMATION));
|
piCopy = (PROCESS_INFORMATION *)malloc(sizeof(PROCESS_INFORMATION));
|
||||||
memcpy(piCopy, &pi, sizeof(PROCESS_INFORMATION));
|
memcpy(piCopy, &pi, sizeof(PROCESS_INFORMATION));
|
||||||
_beginthread(waitProcTermination, 0, (void*) piCopy);
|
_beginthread(waitProcTermination, 0, (void *)piCopy);
|
||||||
|
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
OutputDebugStringW(_T("Process started\n"));
|
OutputDebugStringW(_T("Process started\n"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&cs);
|
LeaveCriticalSection(&cs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -446,11 +450,12 @@ 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};
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
DWORD flags = 0;
|
DWORD flags = 0;
|
||||||
wchar_t *cwd = NULL;
|
wchar_t *cwd = NULL;
|
||||||
|
@ -466,7 +471,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
wchar_t *szEnvBlock = NULL;
|
wchar_t *szEnvBlock = NULL;
|
||||||
|
|
||||||
nCmdLineLength = MAX_CMD_SIZE;
|
nCmdLineLength = MAX_CMD_SIZE;
|
||||||
szCmdLine = (wchar_t*) malloc(nCmdLineLength * sizeof(wchar_t));
|
szCmdLine = (wchar_t *)malloc(nCmdLineLength * sizeof(wchar_t));
|
||||||
szCmdLine[0] = 0;
|
szCmdLine[0] = 0;
|
||||||
|
|
||||||
sa.nLength = sizeof(sa);
|
sa.nLength = sizeof(sa);
|
||||||
|
@ -483,7 +488,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
jstring item = (jstring)(*env)->GetObjectArrayElement(env, cmdarray, i);
|
jstring item = (jstring)(*env)->GetObjectArrayElement(env, cmdarray, i);
|
||||||
jsize len = (*env)->GetStringLength(env, item);
|
jsize len = (*env)->GetStringLength(env, item);
|
||||||
int nCpyLen;
|
int nCpyLen;
|
||||||
const wchar_t *str = (const wchar_t*) (*env)->GetStringChars(env, item, 0);
|
const wchar_t *str = (const wchar_t *)(*env)->GetStringChars(env, item, 0);
|
||||||
if (NULL != str) {
|
if (NULL != str) {
|
||||||
int requiredSize = nPos + len + 2;
|
int requiredSize = nPos + len + 2;
|
||||||
if (requiredSize > 32 * 1024) {
|
if (requiredSize > 32 * 1024) {
|
||||||
|
@ -503,7 +508,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
nPos += nCpyLen;
|
nPos += nCpyLen;
|
||||||
szCmdLine[nPos] = _T(' ');
|
szCmdLine[nPos] = _T(' ');
|
||||||
++nPos;
|
++nPos;
|
||||||
(*env)->ReleaseStringChars(env, item, (const jchar*) str);
|
(*env)->ReleaseStringChars(env, item, (const jchar *)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,16 +516,16 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
|
|
||||||
// Prepare environment block
|
// Prepare environment block
|
||||||
if (nEnvVars > 0) {
|
if (nEnvVars > 0) {
|
||||||
szEnvBlock = (wchar_t*) malloc(nBlkSize * sizeof(wchar_t));
|
szEnvBlock = (wchar_t *)malloc(nBlkSize * sizeof(wchar_t));
|
||||||
nPos = 0;
|
nPos = 0;
|
||||||
for (i = 0; i < nEnvVars; ++i) {
|
for (i = 0; i < nEnvVars; ++i) {
|
||||||
jstring item = (jstring)(*env)->GetObjectArrayElement(env, envp, i);
|
jstring item = (jstring)(*env)->GetObjectArrayElement(env, envp, i);
|
||||||
jsize len = (*env)->GetStringLength(env, item);
|
jsize len = (*env)->GetStringLength(env, item);
|
||||||
const wchar_t *str = (const wchar_t*) (*env)->GetStringChars(env, item, 0);
|
const wchar_t *str = (const wchar_t *)(*env)->GetStringChars(env, item, 0);
|
||||||
if (NULL != str) {
|
if (NULL != str) {
|
||||||
while ((nBlkSize - nPos) <= (len + 2)) { // +2 for two '\0'
|
while ((nBlkSize - nPos) <= (len + 2)) { // +2 for two '\0'
|
||||||
nBlkSize += MAX_ENV_SIZE;
|
nBlkSize += MAX_ENV_SIZE;
|
||||||
szEnvBlock = (wchar_t*) realloc(szEnvBlock, nBlkSize * sizeof(wchar_t));
|
szEnvBlock = (wchar_t *)realloc(szEnvBlock, nBlkSize * sizeof(wchar_t));
|
||||||
if (NULL == szEnvBlock) {
|
if (NULL == szEnvBlock) {
|
||||||
ThrowByName(env, "java/io/Exception", "Not enough memory");
|
ThrowByName(env, "java/io/Exception", "Not enough memory");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -530,7 +535,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
nPos += len;
|
nPos += len;
|
||||||
szEnvBlock[nPos] = _T('\0');
|
szEnvBlock[nPos] = _T('\0');
|
||||||
++nPos;
|
++nPos;
|
||||||
(*env)->ReleaseStringChars(env, item, (const jchar*) str);
|
(*env)->ReleaseStringChars(env, item, (const jchar *)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
szEnvBlock[nPos] = _T('\0');
|
szEnvBlock[nPos] = _T('\0');
|
||||||
|
@ -538,10 +543,10 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir != 0) {
|
if (dir != 0) {
|
||||||
const wchar_t *str = (const wchar_t*) (*env)->GetStringChars(env, dir, 0);
|
const wchar_t *str = (const wchar_t *)(*env)->GetStringChars(env, dir, 0);
|
||||||
if (NULL != str) {
|
if (NULL != str) {
|
||||||
cwd = wcsdup(str);
|
cwd = wcsdup(str);
|
||||||
(*env)->ReleaseStringChars(env, dir, (const jchar*) str);
|
(*env)->ReleaseStringChars(env, dir, (const jchar *)str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +575,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
|
|
||||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
|
||||||
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||||
(wchar_t*) &lpMsgBuf, 0, NULL);
|
(wchar_t *)&lpMsgBuf, 0, NULL);
|
||||||
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
||||||
// Free the buffer.
|
// Free the buffer.
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
|
@ -579,11 +584,10 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv *
|
||||||
// Clean-up
|
// Clean-up
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
ret = (long) pi.dwProcessId; //hProcess;
|
ret = (long)pi.dwProcessId; // hProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
@ -634,8 +639,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *
|
||||||
break;
|
break;
|
||||||
case SIG_TERM:
|
case SIG_TERM:
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Spawner received TERM signal for process %i\n"),
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Spawner received TERM signal for process %i\n"),
|
||||||
pCurProcInfo -> pid);
|
pCurProcInfo->pid);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
SetEvent(pCurProcInfo->eventTerminate);
|
SetEvent(pCurProcInfo->eventTerminate);
|
||||||
|
@ -647,8 +652,8 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv *
|
||||||
|
|
||||||
case SIG_KILL:
|
case SIG_KILL:
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Spawner received KILL signal for process %i\n"),
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Spawner received KILL signal for process %i\n"),
|
||||||
pCurProcInfo -> pid);
|
pCurProcInfo->pid);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
SetEvent(pCurProcInfo->eventKill);
|
SetEvent(pCurProcInfo->eventKill);
|
||||||
|
@ -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;
|
||||||
|
@ -744,7 +749,7 @@ pProcInfo_t createProcInfo() {
|
||||||
EnterCriticalSection(&cs);
|
EnterCriticalSection(&cs);
|
||||||
|
|
||||||
if (NULL == pInfo) {
|
if (NULL == pInfo) {
|
||||||
pInfo = (pProcInfo_t) malloc(sizeof(procInfo_t) * MAX_PROCS);
|
pInfo = (pProcInfo_t)malloc(sizeof(procInfo_t) * MAX_PROCS);
|
||||||
ZeroMemory(pInfo, sizeof(procInfo_t) * MAX_PROCS);
|
ZeroMemory(pInfo, sizeof(procInfo_t) * MAX_PROCS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,7 +827,7 @@ void cleanUpProcBlock(pProcInfo_t pCurProcInfo) {
|
||||||
// pv - pointer to PROCESS_INFORMATION struct
|
// pv - pointer to PROCESS_INFORMATION struct
|
||||||
// Return : no
|
// Return : no
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
void _cdecl waitProcTermination(void* pv) {
|
void _cdecl waitProcTermination(void *pv) {
|
||||||
PROCESS_INFORMATION *pi = (PROCESS_INFORMATION *)pv;
|
PROCESS_INFORMATION *pi = (PROCESS_INFORMATION *)pv;
|
||||||
int i;
|
int i;
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
|
@ -836,7 +841,7 @@ void _cdecl waitProcTermination(void* pv) {
|
||||||
if (pInfo[i].pid == pi->dwProcessId) {
|
if (pInfo[i].pid == pi->dwProcessId) {
|
||||||
cleanUpProcBlock(pInfo + i);
|
cleanUpProcBlock(pInfo + i);
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("waitProcTermination: set PID %i to 0\n"),
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("waitProcTermination: set PID %i to 0\n"),
|
||||||
pi->dwProcessId);
|
pi->dwProcessId);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
|
@ -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;
|
||||||
|
|
|
@ -47,7 +47,7 @@ typedef struct winpty_s winpty_t;
|
||||||
*
|
*
|
||||||
* This function creates a new agent process and connects to it.
|
* This function creates a new agent process and connects to it.
|
||||||
*/
|
*/
|
||||||
WINPTY_API winpty_t* winpty_open(int cols, int rows);
|
WINPTY_API winpty_t *winpty_open(int cols, int rows);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start a child process. Either (but not both) of appname and cmdline may
|
* Start a child process. Either (but not both) of appname and cmdline may
|
||||||
|
|
|
@ -48,15 +48,16 @@ static HANDLE channelToHandle(JNIEnv *env, jobject channel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
jlong handle = (*env)->GetLongField(env, channel, fid);
|
jlong handle = (*env)->GetLongField(env, channel, fid);
|
||||||
return (HANDLE) handle;
|
return (HANDLE)handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inaccessible static: skipBuffer */
|
/* Inaccessible static: skipBuffer */
|
||||||
#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);
|
||||||
|
@ -75,7 +76,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_rea
|
||||||
char *lpMsgBuf;
|
char *lpMsgBuf;
|
||||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
|
||||||
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||||
(wchar_t*) &lpMsgBuf, 0, NULL);
|
(wchar_t *)&lpMsgBuf, 0, NULL);
|
||||||
|
|
||||||
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
||||||
// Free the buffer.
|
// Free the buffer.
|
||||||
|
@ -113,11 +114,12 @@ 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);
|
||||||
|
|
||||||
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
|
@ -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);
|
||||||
|
@ -215,7 +217,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_wr
|
||||||
char *lpMsgBuf;
|
char *lpMsgBuf;
|
||||||
FormatMessage(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, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||||
(wchar_t*) &lpMsgBuf, 0, NULL);
|
(wchar_t *)&lpMsgBuf, 0, NULL);
|
||||||
|
|
||||||
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
ThrowByName(env, "java/io/IOException", lpMsgBuf);
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
|
@ -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
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
static std::map<int, winpty_t*> fd2pty;
|
static std::map<int, winpty_t *> fd2pty;
|
||||||
static std::map<int, int> fd2rc;
|
static std::map<int, int> fd2rc;
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *env, jobject jobj, jboolean console) {
|
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *env, jobject jobj, jboolean console) {
|
||||||
|
@ -49,7 +49,7 @@ JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate masterFD based on current system time */
|
/* Generate masterFD based on current system time */
|
||||||
srand((unsigned int) time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
master = rand();
|
master = rand();
|
||||||
|
|
||||||
/* Make sure masterFD does not exist */
|
/* Make sure masterFD does not exist */
|
||||||
|
@ -60,7 +60,7 @@ JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *
|
||||||
sprintf(line, "winpty_%i", master);
|
sprintf(line, "winpty_%i", master);
|
||||||
|
|
||||||
/* Remember the winpty handle for the generated masterFD */
|
/* Remember the winpty handle for the generated masterFD */
|
||||||
fd2pty.insert(std::pair<int, winpty_t*>(master, winpty));
|
fd2pty.insert(std::pair<int, winpty_t *>(master, winpty));
|
||||||
|
|
||||||
/* Get a reference to the obj's class */
|
/* Get a reference to the obj's class */
|
||||||
cls = env->GetObjectClass(jobj);
|
cls = env->GetObjectClass(jobj);
|
||||||
|
@ -70,7 +70,7 @@ JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *
|
||||||
if (fid == NULL) {
|
if (fid == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
env->SetIntField(jobj, fid, (jint) master);
|
env->SetIntField(jobj, fid, (jint)master);
|
||||||
|
|
||||||
/* Create a new String for the slave. */
|
/* Create a new String for the slave. */
|
||||||
jstr = env->NewStringUTF(line);
|
jstr = env->NewStringUTF(line);
|
||||||
|
@ -81,7 +81,7 @@ JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster(JNIEnv *
|
||||||
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size(JNIEnv *env, jobject jobj, jint fdm,
|
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size(JNIEnv *env, jobject jobj, jint fdm,
|
||||||
jint width, jint height) {
|
jint width, jint height) {
|
||||||
int fd;
|
int fd;
|
||||||
std::map<int, winpty_t*>::const_iterator fd2pty_Iter;
|
std::map<int, winpty_t *>::const_iterator fd2pty_Iter;
|
||||||
|
|
||||||
fd = fdm;
|
fd = fdm;
|
||||||
fd2pty_Iter = fd2pty.find(fd);
|
fd2pty_Iter = fd2pty.find(fd);
|
||||||
|
@ -100,7 +100,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEn
|
||||||
DWORD amount = -1;
|
DWORD amount = -1;
|
||||||
OVERLAPPED over;
|
OVERLAPPED over;
|
||||||
int fd;
|
int fd;
|
||||||
std::map<int, winpty_t*>::const_iterator fd2pty_Iter;
|
std::map<int, winpty_t *>::const_iterator fd2pty_Iter;
|
||||||
|
|
||||||
fd = jfd;
|
fd = jfd;
|
||||||
fd2pty_Iter = fd2pty.find(fd);
|
fd2pty_Iter = fd2pty.find(fd);
|
||||||
|
@ -152,7 +152,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEn
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv *env, jobject jobj, jint jfd) {
|
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv *env, jobject jobj, jint jfd) {
|
||||||
int fd;
|
int fd;
|
||||||
std::map<int, winpty_t*>::iterator fd2pty_Iter;
|
std::map<int, winpty_t *>::iterator fd2pty_Iter;
|
||||||
|
|
||||||
fd = jfd;
|
fd = jfd;
|
||||||
fd2pty_Iter = fd2pty.find(fd);
|
fd2pty_Iter = fd2pty.find(fd);
|
||||||
|
@ -173,7 +173,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNI
|
||||||
DWORD written = -1;
|
DWORD written = -1;
|
||||||
OVERLAPPED over;
|
OVERLAPPED over;
|
||||||
int fd;
|
int fd;
|
||||||
std::map<int, winpty_t*>::iterator fd2pty_Iter;
|
std::map<int, winpty_t *>::iterator fd2pty_Iter;
|
||||||
|
|
||||||
fd = jfd;
|
fd = jfd;
|
||||||
fd2pty_Iter = fd2pty.find(fd);
|
fd2pty_Iter = fd2pty.find(fd);
|
||||||
|
@ -198,7 +198,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNI
|
||||||
if (!ret && GetLastError() == ERROR_IO_PENDING) {
|
if (!ret && GetLastError() == ERROR_IO_PENDING) {
|
||||||
ret = GetOverlappedResult(handle, &over, &written, TRUE);
|
ret = GetOverlappedResult(handle, &over, &written, TRUE);
|
||||||
}
|
}
|
||||||
if (!ret || (int) written != buf_len) {
|
if (!ret || (int)written != buf_len) {
|
||||||
written = -1;
|
written = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNI
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv *env, jobject jobj, jint jfd) {
|
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv *env, jobject jobj, jint jfd) {
|
||||||
int fd;
|
int fd;
|
||||||
std::map<int, winpty_t*>::iterator fd2pty_Iter;
|
std::map<int, winpty_t *>::iterator fd2pty_Iter;
|
||||||
|
|
||||||
fd = jfd;
|
fd = jfd;
|
||||||
fd2pty_Iter = fd2pty.find(fd);
|
fd2pty_Iter = fd2pty.find(fd);
|
||||||
|
@ -282,11 +282,12 @@ 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;
|
||||||
|
|
||||||
const wchar_t *cwdW = (const wchar_t*) env->GetStringChars(jdir, NULL);
|
const wchar_t *cwdW = (const wchar_t *)env->GetStringChars(jdir, NULL);
|
||||||
const char *pts_name = env->GetStringUTFChars(jslaveName, NULL);
|
const char *pts_name = env->GetStringUTFChars(jslaveName, NULL);
|
||||||
|
|
||||||
int pid = -1;
|
int pid = -1;
|
||||||
|
@ -304,28 +305,28 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2(JNIEnv *env, job
|
||||||
if (fd2pty_Iter != fd2pty.end()) {
|
if (fd2pty_Iter != fd2pty.end()) {
|
||||||
winpty_t *winpty = fd2pty_Iter->second;
|
winpty_t *winpty = fd2pty_Iter->second;
|
||||||
if (winpty != NULL) {
|
if (winpty != NULL) {
|
||||||
std::vector < std::wstring > argVector;
|
std::vector<std::wstring> argVector;
|
||||||
|
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
jstring j_str = (jstring) env->GetObjectArrayElement(jcmd, i);
|
jstring j_str = (jstring)env->GetObjectArrayElement(jcmd, i);
|
||||||
const wchar_t *w_str = (const wchar_t*) env->GetStringChars(j_str, NULL);
|
const wchar_t *w_str = (const wchar_t *)env->GetStringChars(j_str, NULL);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
argVector.push_back(convertSlashes(w_str));
|
argVector.push_back(convertSlashes(w_str));
|
||||||
} else {
|
} else {
|
||||||
argVector.push_back(w_str);
|
argVector.push_back(w_str);
|
||||||
}
|
}
|
||||||
env->ReleaseStringChars(j_str, (const jchar*) w_str);
|
env->ReleaseStringChars(j_str, (const jchar *)w_str);
|
||||||
env->DeleteLocalRef(j_str);
|
env->DeleteLocalRef(j_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring envp;
|
std::wstring envp;
|
||||||
|
|
||||||
for (i = 0; i < envc; i++) {
|
for (i = 0; i < envc; i++) {
|
||||||
jstring j_str = (jstring) env->GetObjectArrayElement(jenv, i);
|
jstring j_str = (jstring)env->GetObjectArrayElement(jenv, i);
|
||||||
const wchar_t *w_str = (const wchar_t*) env->GetStringChars(j_str, NULL);
|
const wchar_t *w_str = (const wchar_t *)env->GetStringChars(j_str, NULL);
|
||||||
envp.append(w_str);
|
envp.append(w_str);
|
||||||
envp.push_back(L'\0');
|
envp.push_back(L'\0');
|
||||||
env->ReleaseStringChars(j_str, (const jchar*) w_str);
|
env->ReleaseStringChars(j_str, (const jchar *)w_str);
|
||||||
env->DeleteLocalRef(j_str);
|
env->DeleteLocalRef(j_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -352,7 +354,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor(JNIEnv *env, j
|
||||||
DWORD flags;
|
DWORD flags;
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
std::map<int, winpty_t*>::iterator fd2pty_Iter;
|
std::map<int, winpty_t *>::iterator fd2pty_Iter;
|
||||||
std::map<int, int>::iterator fd2rc_Iter;
|
std::map<int, int>::iterator fd2rc_Iter;
|
||||||
|
|
||||||
fd = masterFD;
|
fd = masterFD;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
static HMODULE getCurrentModule() {
|
static HMODULE getCurrentModule() {
|
||||||
HMODULE module;
|
HMODULE module;
|
||||||
if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||||
(LPCTSTR) getCurrentModule, &module)) {
|
(LPCTSTR)getCurrentModule, &module)) {
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
return module;
|
return module;
|
||||||
|
@ -27,17 +27,17 @@ HMODULE PTYExplicitLoadLibrary(LPCSTR pszModuleName) {
|
||||||
--cchPath;
|
--cchPath;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break; //stop searching; found path separator
|
break; // stop searching; found path separator
|
||||||
}
|
}
|
||||||
lstrcpynA(szPath + cchPath, pszModuleName, MAX_PATH - cchPath);
|
lstrcpynA(szPath + cchPath, pszModuleName, MAX_PATH - cchPath);
|
||||||
return LoadLibraryA(szPath); //call with full path to dependent DLL
|
return LoadLibraryA(szPath); // call with full path to dependent DLL
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FARPROC WINAPI PTYDliNotifyHook(unsigned dliNotify, PDelayLoadInfo pdli) {
|
FARPROC WINAPI PTYDliNotifyHook(unsigned dliNotify, PDelayLoadInfo pdli) {
|
||||||
if (dliNotify == dliNotePreLoadLibrary) {
|
if (dliNotify == dliNotePreLoadLibrary) {
|
||||||
return (FARPROC) PTYExplicitLoadLibrary(pdli->szDll);
|
return (FARPROC)PTYExplicitLoadLibrary(pdli->szDll);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -78,11 +76,10 @@ int interruptProcess(int pid) {
|
||||||
BOOL success = FALSE;
|
BOOL success = FALSE;
|
||||||
FARPROC procaddr = GetProcAddress(hmod, "DebugBreakProcess");
|
FARPROC procaddr = GetProcAddress(hmod, "DebugBreakProcess");
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
@ -106,15 +103,15 @@ int interruptProcess(int pid) {
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
// Find console
|
// Find console
|
||||||
EnumWindows(find_child_console, (LPARAM) pid);
|
EnumWindows(find_child_console, (LPARAM)pid);
|
||||||
|
|
||||||
if (NULL != consoleHWND) { // Yes, we found out it
|
if (NULL != consoleHWND) { // Yes, we found out it
|
||||||
// We are going to switch focus to console,
|
// We are going to switch focus to console,
|
||||||
// send Ctrl-C and then restore focus
|
// send Ctrl-C and then restore focus
|
||||||
BYTE control_scan_code = (BYTE) MapVirtualKey(VK_CONTROL, 0);
|
BYTE control_scan_code = (BYTE)MapVirtualKey(VK_CONTROL, 0);
|
||||||
/* Fake Ctrl-C for SIGINT, and Ctrl-Break for SIGQUIT. */
|
/* Fake Ctrl-C for SIGINT, and Ctrl-Break for SIGQUIT. */
|
||||||
BYTE vk_break_code = VK_CANCEL;
|
BYTE vk_break_code = VK_CANCEL;
|
||||||
BYTE break_scan_code = (BYTE) MapVirtualKey(vk_break_code, 0);
|
BYTE break_scan_code = (BYTE)MapVirtualKey(vk_break_code, 0);
|
||||||
HWND foreground_window;
|
HWND foreground_window;
|
||||||
|
|
||||||
foreground_window = GetForegroundWindow();
|
foreground_window = GetForegroundWindow();
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,13 @@
|
||||||
|
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
|
|
||||||
wchar_t path[MAX_PATH + 1] = { _T('\0') }; // Directory where spawner.dll is located
|
wchar_t path[MAX_PATH + 1] = {_T('\0')}; // Directory where spawner.dll is located
|
||||||
|
|
||||||
#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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
int copyTo(wchar_t *target, const wchar_t *source, int cpyLength, int availSpace);
|
int copyTo(wchar_t *target, const wchar_t *source, int cpyLength, int availSpace);
|
||||||
void DisplayErrorMessage();
|
void DisplayErrorMessage();
|
||||||
|
|
||||||
//BOOL KillProcessEx(DWORD dwProcessId); // Handle of the process
|
// BOOL KillProcessEx(DWORD dwProcessId); // Handle of the process
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
BOOL WINAPI HandlerRoutine(DWORD dwCtrlType) { // control signal type
|
BOOL WINAPI HandlerRoutine(DWORD dwCtrlType) { // control signal type
|
||||||
|
@ -126,7 +126,7 @@ void ensureSize(wchar_t **ptr, int *psize, int requiredLength) {
|
||||||
if (size < requiredLength) {
|
if (size < requiredLength) {
|
||||||
size = requiredLength;
|
size = requiredLength;
|
||||||
}
|
}
|
||||||
*ptr = (wchar_t*) realloc(*ptr, size * sizeof(wchar_t));
|
*ptr = (wchar_t *)realloc(*ptr, size * sizeof(wchar_t));
|
||||||
if (NULL == *ptr) {
|
if (NULL == *ptr) {
|
||||||
*psize = 0;
|
*psize = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -148,7 +148,7 @@ int main() {
|
||||||
|
|
||||||
// Construct the full command line
|
// Construct the full command line
|
||||||
int nCmdLineLength = MAX_CMD_LINE_LENGTH;
|
int nCmdLineLength = MAX_CMD_LINE_LENGTH;
|
||||||
wchar_t *szCmdLine = (wchar_t*) malloc(nCmdLineLength * sizeof(wchar_t));
|
wchar_t *szCmdLine = (wchar_t *)malloc(nCmdLineLength * sizeof(wchar_t));
|
||||||
szCmdLine[0] = 0;
|
szCmdLine[0] = 0;
|
||||||
int nPos = 0;
|
int nPos = 0;
|
||||||
|
|
||||||
|
@ -181,8 +181,8 @@ int main() {
|
||||||
}
|
}
|
||||||
szCmdLine[nPos] = _T('\0');
|
szCmdLine[nPos] = _T('\0');
|
||||||
|
|
||||||
STARTUPINFOW si = { sizeof(si) };
|
STARTUPINFOW si = {sizeof(si)};
|
||||||
PROCESS_INFORMATION pi = { 0 };
|
PROCESS_INFORMATION pi = {0};
|
||||||
DWORD dwExitCode = 0;
|
DWORD dwExitCode = 0;
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
int currentPID = GetCurrentProcessId();
|
int currentPID = GetCurrentProcessId();
|
||||||
|
@ -193,7 +193,7 @@ int main() {
|
||||||
HANDLE waitEvent = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[4]);
|
HANDLE waitEvent = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[4]);
|
||||||
HANDLE h[5];
|
HANDLE h[5];
|
||||||
h[0] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[3]); // simulated SIGINT (CTRL-C or Cygwin 'kill -SIGINT')
|
h[0] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[3]); // simulated SIGINT (CTRL-C or Cygwin 'kill -SIGINT')
|
||||||
// h[1] we reserve for the process handle
|
// h[1] we reserve for the process handle
|
||||||
h[2] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[5]); // simulated SIGTERM
|
h[2] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[5]); // simulated SIGTERM
|
||||||
h[3] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[6]); // simulated SIGKILL
|
h[3] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[6]); // simulated SIGKILL
|
||||||
h[4] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[7]); // CTRL-C, in all cases
|
h[4] = OpenEventW(EVENT_ALL_ACCESS, TRUE, argv[7]); // CTRL-C, in all cases
|
||||||
|
@ -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]);
|
||||||
|
@ -258,7 +258,7 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_MONITOR_DETAILS
|
#ifdef DEBUG_MONITOR_DETAILS
|
||||||
wchar_t * lpvEnv = GetEnvironmentStringsW();
|
wchar_t *lpvEnv = GetEnvironmentStringsW();
|
||||||
|
|
||||||
// If the returned pointer is NULL, exit.
|
// If the returned pointer is NULL, exit.
|
||||||
if (lpvEnv == NULL) {
|
if (lpvEnv == NULL) {
|
||||||
|
@ -268,8 +268,8 @@ int main() {
|
||||||
// terminated by a NULL byte.
|
// terminated by a NULL byte.
|
||||||
|
|
||||||
OutputDebugStringW(_T("Starter: Environment\n"));
|
OutputDebugStringW(_T("Starter: Environment\n"));
|
||||||
for (wchar_t * lpszVariable = (wchar_t *) lpvEnv; *lpszVariable; lpszVariable += wcslen(lpszVariable) + 1) {
|
for (wchar_t *lpszVariable = (wchar_t *)lpvEnv; *lpszVariable; lpszVariable += wcslen(lpszVariable) + 1) {
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("%s\n"), lpszVariable);
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("%s\n"), lpszVariable);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ int main() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Starting: %s\n"), szCmdLine);
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Starting: %s\n"), szCmdLine);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
// Create job object
|
// Create job object
|
||||||
|
@ -318,7 +318,7 @@ int main() {
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Process %i started\n"), pi.dwProcessId);
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Process %i started\n"), pi.dwProcessId);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
#endif
|
#endif
|
||||||
SetEvent(waitEvent); // Means that process has been spawned
|
SetEvent(waitEvent); // Means that process has been spawned
|
||||||
|
@ -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])) {
|
||||||
|
@ -399,7 +402,7 @@ int main() {
|
||||||
SetEvent(waitEvent);
|
SetEvent(waitEvent);
|
||||||
|
|
||||||
if (NULL != hJob) {
|
if (NULL != hJob) {
|
||||||
if (!TerminateJobObject(hJob, (DWORD) - 1)) {
|
if (!TerminateJobObject(hJob, (DWORD)-1)) {
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
OutputDebugStringW(_T("Cannot terminate job\n"));
|
OutputDebugStringW(_T("Cannot terminate job\n"));
|
||||||
DisplayErrorMessage();
|
DisplayErrorMessage();
|
||||||
|
@ -419,11 +422,10 @@ int main() {
|
||||||
exitProc = TRUE;
|
exitProc = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
swprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), _T("Cannot start: %s\n"), szCmdLine);
|
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), _T("Cannot start: %s\n"), szCmdLine);
|
||||||
OutputDebugStringW(buffer);
|
OutputDebugStringW(buffer);
|
||||||
|
|
||||||
DisplayErrorMessage();
|
DisplayErrorMessage();
|
||||||
|
@ -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;
|
||||||
|
@ -517,7 +519,7 @@ void DisplayErrorMessage() {
|
||||||
wchar_t *lpMsgBuf;
|
wchar_t *lpMsgBuf;
|
||||||
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
|
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
|
||||||
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||||
(wchar_t*) &lpMsgBuf, 0, NULL);
|
(wchar_t *)&lpMsgBuf, 0, NULL);
|
||||||
OutputDebugStringW(lpMsgBuf);
|
OutputDebugStringW(lpMsgBuf);
|
||||||
// Free the buffer.
|
// Free the buffer.
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
formatter_profile=_Unmanaged profile 'CDT'
|
|
||||||
formatter_settings_version=1
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
|
|
@ -1,3 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
formatter_profile=_Unmanaged profile 'CDT'
|
|
||||||
formatter_settings_version=1
|
|
|
@ -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
|
|
|
@ -1,3 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
formatter_profile=_Unmanaged profile 'CDT'
|
|
||||||
formatter_settings_version=1
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <org_eclipse_cdt_serial_SerialPort.h>
|
#include <org_eclipse_cdt_serial_SerialPort.h>
|
||||||
|
|
||||||
#define FUNC(x) Java_org_eclipse_cdt_serial_SerialPort_ ## x
|
#define FUNC(x) Java_org_eclipse_cdt_serial_SerialPort_##x
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this method to throw an exception when open fails after the OS open
|
* Use this method to throw an exception when open fails after the OS open
|
||||||
|
@ -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
|
||||||
|
@ -267,26 +267,21 @@ 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) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
const char * name = (*env)->GetStringUTFChars(env, portName, NULL);
|
const char *name = (*env)->GetStringUTFChars(env, portName, NULL);
|
||||||
sprintf_s(msg, sizeof(msg), "Error opening %s", name);
|
sprintf_s(msg, sizeof(msg), "Error opening %s", name);
|
||||||
(*env)->ReleaseStringUTFChars(env, portName, name);
|
(*env)->ReleaseStringUTFChars(env, portName, name);
|
||||||
throwIOException(env, msg);
|
throwIOException(env, msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DCB dcb = { 0 };
|
DCB dcb = {0};
|
||||||
|
|
||||||
if (!GetCommState(handle, &dcb)) {
|
if (!GetCommState(handle, &dcb)) {
|
||||||
closeAndthrowIOException(handle, env, "Error getting DCB");
|
closeAndthrowIOException(handle, env, "Error getting DCB");
|
||||||
|
@ -325,7 +320,7 @@ JNIEXPORT jlong JNICALL FUNC(open0)(JNIEnv *env, jobject jobj, jstring portName,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
COMMTIMEOUTS timeouts = { 0 };
|
COMMTIMEOUTS timeouts = {0};
|
||||||
timeouts.ReadIntervalTimeout = MAXDWORD;
|
timeouts.ReadIntervalTimeout = MAXDWORD;
|
||||||
timeouts.ReadTotalTimeoutMultiplier = MAXDWORD;
|
timeouts.ReadTotalTimeoutMultiplier = MAXDWORD;
|
||||||
timeouts.ReadTotalTimeoutConstant = 200;
|
timeouts.ReadTotalTimeoutConstant = 200;
|
||||||
|
@ -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
|
||||||
|
@ -390,7 +384,7 @@ JNIEXPORT jint JNICALL FUNC(read1)(JNIEnv *env, jobject jobj, jlong jhandle, jby
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
#else
|
#else
|
||||||
OVERLAPPED olp = { 0 };
|
OVERLAPPED olp = {0};
|
||||||
|
|
||||||
olp.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
olp.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
if (olp.hEvent == NULL) {
|
if (olp.hEvent == NULL) {
|
||||||
|
@ -434,13 +428,12 @@ 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);
|
||||||
#else
|
#else
|
||||||
OVERLAPPED olp = { 0 };
|
OVERLAPPED olp = {0};
|
||||||
|
|
||||||
olp.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
olp.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
if (olp.hEvent == NULL) {
|
if (olp.hEvent == NULL) {
|
||||||
|
@ -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];
|
||||||
|
@ -488,7 +481,7 @@ JNIEXPORT void JNICALL FUNC(write1)(JNIEnv *env, jobject jobj, jlong jhandle, jb
|
||||||
offset += n;
|
offset += n;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
OVERLAPPED olp = { 0 };
|
OVERLAPPED olp = {0};
|
||||||
|
|
||||||
olp.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
olp.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
if (olp.hEvent == NULL) {
|
if (olp.hEvent == NULL) {
|
||||||
|
@ -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) {
|
||||||
|
@ -558,7 +550,7 @@ JNIEXPORT jstring FUNC(getPortName)(JNIEnv *env, jclass cls, jint i)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
jstring result = (*env)->NewString(env, (jchar *)value, (jsize) wcslen(value));
|
jstring result = (*env)->NewString(env, (jchar *)value, (jsize)wcslen(value));
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -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
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue