Re: Fourth draft of defs file format

On 24 Jan 2000, Havoc Pennington wrote:

> (function function-name
>   (in-module module-name-list) ;; "static methods" go in their
>                                ;;  object's module
>   (is-constructor-of object-type-alias) ;; optional, marks a constructor
>   (c-name function-name)
>   (return-type return-value-type) ;; defaults to void
>   (caller-owns-return boolean-value) ;; defaults to #f
>   (can-return-null boolean-value) ;; defaults to #f

let this default to true, many functions may return NULL, and defaulting
to false here is dangerous for wrong .defs files (which can easily happen,
e.g. when the semantics of a function change) when bindings don't
check the return value for NULL because of this.

actually i even think assuring that a function will always return a
result != NULL is dangerous in the first place, there are a lot
of functions that should never return NULL, given valid function
arguments, but the return_val_if_fail statements still default to NULL.

>   (parameter in-or-out-or-inout 
>       (type-and-name parameter-type-alias parameter-name)
>       (c-declaration "c-type-and-name")) ;; c-declaration only required
>                                          ;; if the type alias is "native"
>   (varargs #t) ;; has varargs at the end
> )

> === 
> (enum enum-name
>   (in-module modname)
>   (c-name name-in-c)
>   (value (name value-name-noprefixes-hyphen-lowercase) (c-name value-c-name)))

i mentioned this already, please call this "nick" to follow gtk terminology,
what you call "c-name" here is the actuall name of the value and shouldn't
be supperessed by language bindings.

>   (enum DirectionType
>     (in-module Gtk)
>     (c-name GtkDirectionType)
>     (value (name tab-forward) (c-name GTK_DIR_TAB_FORWARD))

      (value (nick tab-forward) (name GTK_DIR_TAB_FORWARD))


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