]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): document use of proto files in develop.txt
authorDamien Lejay <damien@lejay.be>
Mon, 1 Sep 2025 19:02:19 +0000 (21:02 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 1 Sep 2025 19:02:19 +0000 (21:02 +0200)
closes: #17973

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/develop.txt
runtime/doc/tags

index deb40445e9ba5aaa6ecf9581c3a92620842ebb0c..2d486b6ba9e1bf9f3575e7ff97c76b1325e0a445 100644 (file)
@@ -1,4 +1,4 @@
-*develop.txt*   For Vim version 9.1.  Last change: 2025 Aug 11
+*develop.txt*   For Vim version 9.1.  Last change: 2025 Sep 01
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -362,6 +362,34 @@ We follow POSIX.1-2001 (SUSv3) for type sizes, which in practice means:
        unsigned    32-bit or larger unsigned
 
 
+FUNCTION PROTOTYPES                            *assumptions-prototypes*
+
+Vim currently does not use conventional header files (`.h`) for most internal
+function prototypes.  Instead, the current architecture uses individual `.pro`
+files in the `src/proto/` directory, with one `.pro` file per `.c` file.
+
+Unlike traditional self-contained header files, these `.pro` files do not
+contain API documentation, struct and enum definitions, or other declaration;
+only function prototypes.
+
+The bundling of these files is not automated.  The `src/proto.h` header is
+composed of a list of manual `#include` directives, one for each individual
+`.pro` file.
+
+Due to this design, integrating a new source file within this architecture
+involves creating a corresponding `.pro` file, manually adding a new `#include`
+directive to `proto.h` and manually adding this file to both `src/Makefile` and
+`src/Make_mvc.mak`.
+
+A `make proto` target exists in `src/Makefile` with the original goal of
+automating the process of updating the `.pro` files.  However, this target is
+unreliable, fails on major platforms (e.g., macOS), and is only part of the
+new release workflow.  In practice, contributors edit the relevant `.pro` files
+by hand when adding, removing, or modifying a function signatures.
+
+This system has been in place since at least v1.24, when Vim’s functions were
+still written in K&R style.
+
 ==============================================================================
 4. Coding style                                                *coding-style*
 
index 617753221c8eeb28228fbfe7b39fc1efc2ec75b6..e988ffb5786349f2e69e0ebe10b1f0a5a5a819b0 100644 (file)
@@ -6228,6 +6228,7 @@ assert_report()   testing.txt     /*assert_report()*
 assert_true()  testing.txt     /*assert_true()*
 assumptions-C-compiler develop.txt     /*assumptions-C-compiler*
 assumptions-makefiles  develop.txt     /*assumptions-makefiles*
+assumptions-prototypes develop.txt     /*assumptions-prototypes*
 assumptions-variables  develop.txt     /*assumptions-variables*
 astro.vim      syntax.txt      /*astro.vim*
 asy.vim        syntax.txt      /*asy.vim*