diff --git a/doc/develop.jax b/doc/develop.jax index d4553043d..3b837cac0 100644 --- a/doc/develop.jax +++ b/doc/develop.jax @@ -1,4 +1,4 @@ -*develop.txt* For Vim バージョン 9.1. Last change: 2025 Aug 11 +*develop.txt* For Vim バージョン 9.1. Last change: 2025 Sep 01 VIMリファレンスマニュアル by Bram Moolenaar @@ -358,6 +358,35 @@ VAX V7.3 では Compaq C V6.4-005 を使用してビルドする必要がある unsigned 32-bit またはそれ以上の unsigned +☆関数プロトタイプ *assumptions-prototypes* + +Vim は現在、ほとんどの内部関数プロトタイプに従来のヘッダーファイル (`.h`) を使 +用していない。代わりに、現在のアーキテクチャでは `src/proto/` ディレクトリ内の +個別の `.pro` ファイルを使用し、`.c` ファイルごとに 1 つの `.pro` ファイルを使 +用する。 + +従来の自己完結型ヘッダーファイルとは異なり、これらの `.pro` ファイルには、API +ドキュメント、構造体と列挙型の定義、その他の宣言は含まれず、関数のプロトタイプ +のみが含まれる。 + +これらのファイルのバンドルは自動化されていない。`src/proto.h` ヘッダーは、各 +`.pro` ファイルごとに 1 つずつ、手動で記述する `#include` ディレクティブのリス +トで構成されている。 + +この設計のため、このアーキテクチャ内に新しいソースファイルを統合するには、対応 +する `.pro` ファイルを作成し、新しい `#include` ディレクティブを `proto.h` に +手動で追加し、このファイルを `src/Makefile` と `src/Make_mvc.mak` の両方に手動 +で追加する必要がある。 + +`src/Makefile` には `make proto` ターゲットが存在し、本来の目的は `.pro` ファ +イルの更新プロセスを自動化することでした。しかし、このターゲットは信頼性が低 +く、主要プラットフォーム (例えば、macOS) では動作せず、新リリースワークフロー +の一部に過ぎない。実際には、コントリビューターは関数シグネチャを追加、削除、ま +たは変更する際に、関連する `.pro` ファイルを手動で編集している。 + +このシステムは、Vim の関数がまだ K&R スタイルで書かれていたバージョン 1.24 以 +降で導入されている。 + ============================================================================== 4. コーディングスタイル *coding-style* diff --git a/en/develop.txt b/en/develop.txt index deb40445e..2d486b6ba 100644 --- a/en/develop.txt +++ b/en/develop.txt @@ -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*