[hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5346: Drop builder typedefs and _t namespace suffixes.

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Tue, 04 Jan 2011 12:01:32 -0000

------------------------------------------------------------
revno: 5346
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: hipl
timestamp: Mon 2011-01-03 18:56:09 +0100
message:
  Drop builder typedefs and _t namespace suffixes.
  
  The _t namespace is reserved for POSIX; typedefs are evil.
modified:
  hipd/output.c
  hipd/registration.c
  hipd/registration.h
  lib/core/builder.c
  lib/core/builder.h


--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk

Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to 
https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'hipd/output.c'
--- hipd/output.c       2010-12-08 18:40:04 +0000
+++ hipd/output.c       2011-01-03 17:56:09 +0000
@@ -574,7 +574,7 @@
                                  int cookie_k)
 {
     hip_common_t *msg = NULL;
-    hip_srv_t service_list[HIP_TOTAL_EXISTING_SERVICES];
+    struct hip_srv service_list[HIP_TOTAL_EXISTING_SERVICES];
     uint8_t *dh_data1  = NULL, *dh_data2 = NULL;
     char order[] = "000";
     int err = 0, dh_size1 = 0, dh_size2 = 0, written1 = 0, written2 = 0;

=== modified file 'hipd/registration.c'
--- hipd/registration.c 2011-01-03 16:19:22 +0000
+++ hipd/registration.c 2011-01-03 17:56:09 +0000
@@ -61,7 +61,7 @@
 #define HIP_PENDING_REQUEST_LIFETIME 120
 
 /** An array for storing all existing services. */
-hip_srv_t hip_services[HIP_TOTAL_EXISTING_SERVICES];
+struct hip_srv hip_services[HIP_TOTAL_EXISTING_SERVICES];
 /** A linked list for storing pending requests on the client side.
  *  @note This assumes a single threaded model. We are not using mutexes here.
  */
@@ -156,7 +156,7 @@
  * @param  status   the status to set i.e. ON or OFF.
  * @return          zero if the status was set succesfully, -1 otherwise.
  */
-int hip_set_srv_status(uint8_t reg_type, hip_srv_status_t status)
+int hip_set_srv_status(uint8_t reg_type, enum hip_srv_status status)
 {
     int i = 0;
 
@@ -175,7 +175,7 @@
  * whose status is ON.
  *
  * Make sure that the size of the target buffer @c active_services is at least
- * HIP_TOTAL_EXISTING_SERVICES * sizeof(hip_srv_t).
+ * HIP_TOTAL_EXISTING_SERVICES * sizeof(struct hip_srv).
  *
  * @param active_services      a target buffer where to put the active
  *                             services.
@@ -185,7 +185,7 @@
  * @return -1 if active_services is NULL, zero otherwise.
  */
 
-int hip_get_active_services(hip_srv_t *active_services,
+int hip_get_active_services(struct hip_srv *active_services,
                             unsigned int *active_service_count)
 {
     if (active_services == NULL) {

=== modified file 'hipd/registration.h'
--- hipd/registration.h 2010-10-15 15:29:14 +0000
+++ hipd/registration.h 2011-01-03 17:56:09 +0000
@@ -64,8 +64,8 @@
  */
 void hip_uninit_services(void);
 int hip_registration_maintenance(void);
-int hip_set_srv_status(uint8_t reg_type, hip_srv_status_t status);
-int hip_get_active_services(hip_srv_t *active_services,
+int hip_set_srv_status(uint8_t reg_type, enum hip_srv_status status);
+int hip_get_active_services(struct hip_srv *active_services,
                             unsigned int *active_service_count);
 int hip_add_pending_request(hip_pending_request_t *request);
 int hip_del_pending_request(hip_ha_t *entry);

=== modified file 'lib/core/builder.c'
--- lib/core/builder.c  2010-12-13 21:12:34 +0000
+++ lib/core/builder.c  2011-01-03 17:56:09 +0000
@@ -2268,7 +2268,7 @@
 {
     int err    = 0;
     unsigned i = 0;
-    const hip_srv_t *service_list = (const hip_srv_t *) srv_list;
+    const struct hip_srv *service_list = (const struct hip_srv *) srv_list;
     struct hip_reg_info reg_info;
     uint8_t reg_type[service_count];
 

=== modified file 'lib/core/builder.h'
--- lib/core/builder.h  2010-12-08 18:30:17 +0000
+++ lib/core/builder.h  2011-01-03 17:56:09 +0000
@@ -48,16 +48,16 @@
 /* Removed in 2.6.11 - why ? */
 extern struct hip_cert_spki_info hip_cert_spki_info;
 
-/* registration.c typedefs also used by hip_build_param_reg_info() */
-/** Possible service states. */
-typedef enum { HIP_SERVICE_OFF = 0, HIP_SERVICE_ON = 1 } hip_srv_status_t;
+/** possible service states */
+enum hip_srv_status { HIP_SERVICE_OFF = 0, HIP_SERVICE_ON = 1 };
+
 /** HIP service. */
-typedef struct hip_srv {
-    hip_srv_status_t status;     /**< Service status */
-    uint8_t          reg_type;
-    uint8_t          min_lifetime;
-    uint8_t          max_lifetime;
-} hip_srv_t;
+struct hip_srv {
+    enum hip_srv_status status;     /**< service status */
+    uint8_t             reg_type;
+    uint8_t             min_lifetime;
+    uint8_t             max_lifetime;
+};
 
 int hip_build_netlink_dummy_header(struct hip_common *);
 int hip_build_param_heartbeat(struct hip_common *msg, int seconds);

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5346: Drop builder typedefs and _t namespace suffixes. - noreply