Re: Consensus on getter conventions?
- From: Derek Simkowiak <dereks kd-dev com>
- To: Karl Nelson <kenelson ece ucdavis edu>
- Cc: kenelson rainbow ece ucdavis edu, gnome-hackers gnome org,gtk-devel-list gnome org
- Subject: Re: Consensus on getter conventions?
- Date: Thu, 24 Aug 2000 14:28:02 -0700 (PDT)
-> 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]