Changeset 289

Show
Ignore:
Timestamp:
05/25/09 21:56:42 (3 years ago)
Author:
ath
bzr:base-revision:
alberto.botti@gmail.com-20090521192404-ptvzvmhm87oq7etr
bzr:committer:
Alberto Botti <alberto.botti@gmail.com>
bzr:file-ids:

rgc/include/client/rgc_client.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Finclude%2Fclient%2Frgc_client.h
rgc/include/client/rgc_remote_object.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Finclude%2Fclient%2Frgc_remote_object.h
rgc/include/connection/rgc_protocol_client.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Finclude%2Fconnection%2Frgc_protocol_client.h
rgc/include/connection/rgc_protocol_server.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Finclude%2Fconnection%2Frgc_protocol_server.h
rgc/src/client/rgc_client_cmd.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_client_cmd.c
rgc/src/client/rgc_info.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_info.c
rgc/src/client/rgc_info.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_info.h
rgc/src/client/rgc_query.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_query.c
rgc/src/client/rgc_remote_object.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_remote_object.c
rgc/src/client/rgc_remote_signal.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_remote_signal.c
rgc/src/client/rgc_remote_signal.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fclient%2Frgc_remote_signal.h
rgc/src/common/rgc_utils.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fcommon%2Frgc_utils.h
rgc/src/connection/dbus/rgc_protocol_dbus_server.c rgc_protocol_dbus_se-20090309124819-kmj94w5bsr24cefl-4
rgc/src/connection/rbp/rbp_message.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frbp_message.c
rgc/src/connection/rbp/rbp_message.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frbp_message.h
rgc/src/connection/rbp/rbp_message_execute_client.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frbp_message_execute_client.c
rgc/src/connection/rbp/rbp_message_execute_server.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frbp_message_execute_server.c
rgc/src/connection/rbp/rbp_message_lowlevel.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frbp_message_lowlevel.c
rgc/src/connection/rbp/rbp_message_string.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frbp_message_string.c
rgc/src/connection/rbp/rgc_protocol_rbp_client.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frgc_protocol_rbp_client.c
rgc/src/connection/rbp/rgc_protocol_rbp_server.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frbp%2Frgc_protocol_rbp_server.c
rgc/src/connection/rgc_connection_client.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_connection_client.c
rgc/src/connection/rgc_connection_client.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_connection_client.h
rgc/src/connection/rgc_connection_server.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_connection_server.c
rgc/src/connection/rgc_connection_server.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_connection_server.h
rgc/src/connection/rgc_protocol_client.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_protocol_client.c
rgc/src/connection/rgc_protocol_client.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_protocol_client.h
rgc/src/connection/rgc_protocol_server.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_protocol_server.c
rgc/src/connection/rgc_protocol_server.h 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fconnection%2Frgc_protocol_server.h
rgc/src/server/rgc_signal.c 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Fsrc%2Fserver%2Frgc_signal.c
rgc/test/Makefile.am 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Ftest%2FMakefile.am
rgc/test/Makefile.in 210@45ad373b-3914-0410-8193-a61cc481f39f:trunk:rgc%2Ftest%2FMakefile.in
rgc/test/check_query.c check_query.c-20090309124827-7ebnk01c4gfihigv-1
rgc/test/check_rbp.c check_rbp.c-20090522130120-ul6epb7z8me1cerb-1
rgc/test/check_remote_obj.c check_remote_obj.c-20090309124832-uxme781mpafyryoo-1
bzr:mapping-version:
v4
bzr:merge:

alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
bzr:repository-uuid:
45ad373b-3914-0410-8193-a61cc481f39f
bzr:revision-id:
alberto.botti@gmail.com-20090525195410-45j88awlynnup3b1
bzr:revno:
81
bzr:revprop:branch-nick:
trunk
bzr:root:
trunk
bzr:text-parents:

rgc/include/client/rgc_client.h alberto.botti@gmail.com-20090204203706-s4k8dta7qo2zk9xr
rgc/include/client/rgc_remote_object.h alberto.botti@gmail.com-20090306143652-vce6aj4qhdsnato6
rgc/include/connection/rgc_protocol_client.h alberto.botti@gmail.com-20090523141639-btaidciozs00n72k
rgc/include/connection/rgc_protocol_server.h alberto.botti@gmail.com-20090306143652-vce6aj4qhdsnato6
rgc/src/client/rgc_client_cmd.c alberto.botti@gmail.com-20090523141639-btaidciozs00n72k
rgc/src/client/rgc_info.c alberto.botti@gmail.com-20090522085825-x7p3tnbyznz5h32l
rgc/src/client/rgc_info.h alberto.botti@gmail.com-20090522085825-x7p3tnbyznz5h32l
rgc/src/client/rgc_query.c alberto.botti@gmail.com-20090522225944-idvciojo63rw7wgz
rgc/src/client/rgc_remote_object.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/client/rgc_remote_signal.c svn-v3-trunk0:45ad373b-3914-0410-8193-a61cc481f39f:trunk:210
rgc/src/client/rgc_remote_signal.h svn-v3-trunk0:45ad373b-3914-0410-8193-a61cc481f39f:trunk:210
rgc/src/common/rgc_utils.h alberto.botti@gmail.com-20090309202859-cexjc99k235vxl9c
rgc/src/connection/dbus/rgc_protocol_dbus_server.c alberto.botti@gmail.com-20090309124852-c9237byuwhf5xhtb
rgc/src/connection/rbp/rbp_message.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rbp/rbp_message.h alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rbp/rbp_message_execute_client.c alberto.botti@gmail.com-20090522085825-x7p3tnbyznz5h32l
rgc/src/connection/rbp/rbp_message_execute_server.c alberto.botti@gmail.com-20090306143652-vce6aj4qhdsnato6
rgc/src/connection/rbp/rbp_message_lowlevel.c alberto.botti@gmail.com-20090304130000-1a9z78agyveb0x12
rgc/src/connection/rbp/rbp_message_string.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rbp/rgc_protocol_rbp_client.c alberto.botti@gmail.com-20090523141639-btaidciozs00n72k
rgc/src/connection/rbp/rgc_protocol_rbp_server.c alberto.botti@gmail.com-20090522225944-idvciojo63rw7wgz
rgc/src/connection/rgc_connection_client.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rgc_connection_client.h alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rgc_connection_server.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rgc_connection_server.h alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rgc_protocol_client.c alberto.botti@gmail.com-20090523141639-btaidciozs00n72k
rgc/src/connection/rgc_protocol_client.h alberto.botti@gmail.com-20090523141639-btaidciozs00n72k
rgc/src/connection/rgc_protocol_server.c alberto.botti@gmail.com-20090306143652-vce6aj4qhdsnato6
rgc/src/connection/rgc_protocol_server.h alberto.botti@gmail.com-20090306143652-vce6aj4qhdsnato6
rgc/src/server/rgc_signal.c alberto.botti@gmail.com-20090204203706-s4k8dta7qo2zk9xr
rgc/test/Makefile.am alberto.botti@gmail.com-20090523135405-4zsipgk3oj869376
rgc/test/Makefile.in alberto.botti@gmail.com-20090523135405-4zsipgk3oj869376
rgc/test/check_query.c alberto.botti@gmail.com-20090309202859-cexjc99k235vxl9c
rgc/test/check_rbp.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/test/check_remote_obj.c alberto.botti@gmail.com-20090309202859-cexjc99k235vxl9c
bzr:text-revisions:

rgc/include/client/rgc_client.h alberto.botti@gmail.com-20090522085825-x7p3tnbyznz5h32l
rgc/include/client/rgc_remote_object.h alberto.botti@gmail.com-20090523141639-btaidciozs00n72k
rgc/include/connection/rgc_protocol_client.h alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/include/connection/rgc_protocol_server.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/client/rgc_client_cmd.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/client/rgc_info.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/client/rgc_info.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/client/rgc_query.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/client/rgc_remote_object.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/client/rgc_remote_signal.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/client/rgc_remote_signal.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/common/rgc_utils.h alberto.botti@gmail.com-20090522130348-njo1fsfpichievhw
rgc/src/connection/dbus/rgc_protocol_dbus_server.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rbp/rbp_message.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rbp/rbp_message.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rbp/rbp_message_execute_client.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rbp/rbp_message_execute_server.c alberto.botti@gmail.com-20090522085825-x7p3tnbyznz5h32l
rgc/src/connection/rbp/rbp_message_lowlevel.c alberto.botti@gmail.com-20090522225944-idvciojo63rw7wgz
rgc/src/connection/rbp/rbp_message_string.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rbp/rgc_protocol_rbp_client.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rbp/rgc_protocol_rbp_server.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rgc_connection_client.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rgc_connection_client.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rgc_connection_server.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rgc_connection_server.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rgc_protocol_client.c alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rgc_protocol_client.h alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/src/connection/rgc_protocol_server.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/connection/rgc_protocol_server.h alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/src/server/rgc_signal.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/test/Makefile.am alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/test/Makefile.in alberto.botti@gmail.com-20090524203640-94hhlog30bihb0j8
rgc/test/check_query.c alberto.botti@gmail.com-20090522225944-idvciojo63rw7wgz
rgc/test/check_rbp.c alberto.botti@gmail.com-20090525195143-anhz3032v51q4h5p
rgc/test/check_remote_obj.c alberto.botti@gmail.com-20090522085825-x7p3tnbyznz5h32l
bzr:timestamp:
2009-05-25 21:54:10.654000044 +0200
bzr:user-agent:
bzr1.13.1+bzr-svn0.5.3
svn:original-date:
2009-05-25T19:54:10.654000Z
Message:

Fix memory leaks and update call signature for the RbpMessages?.
Add unit tests for RbpMessage?.

Location:
trunk/rgc
Files:
1 added
34 modified

Legend:

Unmodified
Added
Removed
  • trunk/rgc/include/client/rgc_client.h

    r283 r289  
    1414void 
    1515rgc_client_set_message_cb               (RgcMessageCb   cb); 
     16 
     17 
     18/* FIXME: this shouldn't be here */ 
     19void 
     20rgc_info_table_dump                     (void); 
  • trunk/rgc/include/client/rgc_remote_object.h

    r286 r289  
    103103                                         const gchar    *method_name, 
    104104                                         guint          parameter_n, 
    105                                          GValueArray    *parameters); 
     105                                         GValueArray    *array); 
    106106 
    107107void 
  • trunk/rgc/include/connection/rgc_protocol_client.h

    r3 r289  
    3333                                         guint          parameters_n, 
    3434                                         gchar          **parameters, 
    35                                          GValueArray    *values); 
     35                                         GValue         **values); 
    3636 
    3737/*      void (*destroy_object)          (RgcProtocolClient *prot, 
     
    4646                                         const gchar    *method_name, 
    4747                                         guint          parameters_n, 
    48                                          GValueArray    *values); 
     48                                         GValue         **values); 
    4949 
    5050        void (*set_data)                (RgcProtocolClient *prot, 
     
    5252                                         guint          parameters_n, 
    5353                                         gchar          **parameters, 
    54                                          GValueArray    *values); 
     54                                         GValue         **values); 
    5555                                          
    5656        void (*query)                   (RgcProtocolClient *prot, 
  • trunk/rgc/include/connection/rgc_protocol_server.h

    r286 r289  
    2929                                         const gchar    *signal_name, 
    3030                                         guint          parameters_n, 
    31                                          GValueArray    *values); 
     31                                         GValue         **values); 
    3232                                          
    3333        void (*property_changed)        (RgcProtocolServer *prot, 
     
    4040                                         const gchar    *info_type, 
    4141                                         guint          n_values, 
    42                                          GValueArray    *values); 
     42                                         GValue         **values); 
    4343                                                 
    4444        void (*register_object)         (RgcProtocolServer *prot, 
  • trunk/rgc/src/client/rgc_client_cmd.c

    r25 r289  
    233233        gchar *point = (gchar *) string; 
    234234         
    235         guint properties_n = 0; 
    236         gchararray *array_properties = NULL; 
    237         GValueArray *array_values = NULL; 
     235//      guint properties_n = 0; 
     236//      gchararray *array_properties = NULL; 
     237//      GValueArray *array_values = NULL; 
    238238         
    239239         
     
    276276        /* Now the real mess */ 
    277277        switch (mess_type) { 
    278                 case RBP_CALL_METHOD: { 
     278                /*case RBP_CALL_METHOD: { 
    279279                        gchar *method_name = get_token (&point, '('); 
    280280                        if (!method_name) { 
     
    295295                         
    296296                        break; 
    297                 } 
    298                 case RBP_SET_DATA: { 
     297                }*/ 
     298                /*case RBP_SET_DATA: { 
    299299                        if (!parse_parameters (&point, &properties_n, &array_properties, &array_values, FALSE)) 
    300300                                return FALSE; 
     
    305305                         
    306306                        break; 
    307                 } 
    308                 case RBP_NEW: { 
     307                }*/ 
     308                /*case RBP_NEW: { 
    309309                        gchar *class_name = get_token (&point, '('); 
    310310                        if (!class_name != (strlen(class_name) == 0)) { 
     
    324324                         
    325325                        break; 
    326                 } 
     326                }*/ 
    327327/*              case RBP_DESTROY: 
    328328                        mess = (RgcMessage *) rgc_message_destroy_create (obj_name); 
  • trunk/rgc/src/client/rgc_info.c

    r288 r289  
    2525static gchar* 
    2626rgc_info_create_uid                     (const gchar    *obj_name, 
    27                                          const gchar    *type) 
     27                                         const gchar    *info_type, 
     28                                         const gchar    *info_detail) 
    2829{ 
    29         return g_strdup_printf ("%s/%s", obj_name, type); 
     30        return g_strdup_printf ("%s/%s/%s", obj_name, info_type, info_detail); 
    3031} 
    3132 
     
    3334void 
    3435rgc_info_append_cb                      (RgcRemoteObject *obj, 
    35                                          gchar          *info_name, 
     36                                         const gchar    *info_name, 
     37                                         const gchar    *info_detail, 
    3638                                         RgcInfoCallback handler, 
    3739                                         gpointer       handler_data, 
     
    5052        event->user_data = user_data; 
    5153 
    52         gchar *uid = rgc_info_create_uid (obj->obj_name, info_name); 
     54        gchar *uid = rgc_info_create_uid (obj->obj_name, info_name, info_detail); 
    5355 
    5456        GSList *list = g_hash_table_lookup (_rgc_info_table, uid); 
     
    6567void 
    6668rgc_info_cb_execute                     (const gchar    *obj_name, 
    67                                          const gchar    *type, 
     69                                         const gchar    *info_type, 
     70                                         const gchar    *info_detail, 
    6871                                         guint          n_values, 
    69                                          GValue         *values) 
     72                                         GValue         **values) 
    7073{ 
    71         gchar *uid = rgc_info_create_uid (obj_name, type); 
     74        gchar *uid = rgc_info_create_uid (obj_name, info_type, info_detail); 
    7275        GSList *list = g_hash_table_lookup (_rgc_info_table, uid); 
    7376 
    74         RgcRemoteObject *obj = NULL; /******************************************/ 
     77        g_print ("rgc_info_cb_execute: obj_name \"%s\" type \"%s\", detail \"%s\", list %p\n", 
     78                 obj_name, info_type, info_detail, list); 
     79 
     80        // FIXME: we should keep an hash table of RgcRemoteObjects and reuse them 
     81        RgcRemoteObject *obj = g_new0 (RgcRemoteObject, 1); 
     82        obj->obj_name = g_strdup (obj_name); 
    7583 
    7684        while (list) { 
     
    7886                g_assert (event); 
    7987 
    80                 (*(event->handler)) (obj, type, n_values, values, event->handler_data, 
     88                (*(event->handler)) (obj, info_type, info_detail, n_values, values, event->handler_data, 
    8189                                     event->c_marshaller, event->callback, event->user_data); 
    8290 
     
    128136 
    129137 
     138static void 
     139rgc_info_table_dump_foreach             (gpointer       key, 
     140                                         gpointer       value, 
     141                                         gpointer       user_data) 
     142{ 
     143        g_print ("\tkey \"%s\" value %p\n", (const gchar *) key, value); 
     144        GSList *list = (GSList *) value; 
     145        while (list) { 
     146                RgcInfoEvent *event = (RgcInfoEvent *) list->data; 
     147                 
     148                g_print ("\t\thandler %p callback %p\n", event->handler, event->callback); 
     149 
     150                list = list->next; 
     151        } 
     152} 
    130153 
    131154 
    132155void 
     156rgc_info_table_dump                     (void) 
     157{ 
     158        g_print ("_rgc_info_table dump:\n"); 
     159        g_hash_table_foreach (_rgc_info_table, rgc_info_table_dump_foreach, NULL); 
     160} 
     161 
     162 
     163void     
    133164rgc_info_obj_list_cb                    (RgcRemoteObject *obj, 
    134165                                         GValueArray    *array, 
     
    138169                                         gpointer       user_data) 
    139170{ 
    140  
    141171} 
  • trunk/rgc/src/client/rgc_info.h

    r288 r289  
    11typedef gboolean (*RgcInfoCallback)     (RgcRemoteObject *obj, 
    22                                         const gchar    *type, 
     3                                         const gchar    *detail, 
    34                                         guint          n_values, 
    4                                          GValue         *values, 
     5                                         GValue         **values, 
    56                                         gpointer       handler_data, 
    67                                         RgcCbMarshal   c_marshaller, 
     
    2728void 
    2829rgc_info_append_cb                      (RgcRemoteObject *obj, 
    29                                          gchar          *info_name, 
     30                                         const gchar    *info_name, 
     31                                         const gchar    *info_detail, 
    3032                                         RgcInfoCallback handler, 
    3133                                         gpointer       handler_data, 
     
    4648void 
    4749rgc_info_cb_execute                     (const gchar    *obj_name, 
    48                                          const gchar    *type, 
     50                                         const gchar    *info_type, 
     51                                         const gchar    *info_detail, 
    4952                                         guint          n_values, 
    50                                          GValue         *values); 
     53                                         GValue         **values); 
    5154 
    5255void 
  • trunk/rgc/src/client/rgc_query.c

    r288 r289  
    1717 
    1818 
    19 /*static void 
     19static gboolean 
    2020rgc_query_server_info_cb                (RgcRemoteObject *obj, 
    21                                          GValueArray    *array, 
    22                                          gpointer       cb_data, 
     21                                         const gchar    *type, 
     22                                         const gchar    *detail, 
     23                                         guint          n_values, 
     24                                         GValue         **values, 
     25                                         gpointer       handler_data, 
    2326                                         RgcCbMarshal   c_marshaller, 
    2427                                         GCallback      callback, 
    2528                                         gpointer       user_data) 
    2629{ 
    27         RgcQueryServerInfoCb cb = (RgcQueryServerInfoCb) cb_data;    // ehm... 
     30        RgcQueryServerInfoCb cb = (RgcQueryServerInfoCb) callback; 
    2831 
    29         const gchar *server_name = g_value_get_string (g_value_array_get_nth (array, 0)); 
    30         const gchar *server_desc = g_value_get_string (g_value_array_get_nth (array, 1)); 
     32        g_return_val_if_fail (n_values == 2, FALSE); 
     33 
     34        const gchar *server_name = g_value_get_string (values[0]); 
     35        const gchar *server_desc = g_value_get_string (values[1]); 
    3136 
    3237        (*cb) (server_name, server_desc, user_data); 
    33 }*/ 
     38 
     39        return FALSE; 
     40} 
    3441 
    3542 
     
    3845 
    3946void 
    40 rgc_query_server_info                   (RgcQueryServerInfoCb cb, 
    41                                          gpointer       data) 
     47rgc_query_server_info                   (RgcQueryServerInfoCb callback, 
     48                                         gpointer       user_data) 
    4249{ 
    4350        /*event_append (RGC_PENDING_EVENT_QUERY_SERVER_INFO, G_CALLBACK(cb), data, 
     
    4552        //rgc_info_append_cb (_rgc_internal, "QUERY_SERVER_INFO", rgc_query_server_info_cb, cb, NULL, NULL, data); 
    4653        g_print ("STUB: rgc_query_server_info\n"); 
     54 
     55        rgc_info_append_cb (_rgc_internal, "QUERY_SERVER_INFO", "", rgc_query_server_info_cb, 
     56                            NULL /*handler_data*/, NULL, G_CALLBACK (callback), user_data); 
    4757 
    4858        rgc_connection_client_query ("_RGC_INTERNAL", "QUERY_SERVER_INFO", ""); 
  • trunk/rgc/src/client/rgc_remote_object.c

    r288 r289  
    2828rgc_remote_object_created_cb            (RgcRemoteObject *obj, 
    2929                                         const gchar    *type, 
     30                                         const gchar    *detail, 
    3031                                         guint          n_values, 
    31                                          GValue         *values, 
     32                                         GValue         **values, 
    3233                                         gpointer       handler_data, 
    3334                                         RgcCbMarshal   c_marshaller, 
     
    4041        g_return_val_if_fail (data->proposed_name, TRUE); 
    4142 
    42         const gchar *real_name = g_value_get_string (values + 0); 
    43         const gchar *class_name = g_value_get_string (values + 1); 
    44         const gchar *proposed_name = g_value_get_string (values + 2); 
     43        const gchar *real_name = g_value_get_string (values[0]); 
     44        const gchar *class_name = g_value_get_string (values[1]); 
     45        const gchar *proposed_name = g_value_get_string (values[2]); 
    4546 
    4647        g_debug("Someone created a new object \"%s\", \"%s\" of class \"%s\"\n", 
     
    231232        event->proposed_name = g_strdup (obj_name); 
    232233 
    233         rgc_info_append_cb (_rgc_objects, "object_created", rgc_remote_object_created_cb, 
     234        rgc_info_append_cb (_rgc_objects, "object_created", "", rgc_remote_object_created_cb, 
    234235                            event, NULL, G_CALLBACK (callback), data);  
    235236 
    236         rgc_connection_client_create_object (obj_name, class_name, n_properties, properties, array); 
     237        GValue **values = g_new0 (GValue*, n_properties); 
     238        guint i; 
     239        for (i = 0; i < n_properties; i++) 
     240                values[i] = array->values + i; 
     241     
     242        rgc_connection_client_create_object (obj_name, class_name, n_properties, properties, values); 
     243 
     244        g_free (values); 
    237245         
    238246        return TRUE; 
     
    303311                                         GValueArray    *array) 
    304312{ 
    305         rgc_connection_client_set_data(rgc_obj->obj_name, n_properties, properties, array); 
     313        GValue **values = g_new0 (GValue*, n_properties); 
     314        guint i; 
     315        for (i = 0; i < n_properties; i++) 
     316                values[i] = array->values + i; 
     317     
     318        rgc_connection_client_set_data (rgc_obj->obj_name, n_properties, properties, values); 
     319 
     320        g_free (values); 
    306321} 
    307322 
     
    349364                                         GValueArray    *array) 
    350365{ 
    351         rgc_connection_client_call_method(rgc_obj->obj_name, method_name, n_parameters, array); 
     366        GValue **values = g_new0 (GValue*, n_parameters); 
     367        guint i; 
     368        for (i = 0; i < n_parameters; i++) 
     369                values[i] = array->values + i; 
     370     
     371        rgc_connection_client_call_method(rgc_obj->obj_name, method_name, n_parameters, values); 
     372 
     373        g_free (values); 
    352374} 
    353375 
     
    371393 
    372394 
    373 /*static void 
     395static gboolean 
    374396rgc_remote_object_notify_cb             (RgcRemoteObject *obj, 
    375                                          GValueArray    *array, 
    376                                          gpointer       cb_data, 
     397                                         const gchar    *type, 
     398                                         const gchar    *detail, 
     399                                         guint          n_values, 
     400                                         GValue         **values, 
     401                                         gpointer       handler_data, 
    377402                                         RgcCbMarshal   c_marshaller, 
    378403                                         GCallback      callback, 
    379404                                         gpointer       user_data) 
    380405{ 
    381         RgcRemoteObjectNotifyFunc cb = (RgcRemoteObjectNotifyFunc) cb_data;    // ehm... 
    382  
    383         const gchar *server_name = g_value_get_string (g_value_array_get_nth (array, 0)); 
    384  
    385         (*cb) (obj, server_name, g_value_array_get_nth (array, 1), user_data); 
    386 }*/ 
     406        RgcRemoteObjectNotifyFunc cb = (RgcRemoteObjectNotifyFunc) callback; 
     407 
     408        g_print ("cb %p obj %p detail %s value %p user_data %p\n", cb, obj, detail, values, user_data); 
     409     
     410        (*cb) (obj, detail, values[0], user_data); 
     411 
     412        /*const gchar *server_name = g_value_get_string (g_value_array_get_nth (array, 0)); 
     413 
     414        (*cb) (obj, server_name, g_value_array_get_nth (array, 1), user_data);*/ 
     415 
     416        return FALSE; 
     417} 
     418 
     419 
    387420 
    388421 
     
    393426                                         gpointer       user_data) 
    394427{ 
    395         g_print ("STUB: rgc_remote_object_property_changed_notify\n"); 
     428        rgc_info_append_cb (rgc_obj, "_NOTIFY", property_name, rgc_remote_object_notify_cb, 
     429                            NULL /*handler_data*/, NULL, G_CALLBACK (callback), user_data); 
     430     
    396431        //rgc_info_append_cb (rgc_obj, "_NOTIFY", rgc_remote_object_notify_cb, callback, NULL, NULL, user_data); 
    397432        //rgc_info_append_cb (rgc_obj, "_NOTIFY", rgc_remote_object_notify_cb, event, NULL, G_CALLBACK (callback), data);  
  • trunk/rgc/src/client/rgc_remote_signal.c

    r152 r289  
    2121void 
    2222rgc_callback_call                       (RgcCallback    *cb, 
    23                                          GValueArray    *parameters) 
     23                                         guint          n_parameters, 
     24                                         GValue         **values) 
    2425{ 
    25         GValue **param_values; 
    26         param_values = g_new0 (GValue*, 16); 
    27         gint i; 
     26        /* FIXME: validate parameters */ 
    2827 
    29         /* FIXME: validate parameters */ 
    30          
    31         for (i = 0; i < parameters->n_values; i++) { 
    32                 param_values[i] = g_value_array_get_nth (parameters, i); 
    33         } 
    34  
    35         (*cb->c_marshaller) (cb->obj, parameters->n_values, param_values, 
     28        (*cb->c_marshaller) (cb->obj, n_parameters, values, 
    3629                             cb->callback, cb->user_data); 
    37  
    38         g_free (param_values); 
    3930} 
    4031 
  • trunk/rgc/src/client/rgc_remote_signal.h

    r3 r289  
    1313void 
    1414rgc_callback_call                       (RgcCallback    *cb, 
    15                                          GValueArray    *parameters); 
     15                                         guint          n_parameters, 
     16                                         GValue         **values); 
    1617 
    1718RgcCallback * 
  • trunk/rgc/src/common/rgc_utils.h

    r288 r289  
    22g_value_init_int                        (gint           i); 
    33 
     4inline GValue * 
     5g_value_init_boolean                    (gint           i); 
    46 
    57inline GValue * 
  • trunk/rgc/src/connection/dbus/rgc_protocol_dbus_server.c

    r286 r289  
    5555                                         const gchar    *signal_name, 
    5656                                         guint          parameters_n, 
    57                                          GValueArray    *values); 
     57                                         GValue         **values); 
    5858 
    5959static void 
     
    6262                                         const gchar    *info_type, 
    6363                                         guint          n_values, 
    64                                          GValueArray    *values); 
     64                                         GValue         **values); 
    6565 
    6666static void 
     
    356356                                         const gchar    *signal_name, 
    357357                                         guint          parameters_n, 
    358                                          GValueArray    *values) 
     358                                         GValue         **values) 
    359359{ 
    360360        /*DbusMessage *mess = (DbusMessage *) dbus_message_cb_create (obj_name, signal_name, 
     
    373373                                         const gchar    *info_type, 
    374374                                         guint          n_values, 
    375                                          GValueArray    *values) 
     375                                         GValue         **values) 
    376376{ 
    377377        /*DbusMessage *mess = (DbusMessage *) dbus_message_info_create (obj_name, info_type, 
  • trunk/rgc/src/connection/rbp/rbp_message.c

    r285 r289  
    33#include <string.h> 
    44 
     5#include "../../common/rgc_utils.h" 
    56#include "rbp_message.h" 
    67#include "rbp_message_lowlevel.h" 
    78 
    89 
    9 /* FIXME: obj_name should be copied each time */        // FINIRE!!!! 
    10  
    1110RbpMessageCall * 
    1211rbp_message_call_create                 (const gchar    *obj_name, 
    13                                          const gchar    *method, 
     12                                         const gchar    *method_name, 
    1413                                         guint          n_parameters, 
    15                                          GValueArray    *values) 
     14                                         GValue         **values) 
    1615{ 
    1716        RbpMessageCall *mess; 
     
    1918         
    2019        mess->message.type = RBP_CALL_METHOD; 
    21         mess->message.obj_name = g_strdup (obj_name); 
    22          
    23         mess->method_name = g_strdup (method); 
     20        mess->message.obj_name = (gchar *) obj_name; 
     21         
     22        mess->method_name = (gchar *) method_name; 
    2423        mess->n_parameters = n_parameters; 
    2524        mess->values = values; 
    2625         
    27         return (mess); 
     26        return mess; 
    2827} 
    2928 
     
    3332                                         guint          n_properties, 
    3433                                         gchar          **properties, 
    35                                          GValueArray    *values) 
     34                                         GValue         **values) 
    3635{ 
    3736        RbpMessageData *mess; 
     
    3938         
    4039        mess->message.type = RBP_SET_DATA; 
    41         mess->message.obj_name = g_strdup (obj_name); 
     40        mess->message.obj_name = (gchar *) obj_name; 
    4241         
    4342        mess->n_properties = n_properties; 
     
    4544        mess->values = values; 
    4645         
    47         return (mess); 
     46        return mess; 
    4847} 
    4948 
     
    5453                                         guint          n_properties, 
    5554                                         gchar          **properties, 
    56                                          GValueArray    *values) 
     55                                         GValue         **values) 
    5756{ 
    5857        RbpMessageNew *mess; 
     
    6059         
    6160        mess->message.type = RBP_NEW; 
    62         mess->message.obj_name = g_strdup (obj_name); 
    63          
    64         mess->class_name = g_strdup (class_name); 
     61        mess->message.obj_name = (gchar *) obj_name; 
     62         
     63        mess->class_name = (gchar *) class_name; 
    6564 
    6665        mess->n_properties = n_properties; 
    6766        mess->properties = properties; 
    68         mess->values = values;                  // FIXME: we don't own "values", so we 
    69                                                 // shouldn't destroy it later 
    70          
    71         return (mess); 
     67        mess->values = values; 
     68         
     69        return mess; 
    7270} 
    7371 
     
    8179         
    8280        mess->message.type = RBP_REF; 
    83         mess->message.obj_name = g_strdup (obj_name); 
     81        mess->message.obj_name = (gchar *) obj_name; 
    8482         
    8583        mess->increase = increase; 
    8684         
    87         return (mess); 
     85        return mess; 
    8886} 
    8987 
     
    9896         
    9997        mess->message.type = RBP_QUERY; 
    100         mess->message.obj_name = g_strdup (obj_name); 
     98        mess->message.obj_name = (gchar *) obj_name; 
    10199                 
    102         mess->query_type = g_strdup (query_type); 
    103         mess->about = g_strdup (about); 
     100        mess->query_type = (gchar *) query_type; 
     101        mess->about = (gchar *) about; 
    104102         
    105103        return mess; 
     
    111109                                         const gchar    *signal_name, 
    112110                                         guint          n_parameters, 
    113                                          GValueArray    *values) 
     111                                         GValue         **values) 
    114112{ 
    115113        RbpMessageCallBack *mess; 
     
    117115         
    118116        mess->message.type = RBP_CALLBACK; 
    119         mess->message.obj_name = g_strdup(obj_name); 
    120          
    121         mess->signal_name = g_strdup(signal_name); 
     117        mess->message.obj_name = (gchar *) obj_name; 
     118         
     119        mess->signal_name = (gchar *) signal_name; 
    122120        mess->n_parameters = n_parameters; 
    123121        mess->values = values; 
    124122         
    125         return (mess); 
     123        return mess; 
    126124} 
    127125 
     
    130128rbp_message_info_create                 (const gchar    *obj_name, 
    131129                                         const gchar    *info_type, 
     130                                         const gchar    *info_detail, 
    132131                                         guint          n_values, 
    133                                          GValueArray    *values) 
     132                                         GValue         **values) 
    134133{ 
    135134        RbpMessageInfo *mess; 
     
    137136         
    138137        mess->message.type = RBP_INFO; 
    139         mess->message.obj_name = g_strdup(obj_name); 
    140                  
    141         mess->info_type = g_strdup(info_type); 
     138        mess->message.obj_name = (gchar *) obj_name; 
     139 
     140        mess->info_type = (gchar *) info_type; 
     141        mess->info_detail = (gchar *) info_detail; 
    142142        mess->n_values = n_values; 
    143143        mess->values = values; 
    144144 
    145         return (mess); 
    146 } 
    147  
    148  
     145        return mess; 
     146} 
     147 
     148 
     149/* frees the message and its allocated members */ 
    149150void 
    150151rbp_message_destroy                     (RbpMessage     *mess) 
    151152{ 
    152         g_free (mess->obj_name); 
     153        g_free (mess); 
     154} 
     155 
     156 
     157/* frees the message only */ 
     158void 
     159rbp_message_destroy_with_contents       (RbpMessage     *mess) 
     160{ 
     161        guint i; 
     162        g_free (mess->obj_name); 
    153163         
    154164        switch (mess->type) { 
     
    156166                        RbpMessageCall *mess_call; 
    157167                        mess_call = (RbpMessageCall *) mess; 
    158                         g_free(mess_call->method_name); 
    159                         g_value_array_free(mess_call->values); 
    160                         break; 
     168                        g_free (mess_call->method_name); 
     169                        for (i = 0; i < mess_call->n_parameters; i++) { 
     170                                g_value_destroy (mess_call->values[i]); 
     171                        } 
     172                        g_free (mess_call->values); 
     173                        break; 
     174                     
    161175                } case RBP_SET_DATA: { 
    162176                        RbpMessageData *mess_data; 
    163177                        mess_data = (RbpMessageData *) mess; 
    164                         g_strfreev (mess_data->properties); 
    165                         g_value_array_free(mess_data->values); 
    166                         break; 
     178                        for (i = 0; i < mess_data->n_properties; i++) { 
     179                                g_free (mess_data->properties[i]); 
     180                                g_value_destroy (mess_data->values[i]); 
     181                        } 
     182                        g_free (mess_data->properties); 
     183                        g_free (mess_data->values); 
     184                        break; 
     185                     
    167186                } case RBP_NEW: { 
    168                         RbpMessageNew *mess_new; 
     187                        RbpMessageNew *mess_new; 
    169188                        mess_new = (RbpMessageNew *) mess; 
    170                         g_free(mess_new->class_name); 
    171                         g_strfreev(mess_new->properties); 
    172                         g_value_array_free(mess_new->values); 
    173                         break; 
     189                        g_free (mess_new->class_name); 
     190                        for (i = 0; i < mess_new->n_properties; i++) { 
     191                                g_free (mess_new->properties[i]); 
     192                                g_value_destroy (mess_new->values[i]); 
     193                        } 
     194                        g_free (mess_new->properties); 
     195                        g_free (mess_new->values); 
     196                        break; 
     197                     
    174198                } case RBP_REF: { 
    175199                        break; 
     200                     
    176201                } case RBP_QUERY: { 
    177202                        RbpMessageQuery *mess_query; 
    178203                        mess_query = (RbpMessageQuery *) mess; 
    179                         g_free(mess_query->query_type); 
    180                         g_free(mess_query->about); 
    181                         break; 
     204                        g_free (mess_query->query_type); 
     205                        g_free (mess_query->about); 
     206                        break; 
     207                     
    182208                } case RBP_CALLBACK: { 
    183209                        RbpMessageCallBack *mess_cb; 
    184210                        mess_cb = (RbpMessageCallBack *) mess; 
    185                         g_free(mess_cb->signal_name); 
    186                         g_value_array_free(mess_cb->values); 
    187                         break; 
     211                        g_free (mess_cb->signal_name); 
     212                        for (i = 0; i < mess_cb->n_parameters; i++) { 
     213                                g_value_destroy (mess_cb->values[i]); 
     214                        } 
     215                        g_free (mess_cb->values); 
     216                        break; 
     217                     
    188218                } case RBP_INFO: { 
    189219                        RbpMessageInfo *mess_info; 
    190220                        mess_info = (RbpMessageInfo *) mess; 
    191221                        g_free(mess_info->info_type); 
    192                         g_value_array_free(mess_info->values); 
    193                         break; 
     222                        g_free(mess_info->info_detail); 
     223                        for (i = 0; i < mess_info->n_values; i++) { 
     224                                g_value_destroy (mess_info->values[i]); 
     225                        }                    
     226                        g_free (mess_info->values); 
     227                        break; 
     228                     
    194229                } 
    195230                default: 
    196                         g_assert_not_reached(); 
     231                        g_assert_not_reached (); 
    197232        } 
    198233        g_free (mess); 
     
    211246        gint i; 
    212247        gchar *obj_name; 
     248//      gchar *str_tmp; 
    213249        gshort a_short; 
    214250         
     
    224260                        pos = read_binary_to_short (mem, pos, &a_short); 
    225261                        mess_call->n_parameters = (gint) a_short; 
    226                         mess_call->values = g_value_array_new(a_short + 1); 
    227          
    228                         for (i = 0; i < mess_call->n_parameters; i++){ 
     262                     
     263                        if (mess_call->n_parameters > 0) 
     264                                mess_call->values = g_new0 (GValue *, a_short); 
     265         
     266                        for (i = 0; i < mess_call->n_parameters; i++) { 
    229267                                pos = read_binary_to_g_value (ptr, pos, &temp); 
    230                                 mess_call->values = g_value_array_append(mess_call->values, temp); 
     268                                mess_call->values[i] = temp; 
    231269                        } 
    232270                         
     
    239277                        pos = read_binary_to_short (mem, pos, &a_short); 
    240278                        mess_data->n_properties = (gint) a_short; 
    241                         mess_data->properties = g_new0 (gchar*, a_short + 1); 
    242                         mess_data->values = g_value_array_new(a_short + 1); 
    243          
    244                         for (i = 0; i < mess_data->n_properties; i++) { 
     279 
     280                        if (mess_data->n_properties > 0) { 
     281                                mess_data->properties = g_new0 (gchar*, a_short); 
     282                                mess_data->values = g_new0 (GValue *, a_short); 
     283                        }                        
     284 
     285                        for (i = 0; i < mess_data->n_properties; i++) 
    245286                                pos = read_binary_to_string (ptr, pos, &(mess_data->properties[i])); 
    246                         } 
    247287                         
    248288                        for (i = 0; i < mess_data->n_properties; i++) { 
    249289                                pos = read_binary_to_g_value (ptr, pos, &temp); 
    250                                 mess_data->values = g_value_array_append(mess_data->values, temp); 
     290                                mess_data->values[i] = temp; 
    251291                        } 
    252292 
     
    256296                case RBP_NEW: {  
    257297                        RbpMessageNew *mess_new = g_new0 (RbpMessageNew, 1); 
    258                          
     298 
    259299                        pos = read_binary_to_string (mem, pos, &(mess_new->class_name)); 
    260300                        pos = read_binary_to_short (mem, pos, &a_short); 
    261301                         
    262302                        mess_new->n_properties = (gint) a_short; 
    263                         mess_new->properties = g_new0 (gchar*, a_short + 1); 
    264                         mess_new->values = g_value_array_new(a_short + 1); 
    265  
    266                         for (i = 0; i < mess_new->n_properties; i++) { 
     303                        if (mess_new->n_properties > 0) { 
     304                                mess_new->properties = g_new0 (gchar*, a_short); 
     305                                mess_new->values = g_new0 (GValue *, a_short); 
     306                        } 
     307 
     308                        for (i = 0; i < mess_new->n_properties; i++) 
    267309                                pos = read_binary_to_string (ptr, pos, &(mess_new->properties[i])); 
    268                         } 
    269                          
    270                         for (i = 0; i < mess_new->n_properties; i++){ 
     310                         
     311                        for (i = 0; i < mess_new->n_properties; i++){; 
    271312                                pos = read_binary_to_g_value (ptr, pos, &temp); 
    272                                 mess_new->values = g_value_array_append(mess_new->values, temp); 
     313                                mess_new->values[i] = temp; 
    273314                        } 
    274315                         
     
    299340                        pos = read_binary_to_short (mem, pos, &a_short); 
    300341                        mess_cb->n_parameters = (gint) a_short; 
    301                         mess_cb->values = g_value_array_new(a_short + 1); 
     342 
     343                        if (mess_cb->n_parameters > 0) 
     344                                mess_cb->values = g_new0 (GValue *, a_short); 
    302345         
    303346                        for (i = 0; i < mess_cb->n_parameters; i++){ 
    304347                                pos = read_binary_to_g_value (ptr, pos, &temp); 
    305                                 mess_cb->values = g_value_array_append(mess_cb->values, temp); 
    306                                 g_free (temp); 
     348                                mess_cb->values[i] = temp; 
    307349                        } 
    308350                         
     
    314356                         
    315357                        pos = read_binary_to_string(mem, pos, &(mess_info->info_type)); 
     358                        pos = read_binary_to_string(mem, pos, &(mess_info->info_detail)); 
    316359                        pos = read_binary_to_short (mem, pos, &a_short); 
    317360                        mess_info->n_values = (gint) a_short; 
    318                         mess_info->values = g_value_array_new(a_short + 1); 
     361 
     362                        if (mess_info->n_values > 0) 
     363                                mess_info->values = g_new0 (GValue *, a_short); 
    319364                         
    320365                        for (i = 0; i < mess_info->n_values; i++){ 
    321366                                pos = read_binary_to_g_value (ptr, pos, &temp); 
    322                                 mess_info->values = g_value_array_append(mess_info->values, temp); 
     367                                mess_info->values[i] = temp; 
    323368                        } 
    324369                         
     
    361406                        pos = write_short_to_binary (ptr, pos, (gshort) mess_call->n_parameters); 
    362407         
    363                         for (i = 0; i < mess_call->n_parameters; i++){ 
    364                                 pos = write_g_value_to_binary (ptr, pos, g_value_array_get_nth(mess_call->values, i)); 
    365                         } 
    366                          
    367                         /*for (i = 0; i < mess_call->parameter_n; i++){ 
    368                                 pos = write_string_to_binary (ptr, pos, 
    369                                         g_value_array_get_nth (mess_data->properties, i)); 
    370                         }*/ 
     408                        for (i = 0; i < mess_call->n_parameters; i++) 
     409                                pos = write_g_value_to_binary (ptr, pos, mess_call->values[i]); 
     410                         
    371411                        break; 
    372412                } case RBP_SET_DATA: {   
     
    374414                        pos = write_short_to_binary (ptr, pos, (gshort) mess_data->n_properties); 
    375415 
    376                         for (i = 0; i < mess_data->n_properties; i++){ 
     416                        for (i = 0; i < mess_data->n_properties; i++) 
    377417                                pos = write_string_to_binary (ptr, pos, mess_data->properties[i]); 
    378                         } 
    379          
    380                         for (i = 0; i < mess_data->n_properties; i++){ 
    381                                 pos = write_g_value_to_binary (ptr, pos, g_value_array_get_nth(mess_data->values, i)); 
    382                         } 
     418         
     419                        for (i = 0; i < mess_data->n_properties; i++) 
     420                                pos = write_g_value_to_binary (ptr, pos, mess_data->values[i]); 
     421 
    383422                        break; 
    384423                } case RBP_NEW: { 
     
    389428                        pos = write_short_to_binary (ptr, pos, mess_new->n_properties); 
    390429                         
    391                         for (i = 0; i < mess_new->n_properties; i++){ 
     430                        for (i = 0; i < mess_new->n_properties; i++) 
    392431                                pos = write_string_to_binary (ptr, pos, mess_new->properties[i]); 
    393                         } 
    394          
    395                         for (i = 0; i < mess_new->n_properties; i++){ 
    396                                 pos = write_g_value_to_binary (ptr, pos, g_value_array_get_nth(mess_new->values, i)); 
    397                         } 
     432         
     433                        for (i = 0; i < mess_new->n_properties; i++) 
     434                                pos = write_g_value_to_binary (ptr, pos, mess_new->values[i]); 
     435 
    398436                        break; 
    399437                /*} case RBP_DESTROY: { 
     
    423461                        pos = write_short_to_binary (ptr, pos, (gshort) mess_cb->n_parameters); 
    424462         
    425                         for (i = 0; i < mess_cb->n_parameters; i++){ 
    426                                 pos = write_g_value_to_binary (ptr, pos, g_value_array_get_nth(mess_cb->values, i)); 
    427                         } 
    428                          
    429                         /*for (i = 0; i < mess_call->parameter_n; i++){ 
    430                                 pos = write_string_to_binary (ptr, pos, 
    431                                         g_value_array_get_nth (mess_data->properties, i)); 
    432                         }*/ 
     463                        for (i = 0; i < mess_cb->n_parameters; i++) 
     464                                pos = write_g_value_to_binary (ptr, pos, mess_cb->values[i]); 
     465                         
    433466                        break; 
    434467                } case RBP_INFO: { 
     
    437470                         
    438471                        pos = write_string_to_binary (ptr, pos, mess_info->info_type); 
     472                        pos = write_string_to_binary (ptr, pos, mess_info->info_detail); 
    439473                        pos = write_short_to_binary (ptr, pos, (gshort) mess_info->n_values); 
    440474                         
    441                         for (i = 0; i < mess_info->n_values; i++){ 
    442                                 pos = write_g_value_to_binary (ptr, pos, g_value_array_get_nth(mess_info->values, i)); 
    443                         }                        
     475                        for (i = 0; i < mess_info->n_values; i++) 
     476                                pos = write_g_value_to_binary (ptr, pos, mess_info->values[i]); 
     477 
    444478                        break; 
    445479                         
  • trunk/rgc/src/connection/rbp/rbp_message.h

    r22 r289  
    2424        guint           type; 
    2525        gchar           *obj_name; 
     26        gboolean        allocated;      // gchar** and Values* must be freed 
    2627}; 
    2728 
     
    3031        gchar           *method_name; 
    3132        guint           n_parameters; 
    32         GValueArray     *values; 
     33        GValue          **values; 
    3334}; 
    3435 
     
    3738        guint           n_properties; 
    3839        gchar           **properties; 
    39         GValueArray     *values; 
     40        GValue          **values; 
    4041}; 
    4142 
     
    4546        guint           n_properties; 
    4647        gchar           **properties; 
    47         GValueArray     *values; 
     48        GValue          **values; 
    4849}; 
    4950 
     
    6364        gchar           *signal_name; 
    6465        guint           n_parameters; 
    65         GValueArray     *values; 
     66        GValue          **values; 
    6667}; 
    6768 
     
    6970        RbpMessage      message; 
    7071        gchar           *info_type; 
     72        gchar           *info_detail; 
    7173        guint           n_values; 
    72         GValueArray     *values; 
     74        GValue          **values; 
    7375}; 
    7476 
     
    7678RbpMessageCall * 
    7779rbp_message_call_create                 (const gchar    *obj_name, 
    78                                          const gchar    *method, 
     80                                         const gchar    *method_name, 
    7981                                         guint          n_parameters, 
    80                                          GValueArray    *values); 
     82                                         GValue         **values); 
    8183 
    8284RbpMessageData * 
     
    8486                                         guint          n_properties, 
    8587                                         gchar          **properties, 
    86                                          GValueArray    *values); 
     88                                         GValue         **values); 
    8789 
    8890RbpMessageNew * 
     
    9193                                         guint          n_properties, 
    9294                                         gchar          **properties, 
    93                                          GValueArray    *values); 
     95                                         GValue         **values); 
    9496 
    9597RbpMessageRef * 
     
    106108                                         const gchar    *signal_name, 
    107109                                         guint          n_parameters, 
    108                                          GValueArray    *parameters); 
     110                                         GValue         **values); 
    109111 
    110112RbpMessageInfo * 
    111113rbp_message_info_create                 (const gchar    *obj_name, 
    112114                                         const gchar    *info_type, 
     115                                         const gchar    *info_detail, 
    113116                                         guint          n_values, 
    114                                          GValueArray    *values); 
     117                                         GValue         **values); 
    115118 
    116119// private 
     
    130133 
    131134// private 
    132 /* Destroys a RbpMessage and frees all the memory associated with it. */ 
    133135void 
    134136rbp_message_destroy                     (RbpMessage     *mess); 
    135137 
     138void 
     139rbp_message_destroy_with_contents       (RbpMessage     *mess); 
    136140 
    137141 
  • trunk/rgc/src/connection/rbp/rbp_message_execute_client.c

    r283 r289  
    5050        } 
    5151         
    52 //      g_print("<<< %s\n", rbp_message_to_string (mess)); 
     52        g_print("\033[1;31mCLIENT IN  >>> %s\033[00m\n", rbp_message_to_string (mess)); 
    5353 
    5454        switch (mess->type) { 
    5555                case RBP_CALLBACK: { 
    5656                        RbpMessageCallBack *mess_cb = (RbpMessageCallBack *) mess; 
    57                         rgc_connection_client_callback(mess->obj_name,   
    58                                                        mess_cb->signal_name, 
    59                                                        mess_cb->n_parameters, 
    60                                                        mess_cb->values); 
     57                        rgc_connection_client_callback (mess->obj_name,  
     58                                                        mess_cb->signal_name, 
     59                                                        mess_cb->n_parameters, 
     60                                                        mess_cb->values); 
    6161                        break; 
    6262                } 
    6363                case RBP_INFO: { 
    6464                        RbpMessageInfo *mess_info = (RbpMessageInfo *) mess; 
    65                         rgc_connection_client_info(mess->obj_name,       
    66                                                    mess_info->info_type, 
    67                                                    mess_info->n_values, 
    68                                                    mess_info->values); 
     65                        rgc_connection_client_info (mess->obj_name,      
     66                                                    mess_info->info_type, 
     67                                                    mess_info->info_detail, 
     68                                                    mess_info->n_values, 
     69                                                    mess_info->values); 
    6970                        break; 
    7071                } 
  • trunk/rgc/src/connection/rbp/rbp_message_execute_server.c

    r286 r289  
    4040                                         gpointer       data) 
    4141{ 
    42         g_print(">>> %s\n", rbp_message_to_string (mess)); 
     42        g_print("\033[31mSERVER IN  <<< %s\033[00m\n", rbp_message_to_string (mess)); 
    4343 
    4444        switch (mess->type) { 
  • trunk/rgc/src/connection/rbp/rbp_message_lowlevel.c

    r285 r289  
    7272 
    7373/* ... */ 
    74 /* FIXME: check ptr == NULL */ 
    7574inline gsize 
    7675write_string_to_binary                  (gchar          *ptr, 
     
    7877                                         gchar          *string) 
    7978{ 
    80         guint16 len = strlen (string); 
     79        guint16 len; 
     80        if (string) 
     81                len = strlen (string) + 1; 
     82        else 
     83                len = 0; 
    8184        guint16 l = GINT16_TO_ORDER(len); 
    8285        memcpy (ptr + pos, &l, sizeof (guint16)); 
    83         pos += sizeof (guint16);         
    84          
    85         memcpy (ptr + pos, string, len); 
    86         pos = pos + len + 1; 
    87          
    88         return (pos); 
     86        pos += sizeof (guint16); 
     87 
     88        if (string) { 
     89                memcpy (ptr + pos, string, len); 
     90                pos = pos + len; 
     91        } 
     92         
     93        return pos; 
    8994} 
    9095 
     
    202207        /* ****************************************************** */    /* ? */ 
    203208        guint16 val; 
     209        gchar *tmp = NULL; 
    204210        memcpy (&val, ptr + pos, sizeof (guint16)); 
    205211        guint16 len = GINT16_FROM_ORDER(val); 
    206212        pos += sizeof (guint16); 
    207213 
    208         gchar *tmp = g_new0 (gchar, len + 1);           // we're losing memory 
    209         memcpy (tmp, ptr + pos, len); 
    210         pos += len + 1; 
     214        if (len) { 
     215                tmp = g_new0 (gchar, len);              // we're losing memory 
     216                memcpy (tmp, ptr + pos, len); 
     217                pos += len; 
     218        } 
    211219 
    212220        *string = tmp; 
    213         return (pos); 
     221        return pos; 
    214222} 
    215223 
  • trunk/rgc/src/connection/rbp/rbp_message_string.c

    r22 r289  
    1818        gchar *signal = NULL; 
    1919        gchar *info = NULL; 
     20        gchar *detail = NULL; 
    2021        gchar *class_name = NULL; 
    2122        gchar *string = NULL; 
     
    3536                         
    3637                        for (i = 0; i < mess_call->n_parameters; i++) { 
    37                                 token = g_strdup_value_contents(g_value_array_get_nth(mess_call->values, i)); 
     38                                token = g_strdup_value_contents (mess_call->values[i]); 
    3839                                new_string = g_strconcat (str_params, token, NULL); 
    3940                                g_free (str_params); 
     
    6364                                str_params = new_string; 
    6465                         
    65                                 token = g_strdup_value_contents (g_value_array_get_nth(mess_data->values, i)); 
     66                                token = g_strdup_value_contents (mess_data->values[i]); 
    6667                                new_string = g_strconcat (str_params, token, NULL); 
    6768                                g_free (str_params); 
     
    99100                                token = NULL; 
    100101                         
    101                                 token = g_strdup_value_contents (g_value_array_get_nth(mess_new->values, i)); 
     102                                token = g_strdup_value_contents (mess_new->values[i]); 
    102103                                new_string = g_strconcat (str_params, token, NULL); 
    103104                                g_free (token); 
     
    142143                         
    143144                        for (i = 0; i < mess_cb->n_parameters; i++) { 
    144                                 token = g_strdup_value_contents(g_value_array_get_nth(mess_cb->values, i)); 
     145                                token = g_strdup_value_contents (mess_cb->values[i]); 
    145146                                new_string = g_strconcat (str_params, token, NULL); 
    146147                                g_free (str_params); 
     
    161162                        RbpMessageInfo *mess_info = (RbpMessageInfo *) mess; 
    162163                        info = mess_info->info_type; 
     164                        detail = mess_info->info_detail; 
    163165                         
    164166                        str_params = g_strdup (""); 
    165167                         
    166168                        for (i = 0; i < mess_info->n_values; i++) { 
    167                                 token = g_strdup_value_contents(g_value_array_get_nth(mess_info->values, i)); 
     169                                token = g_strdup_value_contents (mess_info->values[i]); 
    168170                                new_string = g_strconcat (str_params, token, NULL); 
    169171                                g_free (str_params); 
     
    178180                        } 
    179181                         
    180                         string = g_strconcat ("info ", obj_name, " ", info, " (", str_params, ")", NULL); 
     182                        string = g_strconcat ("info ", obj_name, " ", info, " ", detail, " (", str_params, ")", NULL); 
    181183                        break; 
    182184                }   
  • trunk/rgc/src/connection/rbp/rgc_protocol_rbp_client.c

    r286 r289  
    7676                                         guint          parameters_n, 
    7777                                         gchar          **parameters, 
    78                                          GValueArray    *values); 
     78                                         GValue         **values); 
    7979                                          
    8080/*static void 
     
    9292                                         const gchar    *method_name, 
    9393                                         guint          parameters_n, 
    94                                          GValueArray    *values); 
     94                                         GValue         **values); 
    9595 
    9696static void 
     
    9999                                         guint          parameters_n, 
    100100                                         gchar          **parameters, 
    101                                          GValueArray    *values); 
     101                                         GValue         **values); 
    102102 
    103103static void 
     
    352352        GError *error = NULL; 
    353353 
    354         g_print ("<<< %s\n", rbp_message_to_string (mess)); 
     354        g_print ("\033[1;31mCLIENT OUT <<< %s\033[00m\n", rbp_message_to_string (mess)); 
    355355 
    356356        GIOStatus status; 
     
    384384                                         guint          parameters_n, 
    385385                                         gchar          **parameters, 
    386                                          GValueArray    *values) 
     386                                         GValue         **values) 
    387387{ 
    388388        RbpMessage *mess = (RbpMessage *) rbp_message_new_create(obj_name, class_name, 
     
    412412                                         const gchar    *method_name, 
    413413                                         guint          parameters_n, 
    414                                          GValueArray    *values) 
     414                                         GValue         **values) 
    415415{ 
    416416        RbpMessage *mess = (RbpMessage *) rbp_message_call_create(obj_name, method_name, 
     
    427427                                         guint          parameters_n, 
    428428                                         gchar          **parameters, 
    429                                          GValueArray    *values) 
     429                                         GValue         **values) 
    430430{ 
    431431        RbpMessage *mess = (RbpMessage *) rbp_message_data_create(obj_name, parameters_n, 
  • trunk/rgc/src/connection/rbp/rgc_protocol_rbp_server.c

    r286 r289  
    2323#include "../../../include/connection/rbp/rgc_protocol_rbp_server.h" 
    2424#include "../../../include/common/rgc_utils.h" 
     25#include "../../common/rgc_utils.h" 
    2526#include "../rgc_protocol_server.h" 
    2627#include "rbp_message.h" 
     28#include "rbp_message_string.h" 
    2729#include "rbp_message_execute_server.h" 
    2830#include "rgc_protocol_rbp_common.h" 
     
    8284                                         const gchar    *signal_name, 
    8385                                         guint          parameters_n, 
    84                                          GValueArray    *values); 
     86                                         GValue         **values); 
    8587 
    8688static void 
     
    9597                                         const gchar    *info_type, 
    9698                                         guint          n_values, 
    97                                          GValueArray    *values); 
     99                                         GValue         **values); 
    98100 
    99101static void 
     
    206208rgc_protocol_rbp_server_dispose         (GObject        *object) 
    207209{ 
    208         g_print ("### rgc_protocol_rbp_server_dispose\n"); 
     210        g_print ("### rgc_protocol_rbp_server_dispose\n");      // FIXME: we sometimes get a segfault here  (?????) 
    209211} 
    210212 
     
    356358        priv->channels_cb_data = g_list_remove (priv->channels_cb_data, cb_data); 
    357359 
    358         g_free (cb_data); 
     360        // g_free (cb_data);    // client->client_socket, already freed in rgc_protocol_rbp_server_stop() 
    359361} 
    360362 
     
    453455        GIOStatus status; 
    454456 
     457        g_print ("\033[31mSERVER OUT >>> %s\033[00m\n", rbp_message_to_string (mess)); 
     458 
    455459        rbp_message_write(mess, &mem, &size); 
     460        //rgc_dump_binary       (mem, size); 
    456461         
    457462        GList *temp = priv->channels_cb_data; 
     
    486491                                         const gchar    *signal_name, 
    487492                                         guint          parameters_n, 
    488                                          GValueArray    *values) 
     493                                         GValue         **values) 
    489494{ 
    490495        RbpMessage *mess = (RbpMessage *) rbp_message_cb_create (obj_name, signal_name, 
     
    504509                                         GValue         *value) 
    505510{ 
    506         GValueArray *array = g_value_array_new (2); 
    507         GValue *val1 = g_value_init_string (g_strdup (property_name)); 
    508         array = g_value_array_append(array, val1); 
    509         array = g_value_array_append(array, value); 
    510  
    511         RbpMessage *mess = (RbpMessage *) rbp_message_info_create (obj_name, "_NOTIFY", 2, array); 
     511//      GValue *array = g_value_array_new (1); 
     512/*      GValue *val1 = g_value_init_string (g_strdup (property_name)); 
     513        array = g_value_array_append(array, val1);*/ 
     514//      array = g_value_array_append(array, value); 
     515 
     516        RbpMessage *mess = (RbpMessage *) rbp_message_info_create (obj_name, "_NOTIFY", property_name, 1, &value); 
    512517         
    513518        g_debug("server_property_changed... "); 
     
    523528                                         const gchar    *info_type, 
    524529                                         guint          n_values, 
    525                                          GValueArray    *values) 
    526 { 
    527         RbpMessage *mess = (RbpMessage *) rbp_message_info_create (obj_name, info_type, 
     530                                         GValue         **values) 
     531{ 
     532        RbpMessage *mess = (RbpMessage *) rbp_message_info_create (obj_name, info_type, "",  
    528533                                                                   n_values, values); 
    529534         
     
    540545                                         const gchar    *requested_name) 
    541546{ 
    542         GValueArray *array = g_value_array_new(3); 
    543         GValue *val1 = g_value_init_string(obj_name); 
    544         GValue *val2 = g_value_init_string(class_name); 
    545         GValue *val3 = g_value_init_string(requested_name); 
    546         array = g_value_array_append(array, val1); 
    547         array = g_value_array_append(array, val2); 
    548         array = g_value_array_append(array, val3); 
    549  
    550         RbpMessage *mess = (RbpMessage *) rbp_message_info_create ("_RGC_OBJECTS", "object_created", 3, array); 
     547        GValue **values = g_new0 (GValue *, 3); 
     548        GValue *val1 = g_value_init_string (obj_name); 
     549        GValue *val2 = g_value_init_string (class_name); 
     550        GValue *val3 = g_value_init_string (requested_name); 
     551        values[0] = val1; 
     552        values[1] = val2; 
     553        values[2] = val3; 
     554 
     555        RbpMessage *mess = (RbpMessage *) rbp_message_info_create ("_RGC_OBJECTS", "object_created", "", 3, values); 
    551556        rgc_protocol_rbp_server_send_message(RGC_PROTOCOL_RBP_SERVER(prot), mess); 
    552557        rbp_message_destroy(mess); 
    553558 
    554 /*      g_value_array_free(array); 
    555         g_free(val1); 
    556         g_free(val2); 
    557         g_free(val3);*/ 
     559        guint i; 
     560        for (i = 0; i < 3; i++) 
     561                g_value_destroy (values[i]); 
     562        g_free (values); 
    558563} 
    559564 
  • trunk/rgc/src/connection/rgc_connection_client.c

    r288 r289  
    6666                                         guint          n_parameters, 
    6767                                         gchar          **parameters, 
    68                                          GValueArray    *values) 
     68                                         GValue         **values) 
    6969{ 
    7070        g_return_if_fail(protocol_client); 
     
    9090                                         const gchar    *method_name, 
    9191                                         guint          n_parameters, 
    92                                          GValueArray    *values) 
     92                                         GValue         **values) 
    9393{ 
    9494        g_return_if_fail(protocol_client); 
     
    104104                                         guint          n_properties, 
    105105                                         gchar          **properties, 
    106                                          GValueArray    *values) 
     106                                         GValue         **values) 
    107107{ 
    108108        g_return_if_fail(protocol_client); 
     
    143143                                         const gchar    *signal_name, 
    144144                                         guint          n_parameters, 
    145                                          GValueArray    *values) 
     145                                         GValue         **values) 
    146146{ 
    147147        RgcCallback *cb = rgc_callback_lookup_by_name (obj_name, signal_name); 
    148148        if (cb) 
    149                 rgc_callback_call (cb, values); 
     149                rgc_callback_call (cb, n_parameters, values); 
    150150        else 
    151151                g_print ("    Callback for signal \"%s\" from object \"%s\" not registered\n", 
     
    157157rgc_connection_client_info              (const gchar    *obj_name, 
    158158                                         const gchar    *info_type, 
     159                                         const gchar    *info_detail, 
    159160                                         guint          n_values, 
    160                                          GValueArray    *values) 
     161                                         GValue         **values) 
    161162{ 
    162163        /*RgcInfoEvent *event = rgc_info_event_lookup_by_name (obj_name, info_type); 
     
    167168                         info_type, obj_name);*/ 
    168169 
    169         rgc_info_cb_execute (obj_name, info_type, n_values, values->values); 
     170        rgc_info_cb_execute (obj_name, info_type, info_detail, n_values, values); 
    170171} 
  • trunk/rgc/src/connection/rgc_connection_client.h

    r283 r289  
    77                                         guint          n_parameters, 
    88                                         gchar          **parameters, 
    9                                          GValueArray    *values); 
     9                                         GValue         **values); 
    1010 
    1111/*void 
     
    1616                                         const gchar    *method_name, 
    1717                                         guint          n_parameters, 
    18                                          GValueArray    *values); 
     18                                         GValue         **values); 
    1919                                          
    2020 
     
    2323                                         guint          n_properties, 
    2424                                         gchar          **properties, 
    25                                          GValueArray    *values); 
     25                                         GValue         **values); 
    2626                                          
    2727void 
     
    4141                                         const gchar    *signal_name, 
    4242                                         guint          n_parameters, 
    43                                          GValueArray    *values); 
     43                                         GValue         **values); 
    4444 
    4545void 
    4646rgc_connection_client_info              (const gchar    *obj_name, 
    4747                                         const gchar    *info_type, 
     48                                         const gchar    *info_detail, 
    4849                                         guint          n_values, 
    49                                          GValueArray    *values); 
     50                                         GValue         **values); 
  • trunk/rgc/src/connection/rgc_connection_server.c

    r286 r289  
    4646                rgc_protocol_server_stop (prot); 
    4747//              g_print ("prot %p unref\n", prot); 
    48                 g_object_unref (G_OBJECT (prot)); 
     48                g_object_unref (G_OBJECT (prot));       // FIXME: we sometimes get a segfault here 
    4949//              g_print ("next\n"); 
    5050                temp = temp->next; 
     
    152152                                         const gchar    *signal_name, 
    153153                                         guint          n_parameters, 
    154                                          GValueArray    *values) 
     154                                         GValue         **values) 
    155155{ 
    156156        GList *temp = protocol_list; 
     
    186186                                         const gchar    *info_type, 
    187187                                         guint          n_values, 
    188                                          GValueArray    *values) 
     188                                         GValue         **values) 
    189189{ 
    190190        GList *temp = protocol_list; 
     
    206206                                         guint          n_parameters, 
    207207                                         gchar          **parameters, 
    208                                          GValueArray    *values) 
     208                                         GValue         **values) 
    209209{ 
    210210        GParameter *param = g_new (GParameter, n_parameters); 
     
    213213        for (i = 0; i < n_parameters; i++) { 
    214214                param[i].name = parameters[i]; 
    215                 param[i].value = *(g_value_array_get_nth (values, i)); 
     215                memcpy (&(param[i].value), values[i], sizeof (GValue)); 
    216216        } 
    217217         
     
    248248                                         const gchar    *method_name, 
    249249                                         guint          n_parameters, 
    250                                          GValueArray    *array) 
     250                                         GValue         **values) 
    251251{ 
    252252        GObject *obj = rgc_object_get_from_name (obj_name); 
     
    263263        g_return_if_fail (method); 
    264264         
    265         GValue **values = g_new(GValue*, n_parameters); 
     265        /*GValue **values = g_new(GValue*, n_parameters); 
    266266        guint i; 
    267267        for (i = 0; i < n_parameters; i++) 
    268                 values[i] = g_value_array_get_nth(array, i); 
     268                values[i] = array[i];*/ 
    269269 
    270270        (*method->c_marshaller) (obj, method->n_params, values, 
     
    281281                                         guint          n_properties, 
    282282                                         gchar          **properties, 
    283                                          GValueArray    *values) 
     283                                         GValue         **values) 
    284284{ 
    285285        GObject *obj = rgc_object_get_from_name (obj_name); 
     
    289289        guint i; 
    290290        for (i = 0; i < n_properties; i++) { 
    291                 g_object_set_property (obj, properties[i], g_value_array_get_nth (values, i)); 
     291                g_object_set_property (obj, properties[i], values[i]); 
    292292                g_debug ("Set property \"%s\" on object \"%s\"\n", properties[i], obj_name); 
    293293        } 
     
    309309                        //rgc_info_server_info() // ????????????? 
    310310 
    311                         GValue *name = g_new0 (GValue, 1); 
     311                        /*GValue *name = g_new0 (GValue, 1); 
    312312                        GValue *desc = g_new0 (GValue, 1); 
    313313                        name = g_value_init (name, G_TYPE_STRING); 
    314314                        desc = g_value_init (desc, G_TYPE_STRING); 
    315315                        g_value_set_string (name, _rgc_server_name); 
    316                         g_value_set_string (desc, _rgc_server_desc); 
    317  
    318                         GValueArray *arr = g_value_array_new (2); 
    319                         arr = g_value_array_append (arr, name); 
    320                         arr = g_value_array_append (arr, desc); 
    321  
    322                         rgc_connection_server_send_info ("_RGC_INTERNAL", "QUERY_SERVER_INFO",  
    323                                          arr->n_values, arr); 
    324  
    325                         g_value_unset (name); 
    326                         g_value_unset (desc); 
     316                        g_value_set_string (desc, _rgc_server_desc);*/ 
     317                        GValue *name = g_value_init_string (_rgc_server_name); 
     318                        GValue *desc = g_value_init_string (_rgc_server_desc); 
     319 
     320                        GValue **values = g_new0 (GValue *, 2); 
     321                        values[0] = name; 
     322                        values[1] = desc; 
     323 
     324                        rgc_connection_server_send_info ("_RGC_INTERNAL", "QUERY_SERVER_INFO", 2, values); 
     325 
     326                        g_value_destroy (name); 
     327                        g_value_destroy (desc); 
     328                        g_free (values); 
    327329                         
    328330 
  • trunk/rgc/src/connection/rgc_connection_server.h

    r288 r289  
    2929                                         const gchar    *signal_name, 
    3030                                         guint          n_parameters, 
    31                                          GValueArray    *values); 
     31                                         GValue         **values); 
    3232 
    3333void 
     
    4040                                         const gchar    *info_type, 
    4141                                         guint          n_values, 
    42                                          GValueArray    *values); 
     42                                         GValue         **values); 
    4343 
    4444 
     
    5050                                         guint          n_parameters, 
    5151                                         gchar          **parameters, 
    52                                          GValueArray    *values); 
     52                                         GValue         **values); 
    5353 
    5454/*void 
     
    6363                                         const gchar    *method_name, 
    6464                                         guint          n_parameters, 
    65                                          GValueArray    *values); 
     65                                         GValue         **values); 
    6666                                          
    6767void 
     
    6969                                         guint          n_parameters, 
    7070                                         gchar          **parameters, 
    71                                          GValueArray    *values); 
     71                                         GValue         **values); 
    7272 
    7373void 
  • trunk/rgc/src/connection/rgc_protocol_client.c

    r3 r289  
    115115                                         guint          parameters_n, 
    116116                                         gchar          **parameters, 
    117                                          GValueArray    *values) 
     117                                         GValue         **values) 
    118118{ 
    119119        RgcProtocolClientClass *class = RGC_PROTOCOL_CLIENT_GET_CLASS(prot); 
     
    159159                                         const gchar    *method_name, 
    160160                                         guint          parameters_n, 
    161                                          GValueArray    *values) 
     161                                         GValue         **values) 
    162162{        
    163163        RgcProtocolClientClass *class = RGC_PROTOCOL_CLIENT_GET_CLASS(prot); 
     
    175175                                         guint          parameters_n, 
    176176                                         gchar          **parameters, 
    177                                          GValueArray    *values) 
     177                                         GValue         **values) 
    178178{ 
    179179        RgcProtocolClientClass *class = RGC_PROTOCOL_CLIENT_GET_CLASS(prot); 
  • trunk/rgc/src/connection/rgc_protocol_client.h

    r3 r289  
    1111                                         guint          parameters_n, 
    1212                                         gchar          **parameters, 
    13                                          GValueArray    *values); 
     13                                         GValue         **values); 
    1414 
    1515/*void 
     
    2727                                         const gchar    *method_name, 
    2828                                         guint          parameters_n, 
    29                                          GValueArray    *values); 
     29                                         GValue         **values); 
    3030 
    3131void 
     
    3434                                         guint          parameters_n, 
    3535                                         gchar          **parameters, 
    36                                          GValueArray    *values); 
     36                                         GValue         **values); 
    3737 
    3838void 
  • trunk/rgc/src/connection/rgc_protocol_server.c

    r286 r289  
    9797                                         const gchar    *signal_name, 
    9898                                         guint          parameters_n, 
    99                                          GValueArray    *values) 
     99                                         GValue         **values) 
    100100{ 
    101101        RgcProtocolServerClass *klass = RGC_PROTOCOL_SERVER_GET_CLASS (prot); 
     
    130130                                         const gchar    *info_type, 
    131131                                         guint          n_values, 
    132                                          GValueArray    *values) 
     132                                         GValue         **values) 
    133133{ 
    134134        RgcProtocolServerClass *klass = RGC_PROTOCOL_SERVER_GET_CLASS (prot); 
  • trunk/rgc/src/connection/rgc_protocol_server.h

    r286 r289  
    1414                                         const gchar    *signal_name, 
    1515                                         guint          parameters_n, 
    16                                          GValueArray    *values); 
     16                                         GValue         **values); 
    1717 
    1818void 
     
    2727                                         const gchar    *info_type, 
    2828                                         guint          n_values, 
    29                                          GValueArray    *values); 
     29                                         GValue         **values); 
    3030  
    3131 
  • trunk/rgc/src/server/rgc_signal.c

    r283 r289  
    177177        } 
    178178 
    179         rgc_connection_server_send_signal(obj_name, signal_name, parameters->n_values, parameters); 
     179        GValue **values = g_new0 (GValue*, parameter_n); 
     180        guint i; 
     181        for (i = 0; i < parameter_n; i++) 
     182                values[i] = parameters->values + i; 
     183 
     184        rgc_connection_server_send_signal (obj_name, signal_name, parameter_n, values); 
    180185} 
    181186 
  • trunk/rgc/test/Makefile.am

    r286 r289  
    11AM_CFLAGS = @RGC_TEST_CFLAGS@ @CHECK_CFLAGS@ @GNET_CFLAGS@ 
     2 
     3AM_LDFLAGS = -static 
    24 
    35 
     
    79        perf_test \ 
    810        client_query \ 
     11        check_rbp \ 
    912        check_init \ 
    1013        check_remote_obj \ 
     
    2225perf_test_SOURCES = \ 
    2326        perf_test.c 
     27 
     28client_query_SOURCES = \ 
     29        client_query.c 
    2430 
    2531 
     
    3945        @GNET_LIBS@ 
    4046         
    41          
    42 client_query_SOURCES = \ 
    43         client_query.c 
    44  
    4547client_query_LDADD =  \ 
    4648        ../src/librgc_client.la \ 
     
    4951 
    5052 
     53TESTS_ENVIRONMENT = MALLOC_CHECK_=2 G_SLICE=debug-blocks 
    5154 
    52 TESTS = check_init check_remote_obj check_query 
     55TESTS = check_rbp check_init check_remote_obj check_query 
    5356 
     57 
     58check_rbp_SOURCES = \ 
     59        check_rbp.c 
     60 
     61check_rbp_LDADD = \ 
     62        ../src/librgc_client.la \ 
     63        @RGC_TEST_LIBS@ \ 
     64        @GNET_LIBS@ \ 
     65        @CHECK_LIBS@ 
    5466 
    5567check_init_SOURCES = \ 
     
    104116        new_server.output \ 
    105117        new_client_async.output 
     118 
     119AM_CPPFLAGS =  
  • trunk/rgc/test/Makefile.in

    r287 r289  
    3434host_triplet = @host@ 
    3535noinst_PROGRAMS = new_server$(EXEEXT) new_client_async$(EXEEXT) \ 
    36         perf_test$(EXEEXT) client_query$(EXEEXT) check_init$(EXEEXT) \ 
     36        perf_test$(EXEEXT) client_query$(EXEEXT) check_rbp$(EXEEXT) \ 
     37        check_init$(EXEEXT) check_remote_obj$(EXEEXT) \ 
     38        check_query$(EXEEXT) 
     39TESTS = check_rbp$(EXEEXT) check_init$(EXEEXT) \ 
    3740        check_remote_obj$(EXEEXT) check_query$(EXEEXT) 
    38 TESTS = check_init$(EXEEXT) check_remote_obj$(EXEEXT) \ 
    39         check_query$(EXEEXT) 
    4041subdir = test 
    4142DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 
     
    6768check_query_DEPENDENCIES = ../src/librgc_server.la \ 
    6869        ../src/librgc_client.la 
     70am_check_rbp_OBJECTS = check_rbp.$(OBJEXT) 
     71check_rbp_OBJECTS = $(am_check_rbp_OBJECTS) 
     72check_rbp_DEPENDENCIES = ../src/librgc_client.la 
    6973am_check_remote_obj_OBJECTS = object1.$(OBJEXT) check_shared.$(OBJEXT) \ 
    7074        check_remote_obj.$(OBJEXT) 
     
    97101        $(LDFLAGS) -o $@ 
    98102SOURCES = $(check_init_SOURCES) $(check_query_SOURCES) \ 
    99         $(check_remote_obj_SOURCES) $(client_query_SOURCES) \ 
    100         $(new_client_async_SOURCES) $(new_server_SOURCES) \ 
    101         $(perf_test_SOURCES) 
     103        $(check_rbp_SOURCES) $(check_remote_obj_SOURCES) \ 
     104        $(client_query_SOURCES) $(new_client_async_SOURCES) \ 
     105        $(new_server_SOURCES) $(perf_test_SOURCES) 
    102106DIST_SOURCES = $(check_init_SOURCES) $(check_query_SOURCES) \ 
    103         $(check_remote_obj_SOURCES) $(client_query_SOURCES) \ 
    104         $(new_client_async_SOURCES) $(new_server_SOURCES) \ 
    105         $(perf_test_SOURCES) 
     107        $(check_rbp_SOURCES) $(check_remote_obj_SOURCES) \ 
     108        $(client_query_SOURCES) $(new_client_async_SOURCES) \ 
     109        $(new_server_SOURCES) $(perf_test_SOURCES) 
    106110ETAGS = etags 
    107111CTAGS = ctags 
     
    279283top_srcdir = @top_srcdir@ 
    280284AM_CFLAGS = @RGC_TEST_CFLAGS@ @CHECK_CFLAGS@ @GNET_CFLAGS@ 
     285AM_LDFLAGS = -static 
    281286new_server_SOURCES = \ 
    282287        object1.c \ 
     
    290295        perf_test.c 
    291296 
     297client_query_SOURCES = \ 
     298        client_query.c 
     299 
    292300new_server_LDADD = \ 
    293301        ../src/librgc_server.la \ 
     
    305313        @GNET_LIBS@ 
    306314 
    307 client_query_SOURCES = \ 
    308         client_query.c 
    309  
    310315client_query_LDADD = \ 
    311316        ../src/librgc_client.la \ 
    312317        @RGC_TEST_LIBS@ \ 
    313318        @GNET_LIBS@ 
     319 
     320TESTS_ENVIRONMENT = MALLOC_CHECK_=2 G_SLICE=debug-blocks 
     321check_rbp_SOURCES = \ 
     322        check_rbp.c 
     323 
     324check_rbp_LDADD = \ 
     325        ../src/librgc_client.la \ 
     326        @RGC_TEST_LIBS@ \ 
     327        @GNET_LIBS@ \ 
     328        @CHECK_LIBS@ 
    314329 
    315330check_init_SOURCES = \ 
     
    361376        new_client_async.output 
    362377 
     378AM_CPPFLAGS =  
    363379all: all-am 
    364380 
     
    407423        @rm -f check_query$(EXEEXT) 
    408424        $(LINK) $(check_query_OBJECTS) $(check_query_LDADD) $(LIBS) 
     425check_rbp$(EXEEXT): $(check_rbp_OBJECTS) $(check_rbp_DEPENDENCIES)  
     426        @rm -f check_rbp$(EXEEXT) 
     427        $(LINK) $(check_rbp_OBJECTS) $(check_rbp_LDADD) $(LIBS) 
    409428check_remote_obj$(EXEEXT): $(check_remote_obj_OBJECTS) $(check_remote_obj_DEPENDENCIES)  
    410429        @rm -f check_remote_obj$(EXEEXT) 
     
    431450@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init.Po@am__quote@ 
    432451@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_query.Po@am__quote@ 
     452@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_rbp.Po@am__quote@ 
    433453@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_remote_obj.Po@am__quote@ 
    434454@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_shared.Po@am__quote@ 
  • trunk/rgc/test/check_query.c

    r288 r289  
    5050        //for (i = 0; i < N_QUERY; i++) { 
    5151                rgc_query_server_info (server_info_cb, random_ptr); 
     52            rgc_info_table_dump (); 
    5253        //} 
    5354} 
  • trunk/rgc/test/check_remote_obj.c

    r288 r289  
    103103        handler_id = g_signal_connect (G_OBJECT (server_obj), "notify::gain", G_CALLBACK (gain_changed_cb), &new_gain); 
    104104 
     105        rgc_info_table_dump (); 
     106 
    105107        GValue *value = g_value_init_float (new_gain); 
    106108        rgc_remote_object_set (obj, "gain", value, NULL);