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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Patrick Steinhardt <ps@xxxxxx> writes:
>
>> + - Functions that operate on a specific structure and which are used by
>> +   other subsystems shall be named after the structure.
> ...
>> + 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux