Skip to content

Commit da47eb0

Browse files
committed
contrib : add _t suffix guideline [no ci]
1 parent 7fd17ba commit da47eb0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@
7474

7575
- Declare structs with `struct x {}` instead of `typedef struct x {} x`
7676
- In C++ code omit the `struct` keyword whenever it is not necessary
77-
- Use `_t` suffix when ...
77+
- Use the `_t` suffix when the types are supposed to be opaque to the user - it's not relevant to them if it is a struct or anything else
78+
79+
```cpp
80+
typedef struct llama_context * llama_context_t;
81+
82+
enum llama_pooling_type llama_pooling_type(const llama_context_t ctx);
83+
```
84+
85+
> [!NOTE]
86+
> This guideline is yet to be applied to the `llama.cpp` codebase. New code should follow this guideline.
7887

7988
- Follow the existing code style, in case of doubt use `clang-format` to format the added code
8089

0 commit comments

Comments
 (0)