Skip to content

Remove the option --edit-code-command #664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cobj/cobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ char *cb_single_jar_name = NULL;
int cb_flag_info_json = 0;
char *cb_info_json_dir = NULL;

char edit_code_command[512];
char edit_code_command_is_set = 0;

#define PROGRAM_ID_LIST_MAX_LEN 1024
char *program_id_list[PROGRAM_ID_LIST_MAX_LEN];

Expand Down Expand Up @@ -314,7 +311,6 @@ static const struct option long_options[] = {
{"reference_check", no_argument, NULL, 'K'},
{"constant", optional_argument, NULL, '3'},
{"fdefaultbyte", required_argument, NULL, OPTION_ID_DEFAULT_BYTE},
{"edit-code-command", optional_argument, NULL, '['},
#undef CB_FLAG
#define CB_FLAG(var, name, doc) \
{"f" name, no_argument, &var, 1}, {"fno-" name, no_argument, &var, 0},
Expand Down Expand Up @@ -1206,10 +1202,6 @@ static int process_command_line(const int argc, char *argv[]) {
perror(optarg);
}
break;
case '[':
strcpy(edit_code_command, optarg);
edit_code_command_is_set = 1;
break;

case 'I':
#ifdef _MSC_VER
Expand Down
3 changes: 0 additions & 3 deletions cobj/cobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ DECLNORET extern void cobc_abort(const char *filename,

extern size_t cobc_check_valid_name(char *name);

extern char edit_code_command[512];
extern char edit_code_command_is_set;

#ifdef I18N_UTF8
#define COB_U8CSIZ 3

Expand Down
48 changes: 1 addition & 47 deletions cobj/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ static char *convert_byte_value_format(char value);
static void append_label_id_map(struct cb_label *label);
static void create_label_id_map(struct cb_program *prog);
static void destroy_label_id_map(void);
static void joutput_edit_code_command(const char *target);

static void joutput_label_variable(struct cb_label *label);
static void joutput_label_variable_name(char *s, int key,
Expand Down Expand Up @@ -675,35 +674,6 @@ static void joutput_local(const char *fmt, ...) {
}
}

static void joutput_edit_code_command(const char *target) {
if (!edit_code_command_is_set) {
return;
}

char command[BUF_SIZE];
char buf[BUF_SIZE];
sprintf(command, "%s --target=%s", edit_code_command, target);

#ifdef _WIN32
FILE *fp = _popen(command, "r");
#else
FILE *fp = popen(command, "r");
#endif
if (fp == NULL) {
return;
}
memset(buf, 0, BUF_SIZE);

while (fgets(buf, BUF_SIZE, fp) != NULL) {
joutput("%s", buf);
}
#ifdef _WIN32
_pclose(fp);
#else
pclose(fp);
#endif
}

/*
* Field
*/
Expand Down Expand Up @@ -6082,9 +6052,6 @@ void codegen(struct cb_program *prog, const int nested, char **program_id_list,
if (cb_java_package_name) {
joutput_line("package %s;\n", cb_java_package_name);
}
if (edit_code_command_is_set) {
joutput_edit_code_command("file-header");
}

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

if (edit_code_command_is_set) {
joutput_edit_code_command("main-class-annotation");
}
if (edit_code_command_is_set) {
joutput("public class %s implements CobolRunnable, ", prog->program_id);
joutput_edit_code_command("main-class-implements");
joutput(" {\n");
} else {
joutput_line("public class %s implements CobolRunnable {",
prog->program_id);
}
joutput_line("public class %s implements CobolRunnable {", prog->program_id);
joutput_indent_level += 2;
joutput("\n");

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

if (edit_code_command_is_set) {
joutput_edit_code_command("main-class-contents");
}
joutput("\n");

joutput_line("@Override");
Expand Down
1 change: 0 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ command_line_options_DEPENDENCIES = \
command-line-options.src/ffold-copy.at \
command-line-options.src/info-java-dir.at \
command-line-options.src/java-package.at \
command-line-options.src/edit-code-command.at \
command-line-options.src/file-path.at \
command-line-options.src/fdefaultbyte.at \
command-line-options.src/ffunctions-all.at \
Expand Down
1 change: 0 additions & 1 deletion tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ command_line_options_DEPENDENCIES = \
command-line-options.src/ffold-copy.at \
command-line-options.src/info-java-dir.at \
command-line-options.src/java-package.at \
command-line-options.src/edit-code-command.at \
command-line-options.src/file-path.at \
command-line-options.src/fdefaultbyte.at \
command-line-options.src/ffunctions-all.at \
Expand Down
2 changes: 0 additions & 2 deletions tests/command-line-options.at
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ m4_include([jar.at])
m4_include([std.at])
m4_include([conf.at])
m4_include([Wimplicit-define.at])

# m4_include([edit-code-command.at])
94 changes: 0 additions & 94 deletions tests/command-line-options.src/edit-code-command.at

This file was deleted.