summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-20 20:13:45 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-20 20:13:45 +0200
commit5843f5f37b0632e2d706abc9014bfd7d98f7b02e (patch)
tree2f1af5fd16214dfdf8edc8717e06a8b0aab81c1a /src/channel.c
parent9a4a8c4d5993c6371486c895a515c2ad351e9aaa (diff)
patch 8.1.1891: functions used in one file are globalv8.1.1891
Problem: Functions used in one file are global. Solution: Add "static". (Yegappan Lakshmanan, closes #4840)
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/channel.c b/src/channel.c
index 8b0abdc302..a023c9fd77 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -55,6 +55,14 @@
#endif
static void channel_read(channel_T *channel, ch_part_T part, char *func);
+# if defined(MSWIN) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+static channel_T *channel_fd2channel(sock_T fd, ch_part_T *partp);
+# endif
+static ch_mode_T channel_get_mode(channel_T *channel, ch_part_T part);
+static int channel_get_timeout(channel_T *channel, ch_part_T part);
+static ch_part_T channel_part_send(channel_T *channel);
+static ch_part_T channel_part_read(channel_T *channel);
+static void free_job_options(jobopt_T *opt);
/* Whether a redraw is needed for appending a line to a buffer. */
static int channel_need_redraw = FALSE;
@@ -1175,7 +1183,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
/*
* Implements ch_open().
*/
- channel_T *
+ static channel_T *
channel_open_func(typval_T *argvars)
{
char_u *address;
@@ -1348,7 +1356,7 @@ channel_set_job(channel_T *channel, job_T *job, jobopt_T *options)
/*
* Set the callback for "channel"/"part" for the response with "id".
*/
- void
+ static void
channel_set_req_callback(
channel_T *channel,
ch_part_T part,
@@ -2848,7 +2856,7 @@ channel_is_open(channel_T *channel)
/*
* Return TRUE if "channel" has JSON or other typeahead.
*/
- int
+ static int
channel_has_readahead(channel_T *channel, ch_part_T part)
{
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
@@ -2959,7 +2967,7 @@ channel_part_info(channel_T *channel, dict_T *dict, char *name, ch_part_T part)
dict_add_number(dict, namebuf, chanpart->ch_timeout);
}
- void
+ static void
channel_info(channel_T *channel, dict_T *dict)
{
dict_add_number(dict, "id", channel->ch_id);
@@ -3067,7 +3075,7 @@ channel_close(channel_T *channel, int invoke_close_cb)
/*
* Close the "in" part channel "channel".
*/
- void
+ static void
channel_close_in(channel_T *channel)
{
ch_close_part(channel, PART_IN);
@@ -3676,7 +3684,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part)
/*
* Common for ch_read() and ch_readraw().
*/
- void
+ static void
common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob)
{
channel_T *channel;
@@ -3762,7 +3770,7 @@ theend:
* Lookup the channel from the socket. Set "partp" to the fd index.
* Returns NULL when the socket isn't found.
*/
- channel_T *
+ static channel_T *
channel_fd2channel(sock_T fd, ch_part_T *partp)
{
channel_T *channel;
@@ -4092,7 +4100,7 @@ send_common(
/*
* common for "ch_evalexpr()" and "ch_sendexpr()"
*/
- void
+ static void
ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
{
char_u *text;
@@ -4154,7 +4162,7 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
/*
* common for "ch_evalraw()" and "ch_sendraw()"
*/
- void
+ static void
ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
{
char_u buf[NUMBUFLEN];
@@ -4540,7 +4548,7 @@ set_ref_in_channel(int copyID)
/*
* Return the "part" to write to for "channel".
*/
- ch_part_T
+ static ch_part_T
channel_part_send(channel_T *channel)
{
if (channel->CH_SOCK_FD == INVALID_FD)
@@ -4551,7 +4559,7 @@ channel_part_send(channel_T *channel)
/*
* Return the default "part" to read from for "channel".
*/
- ch_part_T
+ static ch_part_T
channel_part_read(channel_T *channel)
{
if (channel->CH_SOCK_FD == INVALID_FD)
@@ -4563,7 +4571,7 @@ channel_part_read(channel_T *channel)
* Return the mode of "channel"/"part"
* If "channel" is invalid returns MODE_JSON.
*/
- ch_mode_T
+ static ch_mode_T
channel_get_mode(channel_T *channel, ch_part_T part)
{
if (channel == NULL)
@@ -4574,7 +4582,7 @@ channel_get_mode(channel_T *channel, ch_part_T part)
/*
* Return the timeout of "channel"/"part"
*/
- int
+ static int
channel_get_timeout(channel_T *channel, ch_part_T part)
{
return channel->ch_part[part].ch_timeout;
@@ -4638,7 +4646,7 @@ clear_job_options(jobopt_T *opt)
/*
* Free any members of a jobopt_T.
*/
- void
+ static void
free_job_options(jobopt_T *opt)
{
if (opt->jo_callback.cb_partial != NULL)
@@ -5309,7 +5317,7 @@ job_free(job_T *job)
}
}
-job_T *jobs_to_free = NULL;
+static job_T *jobs_to_free = NULL;
/*
* Put "job" in a list to be freed later, when it's no longer referenced.