mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.1208
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
This commit is contained in:
parent
66f948e928
commit
68c2f638e6
@ -1111,9 +1111,7 @@ gui_ph_encoding_changed(int new_encoding)
|
||||
/****************************************************************************/
|
||||
|
||||
void
|
||||
gui_mch_prepare(argc, argv)
|
||||
int *argc;
|
||||
char **argv;
|
||||
gui_mch_prepare(int *argc, char **argv)
|
||||
{
|
||||
PtInit(NULL);
|
||||
}
|
||||
@ -1720,7 +1718,7 @@ gui_mch_iconify(void)
|
||||
* Bring the Vim window to the foreground.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_foreground()
|
||||
gui_mch_set_foreground(void)
|
||||
{
|
||||
PhWindowEvent_t event;
|
||||
|
||||
@ -1860,8 +1858,7 @@ static int mshape_ids[] =
|
||||
};
|
||||
|
||||
void
|
||||
mch_set_mouse_shape(shape)
|
||||
int shape;
|
||||
mch_set_mouse_shape(int shape)
|
||||
{
|
||||
int id;
|
||||
|
||||
@ -2184,7 +2181,7 @@ gui_mch_clear_block(int row1, int col1, int row2, int col2)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_clear_all()
|
||||
gui_mch_clear_all(void)
|
||||
{
|
||||
PhRect_t text_rect = {
|
||||
{ gui.border_width, gui.border_width },
|
||||
@ -3078,9 +3075,7 @@ gui_mch_get_font(char_u *vim_font_name, int report_error)
|
||||
* Don't know how to get the actual name, thus use the provided name.
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(font, name)
|
||||
GuiFont font;
|
||||
char_u *name;
|
||||
gui_mch_get_fontname(GuiFont font, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
|
@ -2246,7 +2246,7 @@ im_set_active(int active)
|
||||
* Get IM status. When IM is on, return not 0. Else return 0.
|
||||
*/
|
||||
int
|
||||
im_get_status()
|
||||
im_get_status(void)
|
||||
{
|
||||
int status = 0;
|
||||
HIMC hImc;
|
||||
@ -4525,10 +4525,7 @@ typedef struct _signicon_t
|
||||
} signicon_t;
|
||||
|
||||
void
|
||||
gui_mch_drawsign(row, col, typenr)
|
||||
int row;
|
||||
int col;
|
||||
int typenr;
|
||||
gui_mch_drawsign(int row, int col, int typenr)
|
||||
{
|
||||
signicon_t *sign;
|
||||
int x, y, w, h;
|
||||
@ -4605,8 +4602,7 @@ close_signicon_image(signicon_t *sign)
|
||||
}
|
||||
|
||||
void *
|
||||
gui_mch_register_sign(signfile)
|
||||
char_u *signfile;
|
||||
gui_mch_register_sign(char_u *signfile)
|
||||
{
|
||||
signicon_t sign, *psign;
|
||||
char_u *ext;
|
||||
@ -4661,8 +4657,7 @@ gui_mch_register_sign(signfile)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_sign(sign)
|
||||
void *sign;
|
||||
gui_mch_destroy_sign(void *sign)
|
||||
{
|
||||
if (sign)
|
||||
{
|
||||
@ -4766,10 +4761,7 @@ multiline_balloon_available(void)
|
||||
}
|
||||
|
||||
static void
|
||||
make_tooltip(beval, text, pt)
|
||||
BalloonEval *beval;
|
||||
char *text;
|
||||
POINT pt;
|
||||
make_tooltip(BalloonEval *beval, char *text, POINT pt)
|
||||
{
|
||||
TOOLINFO *pti;
|
||||
int ToolInfoSize;
|
||||
@ -4833,19 +4825,18 @@ make_tooltip(beval, text, pt)
|
||||
}
|
||||
|
||||
static void
|
||||
delete_tooltip(beval)
|
||||
BalloonEval *beval;
|
||||
delete_tooltip(BalloonEval *beval)
|
||||
{
|
||||
PostMessage(beval->balloon, WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static VOID CALLBACK
|
||||
BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
|
||||
HWND hwnd;
|
||||
UINT uMsg;
|
||||
UINT_PTR idEvent;
|
||||
DWORD dwTime;
|
||||
BevalTimerProc(
|
||||
HWND hwnd,
|
||||
UINT uMsg,
|
||||
UINT_PTR idEvent,
|
||||
DWORD dwTime)
|
||||
{
|
||||
POINT pt;
|
||||
RECT rect;
|
||||
@ -4883,8 +4874,7 @@ BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_disable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_disable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
// TRACE0("gui_mch_disable_beval_area {{{");
|
||||
KillTimer(s_textArea, BevalTimerId);
|
||||
@ -4893,8 +4883,7 @@ gui_mch_disable_beval_area(beval)
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
gui_mch_enable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_enable_beval_area(BalloonEval *beval)
|
||||
{
|
||||
// TRACE0("gui_mch_enable_beval_area |||");
|
||||
if (beval == NULL)
|
||||
@ -4905,9 +4894,7 @@ gui_mch_enable_beval_area(beval)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_post_balloon(beval, mesg)
|
||||
BalloonEval *beval;
|
||||
char_u *mesg;
|
||||
gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
|
||||
{
|
||||
POINT pt;
|
||||
// TRACE0("gui_mch_post_balloon {{{");
|
||||
@ -4928,11 +4915,11 @@ gui_mch_post_balloon(beval, mesg)
|
||||
|
||||
/*ARGSUSED*/
|
||||
BalloonEval *
|
||||
gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
|
||||
void *target; /* ignored, always use s_textArea */
|
||||
char_u *mesg;
|
||||
void (*mesgCB)(BalloonEval *, int);
|
||||
void *clientData;
|
||||
gui_mch_create_beval_area(
|
||||
void *target, /* ignored, always use s_textArea */
|
||||
char_u *mesg,
|
||||
void (*mesgCB)(BalloonEval *, int),
|
||||
void *clientData)
|
||||
{
|
||||
/* partially stolen from gui_beval.c */
|
||||
BalloonEval *beval;
|
||||
@ -5010,8 +4997,7 @@ TrackUserActivity(UINT uMsg)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
gui_mch_destroy_beval_area(BalloonEval *beval)
|
||||
{
|
||||
vim_free(beval);
|
||||
}
|
||||
|
@ -1144,7 +1144,7 @@ gui_mch_new_colors(void)
|
||||
* Set the colors to their default values.
|
||||
*/
|
||||
void
|
||||
gui_mch_def_colors()
|
||||
gui_mch_def_colors(void)
|
||||
{
|
||||
gui.norm_pixel = GetSysColor(COLOR_WINDOWTEXT);
|
||||
gui.back_pixel = GetSysColor(COLOR_WINDOW);
|
||||
@ -1390,9 +1390,7 @@ gui_mch_get_font(
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(font, name)
|
||||
GuiFont font;
|
||||
char_u *name;
|
||||
gui_mch_get_fontname(GuiFont font, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@ -2623,8 +2621,7 @@ gui_mch_update_tabline(void)
|
||||
* Set the current tab to "nr". First tab is 1.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_curtab(nr)
|
||||
int nr;
|
||||
gui_mch_set_curtab(int nr)
|
||||
{
|
||||
if (s_tabhwnd == NULL)
|
||||
return;
|
||||
@ -3258,7 +3255,7 @@ update_im_font(void)
|
||||
* Handler of gui.wide_font (p_guifontwide) changed notification.
|
||||
*/
|
||||
void
|
||||
gui_mch_wide_font_changed()
|
||||
gui_mch_wide_font_changed(void)
|
||||
{
|
||||
# ifndef MSWIN16_FASTTEXT
|
||||
LOGFONT lf;
|
||||
@ -3385,7 +3382,7 @@ gui_mch_init_font(char_u *font_name, int fontset)
|
||||
* Return TRUE if the GUI window is maximized, filling the whole screen.
|
||||
*/
|
||||
int
|
||||
gui_mch_maximized()
|
||||
gui_mch_maximized(void)
|
||||
{
|
||||
WINDOWPLACEMENT wp;
|
||||
|
||||
@ -3403,7 +3400,7 @@ gui_mch_maximized()
|
||||
* new Rows and Columns. This is like resizing the window.
|
||||
*/
|
||||
void
|
||||
gui_mch_newfont()
|
||||
gui_mch_newfont(void)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
|
404
src/gui_x11.c
404
src/gui_x11.c
@ -571,19 +571,19 @@ static char **gui_argv = NULL;
|
||||
*/
|
||||
|
||||
static void
|
||||
gui_x11_timer_cb(timed_out, interval_id)
|
||||
XtPointer timed_out;
|
||||
XtIntervalId *interval_id UNUSED;
|
||||
gui_x11_timer_cb(
|
||||
XtPointer timed_out,
|
||||
XtIntervalId *interval_id UNUSED)
|
||||
{
|
||||
*((int *)timed_out) = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_visibility_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_visibility_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
if (event->type != VisibilityNotify)
|
||||
return;
|
||||
@ -602,11 +602,11 @@ gui_x11_visibility_cb(w, dud, event, dum)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_expose_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_expose_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
XExposeEvent *gevent;
|
||||
int new_x;
|
||||
@ -678,11 +678,11 @@ shellRectangle(Widget shell, XRectangle *r)
|
||||
#endif
|
||||
|
||||
static void
|
||||
gui_x11_resize_window_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_resize_window_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
static int lastWidth, lastHeight;
|
||||
|
||||
@ -724,31 +724,31 @@ gui_x11_resize_window_cb(w, dud, event, dum)
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_focus_change_cb(w, data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_focus_change_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
gui_focus_change(event->type == FocusIn);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_enter_cb(w, data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer data UNUSED;
|
||||
XEvent *event UNUSED;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_enter_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer data UNUSED,
|
||||
XEvent *event UNUSED,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
gui_focus_change(TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_leave_cb(w, data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer data UNUSED;
|
||||
XEvent *event UNUSED;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_leave_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer data UNUSED,
|
||||
XEvent *event UNUSED,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
gui_focus_change(FALSE);
|
||||
}
|
||||
@ -760,11 +760,11 @@ gui_x11_leave_cb(w, data, event, dum)
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_x11_key_hit_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_key_hit_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
XKeyPressedEvent *ev_press;
|
||||
#ifdef FEAT_XIM
|
||||
@ -1071,11 +1071,11 @@ theend:
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_mouse_cb(w, dud, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer dud UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_mouse_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer dud UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
static XtIntervalId timer = (XtIntervalId)0;
|
||||
static int timed_out = TRUE;
|
||||
@ -1166,10 +1166,10 @@ gui_x11_mouse_cb(w, dud, event, dum)
|
||||
#ifdef FEAT_SNIFF
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
gui_x11_sniff_request_cb(closure, source, id)
|
||||
XtPointer closure UNUSED;
|
||||
int *source UNUSED;
|
||||
XtInputId *id UNUSED;
|
||||
gui_x11_sniff_request_cb(
|
||||
XtPointer closure UNUSED,
|
||||
int *source UNUSED,
|
||||
XtInputId *id UNUSED)
|
||||
{
|
||||
static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
|
||||
|
||||
@ -1187,9 +1187,7 @@ gui_x11_sniff_request_cb(closure, source, id)
|
||||
* when vim is started, whether or not the GUI has been started.
|
||||
*/
|
||||
void
|
||||
gui_mch_prepare(argc, argv)
|
||||
int *argc;
|
||||
char **argv;
|
||||
gui_mch_prepare(int *argc, char **argv)
|
||||
{
|
||||
int arg;
|
||||
int i;
|
||||
@ -1285,7 +1283,7 @@ gui_mch_prepare(argc, argv)
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
int
|
||||
gui_mch_init_check()
|
||||
gui_mch_init_check(void)
|
||||
{
|
||||
#ifdef FEAT_XIM
|
||||
XtSetLanguageProc(NULL, NULL, NULL);
|
||||
@ -1315,10 +1313,10 @@ static XtInputId _xsmp_xtinputid;
|
||||
static void local_xsmp_handle_requests(XtPointer c, int *s, XtInputId *i);
|
||||
|
||||
static void
|
||||
local_xsmp_handle_requests(c, s, i)
|
||||
XtPointer c UNUSED;
|
||||
int *s UNUSED;
|
||||
XtInputId *i UNUSED;
|
||||
local_xsmp_handle_requests(
|
||||
XtPointer c UNUSED,
|
||||
int *s UNUSED,
|
||||
XtInputId *i UNUSED)
|
||||
{
|
||||
if (xsmp_handle_requests() == FAIL)
|
||||
XtRemoveInput(_xsmp_xtinputid);
|
||||
@ -1331,7 +1329,7 @@ local_xsmp_handle_requests(c, s, i)
|
||||
* Returns OK for success, FAIL when the GUI can't be started.
|
||||
*/
|
||||
int
|
||||
gui_mch_init()
|
||||
gui_mch_init(void)
|
||||
{
|
||||
XtGCMask gc_mask;
|
||||
XGCValues gc_vals;
|
||||
@ -1575,7 +1573,7 @@ gui_mch_init()
|
||||
* Called when starting the GUI fails after calling gui_mch_init().
|
||||
*/
|
||||
void
|
||||
gui_mch_uninit()
|
||||
gui_mch_uninit(void)
|
||||
{
|
||||
gui_x11_destroy_widgets();
|
||||
XtCloseDisplay(gui.dpy);
|
||||
@ -1589,7 +1587,7 @@ gui_mch_uninit()
|
||||
* Called when the foreground or background color has been changed.
|
||||
*/
|
||||
void
|
||||
gui_mch_new_colors()
|
||||
gui_mch_new_colors(void)
|
||||
{
|
||||
long_u gc_mask;
|
||||
XGCValues gc_vals;
|
||||
@ -1619,7 +1617,7 @@ gui_mch_new_colors()
|
||||
* Open the GUI window which was created by a call to gui_mch_init().
|
||||
*/
|
||||
int
|
||||
gui_mch_open()
|
||||
gui_mch_open(void)
|
||||
{
|
||||
/* Actually open the window */
|
||||
XtRealizeWidget(vimShell);
|
||||
@ -1700,7 +1698,7 @@ gui_mch_open()
|
||||
* Convert the tooltip fontset name to an XFontSet.
|
||||
*/
|
||||
void
|
||||
gui_init_tooltip_font()
|
||||
gui_init_tooltip_font(void)
|
||||
{
|
||||
XrmValue from, to;
|
||||
|
||||
@ -1719,7 +1717,7 @@ gui_init_tooltip_font()
|
||||
#if defined(FEAT_MENU) || defined(PROTO)
|
||||
/* Convert the menu font/fontset name to an XFontStruct/XFontset */
|
||||
void
|
||||
gui_init_menu_font()
|
||||
gui_init_menu_font(void)
|
||||
{
|
||||
XrmValue from, to;
|
||||
|
||||
@ -1748,8 +1746,7 @@ gui_init_menu_font()
|
||||
#endif
|
||||
|
||||
void
|
||||
gui_mch_exit(rc)
|
||||
int rc UNUSED;
|
||||
gui_mch_exit(int rc UNUSED)
|
||||
{
|
||||
#if 0
|
||||
/* Lesstif gives an error message here, and so does Solaris. The man page
|
||||
@ -1764,8 +1761,7 @@ gui_mch_exit(rc)
|
||||
* Get the position of the top left corner of the window.
|
||||
*/
|
||||
int
|
||||
gui_mch_get_winpos(x, y)
|
||||
int *x, *y;
|
||||
gui_mch_get_winpos(int *x, *y)
|
||||
{
|
||||
Dimension xpos, ypos;
|
||||
|
||||
@ -1783,8 +1779,7 @@ gui_mch_get_winpos(x, y)
|
||||
* coordinates.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_winpos(x, y)
|
||||
int x, y;
|
||||
gui_mch_set_winpos(int x, y)
|
||||
{
|
||||
XtVaSetValues(vimShell,
|
||||
XtNx, x,
|
||||
@ -1793,15 +1788,14 @@ gui_mch_set_winpos(x, y)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||
base_width, base_height, direction)
|
||||
int width;
|
||||
int height;
|
||||
int min_width;
|
||||
int min_height;
|
||||
int base_width;
|
||||
int base_height;
|
||||
int direction UNUSED;
|
||||
gui_mch_set_shellsize(
|
||||
int width,
|
||||
int height,
|
||||
int min_width,
|
||||
int min_height,
|
||||
int base_width,
|
||||
int base_height,
|
||||
int direction UNUSED)
|
||||
{
|
||||
#ifdef FEAT_XIM
|
||||
height += xim_get_status_area_height(),
|
||||
@ -1825,9 +1819,9 @@ gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||
* Is there no way in X to find out how wide the borders really are?
|
||||
*/
|
||||
void
|
||||
gui_mch_get_screen_dimensions(screen_w, screen_h)
|
||||
int *screen_w;
|
||||
int *screen_h;
|
||||
gui_mch_get_screen_dimensions(
|
||||
int *screen_w,
|
||||
int *screen_h)
|
||||
{
|
||||
*screen_w = DisplayWidth(gui.dpy, DefaultScreen(gui.dpy)) - 10;
|
||||
*screen_h = DisplayHeight(gui.dpy, DefaultScreen(gui.dpy)) - p_ghr;
|
||||
@ -1840,9 +1834,9 @@ gui_mch_get_screen_dimensions(screen_w, screen_h)
|
||||
* Return FAIL if the font could not be loaded, OK otherwise.
|
||||
*/
|
||||
int
|
||||
gui_mch_init_font(font_name, do_fontset)
|
||||
char_u *font_name;
|
||||
int do_fontset UNUSED;
|
||||
gui_mch_init_font(
|
||||
char_u *font_name,
|
||||
int do_fontset UNUSED)
|
||||
{
|
||||
XFontStruct *font = NULL;
|
||||
|
||||
@ -1970,9 +1964,7 @@ gui_mch_init_font(font_name, do_fontset)
|
||||
* Get a font structure for highlighting.
|
||||
*/
|
||||
GuiFont
|
||||
gui_mch_get_font(name, giveErrorIfMissing)
|
||||
char_u *name;
|
||||
int giveErrorIfMissing;
|
||||
gui_mch_get_font(char_u *name, int giveErrorIfMissing)
|
||||
{
|
||||
XFontStruct *font;
|
||||
|
||||
@ -2021,9 +2013,7 @@ gui_mch_get_font(name, giveErrorIfMissing)
|
||||
* Don't know how to get the actual name, thus use the provided name.
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_get_fontname(font, name)
|
||||
GuiFont font UNUSED;
|
||||
char_u *name;
|
||||
gui_mch_get_fontname(GuiFont font UNUSED, char_u *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
@ -2035,7 +2025,7 @@ gui_mch_get_fontname(font, name)
|
||||
* Adjust gui.char_height (after 'linespace' was changed).
|
||||
*/
|
||||
int
|
||||
gui_mch_adjust_charheight()
|
||||
gui_mch_adjust_charheight(void)
|
||||
{
|
||||
#ifdef FEAT_XFONTSET
|
||||
if (gui.fontset != NOFONTSET)
|
||||
@ -2059,8 +2049,7 @@ gui_mch_adjust_charheight()
|
||||
* Set the current text font.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_font(font)
|
||||
GuiFont font;
|
||||
gui_mch_set_font(GuiFont font)
|
||||
{
|
||||
static Font prev_font = (Font)-1;
|
||||
Font fid = ((XFontStruct *)font)->fid;
|
||||
@ -2083,8 +2072,7 @@ gui_mch_set_font(font)
|
||||
* Adjust the ascent, in case it's different.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_fontset(fontset)
|
||||
GuiFontset fontset;
|
||||
gui_mch_set_fontset(GuiFontset fontset)
|
||||
{
|
||||
current_fontset = (XFontSet)fontset;
|
||||
gui.char_ascent = fontset_ascent(current_fontset) + p_linespace / 2;
|
||||
@ -2095,8 +2083,7 @@ gui_mch_set_fontset(fontset)
|
||||
* If a font is not going to be used, free its structure.
|
||||
*/
|
||||
void
|
||||
gui_mch_free_font(font)
|
||||
GuiFont font;
|
||||
gui_mch_free_font(GuiFont font)
|
||||
{
|
||||
if (font != NOFONT)
|
||||
XFreeFont(gui.dpy, (XFontStruct *)font);
|
||||
@ -2107,8 +2094,7 @@ gui_mch_free_font(font)
|
||||
* If a fontset is not going to be used, free its structure.
|
||||
*/
|
||||
void
|
||||
gui_mch_free_fontset(fontset)
|
||||
GuiFontset fontset;
|
||||
gui_mch_free_fontset(GuiFontset fontset)
|
||||
{
|
||||
if (fontset != NOFONTSET)
|
||||
XFreeFontSet(gui.dpy, (XFontSet)fontset);
|
||||
@ -2119,10 +2105,10 @@ gui_mch_free_fontset(fontset)
|
||||
* Return a reference to the fontset, or NOFONTSET when failing.
|
||||
*/
|
||||
GuiFontset
|
||||
gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width)
|
||||
char_u *name;
|
||||
int giveErrorIfMissing;
|
||||
int fixed_width;
|
||||
gui_mch_get_fontset(
|
||||
char_u *name,
|
||||
int giveErrorIfMissing,
|
||||
int fixed_width)
|
||||
{
|
||||
XFontSet fontset;
|
||||
char **missing, *def_str;
|
||||
@ -2165,8 +2151,7 @@ gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width)
|
||||
* Check if fontset "fs" is fixed width.
|
||||
*/
|
||||
static int
|
||||
check_fontset_sanity(fs)
|
||||
XFontSet fs;
|
||||
check_fontset_sanity(XFontSet fs)
|
||||
{
|
||||
XFontStruct **xfs;
|
||||
char **font_name;
|
||||
@ -2216,15 +2201,14 @@ check_fontset_sanity(fs)
|
||||
}
|
||||
|
||||
static int
|
||||
fontset_width(fs)
|
||||
XFontSet fs;
|
||||
fontset_width(XFontSet fs)
|
||||
{
|
||||
return XmbTextEscapement(fs, "Vim", 3) / 3;
|
||||
return XmbTextEscapement(fs, "Vim", 3) / 3;
|
||||
}
|
||||
|
||||
int
|
||||
fontset_height(fs)
|
||||
XFontSet fs;
|
||||
fontset_height(
|
||||
XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@ -2239,8 +2223,7 @@ fontset_height(fs)
|
||||
* characters in all fonts of the fontset.
|
||||
*/
|
||||
int
|
||||
fontset_height2(fs)
|
||||
XFontSet fs;
|
||||
fontset_height2(XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@ -2262,8 +2245,7 @@ fontset_descent(fs)
|
||||
*/
|
||||
|
||||
static int
|
||||
fontset_ascent(fs)
|
||||
XFontSet fs;
|
||||
fontset_ascent(XFontSet fs)
|
||||
{
|
||||
XFontSetExtents *extents;
|
||||
|
||||
@ -2278,8 +2260,7 @@ fontset_ascent(fs)
|
||||
* Return INVALCOLOR for error.
|
||||
*/
|
||||
guicolor_T
|
||||
gui_mch_get_color(reqname)
|
||||
char_u *reqname;
|
||||
gui_mch_get_color(char_u *reqname)
|
||||
{
|
||||
int i;
|
||||
char_u *name = reqname;
|
||||
@ -2382,9 +2363,7 @@ gui_mch_get_color(reqname)
|
||||
* Return FAIL if not able to find or allocate a color.
|
||||
*/
|
||||
static int
|
||||
find_closest_color(colormap, colorPtr)
|
||||
Colormap colormap;
|
||||
XColor *colorPtr;
|
||||
find_closest_color(Colormap colormap, XColor *colorPtr)
|
||||
{
|
||||
double tmp, distance, closestDistance;
|
||||
int i, closest, numFound, cmap_size;
|
||||
@ -2452,8 +2431,7 @@ find_closest_color(colormap, colorPtr)
|
||||
* Set the current text foreground color.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_fg_color(color)
|
||||
guicolor_T color;
|
||||
gui_mch_set_fg_color(guicolor_T color)
|
||||
{
|
||||
if (color != prev_fg_color)
|
||||
{
|
||||
@ -2466,8 +2444,7 @@ gui_mch_set_fg_color(color)
|
||||
* Set the current text background color.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_bg_color(color)
|
||||
guicolor_T color;
|
||||
gui_mch_set_bg_color(guicolor_T color)
|
||||
{
|
||||
if (color != prev_bg_color)
|
||||
{
|
||||
@ -2480,8 +2457,7 @@ gui_mch_set_bg_color(color)
|
||||
* Set the current text special color.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_sp_color(color)
|
||||
guicolor_T color;
|
||||
gui_mch_set_sp_color(guicolor_T color)
|
||||
{
|
||||
prev_sp_color = color;
|
||||
}
|
||||
@ -2490,7 +2466,7 @@ gui_mch_set_sp_color(color)
|
||||
* create a mouse pointer that is blank
|
||||
*/
|
||||
static Cursor
|
||||
gui_x11_create_blank_mouse()
|
||||
gui_x11_create_blank_mouse(void)
|
||||
{
|
||||
Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1);
|
||||
GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0);
|
||||
@ -2504,10 +2480,7 @@ gui_x11_create_blank_mouse()
|
||||
* Draw a curled line at the bottom of the character cell.
|
||||
*/
|
||||
static void
|
||||
draw_curl(row, col, cells)
|
||||
int row;
|
||||
int col;
|
||||
int cells;
|
||||
draw_curl(int row, int col, int cells)
|
||||
{
|
||||
int i;
|
||||
int offset;
|
||||
@ -2524,12 +2497,12 @@ draw_curl(row, col, cells)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_draw_string(row, col, s, len, flags)
|
||||
int row;
|
||||
int col;
|
||||
char_u *s;
|
||||
int len;
|
||||
int flags;
|
||||
gui_mch_draw_string(
|
||||
int row,
|
||||
int col,
|
||||
char_u *s,
|
||||
int len,
|
||||
int flags)
|
||||
{
|
||||
int cells = len;
|
||||
#ifdef FEAT_MBYTE
|
||||
@ -2691,8 +2664,7 @@ gui_mch_draw_string(row, col, s, len, flags)
|
||||
* Return OK if the key with the termcap name "name" is supported.
|
||||
*/
|
||||
int
|
||||
gui_mch_haskey(name)
|
||||
char_u *name;
|
||||
gui_mch_haskey(char_u *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2707,9 +2679,7 @@ gui_mch_haskey(name)
|
||||
* Return the text window-id and display. Only required for X-based GUI's
|
||||
*/
|
||||
int
|
||||
gui_get_x11_windis(win, dis)
|
||||
Window *win;
|
||||
Display **dis;
|
||||
gui_get_x11_windis(Window *win, Display **dis)
|
||||
{
|
||||
*win = XtWindow(vimShell);
|
||||
*dis = gui.dpy;
|
||||
@ -2717,14 +2687,13 @@ gui_get_x11_windis(win, dis)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_beep()
|
||||
gui_mch_beep(void)
|
||||
{
|
||||
XBell(gui.dpy, 0);
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_flash(msec)
|
||||
int msec;
|
||||
gui_mch_flash(int msec)
|
||||
{
|
||||
/* Do a visual beep by reversing the foreground and background colors */
|
||||
XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
|
||||
@ -2741,11 +2710,11 @@ gui_mch_flash(msec)
|
||||
* Invert a rectangle from row r, column c, for nr rows and nc columns.
|
||||
*/
|
||||
void
|
||||
gui_mch_invert_rectangle(r, c, nr, nc)
|
||||
int r;
|
||||
int c;
|
||||
int nr;
|
||||
int nc;
|
||||
gui_mch_invert_rectangle(
|
||||
int r,
|
||||
int c,
|
||||
int nr,
|
||||
int nc)
|
||||
{
|
||||
XFillRectangle(gui.dpy, gui.wid, gui.invert_gc,
|
||||
FILL_X(c), FILL_Y(r), (nc) * gui.char_width, (nr) * gui.char_height);
|
||||
@ -2755,7 +2724,7 @@ gui_mch_invert_rectangle(r, c, nr, nc)
|
||||
* Iconify the GUI window.
|
||||
*/
|
||||
void
|
||||
gui_mch_iconify()
|
||||
gui_mch_iconify(void)
|
||||
{
|
||||
XIconifyWindow(gui.dpy, XtWindow(vimShell), DefaultScreen(gui.dpy));
|
||||
}
|
||||
@ -2765,7 +2734,7 @@ gui_mch_iconify()
|
||||
* Bring the Vim window to the foreground.
|
||||
*/
|
||||
void
|
||||
gui_mch_set_foreground()
|
||||
gui_mch_set_foreground(void)
|
||||
{
|
||||
XMapRaised(gui.dpy, XtWindow(vimShell));
|
||||
}
|
||||
@ -2775,8 +2744,7 @@ gui_mch_set_foreground()
|
||||
* Draw a cursor without focus.
|
||||
*/
|
||||
void
|
||||
gui_mch_draw_hollow_cursor(color)
|
||||
guicolor_T color;
|
||||
gui_mch_draw_hollow_cursor(guicolor_T color)
|
||||
{
|
||||
int w = 1;
|
||||
|
||||
@ -2794,10 +2762,7 @@ gui_mch_draw_hollow_cursor(color)
|
||||
* color "color".
|
||||
*/
|
||||
void
|
||||
gui_mch_draw_part_cursor(w, h, color)
|
||||
int w;
|
||||
int h;
|
||||
guicolor_T color;
|
||||
gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
|
||||
{
|
||||
gui_mch_set_fg_color(color);
|
||||
|
||||
@ -2818,7 +2783,7 @@ gui_mch_draw_part_cursor(w, h, color)
|
||||
* immediately.
|
||||
*/
|
||||
void
|
||||
gui_mch_update()
|
||||
gui_mch_update(void)
|
||||
{
|
||||
XtInputMask mask, desired;
|
||||
|
||||
@ -2843,8 +2808,7 @@ gui_mch_update()
|
||||
* or FAIL otherwise.
|
||||
*/
|
||||
int
|
||||
gui_mch_wait_for_chars(wtime)
|
||||
long wtime;
|
||||
gui_mch_wait_for_chars(long wtime)
|
||||
{
|
||||
int focus;
|
||||
|
||||
@ -2930,7 +2894,7 @@ gui_mch_wait_for_chars(wtime)
|
||||
|
||||
/* Flush any output to the screen */
|
||||
void
|
||||
gui_mch_flush()
|
||||
gui_mch_flush(void)
|
||||
{
|
||||
XFlush(gui.dpy);
|
||||
}
|
||||
@ -2940,11 +2904,11 @@ gui_mch_flush()
|
||||
* (row2, col2) inclusive.
|
||||
*/
|
||||
void
|
||||
gui_mch_clear_block(row1, col1, row2, col2)
|
||||
int row1;
|
||||
int col1;
|
||||
int row2;
|
||||
int col2;
|
||||
gui_mch_clear_block(
|
||||
int row1,
|
||||
int col1,
|
||||
int row2,
|
||||
int col2)
|
||||
{
|
||||
int x;
|
||||
|
||||
@ -2958,7 +2922,7 @@ gui_mch_clear_block(row1, col1, row2, col2)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_clear_all()
|
||||
gui_mch_clear_all(void)
|
||||
{
|
||||
XClearArea(gui.dpy, gui.wid, 0, 0, 0, 0, False);
|
||||
}
|
||||
@ -2968,9 +2932,7 @@ gui_mch_clear_all()
|
||||
* text further down within the scroll region.
|
||||
*/
|
||||
void
|
||||
gui_mch_delete_lines(row, num_lines)
|
||||
int row;
|
||||
int num_lines;
|
||||
gui_mch_delete_lines(int row, int num_lines)
|
||||
{
|
||||
if (gui.visibility == VisibilityFullyObscured)
|
||||
return; /* Can't see the window */
|
||||
@ -2995,9 +2957,7 @@ gui_mch_delete_lines(row, num_lines)
|
||||
* following text within the scroll region.
|
||||
*/
|
||||
void
|
||||
gui_mch_insert_lines(row, num_lines)
|
||||
int row;
|
||||
int num_lines;
|
||||
gui_mch_insert_lines(int row, int num_lines)
|
||||
{
|
||||
if (gui.visibility == VisibilityFullyObscured)
|
||||
return; /* Can't see the window */
|
||||
@ -3020,7 +2980,7 @@ gui_mch_insert_lines(row, num_lines)
|
||||
* Update the region revealed by scrolling up/down.
|
||||
*/
|
||||
static void
|
||||
gui_x11_check_copy_area()
|
||||
gui_x11_check_copy_area(void)
|
||||
{
|
||||
XEvent event;
|
||||
XGraphicsExposeEvent *gevent;
|
||||
@ -3052,29 +3012,26 @@ gui_x11_check_copy_area()
|
||||
*/
|
||||
|
||||
void
|
||||
clip_mch_lose_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_lose_selection(VimClipboard *cbd)
|
||||
{
|
||||
clip_x11_lose_selection(vimShell, cbd);
|
||||
}
|
||||
|
||||
int
|
||||
clip_mch_own_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_own_selection(VimClipboard *cbd)
|
||||
{
|
||||
return clip_x11_own_selection(vimShell, cbd);
|
||||
}
|
||||
|
||||
void
|
||||
clip_mch_request_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_request_selection(VimClipboard *cbd)
|
||||
{
|
||||
clip_x11_request_selection(vimShell, gui.dpy, cbd);
|
||||
clip_x11_request_selection(vimShell, gui.dpy, cbd);
|
||||
}
|
||||
|
||||
void
|
||||
clip_mch_set_selection(cbd)
|
||||
VimClipboard *cbd;
|
||||
clip_mch_set_selection(
|
||||
VimClipboard *cbd)
|
||||
{
|
||||
clip_x11_set_selection(cbd);
|
||||
}
|
||||
@ -3088,9 +3045,7 @@ clip_mch_set_selection(cbd)
|
||||
* Make a menu either grey or not grey.
|
||||
*/
|
||||
void
|
||||
gui_mch_menu_grey(menu, grey)
|
||||
vimmenu_T *menu;
|
||||
int grey;
|
||||
gui_mch_menu_grey(vimmenu_T *menu, int grey)
|
||||
{
|
||||
if (menu->id != (Widget)0)
|
||||
{
|
||||
@ -3110,9 +3065,7 @@ gui_mch_menu_grey(menu, grey)
|
||||
* Make menu item hidden or not hidden
|
||||
*/
|
||||
void
|
||||
gui_mch_menu_hidden(menu, hidden)
|
||||
vimmenu_T *menu;
|
||||
int hidden;
|
||||
gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
|
||||
{
|
||||
if (menu->id != (Widget)0)
|
||||
{
|
||||
@ -3127,16 +3080,16 @@ gui_mch_menu_hidden(menu, hidden)
|
||||
* This is called after setting all the menus to grey/hidden or not.
|
||||
*/
|
||||
void
|
||||
gui_mch_draw_menubar()
|
||||
gui_mch_draw_menubar(void)
|
||||
{
|
||||
/* Nothing to do in X */
|
||||
}
|
||||
|
||||
void
|
||||
gui_x11_menu_cb(w, client_data, call_data)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data;
|
||||
XtPointer call_data UNUSED;
|
||||
gui_x11_menu_cb(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
gui_menu_cb((vimmenu_T *)client_data);
|
||||
}
|
||||
@ -3150,11 +3103,11 @@ gui_x11_menu_cb(w, client_data, call_data)
|
||||
* Should put up a requester!
|
||||
*/
|
||||
static void
|
||||
gui_x11_wm_protocol_handler(w, client_data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_wm_protocol_handler(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
/*
|
||||
* Only deal with Client messages.
|
||||
@ -3192,11 +3145,11 @@ gui_x11_wm_protocol_handler(w, client_data, event, dum)
|
||||
* Function called when property changed. Check for incoming commands
|
||||
*/
|
||||
static void
|
||||
gui_x11_send_event_handler(w, client_data, event, dum)
|
||||
Widget w UNUSED;
|
||||
XtPointer client_data UNUSED;
|
||||
XEvent *event;
|
||||
Boolean *dum UNUSED;
|
||||
gui_x11_send_event_handler(
|
||||
Widget w UNUSED,
|
||||
XtPointer client_data UNUSED,
|
||||
XEvent *event,
|
||||
Boolean *dum UNUSED)
|
||||
{
|
||||
XPropertyEvent *e = (XPropertyEvent *) event;
|
||||
|
||||
@ -3228,8 +3181,7 @@ static long_u blink_offtime = 250;
|
||||
static XtIntervalId blink_timer = (XtIntervalId)0;
|
||||
|
||||
void
|
||||
gui_mch_set_blinking(waittime, on, off)
|
||||
long waittime, on, off;
|
||||
gui_mch_set_blinking(long waittime, on, off)
|
||||
{
|
||||
blink_waittime = waittime;
|
||||
blink_ontime = on;
|
||||
@ -3240,7 +3192,7 @@ gui_mch_set_blinking(waittime, on, off)
|
||||
* Stop the cursor blinking. Show the cursor if it wasn't shown.
|
||||
*/
|
||||
void
|
||||
gui_mch_stop_blink()
|
||||
gui_mch_stop_blink(void)
|
||||
{
|
||||
if (blink_timer != (XtIntervalId)0)
|
||||
{
|
||||
@ -3257,7 +3209,7 @@ gui_mch_stop_blink()
|
||||
* waiting time and shows the cursor.
|
||||
*/
|
||||
void
|
||||
gui_mch_start_blink()
|
||||
gui_mch_start_blink(void)
|
||||
{
|
||||
if (blink_timer != (XtIntervalId)0)
|
||||
XtRemoveTimeOut(blink_timer);
|
||||
@ -3272,9 +3224,9 @@ gui_mch_start_blink()
|
||||
}
|
||||
|
||||
static void
|
||||
gui_x11_blink_cb(timed_out, interval_id)
|
||||
XtPointer timed_out UNUSED;
|
||||
XtIntervalId *interval_id UNUSED;
|
||||
gui_x11_blink_cb(
|
||||
XtPointer timed_out UNUSED,
|
||||
XtIntervalId *interval_id UNUSED)
|
||||
{
|
||||
if (blink_state == BLINK_ON)
|
||||
{
|
||||
@ -3296,8 +3248,7 @@ gui_x11_blink_cb(timed_out, interval_id)
|
||||
* Return the RGB value of a pixel as a long.
|
||||
*/
|
||||
long_u
|
||||
gui_mch_get_rgb(pixel)
|
||||
guicolor_T pixel;
|
||||
gui_mch_get_rgb(guicolor_T pixel)
|
||||
{
|
||||
XColor xc;
|
||||
Colormap colormap;
|
||||
@ -3314,9 +3265,7 @@ gui_mch_get_rgb(pixel)
|
||||
* Add the callback functions.
|
||||
*/
|
||||
void
|
||||
gui_x11_callbacks(textArea, vimForm)
|
||||
Widget textArea;
|
||||
Widget vimForm;
|
||||
gui_x11_callbacks(Widget textArea, Widget vimForm)
|
||||
{
|
||||
XtAddEventHandler(textArea, VisibilityChangeMask, FALSE,
|
||||
gui_x11_visibility_cb, (XtPointer)0);
|
||||
@ -3379,9 +3328,7 @@ gui_mch_getmouse(int *x, int *y)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_setmouse(x, y)
|
||||
int x;
|
||||
int y;
|
||||
gui_mch_setmouse(int x, int y)
|
||||
{
|
||||
if (gui.wid)
|
||||
XWarpPointer(gui.dpy, (Window)0, gui.wid, 0, 0, 0, 0, x, y);
|
||||
@ -3389,7 +3336,7 @@ gui_mch_setmouse(x, y)
|
||||
|
||||
#if (defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)) || defined(PROTO)
|
||||
XButtonPressedEvent *
|
||||
gui_x11_get_last_mouse_event()
|
||||
gui_x11_get_last_mouse_event(void)
|
||||
{
|
||||
return &last_mouse_event;
|
||||
}
|
||||
@ -3402,10 +3349,7 @@ gui_x11_get_last_mouse_event()
|
||||
# define SIGN_WIDTH (gui.char_width * 2)
|
||||
|
||||
void
|
||||
gui_mch_drawsign(row, col, typenr)
|
||||
int row;
|
||||
int col;
|
||||
int typenr;
|
||||
gui_mch_drawsign(int row, int col, int typenr)
|
||||
{
|
||||
XImage *sign;
|
||||
|
||||
@ -3421,8 +3365,7 @@ gui_mch_drawsign(row, col, typenr)
|
||||
}
|
||||
|
||||
void *
|
||||
gui_mch_register_sign(signfile)
|
||||
char_u *signfile;
|
||||
gui_mch_register_sign(char_u *signfile)
|
||||
{
|
||||
XpmAttributes attrs;
|
||||
XImage *sign = NULL;
|
||||
@ -3462,8 +3405,7 @@ gui_mch_register_sign(signfile)
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_destroy_sign(sign)
|
||||
void *sign;
|
||||
gui_mch_destroy_sign(void *sign)
|
||||
{
|
||||
XDestroyImage((XImage*)sign);
|
||||
}
|
||||
@ -3480,8 +3422,8 @@ static int last_shape = 0;
|
||||
* Use the blank mouse pointer or not.
|
||||
*/
|
||||
void
|
||||
gui_mch_mousehide(hide)
|
||||
int hide; /* TRUE = use blank ptr, FALSE = use parent ptr */
|
||||
gui_mch_mousehide(
|
||||
int hide) /* TRUE = use blank ptr, FALSE = use parent ptr */
|
||||
{
|
||||
if (gui.pointer_hidden != hide)
|
||||
{
|
||||
@ -3523,8 +3465,7 @@ static int mshape_ids[] =
|
||||
};
|
||||
|
||||
void
|
||||
mch_set_mouse_shape(shape)
|
||||
int shape;
|
||||
mch_set_mouse_shape(int shape)
|
||||
{
|
||||
int id;
|
||||
|
||||
@ -3560,8 +3501,7 @@ mch_set_mouse_shape(shape)
|
||||
* passing a normal menu item here. Can't explain that, but better avoid it.
|
||||
*/
|
||||
void
|
||||
gui_mch_menu_set_tip(menu)
|
||||
vimmenu_T *menu;
|
||||
gui_mch_menu_set_tip(vimmenu_T *menu)
|
||||
{
|
||||
if (menu->id != NULL && menu->parent != NULL
|
||||
&& menu_is_toolbar(menu->parent->name))
|
||||
|
@ -96,9 +96,7 @@ static short_u kind_table_for_3[] =
|
||||
*/
|
||||
|
||||
static int
|
||||
comfcon3(v, c)
|
||||
int v;
|
||||
int c;
|
||||
comfcon3(int v, int c)
|
||||
{
|
||||
if (v == 2 && c == 2)
|
||||
return 3;
|
||||
@ -118,9 +116,7 @@ comfcon3(v, c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comvow3(v, c)
|
||||
int v;
|
||||
int c;
|
||||
comvow3(int v, int c)
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
@ -159,9 +155,7 @@ comvow3(v, c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comcon3(k, c)
|
||||
int k;
|
||||
int c;
|
||||
comcon3(int k, int c)
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
@ -217,8 +211,7 @@ comcon3(k, c)
|
||||
/**********************************************************************/
|
||||
|
||||
static int
|
||||
kind_table_for_2(c)
|
||||
int c;
|
||||
kind_table_for_2(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@ -241,8 +234,7 @@ kind_table_for_2(c)
|
||||
* 결과: 초성이 아니면 0 (If it is not initial sound, return 0).
|
||||
*/
|
||||
static int
|
||||
fcon(c)
|
||||
int c;
|
||||
fcon(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@ -266,8 +258,7 @@ fcon(c)
|
||||
* 결과: 중성이 아니면 0 (If it is not medial vowel, return 0).
|
||||
*/
|
||||
static int
|
||||
vow(c)
|
||||
int c;
|
||||
vow(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@ -289,8 +280,7 @@ vow(c)
|
||||
* 결과: 받침이 아니면 0 (If not prop, return 0)
|
||||
*/
|
||||
static int
|
||||
lcon(c)
|
||||
int c;
|
||||
lcon(int c)
|
||||
{
|
||||
static char_u table[] =
|
||||
{
|
||||
@ -312,9 +302,7 @@ lcon(c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comcon2(k, c)
|
||||
int k;
|
||||
int c;
|
||||
comcon2(int k, int c)
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
@ -369,9 +357,7 @@ comcon2(k, c)
|
||||
*/
|
||||
|
||||
static int
|
||||
comvow2(v, c)
|
||||
int v;
|
||||
int c;
|
||||
comvow2(int v, int c)
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
@ -408,27 +394,26 @@ comvow2(v, c)
|
||||
}
|
||||
|
||||
int
|
||||
hangul_input_state_get()
|
||||
hangul_input_state_get(void)
|
||||
{
|
||||
return hangul_input_state;
|
||||
}
|
||||
|
||||
void
|
||||
hangul_input_state_set(state)
|
||||
int state;
|
||||
hangul_input_state_set(int state)
|
||||
{
|
||||
hangul_input_state = state;
|
||||
hangul_input_clear();
|
||||
}
|
||||
|
||||
int
|
||||
im_get_status()
|
||||
im_get_status(void)
|
||||
{
|
||||
return hangul_input_state_get();
|
||||
}
|
||||
|
||||
void
|
||||
hangul_input_state_toggle()
|
||||
hangul_input_state_toggle(void)
|
||||
{
|
||||
if (hangul_input_state_get())
|
||||
{
|
||||
@ -452,9 +437,7 @@ hangul_input_state_toggle()
|
||||
}
|
||||
|
||||
static int
|
||||
hangul_automata2(buf, c)
|
||||
char_u *buf;
|
||||
int_u *c;
|
||||
hangul_automata2(char_u *buf, int_u *c)
|
||||
{
|
||||
int t,t2;
|
||||
|
||||
@ -614,9 +597,7 @@ hangul_automata2(buf, c)
|
||||
}
|
||||
|
||||
static int
|
||||
hangul_automata3(buf, c)
|
||||
char_u *buf;
|
||||
int_u *c;
|
||||
hangul_automata3(char_u *buf, int_u *c)
|
||||
{
|
||||
int t, t2;
|
||||
|
||||
@ -725,7 +706,7 @@ hangul_automata3(buf, c)
|
||||
}
|
||||
|
||||
void
|
||||
hangul_keyboard_set()
|
||||
hangul_keyboard_set(void)
|
||||
{
|
||||
int keyboard;
|
||||
char *s;
|
||||
@ -746,9 +727,7 @@ hangul_keyboard_set()
|
||||
}
|
||||
|
||||
int
|
||||
hangul_input_process(s, len)
|
||||
char_u *s;
|
||||
int len;
|
||||
hangul_input_process(char_u *s, int len)
|
||||
{
|
||||
int n;
|
||||
unsigned int c;
|
||||
@ -831,7 +810,7 @@ hangul_input_process(s, len)
|
||||
}
|
||||
|
||||
void
|
||||
hangul_input_clear()
|
||||
hangul_input_clear(void)
|
||||
{
|
||||
sp = 0;
|
||||
f = F_NULL;
|
||||
@ -1503,11 +1482,11 @@ static const char_u johab_lcon_to_wan[] =
|
||||
};
|
||||
|
||||
static void
|
||||
convert_ks_to_3(src, fp, mp, lp)
|
||||
const char_u *src;
|
||||
int *fp;
|
||||
int *mp;
|
||||
int *lp;
|
||||
convert_ks_to_3(
|
||||
const char_u *src,
|
||||
int *fp,
|
||||
int *mp,
|
||||
int *lp)
|
||||
{
|
||||
int h = *src;
|
||||
int low = *(src + 1);
|
||||
@ -1539,11 +1518,11 @@ convert_ks_to_3(src, fp, mp, lp)
|
||||
}
|
||||
|
||||
static int
|
||||
convert_3_to_ks(fv, mv, lv, des)
|
||||
int fv;
|
||||
int mv;
|
||||
int lv;
|
||||
char_u *des;
|
||||
convert_3_to_ks(
|
||||
int fv,
|
||||
int mv,
|
||||
int lv,
|
||||
char_u *des)
|
||||
{
|
||||
char_u key[3];
|
||||
register int hi, lo, mi = 0, result, found;
|
||||
@ -1621,9 +1600,7 @@ convert_3_to_ks(fv, mv, lv, des)
|
||||
}
|
||||
|
||||
char_u *
|
||||
hangul_string_convert(buf, p_len)
|
||||
char_u *buf;
|
||||
int *p_len;
|
||||
hangul_string_convert(char_u *buf, int *p_len)
|
||||
{
|
||||
char_u *tmpbuf = NULL;
|
||||
vimconv_T vc;
|
||||
@ -1642,8 +1619,7 @@ hangul_string_convert(buf, p_len)
|
||||
}
|
||||
|
||||
char_u *
|
||||
hangul_composing_buffer_get(p_len)
|
||||
int *p_len;
|
||||
hangul_composing_buffer_get(int *p_len)
|
||||
{
|
||||
char_u *tmpbuf = NULL;
|
||||
|
||||
|
313
src/hardcopy.c
313
src/hardcopy.c
@ -157,7 +157,7 @@ static void prt_get_attr(int hl_id, prt_text_attr_T* pattr, int modec);
|
||||
* Returns an error message or NULL;
|
||||
*/
|
||||
char_u *
|
||||
parse_printoptions()
|
||||
parse_printoptions(void)
|
||||
{
|
||||
return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS);
|
||||
}
|
||||
@ -168,7 +168,7 @@ parse_printoptions()
|
||||
* Returns an error message or NULL;
|
||||
*/
|
||||
char_u *
|
||||
parse_printmbfont()
|
||||
parse_printmbfont(void)
|
||||
{
|
||||
return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS);
|
||||
}
|
||||
@ -184,10 +184,10 @@ parse_printmbfont()
|
||||
* Only used for the printer at the moment...
|
||||
*/
|
||||
static char_u *
|
||||
parse_list_options(option_str, table, table_size)
|
||||
char_u *option_str;
|
||||
option_table_T *table;
|
||||
int table_size;
|
||||
parse_list_options(
|
||||
char_u *option_str,
|
||||
option_table_T *table,
|
||||
int table_size)
|
||||
{
|
||||
char_u *stringp;
|
||||
char_u *colonp;
|
||||
@ -250,8 +250,7 @@ parse_list_options(option_str, table, table_size)
|
||||
* up well on white paper, so reduce their brightness.
|
||||
*/
|
||||
static long_u
|
||||
darken_rgb(rgb)
|
||||
long_u rgb;
|
||||
darken_rgb(long_u rgb)
|
||||
{
|
||||
return ((rgb >> 17) << 16)
|
||||
+ (((rgb & 0xff00) >> 9) << 8)
|
||||
@ -259,8 +258,7 @@ darken_rgb(rgb)
|
||||
}
|
||||
|
||||
static long_u
|
||||
prt_get_term_color(colorindex)
|
||||
int colorindex;
|
||||
prt_get_term_color(int colorindex)
|
||||
{
|
||||
/* TODO: Should check for xterm with 88 or 256 colors. */
|
||||
if (t_colors > 8)
|
||||
@ -269,10 +267,10 @@ prt_get_term_color(colorindex)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_get_attr(hl_id, pattr, modec)
|
||||
int hl_id;
|
||||
prt_text_attr_T *pattr;
|
||||
int modec;
|
||||
prt_get_attr(
|
||||
int hl_id,
|
||||
prt_text_attr_T *pattr,
|
||||
int modec)
|
||||
{
|
||||
int colorindex;
|
||||
long_u fg_color;
|
||||
@ -321,8 +319,7 @@ prt_get_attr(hl_id, pattr, modec)
|
||||
#endif /* FEAT_SYN_HL */
|
||||
|
||||
static void
|
||||
prt_set_fg(fg)
|
||||
long_u fg;
|
||||
prt_set_fg(long_u fg)
|
||||
{
|
||||
if (fg != curr_fg)
|
||||
{
|
||||
@ -332,8 +329,7 @@ prt_set_fg(fg)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_set_bg(bg)
|
||||
long_u bg;
|
||||
prt_set_bg(long_u bg)
|
||||
{
|
||||
if (bg != curr_bg)
|
||||
{
|
||||
@ -343,10 +339,7 @@ prt_set_bg(bg)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_set_font(bold, italic, underline)
|
||||
int bold;
|
||||
int italic;
|
||||
int underline;
|
||||
prt_set_font(int bold, int italic, int underline)
|
||||
{
|
||||
if (curr_bold != bold
|
||||
|| curr_italic != italic
|
||||
@ -363,10 +356,10 @@ prt_set_font(bold, italic, underline)
|
||||
* Print the line number in the left margin.
|
||||
*/
|
||||
static void
|
||||
prt_line_number(psettings, page_line, lnum)
|
||||
prt_settings_T *psettings;
|
||||
int page_line;
|
||||
linenr_T lnum;
|
||||
prt_line_number(
|
||||
prt_settings_T *psettings,
|
||||
int page_line,
|
||||
linenr_T lnum)
|
||||
{
|
||||
int i;
|
||||
char_u tbuf[20];
|
||||
@ -400,7 +393,7 @@ prt_line_number(psettings, page_line, lnum)
|
||||
* Get the currently effective header height.
|
||||
*/
|
||||
int
|
||||
prt_header_height()
|
||||
prt_header_height(void)
|
||||
{
|
||||
if (printer_opts[OPT_PRINT_HEADERHEIGHT].present)
|
||||
return printer_opts[OPT_PRINT_HEADERHEIGHT].number;
|
||||
@ -411,7 +404,7 @@ prt_header_height()
|
||||
* Return TRUE if using a line number for printing.
|
||||
*/
|
||||
int
|
||||
prt_use_number()
|
||||
prt_use_number(void)
|
||||
{
|
||||
return (printer_opts[OPT_PRINT_NUMBER].present
|
||||
&& TOLOWER_ASC(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y');
|
||||
@ -422,8 +415,7 @@ prt_use_number()
|
||||
* Returns PRT_UNIT_NONE if not recognized.
|
||||
*/
|
||||
int
|
||||
prt_get_unit(idx)
|
||||
int idx;
|
||||
prt_get_unit(int idx)
|
||||
{
|
||||
int u = PRT_UNIT_NONE;
|
||||
int i;
|
||||
@ -443,10 +435,10 @@ prt_get_unit(idx)
|
||||
* Print the page header.
|
||||
*/
|
||||
static void
|
||||
prt_header(psettings, pagenum, lnum)
|
||||
prt_settings_T *psettings;
|
||||
int pagenum;
|
||||
linenr_T lnum UNUSED;
|
||||
prt_header(
|
||||
prt_settings_T *psettings,
|
||||
int pagenum,
|
||||
linenr_T lnum UNUSED)
|
||||
{
|
||||
int width = psettings->chars_per_line;
|
||||
int page_line;
|
||||
@ -549,8 +541,7 @@ prt_header(psettings, pagenum, lnum)
|
||||
* Display a print status message.
|
||||
*/
|
||||
static void
|
||||
prt_message(s)
|
||||
char_u *s;
|
||||
prt_message(char_u *s)
|
||||
{
|
||||
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
|
||||
screen_puts(s, (int)Rows - 1, 0, hl_attr(HLF_R));
|
||||
@ -558,8 +549,7 @@ prt_message(s)
|
||||
}
|
||||
|
||||
void
|
||||
ex_hardcopy(eap)
|
||||
exarg_T *eap;
|
||||
ex_hardcopy(exarg_T *eap)
|
||||
{
|
||||
linenr_T lnum;
|
||||
int collated_copies, uncollated_copies;
|
||||
@ -825,10 +815,10 @@ print_fail_no_begin:
|
||||
* Return the next column to print, or zero if the line is finished.
|
||||
*/
|
||||
static colnr_T
|
||||
hardcopy_line(psettings, page_line, ppos)
|
||||
prt_settings_T *psettings;
|
||||
int page_line;
|
||||
prt_pos_T *ppos;
|
||||
hardcopy_line(
|
||||
prt_settings_T *psettings,
|
||||
int page_line,
|
||||
prt_pos_T *ppos)
|
||||
{
|
||||
colnr_T col;
|
||||
char_u *line;
|
||||
@ -1458,9 +1448,7 @@ static char_u prt_hexchar[] = "0123456789abcdef";
|
||||
# endif
|
||||
|
||||
static void
|
||||
prt_write_file_raw_len(buffer, bytes)
|
||||
char_u *buffer;
|
||||
int bytes;
|
||||
prt_write_file_raw_len(char_u *buffer, int bytes)
|
||||
{
|
||||
if (!prt_file_error
|
||||
&& fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd)
|
||||
@ -1472,16 +1460,13 @@ prt_write_file_raw_len(buffer, bytes)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_write_file(buffer)
|
||||
char_u *buffer;
|
||||
prt_write_file(char_u *buffer)
|
||||
{
|
||||
prt_write_file_len(buffer, (int)STRLEN(buffer));
|
||||
}
|
||||
|
||||
static void
|
||||
prt_write_file_len(buffer, bytes)
|
||||
char_u *buffer;
|
||||
int bytes;
|
||||
prt_write_file_len(char_u *buffer, int bytes)
|
||||
{
|
||||
#ifdef EBCDIC
|
||||
ebcdic2ascii(buffer, bytes);
|
||||
@ -1493,8 +1478,7 @@ prt_write_file_len(buffer, bytes)
|
||||
* Write a string.
|
||||
*/
|
||||
static void
|
||||
prt_write_string(s)
|
||||
char *s;
|
||||
prt_write_string(char *s)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer), "%s", s);
|
||||
prt_write_file(prt_line_buffer);
|
||||
@ -1504,8 +1488,7 @@ prt_write_string(s)
|
||||
* Write an int and a space.
|
||||
*/
|
||||
static void
|
||||
prt_write_int(i)
|
||||
int i;
|
||||
prt_write_int(int i)
|
||||
{
|
||||
sprintf((char *)prt_line_buffer, "%d ", i);
|
||||
prt_write_file(prt_line_buffer);
|
||||
@ -1515,8 +1498,7 @@ prt_write_int(i)
|
||||
* Write a boolean and a space.
|
||||
*/
|
||||
static void
|
||||
prt_write_boolean(b)
|
||||
int b;
|
||||
prt_write_boolean(int b)
|
||||
{
|
||||
sprintf((char *)prt_line_buffer, "%s ", (b ? "T" : "F"));
|
||||
prt_write_file(prt_line_buffer);
|
||||
@ -1526,11 +1508,11 @@ prt_write_boolean(b)
|
||||
* Write PostScript to re-encode and define the font.
|
||||
*/
|
||||
static void
|
||||
prt_def_font(new_name, encoding, height, font)
|
||||
char *new_name;
|
||||
char *encoding;
|
||||
int height;
|
||||
char *font;
|
||||
prt_def_font(
|
||||
char *new_name,
|
||||
char *encoding,
|
||||
int height,
|
||||
char *font)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/_%s /VIM-%s /%s ref\n", new_name, encoding, font);
|
||||
@ -1551,10 +1533,7 @@ prt_def_font(new_name, encoding, height, font)
|
||||
* Write a line to define the CID font.
|
||||
*/
|
||||
static void
|
||||
prt_def_cidfont(new_name, height, cidfont)
|
||||
char *new_name;
|
||||
int height;
|
||||
char *cidfont;
|
||||
prt_def_cidfont(char *new_name, int height, char *cidfont)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/_%s /%s[/%s] vim_composefont\n", new_name, prt_cmap, cidfont);
|
||||
@ -1568,9 +1547,7 @@ prt_def_cidfont(new_name, height, cidfont)
|
||||
* Write a line to define a duplicate of a CID font
|
||||
*/
|
||||
static void
|
||||
prt_dup_cidfont(original_name, new_name)
|
||||
char *original_name;
|
||||
char *new_name;
|
||||
prt_dup_cidfont(char *original_name, char *new_name)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/%s %s d\n", new_name, original_name);
|
||||
@ -1584,11 +1561,11 @@ prt_dup_cidfont(original_name, new_name)
|
||||
* is also rounded based on the precision + 1'th fractional digit.
|
||||
*/
|
||||
static void
|
||||
prt_real_bits(real, precision, pinteger, pfraction)
|
||||
double real;
|
||||
int precision;
|
||||
int *pinteger;
|
||||
int *pfraction;
|
||||
prt_real_bits(
|
||||
double real,
|
||||
int precision,
|
||||
int *pinteger,
|
||||
int *pfraction)
|
||||
{
|
||||
int i;
|
||||
int integer;
|
||||
@ -1611,9 +1588,7 @@ prt_real_bits(real, precision, pinteger, pfraction)
|
||||
* what decimal point character to use, but PS always requires a '.'.
|
||||
*/
|
||||
static void
|
||||
prt_write_real(val, prec)
|
||||
double val;
|
||||
int prec;
|
||||
prt_write_real(double val, int prec)
|
||||
{
|
||||
int integer;
|
||||
int fraction;
|
||||
@ -1643,10 +1618,7 @@ prt_write_real(val, prec)
|
||||
* Write a line to define a numeric variable.
|
||||
*/
|
||||
static void
|
||||
prt_def_var(name, value, prec)
|
||||
char *name;
|
||||
double value;
|
||||
int prec;
|
||||
prt_def_var(char *name, double value, int prec)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"/%s ", name);
|
||||
@ -1660,7 +1632,7 @@ prt_def_var(name, value, prec)
|
||||
#define PRT_PS_FONT_TO_USER(scale, size) ((size) * ((scale)/1000.0))
|
||||
|
||||
static void
|
||||
prt_flush_buffer()
|
||||
prt_flush_buffer(void)
|
||||
{
|
||||
if (prt_ps_buffer.ga_len > 0)
|
||||
{
|
||||
@ -1742,9 +1714,7 @@ prt_flush_buffer()
|
||||
|
||||
|
||||
static void
|
||||
prt_resource_name(filename, cookie)
|
||||
char_u *filename;
|
||||
void *cookie;
|
||||
prt_resource_name(char_u *filename, void *cookie)
|
||||
{
|
||||
char_u *resource_filename = cookie;
|
||||
|
||||
@ -1755,9 +1725,7 @@ prt_resource_name(filename, cookie)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_find_resource(name, resource)
|
||||
char *name;
|
||||
struct prt_ps_resource_S *resource;
|
||||
prt_find_resource(char *name, struct prt_ps_resource_S *resource)
|
||||
{
|
||||
char_u *buffer;
|
||||
int retval;
|
||||
@ -1798,7 +1766,7 @@ struct prt_resfile_buffer_S
|
||||
static struct prt_resfile_buffer_S prt_resfile;
|
||||
|
||||
static int
|
||||
prt_resfile_next_line()
|
||||
prt_resfile_next_line(void)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -1824,10 +1792,7 @@ prt_resfile_next_line()
|
||||
}
|
||||
|
||||
static int
|
||||
prt_resfile_strncmp(offset, string, len)
|
||||
int offset;
|
||||
char *string;
|
||||
int len;
|
||||
prt_resfile_strncmp(int offset, char *string, int len)
|
||||
{
|
||||
/* Force not equal if string is longer than remainder of line */
|
||||
if (len > (prt_resfile.line_end - (prt_resfile.line_start + offset)))
|
||||
@ -1838,8 +1803,7 @@ prt_resfile_strncmp(offset, string, len)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_resfile_skip_nonws(offset)
|
||||
int offset;
|
||||
prt_resfile_skip_nonws(int offset)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -1854,8 +1818,7 @@ prt_resfile_skip_nonws(offset)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_resfile_skip_ws(offset)
|
||||
int offset;
|
||||
prt_resfile_skip_ws(int offset)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@ -1872,8 +1835,7 @@ prt_resfile_skip_ws(offset)
|
||||
/* prt_next_dsc() - returns detail on next DSC comment line found. Returns true
|
||||
* if a DSC comment is found, else false */
|
||||
static int
|
||||
prt_next_dsc(p_dsc_line)
|
||||
struct prt_dsc_line_S *p_dsc_line;
|
||||
prt_next_dsc(struct prt_dsc_line_S *p_dsc_line)
|
||||
{
|
||||
int comment;
|
||||
int offset;
|
||||
@ -1922,8 +1884,7 @@ prt_next_dsc(p_dsc_line)
|
||||
* PS resource file so the file details can be added to the DSC header comments.
|
||||
*/
|
||||
static int
|
||||
prt_open_resource(resource)
|
||||
struct prt_ps_resource_S *resource;
|
||||
prt_open_resource(struct prt_ps_resource_S *resource)
|
||||
{
|
||||
int offset;
|
||||
int seen_all;
|
||||
@ -2048,9 +2009,7 @@ prt_open_resource(resource)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_check_resource(resource, version)
|
||||
struct prt_ps_resource_S *resource;
|
||||
char_u *version;
|
||||
prt_check_resource(struct prt_ps_resource_S *resource, char_u *version)
|
||||
{
|
||||
/* Version number m.n should match, the revision number does not matter */
|
||||
if (STRNCMP(resource->version, version, STRLEN(version)))
|
||||
@ -2065,14 +2024,13 @@ prt_check_resource(resource, version)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_start()
|
||||
prt_dsc_start(void)
|
||||
{
|
||||
prt_write_string("%!PS-Adobe-3.0\n");
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_noarg(comment)
|
||||
char *comment;
|
||||
prt_dsc_noarg(char *comment)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"%%%%%s\n", comment);
|
||||
@ -2080,9 +2038,7 @@ prt_dsc_noarg(comment)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_textline(comment, text)
|
||||
char *comment;
|
||||
char *text;
|
||||
prt_dsc_textline(char *comment, char *text)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"%%%%%s: %s\n", comment, text);
|
||||
@ -2090,9 +2046,7 @@ prt_dsc_textline(comment, text)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_text(comment, text)
|
||||
char *comment;
|
||||
char *text;
|
||||
prt_dsc_text(char *comment, char *text)
|
||||
{
|
||||
/* TODO - should scan 'text' for any chars needing escaping! */
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
@ -2103,10 +2057,7 @@ prt_dsc_text(comment, text)
|
||||
#define prt_dsc_atend(c) prt_dsc_text((c), "atend")
|
||||
|
||||
static void
|
||||
prt_dsc_ints(comment, count, ints)
|
||||
char *comment;
|
||||
int count;
|
||||
int *ints;
|
||||
prt_dsc_ints(char *comment, int count, int *ints)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2124,10 +2075,10 @@ prt_dsc_ints(comment, count, ints)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_resources(comment, type, string)
|
||||
char *comment; /* if NULL add to previous */
|
||||
char *type;
|
||||
char *string;
|
||||
prt_dsc_resources(
|
||||
char *comment, /* if NULL add to previous */
|
||||
char *type,
|
||||
char *string)
|
||||
{
|
||||
if (comment != NULL)
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
@ -2143,9 +2094,7 @@ prt_dsc_resources(comment, type, string)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_font_resource(resource, ps_font)
|
||||
char *resource;
|
||||
struct prt_ps_font_S *ps_font;
|
||||
prt_dsc_font_resource(char *resource, struct prt_ps_font_S *ps_font)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2157,12 +2106,12 @@ prt_dsc_font_resource(resource, ps_font)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_requirements(duplex, tumble, collate, color, num_copies)
|
||||
int duplex;
|
||||
int tumble;
|
||||
int collate;
|
||||
int color;
|
||||
int num_copies;
|
||||
prt_dsc_requirements(
|
||||
int duplex,
|
||||
int tumble,
|
||||
int collate,
|
||||
int color,
|
||||
int num_copies)
|
||||
{
|
||||
/* Only output the comment if we need to.
|
||||
* Note: tumble is ignored if we are not duplexing
|
||||
@ -2195,13 +2144,13 @@ prt_dsc_requirements(duplex, tumble, collate, color, num_copies)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_dsc_docmedia(paper_name, width, height, weight, colour, type)
|
||||
char *paper_name;
|
||||
double width;
|
||||
double height;
|
||||
double weight;
|
||||
char *colour;
|
||||
char *type;
|
||||
prt_dsc_docmedia(
|
||||
char *paper_name,
|
||||
double width,
|
||||
double height,
|
||||
double weight,
|
||||
char *colour,
|
||||
char *type)
|
||||
{
|
||||
vim_snprintf((char *)prt_line_buffer, sizeof(prt_line_buffer),
|
||||
"%%%%DocumentMedia: %s ", paper_name);
|
||||
@ -2222,7 +2171,7 @@ prt_dsc_docmedia(paper_name, width, height, weight, colour, type)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_cleanup()
|
||||
mch_print_cleanup(void)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (prt_out_mbyte)
|
||||
@ -2261,10 +2210,7 @@ mch_print_cleanup()
|
||||
}
|
||||
|
||||
static float
|
||||
to_device_units(idx, physsize, def_number)
|
||||
int idx;
|
||||
double physsize;
|
||||
int def_number;
|
||||
to_device_units(int idx, double physsize, int def_number)
|
||||
{
|
||||
float ret;
|
||||
int u;
|
||||
@ -2303,13 +2249,13 @@ to_device_units(idx, physsize, def_number)
|
||||
* Calculate margins for given width and height from printoptions settings.
|
||||
*/
|
||||
static void
|
||||
prt_page_margins(width, height, left, right, top, bottom)
|
||||
double width;
|
||||
double height;
|
||||
double *left;
|
||||
double *right;
|
||||
double *top;
|
||||
double *bottom;
|
||||
prt_page_margins(
|
||||
double width,
|
||||
double height,
|
||||
double *left,
|
||||
double *right,
|
||||
double *top,
|
||||
double *bottom)
|
||||
{
|
||||
*left = to_device_units(OPT_PRINT_LEFT, width, 10);
|
||||
*right = width - to_device_units(OPT_PRINT_RIGHT, width, 5);
|
||||
@ -2318,8 +2264,7 @@ prt_page_margins(width, height, left, right, top, bottom)
|
||||
}
|
||||
|
||||
static void
|
||||
prt_font_metrics(font_scale)
|
||||
int font_scale;
|
||||
prt_font_metrics(int font_scale)
|
||||
{
|
||||
prt_line_height = (float)font_scale;
|
||||
prt_char_width = (float)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx);
|
||||
@ -2327,7 +2272,7 @@ prt_font_metrics(font_scale)
|
||||
|
||||
|
||||
static int
|
||||
prt_get_cpl()
|
||||
prt_get_cpl(void)
|
||||
{
|
||||
if (prt_use_number())
|
||||
{
|
||||
@ -2349,10 +2294,7 @@ prt_get_cpl()
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
static int
|
||||
prt_build_cid_fontname(font, name, name_len)
|
||||
int font;
|
||||
char_u *name;
|
||||
int name_len;
|
||||
prt_build_cid_fontname(int font, char_u *name, int name_len)
|
||||
{
|
||||
char *fontname;
|
||||
|
||||
@ -2370,7 +2312,7 @@ prt_build_cid_fontname(font, name, name_len)
|
||||
* Get number of lines of text that fit on a page (excluding the header).
|
||||
*/
|
||||
static int
|
||||
prt_get_lpp()
|
||||
prt_get_lpp(void)
|
||||
{
|
||||
int lpp;
|
||||
|
||||
@ -2402,10 +2344,10 @@ prt_get_lpp()
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
static int
|
||||
prt_match_encoding(p_encoding, p_cmap, pp_mbenc)
|
||||
char *p_encoding;
|
||||
struct prt_ps_mbfont_S *p_cmap;
|
||||
struct prt_ps_encoding_S **pp_mbenc;
|
||||
prt_match_encoding(
|
||||
char *p_encoding,
|
||||
struct prt_ps_mbfont_S *p_cmap,
|
||||
struct prt_ps_encoding_S **pp_mbenc)
|
||||
{
|
||||
int mbenc;
|
||||
int enc_len;
|
||||
@ -2428,10 +2370,10 @@ prt_match_encoding(p_encoding, p_cmap, pp_mbenc)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_match_charset(p_charset, p_cmap, pp_mbchar)
|
||||
char *p_charset;
|
||||
struct prt_ps_mbfont_S *p_cmap;
|
||||
struct prt_ps_charset_S **pp_mbchar;
|
||||
prt_match_charset(
|
||||
char *p_charset,
|
||||
struct prt_ps_mbfont_S *p_cmap,
|
||||
struct prt_ps_charset_S **pp_mbchar)
|
||||
{
|
||||
int mbchar;
|
||||
int char_len;
|
||||
@ -2456,10 +2398,10 @@ prt_match_charset(p_charset, p_cmap, pp_mbchar)
|
||||
#endif
|
||||
|
||||
int
|
||||
mch_print_init(psettings, jobname, forceit)
|
||||
prt_settings_T *psettings;
|
||||
char_u *jobname;
|
||||
int forceit UNUSED;
|
||||
mch_print_init(
|
||||
prt_settings_T *psettings,
|
||||
char_u *jobname,
|
||||
int forceit UNUSED)
|
||||
{
|
||||
int i;
|
||||
char *paper_name;
|
||||
@ -2805,8 +2747,7 @@ mch_print_init(psettings, jobname, forceit)
|
||||
}
|
||||
|
||||
static int
|
||||
prt_add_resource(resource)
|
||||
struct prt_ps_resource_S *resource;
|
||||
prt_add_resource(struct prt_ps_resource_S *resource)
|
||||
{
|
||||
FILE* fd_resource;
|
||||
char_u resource_buffer[512];
|
||||
@ -2853,8 +2794,7 @@ prt_add_resource(resource)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_begin(psettings)
|
||||
prt_settings_T *psettings;
|
||||
mch_print_begin(prt_settings_T *psettings)
|
||||
{
|
||||
time_t now;
|
||||
int bbox[4];
|
||||
@ -3295,8 +3235,7 @@ theend:
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_end(psettings)
|
||||
prt_settings_T *psettings;
|
||||
mch_print_end(prt_settings_T *psettings)
|
||||
{
|
||||
prt_dsc_noarg("Trailer");
|
||||
|
||||
@ -3333,7 +3272,7 @@ mch_print_end(psettings)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_end_page()
|
||||
mch_print_end_page(void)
|
||||
{
|
||||
prt_flush_buffer();
|
||||
|
||||
@ -3345,8 +3284,7 @@ mch_print_end_page()
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_begin_page(str)
|
||||
char_u *str UNUSED;
|
||||
mch_print_begin_page(char_u *str UNUSED)
|
||||
{
|
||||
int page_num[2];
|
||||
|
||||
@ -3387,7 +3325,7 @@ mch_print_begin_page(str)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_blank_page()
|
||||
mch_print_blank_page(void)
|
||||
{
|
||||
return (mch_print_begin_page(NULL) ? (mch_print_end_page()) : FALSE);
|
||||
}
|
||||
@ -3396,9 +3334,7 @@ static float prt_pos_x = 0;
|
||||
static float prt_pos_y = 0;
|
||||
|
||||
void
|
||||
mch_print_start_line(margin, page_line)
|
||||
int margin;
|
||||
int page_line;
|
||||
mch_print_start_line(int margin, int page_line)
|
||||
{
|
||||
prt_pos_x = prt_left_margin;
|
||||
if (margin)
|
||||
@ -3415,9 +3351,7 @@ mch_print_start_line(margin, page_line)
|
||||
}
|
||||
|
||||
int
|
||||
mch_print_text_out(p, len)
|
||||
char_u *p;
|
||||
int len UNUSED;
|
||||
mch_print_text_out(char_u *p, int len UNUSED)
|
||||
{
|
||||
int need_break;
|
||||
char_u ch;
|
||||
@ -3638,10 +3572,7 @@ mch_print_text_out(p, len)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_set_font(iBold, iItalic, iUnderline)
|
||||
int iBold;
|
||||
int iItalic;
|
||||
int iUnderline;
|
||||
mch_print_set_font(int iBold, int iItalic, int iUnderline)
|
||||
{
|
||||
int font = 0;
|
||||
|
||||
@ -3665,8 +3596,7 @@ mch_print_set_font(iBold, iItalic, iUnderline)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_set_bg(bgcol)
|
||||
long_u bgcol;
|
||||
mch_print_set_bg(long_u bgcol)
|
||||
{
|
||||
prt_bgcol = (int)bgcol;
|
||||
prt_attribute_change = TRUE;
|
||||
@ -3674,8 +3604,7 @@ mch_print_set_bg(bgcol)
|
||||
}
|
||||
|
||||
void
|
||||
mch_print_set_fg(fgcol)
|
||||
long_u fgcol;
|
||||
mch_print_set_fg(long_u fgcol)
|
||||
{
|
||||
if (fgcol != (long_u)prt_fgcol)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ static int hash_may_resize(hashtab_T *ht, int minitems);
|
||||
* Returns NULL when out of memory.
|
||||
*/
|
||||
hashtab_T *
|
||||
hash_create()
|
||||
hash_create(void)
|
||||
{
|
||||
hashtab_T *ht;
|
||||
|
||||
@ -64,8 +64,7 @@ hash_create()
|
||||
* Initialize an empty hash table.
|
||||
*/
|
||||
void
|
||||
hash_init(ht)
|
||||
hashtab_T *ht;
|
||||
hash_init(hashtab_T *ht)
|
||||
{
|
||||
/* This zeroes all "ht_" entries and all the "hi_key" in "ht_smallarray". */
|
||||
vim_memset(ht, 0, sizeof(hashtab_T));
|
||||
@ -78,8 +77,7 @@ hash_init(ht)
|
||||
* If "ht" is not freed then you should call hash_init() next!
|
||||
*/
|
||||
void
|
||||
hash_clear(ht)
|
||||
hashtab_T *ht;
|
||||
hash_clear(hashtab_T *ht)
|
||||
{
|
||||
if (ht->ht_array != ht->ht_smallarray)
|
||||
vim_free(ht->ht_array);
|
||||
@ -91,9 +89,7 @@ hash_clear(ht)
|
||||
* memory to the location of the key (it's always positive).
|
||||
*/
|
||||
void
|
||||
hash_clear_all(ht, off)
|
||||
hashtab_T *ht;
|
||||
int off;
|
||||
hash_clear_all(hashtab_T *ht, int off)
|
||||
{
|
||||
long todo;
|
||||
hashitem_T *hi;
|
||||
@ -119,9 +115,7 @@ hash_clear_all(ht, off)
|
||||
* (adding, setting or removing an item)!
|
||||
*/
|
||||
hashitem_T *
|
||||
hash_find(ht, key)
|
||||
hashtab_T *ht;
|
||||
char_u *key;
|
||||
hash_find(hashtab_T *ht, char_u *key)
|
||||
{
|
||||
return hash_lookup(ht, key, hash_hash(key));
|
||||
}
|
||||
@ -130,10 +124,7 @@ hash_find(ht, key)
|
||||
* Like hash_find(), but caller computes "hash".
|
||||
*/
|
||||
hashitem_T *
|
||||
hash_lookup(ht, key, hash)
|
||||
hashtab_T *ht;
|
||||
char_u *key;
|
||||
hash_T hash;
|
||||
hash_lookup(hashtab_T *ht, char_u *key, hash_T hash)
|
||||
{
|
||||
hash_T perturb;
|
||||
hashitem_T *freeitem;
|
||||
@ -195,7 +186,7 @@ hash_lookup(ht, key, hash)
|
||||
* Called when exiting.
|
||||
*/
|
||||
void
|
||||
hash_debug_results()
|
||||
hash_debug_results(void)
|
||||
{
|
||||
#ifdef HT_DEBUG
|
||||
fprintf(stderr, "\r\n\r\n\r\n\r\n");
|
||||
@ -211,9 +202,7 @@ hash_debug_results()
|
||||
* Returns FAIL when out of memory or the key is already present.
|
||||
*/
|
||||
int
|
||||
hash_add(ht, key)
|
||||
hashtab_T *ht;
|
||||
char_u *key;
|
||||
hash_add(hashtab_T *ht, char_u *key)
|
||||
{
|
||||
hash_T hash = hash_hash(key);
|
||||
hashitem_T *hi;
|
||||
@ -234,11 +223,11 @@ hash_add(ht, key)
|
||||
* Returns OK or FAIL (out of memory).
|
||||
*/
|
||||
int
|
||||
hash_add_item(ht, hi, key, hash)
|
||||
hashtab_T *ht;
|
||||
hashitem_T *hi;
|
||||
char_u *key;
|
||||
hash_T hash;
|
||||
hash_add_item(
|
||||
hashtab_T *ht,
|
||||
hashitem_T *hi,
|
||||
char_u *key,
|
||||
hash_T hash)
|
||||
{
|
||||
/* If resizing failed before and it fails again we can't add an item. */
|
||||
if (ht->ht_error && hash_may_resize(ht, 0) == FAIL)
|
||||
@ -265,9 +254,7 @@ hash_add_item(ht, hi, key, hash)
|
||||
* "hi" is invalid after this!
|
||||
*/
|
||||
void
|
||||
hash_set(hi, key)
|
||||
hashitem_T *hi;
|
||||
char_u *key;
|
||||
hash_set(hashitem_T *hi, char_u *key)
|
||||
{
|
||||
hi->hi_key = key;
|
||||
}
|
||||
@ -279,9 +266,7 @@ hash_set(hi, key)
|
||||
* The caller must take care of freeing the item itself.
|
||||
*/
|
||||
void
|
||||
hash_remove(ht, hi)
|
||||
hashtab_T *ht;
|
||||
hashitem_T *hi;
|
||||
hash_remove(hashtab_T *ht, hashitem_T *hi)
|
||||
{
|
||||
--ht->ht_used;
|
||||
hi->hi_key = HI_KEY_REMOVED;
|
||||
@ -294,8 +279,7 @@ hash_remove(ht, hi)
|
||||
* Must call hash_unlock() later.
|
||||
*/
|
||||
void
|
||||
hash_lock(ht)
|
||||
hashtab_T *ht;
|
||||
hash_lock(hashtab_T *ht)
|
||||
{
|
||||
++ht->ht_locked;
|
||||
}
|
||||
@ -307,9 +291,7 @@ hash_lock(ht)
|
||||
* Must call hash_unlock() later.
|
||||
*/
|
||||
void
|
||||
hash_lock_size(ht, size)
|
||||
hashtab_T *ht;
|
||||
int size;
|
||||
hash_lock_size(hashtab_T *ht, int size)
|
||||
{
|
||||
(void)hash_may_resize(ht, size);
|
||||
++ht->ht_locked;
|
||||
@ -322,8 +304,7 @@ hash_lock_size(ht, size)
|
||||
* This must balance a call to hash_lock().
|
||||
*/
|
||||
void
|
||||
hash_unlock(ht)
|
||||
hashtab_T *ht;
|
||||
hash_unlock(hashtab_T *ht)
|
||||
{
|
||||
--ht->ht_locked;
|
||||
(void)hash_may_resize(ht, 0);
|
||||
@ -335,9 +316,9 @@ hash_unlock(ht)
|
||||
* Returns OK or FAIL (out of memory).
|
||||
*/
|
||||
static int
|
||||
hash_may_resize(ht, minitems)
|
||||
hashtab_T *ht;
|
||||
int minitems; /* minimal number of items */
|
||||
hash_may_resize(
|
||||
hashtab_T *ht,
|
||||
int minitems) /* minimal number of items */
|
||||
{
|
||||
hashitem_T temparray[HT_INIT_SIZE];
|
||||
hashitem_T *oldarray, *newarray;
|
||||
@ -481,8 +462,7 @@ hash_may_resize(ht, minitems)
|
||||
* lower the percentage the better.
|
||||
*/
|
||||
hash_T
|
||||
hash_hash(key)
|
||||
char_u *key;
|
||||
hash_hash(char_u *key)
|
||||
{
|
||||
hash_T hash;
|
||||
char_u *p;
|
||||
|
203
src/if_cscope.c
203
src/if_cscope.c
@ -83,8 +83,7 @@ static cscmd_T cs_cmds[] =
|
||||
};
|
||||
|
||||
static void
|
||||
cs_usage_msg(x)
|
||||
csid_e x;
|
||||
cs_usage_msg(csid_e x)
|
||||
{
|
||||
(void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
|
||||
}
|
||||
@ -104,9 +103,7 @@ static enum
|
||||
* expansion.
|
||||
*/
|
||||
char_u *
|
||||
get_cscope_name(xp, idx)
|
||||
expand_T *xp UNUSED;
|
||||
int idx;
|
||||
get_cscope_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
int current_idx;
|
||||
int i;
|
||||
@ -167,10 +164,10 @@ get_cscope_name(xp, idx)
|
||||
* Handle command line completion for :cscope command.
|
||||
*/
|
||||
void
|
||||
set_context_in_cscope_cmd(xp, arg, cmdidx)
|
||||
expand_T *xp;
|
||||
char_u *arg;
|
||||
cmdidx_T cmdidx;
|
||||
set_context_in_cscope_cmd(
|
||||
expand_T *xp,
|
||||
char_u *arg,
|
||||
cmdidx_T cmdidx)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@ -210,9 +207,9 @@ set_context_in_cscope_cmd(xp, arg, cmdidx)
|
||||
* command function.
|
||||
*/
|
||||
static void
|
||||
do_cscope_general(eap, make_split)
|
||||
exarg_T *eap;
|
||||
int make_split; /* whether to split window */
|
||||
do_cscope_general(
|
||||
exarg_T *eap,
|
||||
int make_split) /* whether to split window */
|
||||
{
|
||||
cscmd_T *cmdp;
|
||||
|
||||
@ -248,8 +245,7 @@ do_cscope_general(eap, make_split)
|
||||
* PUBLIC: do_cscope
|
||||
*/
|
||||
void
|
||||
do_cscope(eap)
|
||||
exarg_T *eap;
|
||||
do_cscope(exarg_T *eap)
|
||||
{
|
||||
do_cscope_general(eap, FALSE);
|
||||
}
|
||||
@ -260,8 +256,7 @@ do_cscope(eap)
|
||||
* same as do_cscope, but splits window, too.
|
||||
*/
|
||||
void
|
||||
do_scscope(eap)
|
||||
exarg_T *eap;
|
||||
do_scscope(exarg_T *eap)
|
||||
{
|
||||
do_cscope_general(eap, TRUE);
|
||||
}
|
||||
@ -271,8 +266,7 @@ do_scscope(eap)
|
||||
*
|
||||
*/
|
||||
void
|
||||
do_cstag(eap)
|
||||
exarg_T *eap;
|
||||
do_cstag(exarg_T *eap)
|
||||
{
|
||||
int ret = FALSE;
|
||||
|
||||
@ -354,9 +348,7 @@ do_cstag(eap)
|
||||
* returns TRUE if eof, FALSE otherwise
|
||||
*/
|
||||
int
|
||||
cs_fgets(buf, size)
|
||||
char_u *buf;
|
||||
int size;
|
||||
cs_fgets(char_u *buf, int size)
|
||||
{
|
||||
char *p;
|
||||
|
||||
@ -374,7 +366,7 @@ cs_fgets(buf, size)
|
||||
* called only from do_tag(), when popping the tag stack
|
||||
*/
|
||||
void
|
||||
cs_free_tags()
|
||||
cs_free_tags(void)
|
||||
{
|
||||
cs_manage_matches(NULL, NULL, -1, Free);
|
||||
}
|
||||
@ -386,7 +378,7 @@ cs_free_tags()
|
||||
* called from do_tag()
|
||||
*/
|
||||
void
|
||||
cs_print_tags()
|
||||
cs_print_tags(void)
|
||||
{
|
||||
cs_manage_matches(NULL, NULL, -1, Print);
|
||||
}
|
||||
@ -421,10 +413,7 @@ cs_print_tags()
|
||||
*/
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
int
|
||||
cs_connection(num, dbpath, ppath)
|
||||
int num;
|
||||
char_u *dbpath;
|
||||
char_u *ppath;
|
||||
cs_connection(int num, char_u *dbpath, char_u *ppath)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -486,8 +475,7 @@ cs_connection(num, dbpath, ppath)
|
||||
* MAXPATHL 256
|
||||
*/
|
||||
static int
|
||||
cs_add(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_add(exarg_T *eap UNUSED)
|
||||
{
|
||||
char *fname, *ppath, *flags = NULL;
|
||||
|
||||
@ -503,8 +491,7 @@ cs_add(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
cs_stat_emsg(fname)
|
||||
char *fname;
|
||||
cs_stat_emsg(char *fname)
|
||||
{
|
||||
char *stat_emsg = _("E563: stat(%s) error: %d");
|
||||
char *buf = (char *)alloc((unsigned)strlen(stat_emsg) + MAXPATHL + 10);
|
||||
@ -528,10 +515,10 @@ cs_stat_emsg(fname)
|
||||
* routine uses a number of goto statements.
|
||||
*/
|
||||
static int
|
||||
cs_add_common(arg1, arg2, flags)
|
||||
char *arg1; /* filename - may contain environment variables */
|
||||
char *arg2; /* prepend path - may contain environment variables */
|
||||
char *flags;
|
||||
cs_add_common(
|
||||
char *arg1, /* filename - may contain environment variables */
|
||||
char *arg2, /* prepend path - may contain environment variables */
|
||||
char *flags)
|
||||
{
|
||||
struct stat statbuf;
|
||||
int ret;
|
||||
@ -665,14 +652,14 @@ add_err:
|
||||
|
||||
|
||||
static int
|
||||
cs_check_for_connections()
|
||||
cs_check_for_connections(void)
|
||||
{
|
||||
return (cs_cnt_connections() > 0);
|
||||
} /* cs_check_for_connections */
|
||||
|
||||
|
||||
static int
|
||||
cs_check_for_tags()
|
||||
cs_check_for_tags(void)
|
||||
{
|
||||
return (p_tags[0] != NUL && curbuf->b_p_tags != NULL);
|
||||
} /* cs_check_for_tags */
|
||||
@ -684,7 +671,7 @@ cs_check_for_tags()
|
||||
* count the number of cscope connections
|
||||
*/
|
||||
static int
|
||||
cs_cnt_connections()
|
||||
cs_cnt_connections(void)
|
||||
{
|
||||
short i;
|
||||
short cnt = 0;
|
||||
@ -698,8 +685,8 @@ cs_cnt_connections()
|
||||
} /* cs_cnt_connections */
|
||||
|
||||
static void
|
||||
cs_reading_emsg(idx)
|
||||
int idx; /* connection index */
|
||||
cs_reading_emsg(
|
||||
int idx) /* connection index */
|
||||
{
|
||||
EMSGN(_("E262: error reading cscope connection %ld"), idx);
|
||||
}
|
||||
@ -711,8 +698,7 @@ cs_reading_emsg(idx)
|
||||
* count the number of matches for a given cscope connection.
|
||||
*/
|
||||
static int
|
||||
cs_cnt_matches(idx)
|
||||
int idx;
|
||||
cs_cnt_matches(int idx)
|
||||
{
|
||||
char *stok;
|
||||
char *buf;
|
||||
@ -773,9 +759,7 @@ cs_cnt_matches(idx)
|
||||
* Creates the actual cscope command query from what the user entered.
|
||||
*/
|
||||
static char *
|
||||
cs_create_cmd(csoption, pattern)
|
||||
char *csoption;
|
||||
char *pattern;
|
||||
cs_create_cmd(char *csoption, char *pattern)
|
||||
{
|
||||
char *cmd;
|
||||
short search;
|
||||
@ -836,8 +820,7 @@ cs_create_cmd(csoption, pattern)
|
||||
* the BSD license notice?
|
||||
*/
|
||||
static int
|
||||
cs_create_connection(i)
|
||||
int i;
|
||||
cs_create_connection(int i)
|
||||
{
|
||||
#ifdef UNIX
|
||||
int to_cs[2], from_cs[2];
|
||||
@ -1082,8 +1065,7 @@ err_closing:
|
||||
* returns TRUE if we jump to a tag or abort, FALSE if not.
|
||||
*/
|
||||
static int
|
||||
cs_find(eap)
|
||||
exarg_T *eap;
|
||||
cs_find(exarg_T *eap)
|
||||
{
|
||||
char *opt, *pat;
|
||||
int i;
|
||||
@ -1126,13 +1108,13 @@ cs_find(eap)
|
||||
* common code for cscope find, shared by cs_find() and do_cstag()
|
||||
*/
|
||||
static int
|
||||
cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
|
||||
char *opt;
|
||||
char *pat;
|
||||
int forceit;
|
||||
int verbose;
|
||||
int use_ll UNUSED;
|
||||
char_u *cmdline UNUSED;
|
||||
cs_find_common(
|
||||
char *opt,
|
||||
char *pat,
|
||||
int forceit,
|
||||
int verbose,
|
||||
int use_ll UNUSED,
|
||||
char_u *cmdline UNUSED)
|
||||
{
|
||||
int i;
|
||||
char *cmd;
|
||||
@ -1344,8 +1326,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
|
||||
* print help
|
||||
*/
|
||||
static int
|
||||
cs_help(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_help(exarg_T *eap UNUSED)
|
||||
{
|
||||
cscmd_T *cmdp = cs_cmds;
|
||||
|
||||
@ -1382,8 +1363,7 @@ cs_help(eap)
|
||||
|
||||
|
||||
static void
|
||||
clear_csinfo(i)
|
||||
int i;
|
||||
clear_csinfo(int i)
|
||||
{
|
||||
csinfo[i].fname = NULL;
|
||||
csinfo[i].ppath = NULL;
|
||||
@ -1408,7 +1388,7 @@ clear_csinfo(i)
|
||||
static char *GetWin32Error(void);
|
||||
|
||||
static char *
|
||||
GetWin32Error()
|
||||
GetWin32Error(void)
|
||||
{
|
||||
char *msg = NULL;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
@ -1430,11 +1410,11 @@ GetWin32Error()
|
||||
* insert a new cscope database filename into the filelist
|
||||
*/
|
||||
static int
|
||||
cs_insert_filelist(fname, ppath, flags, sb)
|
||||
char *fname;
|
||||
char *ppath;
|
||||
char *flags;
|
||||
struct stat *sb UNUSED;
|
||||
cs_insert_filelist(
|
||||
char *fname,
|
||||
char *ppath,
|
||||
char *flags,
|
||||
struct stat *sb UNUSED)
|
||||
{
|
||||
short i, j;
|
||||
#ifndef UNIX
|
||||
@ -1577,8 +1557,7 @@ cs_insert_filelist(fname, ppath, flags, sb)
|
||||
* find cscope command in command table
|
||||
*/
|
||||
static cscmd_T *
|
||||
cs_lookup_cmd(eap)
|
||||
exarg_T *eap;
|
||||
cs_lookup_cmd(exarg_T *eap)
|
||||
{
|
||||
cscmd_T *cmdp;
|
||||
char *stok;
|
||||
@ -1609,8 +1588,7 @@ cs_lookup_cmd(eap)
|
||||
* nuke em
|
||||
*/
|
||||
static int
|
||||
cs_kill(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_kill(exarg_T *eap UNUSED)
|
||||
{
|
||||
char *stok;
|
||||
short i;
|
||||
@ -1667,9 +1645,9 @@ cs_kill(eap)
|
||||
* Actually kills a specific cscope connection.
|
||||
*/
|
||||
static void
|
||||
cs_kill_execute(i, cname)
|
||||
int i; /* cscope table index */
|
||||
char *cname; /* cscope database name */
|
||||
cs_kill_execute(
|
||||
int i, /* cscope table index */
|
||||
char *cname) /* cscope database name */
|
||||
{
|
||||
if (p_csverbose)
|
||||
{
|
||||
@ -1702,11 +1680,11 @@ cs_kill_execute(i, cname)
|
||||
* characters to comply with ctags formatting.
|
||||
*/
|
||||
static char *
|
||||
cs_make_vim_style_matches(fname, slno, search, tagstr)
|
||||
char *fname;
|
||||
char *slno;
|
||||
char *search;
|
||||
char *tagstr;
|
||||
cs_make_vim_style_matches(
|
||||
char *fname,
|
||||
char *slno,
|
||||
char *search,
|
||||
char *tagstr)
|
||||
{
|
||||
/* vim style is ctags:
|
||||
*
|
||||
@ -1762,11 +1740,11 @@ cs_make_vim_style_matches(fname, slno, search, tagstr)
|
||||
* Print: prints the tags
|
||||
*/
|
||||
static char *
|
||||
cs_manage_matches(matches, contexts, totmatches, cmd)
|
||||
char **matches;
|
||||
char **contexts;
|
||||
int totmatches;
|
||||
mcmd_e cmd;
|
||||
cs_manage_matches(
|
||||
char **matches,
|
||||
char **contexts,
|
||||
int totmatches,
|
||||
mcmd_e cmd)
|
||||
{
|
||||
static char **mp = NULL;
|
||||
static char **cp = NULL;
|
||||
@ -1829,13 +1807,13 @@ cs_manage_matches(matches, contexts, totmatches, cmd)
|
||||
* parse cscope output
|
||||
*/
|
||||
static char *
|
||||
cs_parse_results(cnumber, buf, bufsize, context, linenumber, search)
|
||||
int cnumber;
|
||||
char *buf;
|
||||
int bufsize;
|
||||
char **context;
|
||||
char **linenumber;
|
||||
char **search;
|
||||
cs_parse_results(
|
||||
int cnumber,
|
||||
char *buf,
|
||||
int bufsize,
|
||||
char **context,
|
||||
char **linenumber,
|
||||
char **search)
|
||||
{
|
||||
int ch;
|
||||
char *p;
|
||||
@ -1892,9 +1870,7 @@ cs_parse_results(cnumber, buf, bufsize, context, linenumber, search)
|
||||
* write cscope find results to file
|
||||
*/
|
||||
static void
|
||||
cs_file_results(f, nummatches_a)
|
||||
FILE *f;
|
||||
int *nummatches_a;
|
||||
cs_file_results(FILE *f, int *nummatches_a)
|
||||
{
|
||||
int i, j;
|
||||
char *buf;
|
||||
@ -1951,13 +1927,13 @@ cs_file_results(f, nummatches_a)
|
||||
* When there are no matches sets "*matches_p" to NULL.
|
||||
*/
|
||||
static void
|
||||
cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched)
|
||||
char *tagstr;
|
||||
int totmatches;
|
||||
int *nummatches_a;
|
||||
char ***matches_p;
|
||||
char ***cntxts_p;
|
||||
int *matched;
|
||||
cs_fill_results(
|
||||
char *tagstr,
|
||||
int totmatches,
|
||||
int *nummatches_a,
|
||||
char ***matches_p,
|
||||
char ***cntxts_p,
|
||||
int *matched)
|
||||
{
|
||||
int i, j;
|
||||
char *buf;
|
||||
@ -2031,8 +2007,7 @@ parse_out:
|
||||
|
||||
/* get the requested path components */
|
||||
static char *
|
||||
cs_pathcomponents(path)
|
||||
char *path;
|
||||
cs_pathcomponents(char *path)
|
||||
{
|
||||
int i;
|
||||
char *s;
|
||||
@ -2063,10 +2038,7 @@ cs_pathcomponents(path)
|
||||
* called from cs_manage_matches()
|
||||
*/
|
||||
static void
|
||||
cs_print_tags_priv(matches, cntxts, num_matches)
|
||||
char **matches;
|
||||
char **cntxts;
|
||||
int num_matches;
|
||||
cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
|
||||
{
|
||||
char *buf = NULL;
|
||||
char *t_buf;
|
||||
@ -2212,8 +2184,7 @@ cs_print_tags_priv(matches, cntxts, num_matches)
|
||||
* read a cscope prompt (basically, skip over the ">> ")
|
||||
*/
|
||||
static int
|
||||
cs_read_prompt(i)
|
||||
int i;
|
||||
cs_read_prompt(int i)
|
||||
{
|
||||
int ch;
|
||||
char *buf = NULL; /* buffer for possible error message from cscope */
|
||||
@ -2312,9 +2283,7 @@ sig_handler SIGDEFARG(sigarg)
|
||||
* or not to free the filename. Called by cs_kill and cs_reset.
|
||||
*/
|
||||
static void
|
||||
cs_release_csp(i, freefnpp)
|
||||
int i;
|
||||
int freefnpp;
|
||||
cs_release_csp(int i, int freefnpp)
|
||||
{
|
||||
/*
|
||||
* Trying to exit normally (not sure whether it is fit to UNIX cscope
|
||||
@ -2441,8 +2410,7 @@ cs_release_csp(i, freefnpp)
|
||||
* calls cs_kill on all cscope connections then reinits
|
||||
*/
|
||||
static int
|
||||
cs_reset(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_reset(exarg_T *eap UNUSED)
|
||||
{
|
||||
char **dblist = NULL, **pplist = NULL, **fllist = NULL;
|
||||
int i;
|
||||
@ -2514,9 +2482,7 @@ cs_reset(eap)
|
||||
* Contrast this with my development system (Digital Unix), which does.
|
||||
*/
|
||||
static char *
|
||||
cs_resolve_file(i, name)
|
||||
int i;
|
||||
char *name;
|
||||
cs_resolve_file(int i, char *name)
|
||||
{
|
||||
char *fullname;
|
||||
int len;
|
||||
@ -2580,8 +2546,7 @@ cs_resolve_file(i, name)
|
||||
* show all cscope connections
|
||||
*/
|
||||
static int
|
||||
cs_show(eap)
|
||||
exarg_T *eap UNUSED;
|
||||
cs_show(exarg_T *eap UNUSED)
|
||||
{
|
||||
short i;
|
||||
if (cs_cnt_connections() == 0)
|
||||
@ -2616,7 +2581,7 @@ cs_show(eap)
|
||||
* Only called when VIM exits to quit any cscope sessions.
|
||||
*/
|
||||
void
|
||||
cs_end()
|
||||
cs_end(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -3749,7 +3749,7 @@ get_vim_curr_window(void)
|
||||
}
|
||||
|
||||
static void
|
||||
make_modules()
|
||||
make_modules(void)
|
||||
{
|
||||
int i;
|
||||
Scheme_Env *mod = NULL;
|
||||
|
@ -25,11 +25,11 @@
|
||||
#define NIL(type) ((type)0)
|
||||
|
||||
static int
|
||||
sfvimwrite(f, buf, n, disc)
|
||||
Sfio_t *f; /* stream involved */
|
||||
char *buf; /* buffer to read from */
|
||||
int n; /* number of bytes to write */
|
||||
Sfdisc_t *disc; /* discipline */
|
||||
sfvimwrite(
|
||||
Sfio_t *f, /* stream involved */
|
||||
char *buf, /* buffer to read from */
|
||||
int n, /* number of bytes to write */
|
||||
Sfdisc_t *disc) /* discipline */
|
||||
{
|
||||
char_u *str;
|
||||
|
||||
@ -47,7 +47,7 @@ sfvimwrite(f, buf, n, disc)
|
||||
* Create Vim discipline
|
||||
*/
|
||||
Sfdisc_t *
|
||||
sfdcnewvim()
|
||||
sfdcnewvim(void)
|
||||
{
|
||||
Sfdisc_t *disc;
|
||||
|
||||
|
@ -861,7 +861,7 @@ Python_RestoreThread(void)
|
||||
#endif
|
||||
|
||||
void
|
||||
python_end()
|
||||
python_end(void)
|
||||
{
|
||||
static int recurse = 0;
|
||||
|
||||
@ -899,7 +899,7 @@ python_end()
|
||||
|
||||
#if (defined(DYNAMIC_PYTHON) && defined(FEAT_PYTHON3)) || defined(PROTO)
|
||||
int
|
||||
python_loaded()
|
||||
python_loaded(void)
|
||||
{
|
||||
return (hinstPython != 0);
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ python3_enabled(int verbose)
|
||||
static void get_py3_exceptions(void);
|
||||
|
||||
static void
|
||||
get_py3_exceptions()
|
||||
get_py3_exceptions(void)
|
||||
{
|
||||
PyObject *exmod = PyImport_ImportModule("builtins");
|
||||
PyObject *exdict = PyModule_GetDict(exmod);
|
||||
@ -800,7 +800,7 @@ static PyObject *Py3Init_vim(void);
|
||||
*/
|
||||
|
||||
void
|
||||
python3_end()
|
||||
python3_end(void)
|
||||
{
|
||||
static int recurse = 0;
|
||||
|
||||
@ -830,7 +830,7 @@ python3_end()
|
||||
|
||||
#if (defined(DYNAMIC_PYTHON3) && defined(DYNAMIC_PYTHON) && defined(FEAT_PYTHON) && defined(UNIX)) || defined(PROTO)
|
||||
int
|
||||
python3_loaded()
|
||||
python3_loaded(void)
|
||||
{
|
||||
return (hinstPy3 != 0);
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ static struct
|
||||
* Free ruby.dll
|
||||
*/
|
||||
static void
|
||||
end_dynamic_ruby()
|
||||
end_dynamic_ruby(void)
|
||||
{
|
||||
if (hinstRuby)
|
||||
{
|
||||
@ -674,15 +674,14 @@ ruby_runtime_link_init(char *libname, int verbose)
|
||||
* else FALSE.
|
||||
*/
|
||||
int
|
||||
ruby_enabled(verbose)
|
||||
int verbose;
|
||||
ruby_enabled(int verbose)
|
||||
{
|
||||
return ruby_runtime_link_init((char *)p_rubydll, verbose) == OK;
|
||||
}
|
||||
#endif /* defined(DYNAMIC_RUBY) || defined(PROTO) */
|
||||
|
||||
void
|
||||
ruby_end()
|
||||
ruby_end(void)
|
||||
{
|
||||
#ifdef DYNAMIC_RUBY
|
||||
end_dynamic_ruby();
|
||||
@ -1115,12 +1114,12 @@ static buf_T *get_buf(VALUE obj)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static VALUE buffer_s_current()
|
||||
static VALUE buffer_s_current(void)
|
||||
{
|
||||
return buffer_new(curbuf);
|
||||
}
|
||||
|
||||
static VALUE buffer_s_count()
|
||||
static VALUE buffer_s_count(void)
|
||||
{
|
||||
buf_T *b;
|
||||
int n = 0;
|
||||
@ -1357,7 +1356,7 @@ static win_T *get_win(VALUE obj)
|
||||
return win;
|
||||
}
|
||||
|
||||
static VALUE window_s_current()
|
||||
static VALUE window_s_current(void)
|
||||
{
|
||||
return window_new(curwin);
|
||||
}
|
||||
@ -1366,7 +1365,7 @@ static VALUE window_s_current()
|
||||
* Added line manipulation functions
|
||||
* SegPhault - 03/07/05
|
||||
*/
|
||||
static VALUE line_s_current()
|
||||
static VALUE line_s_current(void)
|
||||
{
|
||||
return get_buffer_line(curbuf, curwin->w_cursor.lnum);
|
||||
}
|
||||
@ -1376,14 +1375,14 @@ static VALUE set_current_line(VALUE self UNUSED, VALUE str)
|
||||
return set_buffer_line(curbuf, curwin->w_cursor.lnum, str);
|
||||
}
|
||||
|
||||
static VALUE current_line_number()
|
||||
static VALUE current_line_number(void)
|
||||
{
|
||||
return INT2FIX((int)curwin->w_cursor.lnum);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static VALUE window_s_count()
|
||||
static VALUE window_s_count(void)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *w;
|
||||
|
@ -404,7 +404,7 @@ SniffEmacsReadThread(void *dummy)
|
||||
* to process the waiting sniff requests
|
||||
*/
|
||||
void
|
||||
ProcessSniffRequests()
|
||||
ProcessSniffRequests(void)
|
||||
{
|
||||
static char buf[MAX_REQUEST_LEN];
|
||||
int len;
|
||||
@ -433,8 +433,7 @@ ProcessSniffRequests()
|
||||
}
|
||||
|
||||
static struct sn_cmd *
|
||||
find_sniff_cmd(cmd)
|
||||
char *cmd;
|
||||
find_sniff_cmd(char *cmd)
|
||||
{
|
||||
struct sn_cmd *sniff_cmd = NULL;
|
||||
int i;
|
||||
@ -463,10 +462,7 @@ find_sniff_cmd(cmd)
|
||||
}
|
||||
|
||||
static int
|
||||
add_sniff_cmd(cmd, def, msg)
|
||||
char *cmd;
|
||||
char *def;
|
||||
char *msg;
|
||||
add_sniff_cmd(char *cmd, char *def, char *msg)
|
||||
{
|
||||
int rc = 0;
|
||||
if (def != NULL && def[0] != NUL && find_sniff_cmd(cmd) == NULL)
|
||||
@ -526,8 +522,7 @@ add_sniff_cmd(cmd, def, msg)
|
||||
* Handle ":sniff" command
|
||||
*/
|
||||
void
|
||||
ex_sniff(eap)
|
||||
exarg_T *eap;
|
||||
ex_sniff(exarg_T *eap)
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
char_u *symbol = NULL;
|
||||
@ -593,7 +588,7 @@ ex_sniff(eap)
|
||||
|
||||
|
||||
static void
|
||||
sniff_connect()
|
||||
sniff_connect(void)
|
||||
{
|
||||
if (sniff_connected)
|
||||
return;
|
||||
@ -609,8 +604,7 @@ sniff_connect()
|
||||
}
|
||||
|
||||
void
|
||||
sniff_disconnect(immediately)
|
||||
int immediately;
|
||||
sniff_disconnect(int immediately)
|
||||
{
|
||||
if (!sniff_connected)
|
||||
return;
|
||||
@ -674,7 +668,7 @@ sniff_disconnect(immediately)
|
||||
* Connect to Sniff: returns 1 on error
|
||||
*/
|
||||
static int
|
||||
ConnectToSniffEmacs()
|
||||
ConnectToSniffEmacs(void)
|
||||
{
|
||||
#ifdef WIN32 /* Windows Version of the Code */
|
||||
HANDLE ToSniffEmacs[2], FromSniffEmacs[2];
|
||||
@ -773,8 +767,7 @@ ConnectToSniffEmacs()
|
||||
* Handle one request from SNiFF+
|
||||
*/
|
||||
static void
|
||||
HandleSniffRequest(buffer)
|
||||
char *buffer;
|
||||
HandleSniffRequest(char *buffer)
|
||||
{
|
||||
char VICommand[MAX_REQUEST_LEN];
|
||||
char command;
|
||||
@ -942,10 +935,7 @@ HandleSniffRequest(buffer)
|
||||
* <0 on error
|
||||
*/
|
||||
static int
|
||||
get_request(fd, buf, maxlen)
|
||||
int fd;
|
||||
char *buf;
|
||||
int maxlen;
|
||||
get_request(int fd, char *buf, int maxlen)
|
||||
{
|
||||
static char inbuf[1024];
|
||||
static int pos = 0, bytes = 0;
|
||||
@ -997,9 +987,7 @@ get_request(fd, buf, maxlen)
|
||||
|
||||
|
||||
static void
|
||||
SendRequest(command, symbol)
|
||||
struct sn_cmd *command;
|
||||
char *symbol;
|
||||
SendRequest(struct sn_cmd *command, char *symbol)
|
||||
{
|
||||
int cmd_type = command->cmd_type;
|
||||
static char cmdstr[MAX_REQUEST_LEN];
|
||||
@ -1074,8 +1062,7 @@ SendRequest(command, symbol)
|
||||
|
||||
|
||||
static void
|
||||
WriteToSniff(str)
|
||||
char *str;
|
||||
WriteToSniff(char *str)
|
||||
{
|
||||
int bytes;
|
||||
#ifdef WIN32
|
||||
@ -1097,24 +1084,21 @@ WriteToSniff(str)
|
||||
/*-------- vim helping functions --------------------------------*/
|
||||
|
||||
static void
|
||||
vi_msg(str)
|
||||
char *str;
|
||||
vi_msg(char *str)
|
||||
{
|
||||
if (str != NULL && *str != NUL)
|
||||
MSG((char_u *)str);
|
||||
}
|
||||
|
||||
static void
|
||||
vi_error_msg(str)
|
||||
char *str;
|
||||
vi_error_msg(char *str)
|
||||
{
|
||||
if (str != NULL && *str != NUL)
|
||||
EMSG((char_u *)str);
|
||||
}
|
||||
|
||||
static void
|
||||
vi_open_file(fname)
|
||||
char *fname;
|
||||
vi_open_file(char *fname)
|
||||
{
|
||||
++no_wait_return;
|
||||
do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF,
|
||||
@ -1124,8 +1108,7 @@ vi_open_file(fname)
|
||||
}
|
||||
|
||||
static buf_T *
|
||||
vi_find_buffer(fname)
|
||||
char *fname;
|
||||
vi_find_buffer(char *fname)
|
||||
{ /* derived from buflist_findname() [buffer.c] */
|
||||
buf_T *buf;
|
||||
|
||||
@ -1137,7 +1120,7 @@ vi_find_buffer(fname)
|
||||
|
||||
|
||||
static char *
|
||||
vi_symbol_under_cursor()
|
||||
vi_symbol_under_cursor(void)
|
||||
{
|
||||
int len;
|
||||
char *symbolp;
|
||||
@ -1156,14 +1139,13 @@ vi_symbol_under_cursor()
|
||||
|
||||
|
||||
static char *
|
||||
vi_buffer_name()
|
||||
vi_buffer_name(void)
|
||||
{
|
||||
return (char *)curbuf->b_sfname;
|
||||
}
|
||||
|
||||
static void
|
||||
vi_exec_cmd(vicmd)
|
||||
char *vicmd;
|
||||
vi_exec_cmd(char *vicmd)
|
||||
{
|
||||
do_cmdline_cmd((char_u *)vicmd); /* [ex_docmd.c] */
|
||||
}
|
||||
@ -1173,8 +1155,7 @@ vi_exec_cmd(vicmd)
|
||||
* derived from cursor_pos_info() [buffer.c]
|
||||
*/
|
||||
static void
|
||||
vi_set_cursor_pos(char_pos)
|
||||
long char_pos;
|
||||
vi_set_cursor_pos(long char_pos)
|
||||
{
|
||||
linenr_T lnum;
|
||||
long char_count = 1; /* first position = 1 */
|
||||
@ -1200,7 +1181,7 @@ vi_set_cursor_pos(char_pos)
|
||||
}
|
||||
|
||||
static long
|
||||
vi_cursor_pos()
|
||||
vi_cursor_pos(void)
|
||||
{
|
||||
linenr_T lnum;
|
||||
long char_count=1; /* sniff starts with pos 1 */
|
||||
|
247
src/if_tcl.c
247
src/if_tcl.c
@ -237,8 +237,7 @@ static char *find_executable_arg = NULL;
|
||||
#endif
|
||||
|
||||
void
|
||||
vim_tcl_init(arg)
|
||||
char *arg;
|
||||
vim_tcl_init(char *arg)
|
||||
{
|
||||
#ifndef DYNAMIC_TCL
|
||||
Tcl_FindExecutable(arg);
|
||||
@ -255,8 +254,7 @@ static int stubs_initialized = FALSE;
|
||||
* Return TRUE if the TCL interface can be used.
|
||||
*/
|
||||
int
|
||||
tcl_enabled(verbose)
|
||||
int verbose;
|
||||
tcl_enabled(int verbose)
|
||||
{
|
||||
if (!stubs_initialized && find_executable_arg != NULL
|
||||
&& tcl_runtime_link_init((char *)p_tcldll, verbose) == OK)
|
||||
@ -280,7 +278,7 @@ tcl_enabled(verbose)
|
||||
#endif
|
||||
|
||||
void
|
||||
tcl_end()
|
||||
tcl_end(void)
|
||||
{
|
||||
#ifdef DYNAMIC_TCL
|
||||
if (hTclLib)
|
||||
@ -310,11 +308,11 @@ tcl_end()
|
||||
* useless for this routine to return the exit code via Tcl_SetResult().
|
||||
*/
|
||||
static int
|
||||
exitcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
exitcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int value = 0;
|
||||
|
||||
@ -339,11 +337,11 @@ exitcmd(dummy, interp, objc, objv)
|
||||
* "::vim::beep" - what Vi[m] does best :-)
|
||||
*/
|
||||
static int
|
||||
beepcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
beepcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
if (objc != 1)
|
||||
{
|
||||
@ -361,11 +359,11 @@ beepcmd(dummy, interp, objc, objv)
|
||||
* "::vim::buffer new" - create a new buffer (not implemented)
|
||||
*/
|
||||
static int
|
||||
buffercmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
buffercmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
char *name;
|
||||
buf_T *buf;
|
||||
@ -457,11 +455,11 @@ buffercmd(dummy, interp, objc, objv)
|
||||
* "::vim::window list" - create list of window commands.
|
||||
*/
|
||||
static int
|
||||
windowcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
windowcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
char *what, *string;
|
||||
win_T *win;
|
||||
@ -498,11 +496,11 @@ windowcmd(dummy, interp, objc, objv)
|
||||
* This function implements the buffer commands.
|
||||
*/
|
||||
static int
|
||||
bufselfcmd(ref, interp, objc, objv)
|
||||
ClientData ref;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
bufselfcmd(
|
||||
ClientData ref,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int opt, err, idx, flags;
|
||||
int val1, val2, n, i;
|
||||
@ -937,11 +935,11 @@ bufselfcmd(ref, interp, objc, objv)
|
||||
* This function implements the window commands.
|
||||
*/
|
||||
static int
|
||||
winselfcmd(ref, interp, objc, objv)
|
||||
ClientData ref;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
winselfcmd(
|
||||
ClientData ref,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int err, idx, flags;
|
||||
int val1, val2;
|
||||
@ -1111,11 +1109,11 @@ winselfcmd(ref, interp, objc, objv)
|
||||
|
||||
|
||||
static int
|
||||
commandcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
commandcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -1125,11 +1123,11 @@ commandcmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
static int
|
||||
optioncmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
optioncmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -1139,11 +1137,11 @@ optioncmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
static int
|
||||
exprcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
exprcmd(
|
||||
ClientData dummy UNUSED,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[])
|
||||
{
|
||||
return tclvimexpr(interp, objc, objv, 1);
|
||||
}
|
||||
@ -1156,11 +1154,11 @@ exprcmd(dummy, interp, objc, objv)
|
||||
* Get a line number from 'obj' and convert it to vim's range.
|
||||
*/
|
||||
static int
|
||||
tclgetlinenum(interp, obj, valueP, buf)
|
||||
Tcl_Interp *interp;
|
||||
Tcl_Obj *obj;
|
||||
int *valueP;
|
||||
buf_T *buf;
|
||||
tclgetlinenum(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *obj,
|
||||
int *valueP,
|
||||
buf_T *buf)
|
||||
{
|
||||
int err, i;
|
||||
|
||||
@ -1209,8 +1207,7 @@ tclgetlinenum(interp, obj, valueP, buf)
|
||||
* Find the first window in the window list that displays the buffer.
|
||||
*/
|
||||
static win_T *
|
||||
tclfindwin(buf)
|
||||
buf_T *buf;
|
||||
tclfindwin(buf_T *buf)
|
||||
{
|
||||
win_T *win;
|
||||
|
||||
@ -1226,11 +1223,11 @@ tclfindwin(buf)
|
||||
* Do-it-all function for "::vim::command", "$buf command" and "$win command".
|
||||
*/
|
||||
static int
|
||||
tcldoexcommand(interp, objc, objv, objn)
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
int objn;
|
||||
tcldoexcommand(
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[],
|
||||
int objn)
|
||||
{
|
||||
tcl_info saveinfo;
|
||||
int err, flag, nobjs;
|
||||
@ -1284,11 +1281,11 @@ tcldoexcommand(interp, objc, objv, objn)
|
||||
* Do-it-all function for "::vim::option", "$buf option" and "$win option".
|
||||
*/
|
||||
static int
|
||||
tclsetoption(interp, objc, objv, objn)
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
int objn;
|
||||
tclsetoption(
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[],
|
||||
int objn)
|
||||
{
|
||||
int err, nobjs, idx;
|
||||
char_u *option;
|
||||
@ -1365,11 +1362,11 @@ tclsetoption(interp, objc, objv, objn)
|
||||
* Do-it-all function for "::vim::expr", "$buf expr" and "$win expr".
|
||||
*/
|
||||
static int
|
||||
tclvimexpr(interp, objc, objv, objn)
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
int objn;
|
||||
tclvimexpr(
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[],
|
||||
int objn)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
char *expr, *str;
|
||||
@ -1402,8 +1399,7 @@ tclvimexpr(interp, objc, objv, objn)
|
||||
* Check for internal vim errors.
|
||||
*/
|
||||
static int
|
||||
vimerror(interp)
|
||||
Tcl_Interp *interp;
|
||||
vimerror(Tcl_Interp *interp)
|
||||
{
|
||||
if (got_int)
|
||||
{
|
||||
@ -1427,8 +1423,7 @@ vimerror(interp)
|
||||
* tclsetdelcmd() - add Tcl callback command to a vim object
|
||||
*/
|
||||
static void
|
||||
delref(cref)
|
||||
ClientData cref;
|
||||
delref(ClientData cref)
|
||||
{
|
||||
struct ref *ref = (struct ref *)cref;
|
||||
|
||||
@ -1441,13 +1436,13 @@ delref(cref)
|
||||
}
|
||||
|
||||
static char *
|
||||
tclgetref(interp, refstartP, prefix, vimobj, proc)
|
||||
Tcl_Interp *interp;
|
||||
void **refstartP; /* ptr to w_tcl_ref/b_tcl-ref member of
|
||||
tclgetref(
|
||||
Tcl_Interp *interp,
|
||||
void **refstartP, /* ptr to w_tcl_ref/b_tcl-ref member of
|
||||
win_T/buf_T struct */
|
||||
char *prefix; /* "win" or "buf" */
|
||||
void *vimobj; /* win_T* or buf_T* */
|
||||
Tcl_ObjCmdProc *proc; /* winselfcmd or bufselfcmd */
|
||||
char *prefix, /* "win" or "buf" */
|
||||
void *vimobj, /* win_T* or buf_T* */
|
||||
Tcl_ObjCmdProc *proc) /* winselfcmd or bufselfcmd */
|
||||
{
|
||||
struct ref *ref, *unused = NULL;
|
||||
static char name[VARNAME_SIZE];
|
||||
@ -1501,27 +1496,23 @@ tclgetref(interp, refstartP, prefix, vimobj, proc)
|
||||
}
|
||||
|
||||
static char *
|
||||
tclgetwindow(interp, win)
|
||||
Tcl_Interp *interp;
|
||||
win_T *win;
|
||||
tclgetwindow(Tcl_Interp *interp, win_T *win)
|
||||
{
|
||||
return tclgetref(interp, &(win->w_tcl_ref), "win", (void *)win, winselfcmd);
|
||||
}
|
||||
|
||||
static char *
|
||||
tclgetbuffer(interp, buf)
|
||||
Tcl_Interp *interp;
|
||||
buf_T *buf;
|
||||
tclgetbuffer(Tcl_Interp *interp, buf_T *buf)
|
||||
{
|
||||
return tclgetref(interp, &(buf->b_tcl_ref), "buf", (void *)buf, bufselfcmd);
|
||||
}
|
||||
|
||||
static int
|
||||
tclsetdelcmd(interp, reflist, vimobj, delcmd)
|
||||
Tcl_Interp *interp;
|
||||
struct ref *reflist;
|
||||
void *vimobj;
|
||||
Tcl_Obj *delcmd;
|
||||
tclsetdelcmd(
|
||||
Tcl_Interp *interp,
|
||||
struct ref *reflist,
|
||||
void *vimobj,
|
||||
Tcl_Obj *delcmd)
|
||||
{
|
||||
if (reflist == &refsdeleted)
|
||||
{
|
||||
@ -1555,9 +1546,7 @@ tclsetdelcmd(interp, reflist, vimobj, delcmd)
|
||||
********************************************/
|
||||
|
||||
static int
|
||||
tcl_channel_close(instance, interp)
|
||||
ClientData instance;
|
||||
Tcl_Interp *interp UNUSED;
|
||||
tcl_channel_close(ClientData instance, Tcl_Interp *interp UNUSED)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
@ -1572,11 +1561,11 @@ tcl_channel_close(instance, interp)
|
||||
}
|
||||
|
||||
static int
|
||||
tcl_channel_input(instance, buf, bufsiz, errptr)
|
||||
ClientData instance UNUSED;
|
||||
char *buf UNUSED;
|
||||
int bufsiz UNUSED;
|
||||
int *errptr;
|
||||
tcl_channel_input(
|
||||
ClientData instance UNUSED,
|
||||
char *buf UNUSED,
|
||||
int bufsiz UNUSED,
|
||||
int *errptr)
|
||||
{
|
||||
|
||||
/* input is currently not supported */
|
||||
@ -1588,11 +1577,11 @@ tcl_channel_input(instance, buf, bufsiz, errptr)
|
||||
}
|
||||
|
||||
static int
|
||||
tcl_channel_output(instance, buf, bufsiz, errptr)
|
||||
ClientData instance;
|
||||
char *buf;
|
||||
int bufsiz;
|
||||
int *errptr;
|
||||
tcl_channel_output(
|
||||
ClientData instance,
|
||||
const char *buf,
|
||||
int bufsiz,
|
||||
int *errptr)
|
||||
{
|
||||
char_u *str;
|
||||
int result;
|
||||
@ -1628,18 +1617,16 @@ tcl_channel_output(instance, buf, bufsiz, errptr)
|
||||
}
|
||||
|
||||
static void
|
||||
tcl_channel_watch(instance, mask)
|
||||
ClientData instance UNUSED;
|
||||
int mask UNUSED;
|
||||
tcl_channel_watch(ClientData instance UNUSED, int mask UNUSED)
|
||||
{
|
||||
Tcl_SetErrno(EINVAL);
|
||||
}
|
||||
|
||||
static int
|
||||
tcl_channel_gethandle(instance, direction, handleptr)
|
||||
ClientData instance UNUSED;
|
||||
int direction UNUSED;
|
||||
ClientData *handleptr UNUSED;
|
||||
tcl_channel_gethandle(
|
||||
ClientData instance UNUSED,
|
||||
int direction UNUSED,
|
||||
ClientData *handleptr UNUSED)
|
||||
{
|
||||
Tcl_SetErrno(EINVAL);
|
||||
return EINVAL;
|
||||
@ -1682,7 +1669,7 @@ static Tcl_ChannelType tcl_channel_type =
|
||||
**********************************/
|
||||
|
||||
static void
|
||||
tclupdatevars()
|
||||
tclupdatevars(void)
|
||||
{
|
||||
char varname[VARNAME_SIZE]; /* must be writeable */
|
||||
char *name;
|
||||
@ -1710,8 +1697,7 @@ tclupdatevars()
|
||||
|
||||
|
||||
static int
|
||||
tclinit(eap)
|
||||
exarg_T *eap;
|
||||
tclinit(exarg_T *eap)
|
||||
{
|
||||
char varname[VARNAME_SIZE]; /* Tcl_LinkVar requires writeable varname */
|
||||
char *name;
|
||||
@ -1820,8 +1806,7 @@ tclinit(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
tclerrmsg(text)
|
||||
char *text;
|
||||
tclerrmsg(char *text)
|
||||
{
|
||||
char *next;
|
||||
|
||||
@ -1836,8 +1821,7 @@ tclerrmsg(text)
|
||||
}
|
||||
|
||||
static void
|
||||
tclmsg(text)
|
||||
char *text;
|
||||
tclmsg(char *text)
|
||||
{
|
||||
char *next;
|
||||
|
||||
@ -1852,7 +1836,7 @@ tclmsg(text)
|
||||
}
|
||||
|
||||
static void
|
||||
tcldelthisinterp()
|
||||
tcldelthisinterp(void)
|
||||
{
|
||||
if (!Tcl_InterpDeleted(tclinfo.interp))
|
||||
Tcl_DeleteInterp(tclinfo.interp);
|
||||
@ -1874,8 +1858,7 @@ tcldelthisinterp()
|
||||
}
|
||||
|
||||
static int
|
||||
tclexit(error)
|
||||
int error;
|
||||
tclexit(int error)
|
||||
{
|
||||
int newerr = OK;
|
||||
|
||||
@ -1923,8 +1906,7 @@ tclexit(error)
|
||||
* ":tcl"
|
||||
*/
|
||||
void
|
||||
ex_tcl(eap)
|
||||
exarg_T *eap;
|
||||
ex_tcl(exarg_T *eap)
|
||||
{
|
||||
char_u *script;
|
||||
int err;
|
||||
@ -1950,8 +1932,7 @@ ex_tcl(eap)
|
||||
* ":tclfile"
|
||||
*/
|
||||
void
|
||||
ex_tclfile(eap)
|
||||
exarg_T *eap;
|
||||
ex_tclfile(exarg_T *eap)
|
||||
{
|
||||
char *file = (char *)eap->arg;
|
||||
int err;
|
||||
@ -1969,8 +1950,7 @@ ex_tclfile(eap)
|
||||
* ":tcldo"
|
||||
*/
|
||||
void
|
||||
ex_tcldo(eap)
|
||||
exarg_T *eap;
|
||||
ex_tcldo(exarg_T *eap)
|
||||
{
|
||||
char *script, *line;
|
||||
int err, rs, re, lnum;
|
||||
@ -2045,8 +2025,7 @@ ex_tcldo(eap)
|
||||
}
|
||||
|
||||
static void
|
||||
tcldelallrefs(ref)
|
||||
struct ref *ref;
|
||||
tcldelallrefs(struct ref *ref)
|
||||
{
|
||||
struct ref *next;
|
||||
int err;
|
||||
@ -2083,8 +2062,7 @@ tcldelallrefs(ref)
|
||||
}
|
||||
|
||||
void
|
||||
tcl_buffer_free(buf)
|
||||
buf_T *buf;
|
||||
tcl_buffer_free(buf_T *buf)
|
||||
{
|
||||
struct ref *reflist;
|
||||
|
||||
@ -2104,8 +2082,7 @@ tcl_buffer_free(buf)
|
||||
|
||||
#if defined(FEAT_WINDOWS) || defined(PROTO)
|
||||
void
|
||||
tcl_window_free(win)
|
||||
win_T *win;
|
||||
tcl_window_free(win_T *win)
|
||||
{
|
||||
struct ref *reflist;
|
||||
|
||||
|
159
src/if_xcmdsrv.c
159
src/if_xcmdsrv.c
@ -214,9 +214,9 @@ static char_u *empty_prop = (char_u *)""; /* empty GetRegProp() result */
|
||||
* Returns FAIL or OK.
|
||||
*/
|
||||
int
|
||||
serverRegisterName(dpy, name)
|
||||
Display *dpy; /* display to register with */
|
||||
char_u *name; /* the name that will be used as a base */
|
||||
serverRegisterName(
|
||||
Display *dpy, /* display to register with */
|
||||
char_u *name) /* the name that will be used as a base */
|
||||
{
|
||||
int i;
|
||||
int res;
|
||||
@ -252,9 +252,7 @@ serverRegisterName(dpy, name)
|
||||
}
|
||||
|
||||
static int
|
||||
DoRegisterName(dpy, name)
|
||||
Display *dpy;
|
||||
char_u *name;
|
||||
DoRegisterName(Display *dpy, char_u *name)
|
||||
{
|
||||
Window w;
|
||||
XErrorHandler old_handler;
|
||||
@ -332,9 +330,9 @@ DoRegisterName(dpy, name)
|
||||
* Change any registered window ID.
|
||||
*/
|
||||
void
|
||||
serverChangeRegisteredWindow(dpy, newwin)
|
||||
Display *dpy; /* Display to register with */
|
||||
Window newwin; /* Re-register to this ID */
|
||||
serverChangeRegisteredWindow(
|
||||
Display *dpy, /* Display to register with */
|
||||
Window newwin) /* Re-register to this ID */
|
||||
{
|
||||
char_u propInfo[MAX_NAME_LENGTH + 20];
|
||||
|
||||
@ -368,15 +366,15 @@ serverChangeRegisteredWindow(dpy, newwin)
|
||||
* Returns 0 for OK, negative for an error.
|
||||
*/
|
||||
int
|
||||
serverSendToVim(dpy, name, cmd, result, server, asExpr, localLoop, silent)
|
||||
Display *dpy; /* Where to send. */
|
||||
char_u *name; /* Where to send. */
|
||||
char_u *cmd; /* What to send. */
|
||||
char_u **result; /* Result of eval'ed expression */
|
||||
Window *server; /* Actual ID of receiving app */
|
||||
Bool asExpr; /* Interpret as keystrokes or expr ? */
|
||||
Bool localLoop; /* Throw away everything but result */
|
||||
int silent; /* don't complain about no server */
|
||||
serverSendToVim(
|
||||
Display *dpy, /* Where to send. */
|
||||
char_u *name, /* Where to send. */
|
||||
char_u *cmd, /* What to send. */
|
||||
char_u **result, /* Result of eval'ed expression */
|
||||
Window *server, /* Actual ID of receiving app */
|
||||
Bool asExpr, /* Interpret as keystrokes or expr ? */
|
||||
Bool localLoop, /* Throw away everything but result */
|
||||
int silent) /* don't complain about no server */
|
||||
{
|
||||
Window w;
|
||||
char_u *property;
|
||||
@ -535,8 +533,7 @@ serverSendToVim(dpy, name, cmd, result, server, asExpr, localLoop, silent)
|
||||
}
|
||||
|
||||
static int
|
||||
WaitForPend(p)
|
||||
void *p;
|
||||
WaitForPend(void *p)
|
||||
{
|
||||
PendingCommand *pending = (PendingCommand *) p;
|
||||
return pending->result != NULL;
|
||||
@ -546,9 +543,7 @@ WaitForPend(p)
|
||||
* Return TRUE if window "w" exists and has a "Vim" property on it.
|
||||
*/
|
||||
static int
|
||||
WindowValid(dpy, w)
|
||||
Display *dpy;
|
||||
Window w;
|
||||
WindowValid(Display *dpy, Window w)
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
Atom *plist;
|
||||
@ -577,13 +572,13 @@ WindowValid(dpy, w)
|
||||
* Enter a loop processing X events & polling chars until we see a result
|
||||
*/
|
||||
static void
|
||||
ServerWait(dpy, w, endCond, endData, localLoop, seconds)
|
||||
Display *dpy;
|
||||
Window w;
|
||||
EndCond endCond;
|
||||
void *endData;
|
||||
int localLoop;
|
||||
int seconds;
|
||||
ServerWait(
|
||||
Display *dpy,
|
||||
Window w,
|
||||
EndCond endCond,
|
||||
void *endData,
|
||||
int localLoop,
|
||||
int seconds)
|
||||
{
|
||||
time_t start;
|
||||
time_t now;
|
||||
@ -649,8 +644,7 @@ ServerWait(dpy, w, endCond, endData, localLoop, seconds)
|
||||
* Returns a newline separated list in allocated memory or NULL.
|
||||
*/
|
||||
char_u *
|
||||
serverGetVimNames(dpy)
|
||||
Display *dpy;
|
||||
serverGetVimNames(Display *dpy)
|
||||
{
|
||||
char_u *regProp;
|
||||
char_u *entry;
|
||||
@ -704,9 +698,7 @@ serverGetVimNames(dpy)
|
||||
*/
|
||||
|
||||
static struct ServerReply *
|
||||
ServerReplyFind(w, op)
|
||||
Window w;
|
||||
enum ServerReplyOp op;
|
||||
ServerReplyFind(Window w, enum ServerReplyOp op)
|
||||
{
|
||||
struct ServerReply *p;
|
||||
struct ServerReply e;
|
||||
@ -748,8 +740,7 @@ ServerReplyFind(w, op)
|
||||
* Issue an error if the id is invalid.
|
||||
*/
|
||||
Window
|
||||
serverStrToWin(str)
|
||||
char_u *str;
|
||||
serverStrToWin(char_u *str)
|
||||
{
|
||||
unsigned id = None;
|
||||
|
||||
@ -765,9 +756,7 @@ serverStrToWin(str)
|
||||
* Return -1 if the window is invalid.
|
||||
*/
|
||||
int
|
||||
serverSendReply(name, str)
|
||||
char_u *name;
|
||||
char_u *str;
|
||||
serverSendReply(char_u *name, char_u *str)
|
||||
{
|
||||
char_u *property;
|
||||
int length;
|
||||
@ -807,8 +796,7 @@ serverSendReply(name, str)
|
||||
}
|
||||
|
||||
static int
|
||||
WaitForReply(p)
|
||||
void *p;
|
||||
WaitForReply(void *p)
|
||||
{
|
||||
Window *w = (Window *) p;
|
||||
return ServerReplyFind(*w, SROP_Find) != NULL;
|
||||
@ -820,11 +808,11 @@ WaitForReply(p)
|
||||
* Return -1 if the window becomes invalid while waiting.
|
||||
*/
|
||||
int
|
||||
serverReadReply(dpy, win, str, localLoop)
|
||||
Display *dpy;
|
||||
Window win;
|
||||
char_u **str;
|
||||
int localLoop;
|
||||
serverReadReply(
|
||||
Display *dpy,
|
||||
Window win,
|
||||
char_u **str,
|
||||
int localLoop)
|
||||
{
|
||||
int len;
|
||||
char_u *s;
|
||||
@ -858,10 +846,7 @@ serverReadReply(dpy, win, str, localLoop)
|
||||
* Return TRUE and a non-malloc'ed string if there is. Else return FALSE.
|
||||
*/
|
||||
int
|
||||
serverPeekReply(dpy, win, str)
|
||||
Display *dpy;
|
||||
Window win;
|
||||
char_u **str;
|
||||
serverPeekReply(Display *dpy, Window win, char_u **str)
|
||||
{
|
||||
struct ServerReply *p;
|
||||
|
||||
@ -882,8 +867,7 @@ serverPeekReply(dpy, win, str)
|
||||
* results.
|
||||
*/
|
||||
static int
|
||||
SendInit(dpy)
|
||||
Display *dpy;
|
||||
SendInit(Display *dpy)
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
|
||||
@ -939,11 +923,11 @@ SendInit(dpy)
|
||||
* removed from the registry property.
|
||||
*/
|
||||
static Window
|
||||
LookupName(dpy, name, delete, loose)
|
||||
Display *dpy; /* Display whose registry to check. */
|
||||
char_u *name; /* Name of a server. */
|
||||
int delete; /* If non-zero, delete info about name. */
|
||||
char_u **loose; /* Do another search matching -999 if not found
|
||||
LookupName(
|
||||
Display *dpy, /* Display whose registry to check. */
|
||||
char_u *name, /* Name of a server. */
|
||||
int delete, /* If non-zero, delete info about name. */
|
||||
char_u **loose) /* Do another search matching -999 if not found
|
||||
Return result here if a match is found */
|
||||
{
|
||||
char_u *regProp, *entry;
|
||||
@ -1033,9 +1017,9 @@ LookupName(dpy, name, delete, loose)
|
||||
* 3. The window will mistakenly be regarded valid because of own commWindow
|
||||
*/
|
||||
static void
|
||||
DeleteAnyLingerer(dpy, win)
|
||||
Display *dpy; /* Display whose registry to check. */
|
||||
Window win; /* Window to remove */
|
||||
DeleteAnyLingerer(
|
||||
Display *dpy, /* Display whose registry to check. */
|
||||
Window win) /* Window to remove */
|
||||
{
|
||||
char_u *regProp, *entry = NULL;
|
||||
char_u *p;
|
||||
@ -1095,11 +1079,11 @@ DeleteAnyLingerer(dpy, win)
|
||||
* Return OK when successful.
|
||||
*/
|
||||
static int
|
||||
GetRegProp(dpy, regPropp, numItemsp, domsg)
|
||||
Display *dpy;
|
||||
char_u **regPropp;
|
||||
long_u *numItemsp;
|
||||
int domsg; /* When TRUE give error message. */
|
||||
GetRegProp(
|
||||
Display *dpy,
|
||||
char_u **regPropp,
|
||||
long_u *numItemsp,
|
||||
int domsg) /* When TRUE give error message. */
|
||||
{
|
||||
int result, actualFormat;
|
||||
long_u bytesAfter;
|
||||
@ -1152,10 +1136,10 @@ GetRegProp(dpy, regPropp, numItemsp, domsg)
|
||||
* response.
|
||||
*/
|
||||
void
|
||||
serverEventProc(dpy, eventPtr, immediate)
|
||||
Display *dpy;
|
||||
XEvent *eventPtr; /* Information about event. */
|
||||
int immediate; /* Run event immediately. Should mostly be 0. */
|
||||
serverEventProc(
|
||||
Display *dpy,
|
||||
XEvent *eventPtr, /* Information about event. */
|
||||
int immediate) /* Run event immediately. Should mostly be 0. */
|
||||
{
|
||||
char_u *propInfo;
|
||||
int result, actualFormat;
|
||||
@ -1197,9 +1181,7 @@ serverEventProc(dpy, eventPtr, immediate)
|
||||
* vim is idle.
|
||||
*/
|
||||
static void
|
||||
save_in_queue(propInfo, len)
|
||||
char_u *propInfo;
|
||||
long_u len;
|
||||
save_in_queue(char_u *propInfo, long_u len)
|
||||
{
|
||||
x_queue_T *node;
|
||||
|
||||
@ -1226,7 +1208,7 @@ save_in_queue(propInfo, len)
|
||||
* Parses queued clientserver messages.
|
||||
*/
|
||||
void
|
||||
server_parse_messages()
|
||||
server_parse_messages(void)
|
||||
{
|
||||
x_queue_T *node;
|
||||
|
||||
@ -1247,7 +1229,7 @@ server_parse_messages()
|
||||
* int the queue.
|
||||
*/
|
||||
int
|
||||
server_waiting()
|
||||
server_waiting(void)
|
||||
{
|
||||
return head.next != NULL && head.next != &head;
|
||||
}
|
||||
@ -1258,10 +1240,10 @@ server_waiting()
|
||||
* "propInfo" will be freed.
|
||||
*/
|
||||
static void
|
||||
server_parse_message(dpy, propInfo, numItems)
|
||||
Display *dpy;
|
||||
char_u *propInfo; /* A string containing 0 or more X commands */
|
||||
long_u numItems; /* The size of propInfo in bytes. */
|
||||
server_parse_message(
|
||||
Display *dpy,
|
||||
char_u *propInfo, /* A string containing 0 or more X commands */
|
||||
long_u numItems) /* The size of propInfo in bytes. */
|
||||
{
|
||||
char_u *p;
|
||||
int code;
|
||||
@ -1539,12 +1521,12 @@ server_parse_message(dpy, propInfo, numItems)
|
||||
* Return: 0 for OK, -1 for error
|
||||
*/
|
||||
static int
|
||||
AppendPropCarefully(dpy, window, property, value, length)
|
||||
Display *dpy; /* Display on which to operate. */
|
||||
Window window; /* Window whose property is to be modified. */
|
||||
Atom property; /* Name of property. */
|
||||
char_u *value; /* Characters to append to property. */
|
||||
int length; /* How much to append */
|
||||
AppendPropCarefully(
|
||||
Display *dpy, /* Display on which to operate. */
|
||||
Window window, /* Window whose property is to be modified. */
|
||||
Atom property, /* Name of property. */
|
||||
char_u *value, /* Characters to append to property. */
|
||||
int length) /* How much to append */
|
||||
{
|
||||
XErrorHandler old_handler;
|
||||
|
||||
@ -1562,9 +1544,7 @@ AppendPropCarefully(dpy, window, property, value, length)
|
||||
* Another X Error handler, just used to check for errors.
|
||||
*/
|
||||
static int
|
||||
x_error_check(dpy, error_event)
|
||||
Display *dpy UNUSED;
|
||||
XErrorEvent *error_event UNUSED;
|
||||
x_error_check(Display *dpy UNUSED, XErrorEvent *error_event UNUSED)
|
||||
{
|
||||
got_x_error = TRUE;
|
||||
return 0;
|
||||
@ -1575,8 +1555,7 @@ x_error_check(dpy, error_event)
|
||||
* Actually just checks if the name ends in a digit.
|
||||
*/
|
||||
static int
|
||||
IsSerialName(str)
|
||||
char_u *str;
|
||||
IsSerialName(char_u *str)
|
||||
{
|
||||
int len = STRLEN(str);
|
||||
|
||||
|
@ -620,8 +620,8 @@ adjust_sign_name(char *filename)
|
||||
if you want to do things differently if the editor is started standalone
|
||||
or in WorkShop mode. For example, in standalone mode you may not want to
|
||||
add a footer/message area or a sign gutter. */
|
||||
int
|
||||
workshop_invoked()
|
||||
int
|
||||
workshop_invoked(void)
|
||||
{
|
||||
static int result = -1;
|
||||
if (result == -1) {
|
||||
@ -735,7 +735,7 @@ void workshop_connect(XtAppContext context)
|
||||
dummy = write(sd, buf, strlen(buf));
|
||||
}
|
||||
|
||||
void workshop_disconnect()
|
||||
void workshop_disconnect(void)
|
||||
{
|
||||
/* Probably need to send some message here */
|
||||
|
||||
|
@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1208,
|
||||
/**/
|
||||
1207,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user