Re: [gnome-db] Alternative to "gda_prepare_create_table" not using variable arguments ?



On 30 June 2010 19:47, Daniel Espinosa <esodan gmail com> wrote:
> I can write a new function as follow:
>
> gda_connection_prepare_create_table_from_list (GdaConnection *cnn, const
> gchar *table_name, GSList *fields, GError **error)
>
> GSList *list - could hold a new data structure like:
>
> typedef {
>      gchar  *field_name, // Filed's name
>     GType  field_type,  // Field's type
>     GdaEasyCreateTableFlag flag, // a tag
>     GSList tag_arguments // Tag's arguments like for
> GDA_EASY_CREATE_TABLE_FKEY_FLAG
> } GdaCreateTable
>
> What do you think?
>

I don't think it's worth it. Let me explain: the existing
"convenience" API is there only because it enables to user to do some
tasks quickly, hence the usage of the ellipsis in C to pass
parameters: the programmer known what he wants and it is "staticaly"
coded.
For a more general purpose I prefer that the user use the full API
because otherwise the final API will be made only of convenience
functions which is not what I want.

Thanks anyway for proposing to improve things,

Regards,

Vivien


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