Skip to content

Commit 0ed0878

Browse files
dlejaychrisbra
authored andcommitted
runtime(doc): document use of proto files in develop.txt
closes: #17973 Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent f50504a commit 0ed0878

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

runtime/doc/develop.txt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*develop.txt* For Vim version 9.1. Last change: 2025 Aug 11
1+
*develop.txt* For Vim version 9.1. Last change: 2025 Sep 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -362,6 +362,34 @@ We follow POSIX.1-2001 (SUSv3) for type sizes, which in practice means:
362362
unsigned 32-bit or larger unsigned
363363

364364

365+
FUNCTION PROTOTYPES *assumptions-prototypes*
366+
367+
Vim currently does not use conventional header files (`.h`) for most internal
368+
function prototypes. Instead, the current architecture uses individual `.pro`
369+
files in the `src/proto/` directory, with one `.pro` file per `.c` file.
370+
371+
Unlike traditional self-contained header files, these `.pro` files do not
372+
contain API documentation, struct and enum definitions, or other declaration;
373+
only function prototypes.
374+
375+
The bundling of these files is not automated. The `src/proto.h` header is
376+
composed of a list of manual `#include` directives, one for each individual
377+
`.pro` file.
378+
379+
Due to this design, integrating a new source file within this architecture
380+
involves creating a corresponding `.pro` file, manually adding a new `#include`
381+
directive to `proto.h` and manually adding this file to both `src/Makefile` and
382+
`src/Make_mvc.mak`.
383+
384+
A `make proto` target exists in `src/Makefile` with the original goal of
385+
automating the process of updating the `.pro` files. However, this target is
386+
unreliable, fails on major platforms (e.g., macOS), and is only part of the
387+
new release workflow. In practice, contributors edit the relevant `.pro` files
388+
by hand when adding, removing, or modifying a function signatures.
389+
390+
This system has been in place since at least v1.24, when Vim’s functions were
391+
still written in K&R style.
392+
365393
==============================================================================
366394
4. Coding style *coding-style*
367395

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6228,6 +6228,7 @@ assert_report() testing.txt /*assert_report()*
62286228
assert_true() testing.txt /*assert_true()*
62296229
assumptions-C-compiler develop.txt /*assumptions-C-compiler*
62306230
assumptions-makefiles develop.txt /*assumptions-makefiles*
6231+
assumptions-prototypes develop.txt /*assumptions-prototypes*
62316232
assumptions-variables develop.txt /*assumptions-variables*
62326233
astro.vim syntax.txt /*astro.vim*
62336234
asy.vim syntax.txt /*asy.vim*

0 commit comments

Comments
 (0)