summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-03-15 15:56:58 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-03-15 15:56:58 +0100
commit112398ee6221c1d29771ae8b5a201d25d30f53d7 (patch)
treeb374a7f5ea98eef604c8ccb05d061b0cc14ee344 /src/plugins
parent4ee2ef584de596df4bffc5952c8b8e72aaa01d15 (diff)
downloadweechat-112398ee6221c1d29771ae8b5a201d25d30f53d7.zip
exec: fix compilation on OpenBSD
Looks like the variable name "stdout" is a problem on OpenBSD (macro?). So "stdout" and "stderr" are renamed to "out" an "err".
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/exec/exec.c38
-rw-r--r--src/plugins/exec/exec.h11
2 files changed, 25 insertions, 24 deletions
diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c
index a4c137b23..b638ee2a9 100644
--- a/src/plugins/exec/exec.c
+++ b/src/plugins/exec/exec.c
@@ -153,10 +153,10 @@ exec_add ()
new_exec_cmd->buffer_full_name = NULL;
new_exec_cmd->line_numbers = 0;
new_exec_cmd->display_rc = 0;
- new_exec_cmd->stdout_size = 0;
- new_exec_cmd->stdout = NULL;
- new_exec_cmd->stderr_size = 0;
- new_exec_cmd->stderr = NULL;
+ new_exec_cmd->out_size = 0;
+ new_exec_cmd->out = NULL;
+ new_exec_cmd->err_size = 0;
+ new_exec_cmd->err = NULL;
new_exec_cmd->return_code = -1;
exec_cmds_count++;
@@ -220,13 +220,13 @@ exec_command_concat_output (int *size, char **output, const char *text)
void
exec_command_display_output (struct t_exec_cmd *exec_cmd,
- struct t_gui_buffer *buffer, int stdout)
+ struct t_gui_buffer *buffer, int out)
{
char *ptr_output, *ptr_line, *line, *line2, *pos;
char str_number[32], str_tags[1024];
int line_nb, length;
- ptr_output = (stdout) ? exec_cmd->stdout : exec_cmd->stderr;
+ ptr_output = (out) ? exec_cmd->out : exec_cmd->err;
if (!ptr_output)
return;
@@ -287,7 +287,7 @@ exec_command_display_output (struct t_exec_cmd *exec_cmd,
snprintf (str_number, sizeof (str_number), "%d", exec_cmd->number);
snprintf (str_tags, sizeof (str_tags),
"exec_%s,exec_cmd_%s",
- (stdout) ? "stdout" : "stderr",
+ (out) ? "stdout" : "stderr",
(exec_cmd->name) ? exec_cmd->name : str_number);
snprintf (str_number, sizeof (str_number), "%d\t", line_nb);
weechat_printf_tags (buffer, str_tags,
@@ -394,14 +394,14 @@ exec_process_cb (void *data, const char *command, int return_code,
if (out)
{
- exec_command_concat_output (&ptr_exec_cmd->stdout_size,
- &ptr_exec_cmd->stdout,
+ exec_command_concat_output (&ptr_exec_cmd->out_size,
+ &ptr_exec_cmd->out,
out);
}
if (err)
{
- exec_command_concat_output (&ptr_exec_cmd->stderr_size,
- &ptr_exec_cmd->stderr,
+ exec_command_concat_output (&ptr_exec_cmd->err_size,
+ &ptr_exec_cmd->err,
err);
}
@@ -440,10 +440,10 @@ exec_free (struct t_exec_cmd *exec_cmd)
free (exec_cmd->command);
if (exec_cmd->buffer_full_name)
free (exec_cmd->buffer_full_name);
- if (exec_cmd->stdout)
- free (exec_cmd->stdout);
- if (exec_cmd->stderr)
- free (exec_cmd->stderr);
+ if (exec_cmd->out)
+ free (exec_cmd->out);
+ if (exec_cmd->err)
+ free (exec_cmd->err);
free (exec_cmd);
@@ -489,10 +489,10 @@ exec_print_log ()
weechat_log_printf (" buffer_full_name. . . . : '%s'", ptr_exec_cmd->buffer_full_name);
weechat_log_printf (" line_numbers. . . . . . : %d", ptr_exec_cmd->line_numbers);
weechat_log_printf (" display_rc. . . . . . . : %d", ptr_exec_cmd->display_rc);
- weechat_log_printf (" stdout_size . . . . . . : %d", ptr_exec_cmd->stdout_size);
- weechat_log_printf (" stdout. . . . . . . . . : '%s'", ptr_exec_cmd->stdout);
- weechat_log_printf (" stderr_size . . . . . . : %d", ptr_exec_cmd->stderr_size);
- weechat_log_printf (" stderr. . . . . . . . . : '%s'", ptr_exec_cmd->stderr);
+ weechat_log_printf (" out_size. . . . . . . . : %d", ptr_exec_cmd->out_size);
+ weechat_log_printf (" out . . . . . . . . . . : '%s'", ptr_exec_cmd->out);
+ weechat_log_printf (" err_size. . . . . . . . : %d", ptr_exec_cmd->err_size);
+ weechat_log_printf (" err . . . . . . . . . . : '%s'", ptr_exec_cmd->err);
weechat_log_printf (" return_code . . . . . . : %d", ptr_exec_cmd->return_code);
weechat_log_printf (" prev_cmd. . . . . . . . : 0x%lx", ptr_exec_cmd->prev_cmd);
weechat_log_printf (" next_cmd. . . . . . . . : 0x%lx", ptr_exec_cmd->next_cmd);
diff --git a/src/plugins/exec/exec.h b/src/plugins/exec/exec.h
index c5f46092d..483b51ef3 100644
--- a/src/plugins/exec/exec.h
+++ b/src/plugins/exec/exec.h
@@ -25,7 +25,8 @@
#define weechat_plugin weechat_exec_plugin
#define EXEC_PLUGIN_NAME "exec"
-enum t_exec_color {
+enum t_exec_color
+{
EXEC_COLOR_ANSI = 0,
EXEC_COLOR_DECODE,
EXEC_COLOR_STRIP,
@@ -53,10 +54,10 @@ struct t_exec_cmd
int display_rc; /* 1 if return code is displayed */
/* command output */
- int stdout_size; /* number of bytes in stdout */
- char *stdout; /* stdout of command */
- int stderr_size; /* number of bytes in stderr */
- char *stderr; /* stderr of command */
+ int out_size; /* number of bytes in stdout */
+ char *out; /* stdout of command */
+ int err_size; /* number of bytes in stderr */
+ char *err; /* stderr of command */
int return_code; /* command return code */
struct t_exec_cmd *prev_cmd; /* link to previous command */