Thread (1 message) 1 message, 1 author, 2024-07-24

Re: [PATCH 2/3] Documentation: document naming schema for struct-related functions

From: Junio C Hamano <hidden>
Date: 2024-07-24 16:56:10

Junio C Hamano [off-list ref] writes:
Patrick Steinhardt [off-list ref] writes:
quoted
+ - Functions that operate on a specific structure and which are used by
+   other subsystems shall be named after the structure.
...
quoted
+ The function
+   name should start with the name of the structure followed by a verb.
+   E.g.
+
+	struct strbuf;
+
+	void strbuf_add(struct strbuf *buf, ...);
+ ...
+	void strbuf_reset(struct strbuf *buf);
Another thing we may want to say about these "The primary data
structure subsystem 'S' deals with is called 'struct S' and the
functions that operate on 'struct S' are named S_<verb>()" theme is
that the convention for S_<verb>() functions is to have the operand,
which is always 'struct S *', of the verb as the first parameter.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help