Suppose I have a struct list, and I want to provide a “constructor” and a “destructor” function. How should I name them, respectively?
void list__init(struct list * self);
void list__construct(struct list * self);
void list__create(struct list * self);
...
void list__done(struct list * self);
void list__destruct(struct list * self);
void list__destroy(struct list * self);
...
Is there an established naming convention that is predominant in the real world?
There is no generally accepted convention.
C++ has influenced peoples views in this matter, of course.
Personally, I use new() when the function performs memory allocation, init() if it does not, delete() if deallocation occurs and cleanup() if not.