Re: fun project!



: i think we should keep magic commenting to the minimum possible,
: if at all, so we better make sure the default choosen apply to the
: commmon case. for strings specifically this means:
: - returned strings usually do not need to be freed
: - strings can most often be passed as NULL, (tooltips, label text...)
: - returned strigs may be NULL

My $.02 on this.  I've solved this sort of problem before by 
changing the function signature itself through the use of
typedefs.  Then, when a midl compiler or other utility
is used to gain knowledge of marshalling requirements,
no additional data is required.  

typedef char     gchar;
typedef char     gcharmalloc;
typedef char     gcharnofree;

gcharnofree * gtk_type_name(GtkType type);

This method makes it obvious to both the programmer and
the CORBA tools what's happening.  I realize it's probably
way too late to change GTK headers like this, but I thought
I'd post this anyway.

Regards,

Greg




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