[maemo-commits] [maemo-commits] r15429 - in projects/haf/trunk/maemo-launcher: . launcher

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Apr 16 01:36:03 EEST 2008
Author: guillem
Date: 2008-04-16 01:36:02 +0300 (Wed, 16 Apr 2008)
New Revision: 15429

Modified:
   projects/haf/trunk/maemo-launcher/ChangeLog
   projects/haf/trunk/maemo-launcher/launcher/comm_msg.c
   projects/haf/trunk/maemo-launcher/launcher/comm_msg.h
   projects/haf/trunk/maemo-launcher/launcher/launcher.c
   projects/haf/trunk/maemo-launcher/launcher/test_msg.c
   projects/haf/trunk/maemo-launcher/launcher/test_msg_perf.c
Log:
Unify comm_msg function names to put/get pairs


Modified: projects/haf/trunk/maemo-launcher/ChangeLog
===================================================================
--- projects/haf/trunk/maemo-launcher/ChangeLog	2008-04-15 22:36:00 UTC (rev 15428)
+++ projects/haf/trunk/maemo-launcher/ChangeLog	2008-04-15 22:36:02 UTC (rev 15429)
@@ -1,5 +1,18 @@
 2008-04-15  Guillem Jover  <guillem.jover at nokia.com>
 
+	* launcher/comm_msg.h (comm_msg_set_magic): Rename to ...
+	(comm_msg_put_magic): ... this. Fix all users.
+	(comm_msg_pack_int): Rename to ...
+	(comm_msg_put_int): ... this. Fix all users.
+	(comm_msg_unpack_int): Rename to ...
+	(comm_msg_get_int): ... this. Fix all users.
+	(comm_msg_pack_str): Rename to ...
+	(comm_msg_put_str): ... this. Fix all users.
+	(comm_msg_unpack_str): Rename to ...
+	(comm_msg_get_str): ... this. Fix all users.
+
+2008-04-15  Guillem Jover  <guillem.jover at nokia.com>
+
 	* launcher/comm_msg.c (comm_msg_unpack_mem): Remove function.
 	(comm_msg_put_u32): New function.
 	(comm_msg_get_u32): Likewise.

Modified: projects/haf/trunk/maemo-launcher/launcher/comm_msg.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/comm_msg.c	2008-04-15 22:36:00 UTC (rev 15428)
+++ projects/haf/trunk/maemo-launcher/launcher/comm_msg.c	2008-04-15 22:36:02 UTC (rev 15429)
@@ -158,11 +158,11 @@
 }
 
 /*
- * High level get/set functions.
+ * High level put/get functions.
  */
 
 bool
-comm_msg_set_magic(comm_msg_t *msg, uint32_t magic)
+comm_msg_put_magic(comm_msg_t *msg, uint32_t magic)
 {
   if (!comm_msg_grow(msg, sizeof(magic)))
     return false;
@@ -184,7 +184,7 @@
 }
 
 bool
-comm_msg_pack_int(comm_msg_t *msg, uint32_t i)
+comm_msg_put_int(comm_msg_t *msg, uint32_t i)
 {
   static const uint32_t size = sizeof(i);
 
@@ -201,7 +201,7 @@
 }
 
 bool
-comm_msg_unpack_int(comm_msg_t *msg, uint32_t *i)
+comm_msg_get_int(comm_msg_t *msg, uint32_t *i)
 {
   uint32_t size;
 
@@ -219,7 +219,7 @@
 }
 
 bool
-comm_msg_pack_str(comm_msg_t *msg, const char *str)
+comm_msg_put_str(comm_msg_t *msg, const char *str)
 {
   uint32_t size = strlen(str) + 1;
   uint32_t aligned_size = WORD_ALIGN(size);
@@ -246,7 +246,7 @@
 }
 
 bool
-comm_msg_unpack_str(comm_msg_t *msg, const char **str_r)
+comm_msg_get_str(comm_msg_t *msg, const char **str_r)
 {
   uint32_t size;
   const char *str;

Modified: projects/haf/trunk/maemo-launcher/launcher/comm_msg.h
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/comm_msg.h	2008-04-15 22:36:00 UTC (rev 15428)
+++ projects/haf/trunk/maemo-launcher/launcher/comm_msg.h	2008-04-15 22:36:02 UTC (rev 15429)
@@ -37,14 +37,14 @@
 bool comm_msg_send(int fd, comm_msg_t *msg);
 bool comm_msg_recv(int fd, comm_msg_t *msg);
 
-bool comm_msg_set_magic(comm_msg_t *msg, uint32_t magic);
+bool comm_msg_put_magic(comm_msg_t *msg, uint32_t magic);
 bool comm_msg_get_magic(comm_msg_t *msg, uint32_t *magic);
 
-bool comm_msg_pack_int(comm_msg_t *msg, uint32_t i);
-bool comm_msg_unpack_int(comm_msg_t *msg, uint32_t *i);
+bool comm_msg_put_int(comm_msg_t *msg, uint32_t i);
+bool comm_msg_get_int(comm_msg_t *msg, uint32_t *i);
 
-bool comm_msg_pack_str(comm_msg_t *msg, const char *str);
-bool comm_msg_unpack_str(comm_msg_t *msg, const char **str);
+bool comm_msg_put_str(comm_msg_t *msg, const char *str);
+bool comm_msg_get_str(comm_msg_t *msg, const char **str);
 
 #endif
 

Modified: projects/haf/trunk/maemo-launcher/launcher/launcher.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-04-15 22:36:00 UTC (rev 15428)
+++ projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-04-15 22:36:02 UTC (rev 15429)
@@ -566,16 +566,16 @@
 
   msg = comm_msg_new(512, 0);
 
-  comm_msg_set_magic(msg, LAUNCHER_STATE_SIG);
+  comm_msg_put_magic(msg, LAUNCHER_STATE_SIG);
 
-  comm_msg_pack_int(msg, invoker_fd);
-  comm_msg_pack_int(msg, childs->used);
+  comm_msg_put_int(msg, invoker_fd);
+  comm_msg_put_int(msg, childs->used);
 
   for (i = 0; i < childs->used; i++)
   {
-    comm_msg_pack_int(msg, list[i].pid);
-    comm_msg_pack_int(msg, list[i].sock);
-    comm_msg_pack_str(msg, list[i].name);
+    comm_msg_put_int(msg, list[i].pid);
+    comm_msg_put_int(msg, list[i].sock);
+    comm_msg_put_str(msg, list[i].name);
   }
 
   comm_msg_send(fd, msg);
@@ -616,18 +616,18 @@
     return NULL;
   }
 
-  comm_msg_unpack_int(msg, invoker_fd);
+  comm_msg_get_int(msg, invoker_fd);
 
-  comm_msg_unpack_int(msg, &w);
+  comm_msg_get_int(msg, &w);
   childs = kindergarten_new(w);
   childs->used = w;
   list = childs->list;
 
   for (i = 0; i < childs->used; i++)
   {
-    comm_msg_unpack_int(msg, &list[i].pid);
-    comm_msg_unpack_int(msg, &list[i].sock);
-    comm_msg_unpack_str(msg, &s);
+    comm_msg_get_int(msg, &list[i].pid);
+    comm_msg_get_int(msg, &list[i].sock);
+    comm_msg_get_str(msg, &s);
     list[i].name = strdup(s);
   }
 

Modified: projects/haf/trunk/maemo-launcher/launcher/test_msg.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/test_msg.c	2008-04-15 22:36:00 UTC (rev 15428)
+++ projects/haf/trunk/maemo-launcher/launcher/test_msg.c	2008-04-15 22:36:02 UTC (rev 15429)
@@ -47,14 +47,14 @@
 
 	msg = comm_msg_new(20, 0);
 
-	comm_msg_set_magic(msg, magic);
+	comm_msg_put_magic(msg, magic);
 
-	comm_msg_pack_int(msg, w1);
-	comm_msg_pack_int(msg, w2);
-	comm_msg_pack_str(msg, s1);
-	comm_msg_pack_str(msg, s2);
-	comm_msg_pack_int(msg, w3);
-	comm_msg_pack_int(msg, w4);
+	comm_msg_put_int(msg, w1);
+	comm_msg_put_int(msg, w2);
+	comm_msg_put_str(msg, s1);
+	comm_msg_put_str(msg, s2);
+	comm_msg_put_int(msg, w3);
+	comm_msg_put_int(msg, w4);
 
 	fd = open(test_file, O_WRONLY | O_CREAT, 0644);
 	if (fd < 0)
@@ -80,17 +80,17 @@
 	if (comm_msg_get_magic(msg, &w))
 		test_cmp_int(magic, w);
 
-	if (comm_msg_unpack_int(msg, &w))
+	if (comm_msg_get_int(msg, &w))
 		test_cmp_int(w1, w);
-	if (comm_msg_unpack_int(msg, &w))
+	if (comm_msg_get_int(msg, &w))
 		test_cmp_int(w2, w);
-	if (comm_msg_unpack_str(msg, &s))
+	if (comm_msg_get_str(msg, &s))
 		test_cmp_str(s1, s);
-	if (comm_msg_unpack_str(msg, &s))
+	if (comm_msg_get_str(msg, &s))
 		test_cmp_str(s2, s);
-	if (comm_msg_unpack_int(msg, &w))
+	if (comm_msg_get_int(msg, &w))
 		test_cmp_int(w3, w);
-	if (comm_msg_unpack_int(msg, &w))
+	if (comm_msg_get_int(msg, &w))
 		test_cmp_int(w4, w);
 
 	comm_msg_destroy(msg);
@@ -103,9 +103,9 @@
 
 	msg = comm_msg_new(4, 8);
 
-	comm_msg_pack_int(msg, w1);
-	comm_msg_pack_int(msg, w2);
-	test_failure(comm_msg_pack_int(msg, w3));
+	comm_msg_put_int(msg, w1);
+	comm_msg_put_int(msg, w2);
+	test_failure(comm_msg_put_int(msg, w3));
 
 	comm_msg_destroy(msg);
 

Modified: projects/haf/trunk/maemo-launcher/launcher/test_msg_perf.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/test_msg_perf.c	2008-04-15 22:36:00 UTC (rev 15428)
+++ projects/haf/trunk/maemo-launcher/launcher/test_msg_perf.c	2008-04-15 22:36:02 UTC (rev 15429)
@@ -46,7 +46,7 @@
 	for (i = 0; i < i_max; i++)
 	{
 		for (j = 0; j < j_max; j++)
-			comm_msg_pack_int(msg, w);
+			comm_msg_put_int(msg, w);
 
 		comm_msg_reset(msg);
 	}


More information about the maemo-commits mailing list