From: Hirohito Higashi Date: Wed, 5 Aug 2026 18:52:06 +0000 (+0000) Subject: patch 9.2.0912: hardcopy: prototypes are hand-written instead of generated X-Git-Tag: v9.2.0912^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be85db01f1ca977e29c7f593293d6459b0b84b5e;p=thirdparty%2Fvim.git patch 9.2.0912: hardcopy: prototypes are hand-written instead of generated Problem: The prototypes for the pango and PostScript hardcopy functions are written by hand in hardcopy_pango.h and hardcopy_postscript.h, instead of being generated into proto/ like for every other source file. Solution: Generate proto/hardcopy_pango.pro and proto/hardcopy_postscript.pro, include them from proto.h and drop the hand-written declarations. hardcopy_pango.h only held prototypes and is removed; hardcopy_postscript.h keeps its defines and the mbfont_opts declaration. closes: #20946 Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/Filelist b/Filelist index 7a2f1219ba..945c87e031 100644 --- a/Filelist +++ b/Filelist @@ -95,7 +95,6 @@ SRC_ALL = \ src/hardcopy.c \ src/hardcopy.h \ src/hardcopy_pango.c \ - src/hardcopy_pango.h \ src/hardcopy_postscript.c \ src/hardcopy_postscript.h \ src/hashtab.c \ @@ -316,6 +315,8 @@ SRC_ALL = \ src/proto/gui.pro \ src/proto/gui_beval.pro \ src/proto/hardcopy.pro \ + src/proto/hardcopy_pango.pro \ + src/proto/hardcopy_postscript.pro \ src/proto/hashtab.pro \ src/proto/help.pro \ src/proto/highlight.pro \ diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 92b6f4066a..1b91f5b292 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -1990,6 +1990,8 @@ proto.h: \ proto/gc.pro \ proto/gui_xim.pro \ proto/hardcopy.pro \ + proto/hardcopy_pango.pro \ + proto/hardcopy_postscript.pro \ proto/hashtab.pro \ proto/help.pro \ proto/highlight.pro \ diff --git a/src/Makefile b/src/Makefile index a8a046da7f..04917c0641 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1927,6 +1927,8 @@ PROTO_FILES = \ proto/gui_gtk_gresources.pro \ proto/gui_xim.pro \ proto/hardcopy.pro \ + proto/hardcopy_pango.pro \ + proto/hardcopy_postscript.pro \ proto/hashtab.pro \ proto/help.pro \ proto/highlight.pro \ @@ -4109,12 +4111,12 @@ objects/hardcopy.o: auto/osdef.h hardcopy.c vim.h protodef.h auto/config.h featu ascii.h keymap.h termdefs.h macros.h option.h beval.h \ structs.h regexp.h gui.h libvterm/include/vterm.h \ libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ - globals.h errors.h version.h hardcopy.h hardcopy_pango.h hardcopy_postscript.h + globals.h errors.h version.h hardcopy.h hardcopy_postscript.h objects/hardcopy_pango.o: auto/osdef.h hardcopy_pango.c vim.h protodef.h auto/config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h option.h beval.h \ structs.h regexp.h gui.h libvterm/include/vterm.h \ libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ - globals.h errors.h hardcopy.h hardcopy_pango.h + globals.h errors.h hardcopy.h objects/hardcopy_postscript.o: auto/osdef.h hardcopy_postscript.c vim.h protodef.h auto/config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h option.h beval.h \ structs.h regexp.h gui.h libvterm/include/vterm.h \ @@ -4850,6 +4852,8 @@ proto/gui_beval.pro: gui_beval.c proto/gui_gtk_gresources.pro: auto/gui_gtk_gresources.c proto/gui_xim.pro: gui_xim.c proto/hardcopy.pro: hardcopy.c +proto/hardcopy_pango.pro: hardcopy_pango.c +proto/hardcopy_postscript.pro: hardcopy_postscript.c proto/hashtab.pro: hashtab.c proto/help.pro: help.c proto/highlight.pro: highlight.c diff --git a/src/hardcopy.c b/src/hardcopy.c index d7f2298950..8387deabb8 100644 --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -20,9 +20,6 @@ #ifdef FEAT_POSTSCRIPT # include "hardcopy_postscript.h" #endif -#ifdef FEAT_PRINT_PANGO -# include "hardcopy_pango.h" -#endif /* * To implement printing on a platform, the following functions must be diff --git a/src/hardcopy_pango.c b/src/hardcopy_pango.c index e3d46a57b7..29c6118b8a 100644 --- a/src/hardcopy_pango.c +++ b/src/hardcopy_pango.c @@ -21,7 +21,6 @@ #ifdef FEAT_PRINT_PANGO #include "hardcopy.h" -#include "hardcopy_pango.h" #include #include diff --git a/src/hardcopy_postscript.h b/src/hardcopy_postscript.h index fe41df8f87..1134889c29 100644 --- a/src/hardcopy_postscript.h +++ b/src/hardcopy_postscript.h @@ -24,19 +24,6 @@ extern option_table_T mbfont_opts[OPT_MBFONT_NUM_OPTIONS]; -void mch_print_cleanup(void); -int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit); -int mch_print_begin(prt_settings_T *psettings); -void mch_print_end(prt_settings_T *psettings); -int mch_print_end_page(void); -int mch_print_begin_page(char_u *str); -int mch_print_blank_page(void); -void mch_print_start_line(int margin, int page_line); -int mch_print_text_out(char_u *textp, int len); -void mch_print_set_font(int iBold, int iItalic, int iUnderline); -void mch_print_set_bg(long_u bgcol); -void mch_print_set_fg(long_u fgcol); - #endif #endif diff --git a/src/proto.h b/src/proto.h index a06b82622c..fa0ca9cc2c 100644 --- a/src/proto.h +++ b/src/proto.h @@ -98,6 +98,12 @@ extern int _stricoll(char *a, char *b); # include "gc.pro" # include "gui_xim.pro" # include "hardcopy.pro" +# ifdef FEAT_PRINT_PANGO +# include "hardcopy_pango.pro" +# endif +# ifdef FEAT_POSTSCRIPT +# include "hardcopy_postscript.pro" +# endif # include "hashtab.pro" # include "help.pro" # include "highlight.pro" diff --git a/src/hardcopy_pango.h b/src/proto/hardcopy_pango.pro similarity index 57% rename from src/hardcopy_pango.h rename to src/proto/hardcopy_pango.pro index 26a4c227a6..072faa55a9 100644 --- a/src/hardcopy_pango.h +++ b/src/proto/hardcopy_pango.pro @@ -1,19 +1,4 @@ -/* vi:set ts=8 sts=4 sw=4 noet: - * - * VIM - Vi IMproved by Bram Moolenaar - * - * Do ":help uganda" in Vim to read copying and usage conditions. - * Do ":help credits" in Vim to see a list of people who contributed. - * See README.txt for an overview of the Vim source code. - */ - -#ifndef HARDCOPY_PANGO_H -#define HARDCOPY_PANGO_H - -#include "vim.h" - -#if defined(FEAT_PRINT_PANGO) - +/* hardcopy_pango.c */ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit); int mch_print_begin(prt_settings_T *psettings); void mch_print_end(prt_settings_T *psettings); @@ -26,7 +11,4 @@ void mch_print_set_font(int bold, int italic, int underline); void mch_print_set_bg(long_u bgcol); void mch_print_set_fg(long_u fgcol); void mch_print_cleanup(void); - -#endif - -#endif +/* vim: set ft=c : */ diff --git a/src/proto/hardcopy_postscript.pro b/src/proto/hardcopy_postscript.pro new file mode 100644 index 0000000000..70d7bb8649 --- /dev/null +++ b/src/proto/hardcopy_postscript.pro @@ -0,0 +1,14 @@ +/* hardcopy_postscript.c */ +void mch_print_cleanup(void); +int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit); +int mch_print_begin(prt_settings_T *psettings); +void mch_print_end(prt_settings_T *psettings); +int mch_print_end_page(void); +int mch_print_begin_page(char_u *str); +int mch_print_blank_page(void); +void mch_print_start_line(int margin, int page_line); +int mch_print_text_out(char_u *textp, int len); +void mch_print_set_font(int iBold, int iItalic, int iUnderline); +void mch_print_set_bg(long_u bgcol); +void mch_print_set_fg(long_u fgcol); +/* vim: set ft=c : */ diff --git a/src/version.c b/src/version.c index e65bb14ea2..ef0edee5ec 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 912, /**/ 911, /**/