clutter - "... int *argc" - their doc entries and corresponding GIArgInfo



Hello,

I am working on G-Golf (a guile scheme GI binding library) [1]. I now have a
'reasonably good sketch' to work on what will eventually let me 'fully bind' GI
functions.

While working on this, using Clutter to test, a few questions 'came up', wrt to
clutter_init and clutter_init_with_args first argument, their respective
documentation entry and the way GI defines their corresponding GIArg-Info.

1]      Lets start with the doc quiz:

        ClutterInitError
        clutter_init (int *argc,
                      char ***argv);

        ...
        argc    The number of arguments in argv.        [inout]
        argv    A pointer       to the array ...                        [inout][allow-none]


        ClutterInitError
        clutter_init_with_args (int *argc,
                                char ***argv,
                                ...

        ...
        argc    a pointer to the number of command line arguments.      [inout]
        argv    a pointer       to the array ...                                                        
[inout][allow-none]

But I see in an 'old' guile-clutter binding (not using GI), which I can still use, so it
works fine, that the initialization call is (always):

        if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)

Which means that argc is a pointer, that can be NULL, so should the doc entry not be:

        argc    a pointer to the number of command line arguments.      [inout][allow-none]

2]      Now, 'their' GIArgInfo definition and related question

        [ you can see the complete <function> and <argument> instances for
        [ clutter_init, as 'seen' by G-Golf here [2], but here is 'just' the first
        [ argument, so I can ask my question>

Here is the definition the argc argument, as 'seen' by G-Golf

        #<<argument> 55e221b84ea0> - instance of <argument>
          slots and values are:
            name = argc
            closure = -1
            destroy = -1
            direction = inout
            transfert = everything
            scope = invalid
            type-tag = int32
            type-desc = int32
            is-pointer? = #f
            may-be-null? = #f
            is-caller-allocate? = #f
            is-optional? = #f
            is-return-value? = #f
            is-skip? = #f
            gi-argument = #<pointer 0x55e221b2cdd0>
            gi-argument-field = v-int32

So, it's definitely not a pointer, and can't be null.
What am I missing here?

Thanks,
David

[1]     https://www.gnu.org/software/g-golf/

[2]     the clutter_init function and arguments s 'seen' by G-Golf

#<<function> 55e221b5b230> - instance of <function>
  slots and values are:
    name = clutter-init
    flags = ()
    n-arg = 2
    caller-owns = nothing
    return-type = interface
    type-desc = (enum clutter-init-error #<<gi-enum> 55e221a63120> 94429717812384)
    may-return-null? = #f
    arguments = (#<<argument> 55e221b84ea0> #<<argument> 55e221b84e10>)
    n-gi-arg-in = 2
    gi-args-in = #<pointer 0x55e221b2cd10>
    n-gi-arg-out = 2
    gi-args-out = #<pointer 0x55e221b2cce0>

#<<argument> 55e221b84ea0> - instance of <argument>
  slots and values are:
    name = argc
    closure = -1
    destroy = -1
    direction = inout
    transfert = everything
    scope = invalid
    type-tag = int32
    type-desc = int32
    is-pointer? = #f
    may-be-null? = #f
    is-caller-allocate? = #f
    is-optional? = #f
    is-return-value? = #f
    is-skip? = #f
    gi-argument = #<pointer 0x55e221b2cdd0>
    gi-argument-field = v-int32

#<<argument> 55e221b84e10> - instance of <argument>
  slots and values are:
    name = argv
    closure = -1
    destroy = -1
    direction = inout
    transfert = everything
    scope = invalid
    type-tag = array
    type-desc = (array . c)
    is-pointer? = #t
    may-be-null? = #t
    is-caller-allocate? = #f
    is-optional? = #t
    is-return-value? = #f
    is-skip? = #f
    gi-argument = #<pointer 0x55e221b2cd70>
    gi-argument-field = v-pointer



















Attachment: pgpYGFy88hBMn.pgp
Description: OpenPGP digital signature



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