Re: Consensus on getter conventions?



-> My personal preference is to have all get_* functions which return
-> something be a pointer to a "static" piece of memory.  Those
-> cases where deallocation is required should return by argument.
-> 
->   /* this doesn't need to be freed because it was the return */
->   const gchar* gtk_widget_get_name(GtkWidget*);
-> 
->   /* this one does need to be free and it is different for that reason */
->   void gtk_font_selection_dialog_get_font_name(
->         GtkFontSelectionDialog *fsd,  gchar**);
->                                       ^^^^^
->               notice it isn't const because we give it to the user.

	I like Karl's idea.  Makes it clear as day.

	Would this cause any problems for language bindings?


--Derek






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