Vala-Problem with ??? array variables

Frederik Sdun frederik.sdun at googlemail.com
Wed Oct 21 19:19:56 CEST 2009


* Matthias Huber <matthias.huber at wollishausen.de> [21.10.2009 18:28]:
>    Michael 'Mickey' Lauer schrieb:
> 
>  Am Mittwoch, den 21.10.2009, 16:33 +0200 schrieb Matthias Huber:
>   
> 
>  Sorry when i am nervy, but i don't find a documentation about vala's stdout:
> 
>  when i pipe my program (because i don't want to rewrite my c-code
>  completele with vala)
>  into my program, or even into tail, the prog doesn't show any output with my
> 
>  stdout.printf("sonemting")
> 
>  is there a stdout.flush() ?
>  yes there is one.
> 
>  but that doesn't help me.
> 
>  Any Idea ?
>     
> 
>  Try appending \n. This is not Vala-specific though, it's plain old posix
>  stdout.
> 
> 
>   
> 
>    Thank you, now it is working so far.
> 
>    But for initially getting the provider from dbus, i need to do a call, but
>    i can not find out, how the function prototype has to be declared and also
>    after that, howto get the provider itself, i.e: (this doesn't work):
> 
>            // async dbus call
>           this.device.GetStatus( reply_handler );
> 
>    what type is here given back ?
> 
>       private void reply_handler (string[] ids, GLib.Error e) {
>            // callback for async dbus call
>            if (e != null) {
>                critical ("%s", e.message);
>                return;
>            }
>            try {
>                foreach (string id in ids)
>                    message ("Answer: %s", id);
>            }
>            catch (GLib.Error err) {
>                critical ("%s", err.message);
>            }
>        }
You can use libfso-glib which is available on [1]. it is generated from
the docs and you get errors on compiletime if you use wrong signatures.

To uses it you only have to use:

var obj = DBus.Bus.get( DBus.BusType.SYSTEM)
            .get_object("org.freesmartphone.GSM.Device",
                "/org/freesmartphone/GSM/Device" ) as
            FreeSmartphone.GSM.Device;
        obj.get_state(reply_handler);

Frederik

[1] http://git.freesmartphone.org/?p=libfso-glib.git;a=summary
> _______________________________________________
> devel mailing list
> devel at lists.openmoko.org
> https://lists.openmoko.org/mailman/listinfo/devel


-- 
IRC: playya @ Freenode, Gimpnet
xmpp: playya at draugr.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.openmoko.org/pipermail/devel/attachments/20091021/d51639c2/attachment-0001.pgp 


More information about the devel mailing list