|
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 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -362,6 +362,34 @@ We follow POSIX.1-2001 (SUSv3) for type sizes, which in practice means:
|
362 | 362 | unsigned 32-bit or larger unsigned
|
363 | 363 |
|
364 | 364 |
|
| 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 | + |
365 | 393 | ==============================================================================
|
366 | 394 | 4. Coding style *coding-style*
|
367 | 395 |
|
|
0 commit comments