Skip to content

Commit 2794a5e

Browse files
Remove the option --edit-code-command (#664)
1 parent d054153 commit 2794a5e

File tree

7 files changed

+1
-156
lines changed

7 files changed

+1
-156
lines changed

cobj/cobj.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ char *cb_single_jar_name = NULL;
194194
int cb_flag_info_json = 0;
195195
char *cb_info_json_dir = NULL;
196196

197-
char edit_code_command[512];
198-
char edit_code_command_is_set = 0;
199-
200197
#define PROGRAM_ID_LIST_MAX_LEN 1024
201198
char *program_id_list[PROGRAM_ID_LIST_MAX_LEN];
202199

@@ -314,7 +311,6 @@ static const struct option long_options[] = {
314311
{"reference_check", no_argument, NULL, 'K'},
315312
{"constant", optional_argument, NULL, '3'},
316313
{"fdefaultbyte", required_argument, NULL, OPTION_ID_DEFAULT_BYTE},
317-
{"edit-code-command", optional_argument, NULL, '['},
318314
#undef CB_FLAG
319315
#define CB_FLAG(var, name, doc) \
320316
{"f" name, no_argument, &var, 1}, {"fno-" name, no_argument, &var, 0},
@@ -1206,10 +1202,6 @@ static int process_command_line(const int argc, char *argv[]) {
12061202
perror(optarg);
12071203
}
12081204
break;
1209-
case '[':
1210-
strcpy(edit_code_command, optarg);
1211-
edit_code_command_is_set = 1;
1212-
break;
12131205

12141206
case 'I':
12151207
#ifdef _MSC_VER

cobj/cobj.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ DECLNORET extern void cobc_abort(const char *filename,
175175

176176
extern size_t cobc_check_valid_name(char *name);
177177

178-
extern char edit_code_command[512];
179-
extern char edit_code_command_is_set;
180-
181178
#ifdef I18N_UTF8
182179
#define COB_U8CSIZ 3
183180

cobj/codegen.c

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ static char *convert_byte_value_format(char value);
187187
static void append_label_id_map(struct cb_label *label);
188188
static void create_label_id_map(struct cb_program *prog);
189189
static void destroy_label_id_map(void);
190-
static void joutput_edit_code_command(const char *target);
191190

192191
static void joutput_label_variable(struct cb_label *label);
193192
static void joutput_label_variable_name(char *s, int key,
@@ -675,35 +674,6 @@ static void joutput_local(const char *fmt, ...) {
675674
}
676675
}
677676

678-
static void joutput_edit_code_command(const char *target) {
679-
if (!edit_code_command_is_set) {
680-
return;
681-
}
682-
683-
char command[BUF_SIZE];
684-
char buf[BUF_SIZE];
685-
sprintf(command, "%s --target=%s", edit_code_command, target);
686-
687-
#ifdef _WIN32
688-
FILE *fp = _popen(command, "r");
689-
#else
690-
FILE *fp = popen(command, "r");
691-
#endif
692-
if (fp == NULL) {
693-
return;
694-
}
695-
memset(buf, 0, BUF_SIZE);
696-
697-
while (fgets(buf, BUF_SIZE, fp) != NULL) {
698-
joutput("%s", buf);
699-
}
700-
#ifdef _WIN32
701-
_pclose(fp);
702-
#else
703-
pclose(fp);
704-
#endif
705-
}
706-
707677
/*
708678
* Field
709679
*/
@@ -6082,9 +6052,6 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list,
60826052
if (cb_java_package_name) {
60836053
joutput_line("package %s;\n", cb_java_package_name);
60846054
}
6085-
if (edit_code_command_is_set) {
6086-
joutput_edit_code_command("file-header");
6087-
}
60886055

60896056
joutput_line("import java.io.UnsupportedEncodingException;");
60906057
joutput_line("import jp.osscons.opensourcecobol.libcobj.*;");
@@ -6113,17 +6080,7 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list,
61136080
}
61146081
}*/
61156082

6116-
if (edit_code_command_is_set) {
6117-
joutput_edit_code_command("main-class-annotation");
6118-
}
6119-
if (edit_code_command_is_set) {
6120-
joutput("public class %s implements CobolRunnable, ", prog->program_id);
6121-
joutput_edit_code_command("main-class-implements");
6122-
joutput(" {\n");
6123-
} else {
6124-
joutput_line("public class %s implements CobolRunnable {",
6125-
prog->program_id);
6126-
}
6083+
joutput_line("public class %s implements CobolRunnable {", prog->program_id);
61276084
joutput_indent_level += 2;
61286085
joutput("\n");
61296086

@@ -6135,9 +6092,6 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list,
61356092
// output_storage ("union cob_call_union\tcob_unifunc;\n\n");
61366093
joutput_line("private CobolRunnable cob_unifunc;\n");
61376094

6138-
if (edit_code_command_is_set) {
6139-
joutput_edit_code_command("main-class-contents");
6140-
}
61416095
joutput("\n");
61426096

61436097
joutput_line("@Override");

tests/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ command_line_options_DEPENDENCIES = \
185185
command-line-options.src/ffold-copy.at \
186186
command-line-options.src/info-java-dir.at \
187187
command-line-options.src/java-package.at \
188-
command-line-options.src/edit-code-command.at \
189188
command-line-options.src/file-path.at \
190189
command-line-options.src/fdefaultbyte.at \
191190
command-line-options.src/ffunctions-all.at \

tests/Makefile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,6 @@ command_line_options_DEPENDENCIES = \
724724
command-line-options.src/ffold-copy.at \
725725
command-line-options.src/info-java-dir.at \
726726
command-line-options.src/java-package.at \
727-
command-line-options.src/edit-code-command.at \
728727
command-line-options.src/file-path.at \
729728
command-line-options.src/fdefaultbyte.at \
730729
command-line-options.src/ffunctions-all.at \

tests/command-line-options.at

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,3 @@ m4_include([jar.at])
3636
m4_include([std.at])
3737
m4_include([conf.at])
3838
m4_include([Wimplicit-define.at])
39-
40-
# m4_include([edit-code-command.at])

tests/command-line-options.src/edit-code-command.at

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)