{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/rcl/pulls/comments/191609548","pull_request_review_id":124212545,"id":191609548,"diff_hunk":"@@ -0,0 +1,1384 @@\n+// Copyright 2018 Apex.AI, Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+#include <errno.h>\n+#include <inttypes.h>\n+#include <stdbool.h>\n+#include <stdint.h>\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <yaml.h>\n+\n+#include \"rcl_yaml_param_parser/parser.h\"\n+#include \"rcl_yaml_param_parser/types.h\"\n+\n+#include \"rcl/error_handling.h\"\n+#include \"rcl/types.h\"\n+#include \"rcutils/strdup.h\"\n+\n+/// NOTE: Will allow a max YAML mapping depth of 5\n+/// map level 1 : Node name mapping\n+/// map level 2 : Params mapping\n+typedef enum yaml_map_lvl_e\n+{\n+  MAP_UNINIT_LVL = 0U,\n+  MAP_NODE_NAME_LVL = 1U,\n+  MAP_PARAMS_LVL = 2U,\n+} yaml_map_lvl_t;\n+\n+/// Basic supported data types in the yaml file\n+typedef enum data_types_e\n+{\n+  DATA_TYPE_UNKNOWN = 0U,\n+  DATA_TYPE_BOOL = 1U,\n+  DATA_TYPE_INT64 = 2U,\n+  DATA_TYPE_DOUBLE = 3U,\n+  DATA_TYPE_STRING = 4U\n+} data_types_t;\n+\n+typedef enum namespace_type_e\n+{\n+  NS_TYPE_NODE = 1U,\n+  NS_TYPE_PARAM = 2U\n+} namespace_type_t;\n+\n+/// Keep track of node and parameter name spaces\n+typedef struct namespace_tracker_s\n+{\n+  char * node_ns;\n+  uint32_t num_node_ns;\n+  char * parameter_ns;\n+  uint32_t num_parameter_ns;\n+} namespace_tracker_t;\n+\n+#define MAX_STRING_SIZE 128U\n+#define PARAMS_KEY \"ros__parameters\"\n+#define NODE_NS_SEPERATOR \"/\"\n+#define PARAMETER_NS_SEPERATOR \".\"\n+\n+#define MAX_NUM_NODE_ENTRIES 256U\n+#define MAX_NUM_PARAMS_PER_NODE 512U\n+\n+static rcl_ret_t node_params_init(\n+  rcl_node_params_t * node_params,\n+  const rcl_allocator_t allocator);\n+\n+static rcl_ret_t add_val_to_bool_arr(\n+  rcl_bool_array_t * const val_array,\n+  bool * value,\n+  const rcl_allocator_t allocator);\n+\n+static rcl_ret_t add_val_to_int_arr(\n+  rcl_int64_array_t * const val_array,\n+  int64_t * value,\n+  const rcl_allocator_t allocator);\n+\n+static rcl_ret_t add_val_to_double_arr(\n+  rcl_double_array_t * const val_array,\n+  double * value,\n+  const rcl_allocator_t allocator);\n+\n+static rcl_ret_t add_val_to_string_arr(\n+  rcutils_string_array_t * const val_array,\n+  char * value,\n+  const rcl_allocator_t allocator);\n+\n+///\n+/// TODO (anup.pemmaiah): Support byte array\n+///\n+\n+static rcl_ret_t add_name_to_ns(\n+  namespace_tracker_t * ns_tracker,\n+  const char * name,\n+  const namespace_type_t namespace_type,\n+  rcl_allocator_t allocator);\n+\n+static rcl_ret_t rem_name_from_ns(\n+  namespace_tracker_t * ns_tracker,\n+  const namespace_type_t namespace_type,\n+  rcl_allocator_t allocator);\n+\n+static rcl_ret_t replace_ns(\n+  namespace_tracker_t * ns_tracker,\n+  char * const new_ns,\n+  const uint32_t new_ns_count,\n+  const namespace_type_t namespace_type,\n+  rcl_allocator_t allocator);\n+\n+static void * get_value(\n+  const char * const value,\n+  data_types_t * val_type,\n+  const rcl_allocator_t allocator);\n+\n+static rcl_ret_t parse_value(\n+  const yaml_event_t event,\n+  const bool is_seq,\n+  data_types_t * seq_data_type,\n+  rcl_params_t * params_st);\n+\n+static rcl_ret_t parse_key(\n+  const yaml_event_t event,\n+  uint32_t * map_level,\n+  bool * is_new_map,\n+  namespace_tracker_t * ns_tracker,\n+  rcl_params_t * params_st);\n+\n+static rcl_ret_t parse_events(\n+  yaml_parser_t * parser,\n+  namespace_tracker_t * ns_tracker,\n+  rcl_params_t * params_st);\n+\n+///\n+/// Add name to namespace tracker\n+///\n+static rcl_ret_t add_name_to_ns(\n+  namespace_tracker_t * ns_tracker,\n+  const char * name,\n+  const namespace_type_t namespace_type,\n+  rcl_allocator_t allocator)\n+{\n+  char * cur_ns;\n+  uint32_t * cur_count;\n+  char * sep_str;\n+  size_t name_len;\n+  size_t ns_len;\n+  size_t sep_len;\n+  size_t tot_len;\n+  rcl_ret_t res = RCL_RET_OK;\n+\n+  switch (namespace_type) {\n+    case NS_TYPE_NODE:\n+      cur_ns = ns_tracker->node_ns;\n+      cur_count = &(ns_tracker->num_node_ns);\n+      sep_str = NODE_NS_SEPERATOR;\n+      break;\n+    case NS_TYPE_PARAM:\n+      cur_ns = ns_tracker->parameter_ns;\n+      cur_count = &(ns_tracker->num_parameter_ns);\n+      sep_str = PARAMETER_NS_SEPERATOR;\n+      break;\n+    default:\n+      res = RCL_RET_ERROR;\n+      break;\n+  }\n+\n+  if (RCL_RET_OK == res) {\n+    /// Add a name to ns\n+    if (NULL == name) {\n+      return RCL_RET_INVALID_ARGUMENT;\n+    }\n+    if (0U == *cur_count) {\n+      cur_ns = rcutils_strdup(name, allocator);\n+      if (NULL == cur_ns) {\n+        return RCL_RET_BAD_ALLOC;\n+      }\n+    } else {\n+      ns_len = strlen(cur_ns);\n+      name_len = strlen(name);\n+      sep_len = strlen(sep_str);\n+      tot_len = ns_len + name_len + sep_len + 1U;\n+\n+      if (tot_len > MAX_STRING_SIZE) {\n+        RCL_SET_ERROR_MSG(\"New namespace string is exceeding max string size\",\n+          allocator);\n+        return RCL_RET_ERROR;\n+      }\n+      cur_ns = allocator.reallocate(cur_ns, tot_len, allocator.state);\n+      if (NULL == cur_ns) {\n+        return RCL_RET_BAD_ALLOC;\n+      }\n+      memmove((cur_ns + ns_len), sep_str, sep_len);\n+      memmove((cur_ns + ns_len + sep_len), name, name_len);\n+      cur_ns[tot_len - 1U] = '\\0';\n+    }\n+    *cur_count = (*cur_count + 1U);\n+\n+    if (NS_TYPE_NODE == namespace_type) {\n+      ns_tracker->node_ns = cur_ns;\n+    } else {\n+      ns_tracker->parameter_ns = cur_ns;\n+    }\n+  }\n+  return res;\n+}\n+\n+///\n+/// Remove name from namespace tracker\n+///\n+static rcl_ret_t rem_name_from_ns(\n+  namespace_tracker_t * ns_tracker,\n+  const namespace_type_t namespace_type,\n+  rcl_allocator_t allocator)\n+{\n+  char * cur_ns;\n+  uint32_t * cur_count;\n+  char * sep_str;\n+  size_t ns_len;\n+  size_t tot_len;\n+  rcl_ret_t res = RCL_RET_OK;\n+\n+  switch (namespace_type) {\n+    case NS_TYPE_NODE:\n+      cur_ns = ns_tracker->node_ns;\n+      cur_count = &(ns_tracker->num_node_ns);\n+      sep_str = NODE_NS_SEPERATOR;\n+      break;\n+    case NS_TYPE_PARAM:\n+      cur_ns = ns_tracker->parameter_ns;\n+      cur_count = &(ns_tracker->num_parameter_ns);\n+      sep_str = PARAMETER_NS_SEPERATOR;\n+      break;\n+    default:\n+      res = RCL_RET_ERROR;\n+      break;\n+  }\n+\n+  if (RCL_RET_OK == res) {\n+    /// Remove last name from ns\n+    if (*cur_count > 0U) {\n+      if (1U == *cur_count) {\n+        allocator.deallocate(cur_ns, allocator.state);\n+        cur_ns = NULL;\n+      } else {\n+        ns_len = strlen(cur_ns);\n+        char * last_idx = NULL;\n+        char * next_str = NULL;\n+        const char * end_ptr = (cur_ns + ns_len);\n+\n+        next_str = strstr(cur_ns, sep_str);\n+        while (NULL != next_str) {\n+          if (next_str > end_ptr) {\n+            RCL_SET_ERROR_MSG(\"Internal error. Crossing arrau boundary\", allocator);\n+            return RCL_RET_ERROR;\n+          }\n+          last_idx = next_str;\n+          next_str = (next_str + strlen(sep_str));\n+          next_str = strstr(next_str, sep_str);\n+        }\n+        if (NULL != last_idx) {\n+          tot_len = ((size_t)(last_idx - cur_ns) + 1U);\n+          cur_ns = allocator.reallocate(cur_ns, tot_len, allocator.state);\n+          if (NULL == cur_ns) {\n+            return RCL_RET_BAD_ALLOC;\n+          }\n+          cur_ns[tot_len - 1U] = '\\0';\n+        }\n+      }\n+      *cur_count = (*cur_count - 1U);\n+    }\n+    if (NS_TYPE_NODE == namespace_type) {\n+      ns_tracker->node_ns = cur_ns;\n+    } else {\n+      ns_tracker->parameter_ns = cur_ns;\n+    }\n+  }\n+  return res;\n+}\n+\n+///\n+/// Replace namespace in namespace tracker\n+///\n+static rcl_ret_t replace_ns(\n+  namespace_tracker_t * ns_tracker,\n+  char * const new_ns,\n+  const uint32_t new_ns_count,\n+  const namespace_type_t namespace_type,\n+  rcl_allocator_t allocator)\n+{\n+  rcl_ret_t res = RCL_RET_OK;\n+\n+  /// Remove the old namespace and point to the new namespace\n+  switch (namespace_type) {\n+    case NS_TYPE_NODE:\n+      if (NULL != ns_tracker->node_ns) {\n+        allocator.deallocate(ns_tracker->node_ns, allocator.state);\n+      }\n+      ns_tracker->node_ns = new_ns;\n+      ns_tracker->num_node_ns = new_ns_count;\n+      break;\n+    case NS_TYPE_PARAM:\n+      if (NULL != ns_tracker->parameter_ns) {\n+        allocator.deallocate(ns_tracker->parameter_ns, allocator.state);\n+      }\n+      ns_tracker->parameter_ns = new_ns;\n+      ns_tracker->num_parameter_ns = new_ns_count;\n+      break;\n+    default:\n+      res = RCL_RET_ERROR;\n+      break;\n+  }\n+  return res;\n+}\n+\n+///\n+/// Create rcl_node_params_t structure\n+///\n+static rcl_ret_t node_params_init(\n+  rcl_node_params_t * node_params,\n+  const rcl_allocator_t allocator)\n+{\n+  if (NULL == node_params) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  node_params->parameter_names = allocator.zero_allocate(MAX_NUM_PARAMS_PER_NODE,\n+      sizeof(char *), allocator.state);\n+  if (NULL == node_params->parameter_names) {\n+    return RCL_RET_BAD_ALLOC;\n+  }\n+\n+  node_params->parameter_values = allocator.zero_allocate(MAX_NUM_PARAMS_PER_NODE,\n+      sizeof(rcl_variant_t), allocator.state);\n+  if (NULL == node_params->parameter_values) {\n+    allocator.deallocate(node_params->parameter_names, allocator.state);\n+    return RCL_RET_BAD_ALLOC;\n+  }\n+\n+  return RCL_RET_OK;\n+}\n+\n+///\n+/// Create the rcl_params_t parameter structure\n+///\n+rcl_params_t * rcl_yaml_node_struct_init(\n+  const rcl_allocator_t allocator)\n+{\n+  rcl_params_t * params_st;\n+\n+  params_st = allocator.zero_allocate(1, sizeof(rcl_params_t), allocator.state);\n+  if (NULL == params_st) {\n+    RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+    return NULL;\n+  }\n+\n+  params_st->node_names = allocator.zero_allocate(MAX_NUM_NODE_ENTRIES,\n+      sizeof(char *), allocator.state);\n+  if (NULL == params_st->node_names) {\n+    rcl_yaml_node_struct_fini(params_st);\n+    RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+    return NULL;\n+  }\n+\n+  params_st->params = allocator.zero_allocate(MAX_NUM_NODE_ENTRIES, sizeof(rcl_node_params_t),\n+      allocator.state);\n+  if (NULL == params_st->params) {\n+    rcl_yaml_node_struct_fini(params_st);\n+    RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+    return NULL;\n+  }\n+\n+  params_st->num_nodes = 0U;\n+  params_st->allocator = allocator;\n+\n+  return params_st;\n+}\n+\n+///\n+/// Free param structure\n+/// NOTE: If there is an error, would recommend just to safely exit the process instead\n+/// of calling this free function and continuing\n+///\n+void rcl_yaml_node_struct_fini(\n+  rcl_params_t * params_st)\n+{\n+  uint32_t node_idx;\n+  size_t parameter_idx = 0U;\n+  rcl_allocator_t allocator;\n+\n+  if (NULL == params_st) {\n+    return;\n+  }\n+  allocator = params_st->allocator;\n+\n+  for (node_idx = 0; node_idx < params_st->num_nodes; node_idx++) {\n+    char * node_name = params_st->node_names[node_idx];\n+    if (NULL != node_name) {\n+      allocator.deallocate(node_name, allocator.state);\n+    }\n+\n+    if (NULL != params_st->params) {\n+      char * param_name;\n+      rcl_variant_t * param_var;\n+      for (parameter_idx = 0; parameter_idx < params_st->params[node_idx].num_params;\n+        parameter_idx++)\n+      {\n+        if ((NULL != params_st->params[node_idx].parameter_names) &&\n+          (NULL != params_st->params[node_idx].parameter_values))\n+        {\n+          param_name = params_st->params[node_idx].parameter_names[parameter_idx];\n+          param_var = &(params_st->params[node_idx].parameter_values[parameter_idx]);\n+          if (NULL != param_name) {\n+            allocator.deallocate(param_name, allocator.state);\n+          }\n+\n+          if (NULL != param_var) {\n+            if (NULL != param_var->bool_value) {\n+              allocator.deallocate(param_var->bool_value, allocator.state);\n+            } else if (NULL != param_var->integer_value) {\n+              allocator.deallocate(param_var->integer_value, allocator.state);\n+            } else if (NULL != param_var->double_value) {\n+              allocator.deallocate(param_var->double_value, allocator.state);\n+            } else if (NULL != param_var->string_value) {\n+              allocator.deallocate(param_var->string_value, allocator.state);\n+            } else if (NULL != param_var->bool_array_value) {\n+              if (NULL != param_var->bool_array_value->values) {\n+                allocator.deallocate(param_var->bool_array_value->values, allocator.state);\n+              }\n+              allocator.deallocate(param_var->bool_array_value, allocator.state);\n+            } else if (NULL != param_var->integer_array_value) {\n+              if (NULL != param_var->integer_array_value->values) {\n+                allocator.deallocate(param_var->integer_array_value->values, allocator.state);\n+              }\n+              allocator.deallocate(param_var->integer_array_value, allocator.state);\n+            } else if (NULL != param_var->double_array_value) {\n+              if (NULL != param_var->double_array_value->values) {\n+                allocator.deallocate(param_var->double_array_value->values, allocator.state);\n+              }\n+              allocator.deallocate(param_var->double_array_value, allocator.state);\n+            } else if (NULL != param_var->string_array_value) {\n+              if (RCL_RET_OK != rcutils_string_array_fini(param_var->string_array_value)) {\n+                // Log and continue ...\n+                RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error deallocating string array\");\n+              }\n+              allocator.deallocate(param_var->string_array_value, allocator.state);\n+            } else {\n+              /// Nothing to do to keep pclint happy\n+            }\n+          }  // if (param_var)\n+        }\n+      }  // for (parameter_idx)\n+      if (NULL != params_st->params[node_idx].parameter_values) {\n+        allocator.deallocate(params_st->params[node_idx].parameter_values, allocator.state);\n+      }\n+      if (NULL != params_st->params[node_idx].parameter_names) {\n+        allocator.deallocate(params_st->params[node_idx].parameter_names, allocator.state);\n+      }\n+    }  // if (params)\n+  }  // for (node_idx)\n+  if (NULL != params_st->node_names) {\n+    allocator.deallocate(params_st->node_names, allocator.state);\n+    params_st->node_names = NULL;\n+  }\n+  if (NULL != params_st->params) {\n+    allocator.deallocate(params_st->params, allocator.state);\n+    params_st->params = NULL;\n+  }\n+  params_st->num_nodes = 0U;\n+  allocator.deallocate(params_st, allocator.state);\n+}\n+\n+///\n+/// Dump the param structure\n+///\n+void rcl_yaml_node_struct_print(\n+  const rcl_params_t * const params_st)\n+{\n+  size_t node_idx;\n+  size_t parameter_idx = 0U;\n+\n+  if (NULL == params_st) {\n+    return;\n+  }\n+\n+  printf(\"\\n Node Name\\t\\t\\t\\tParameters\\n\");\n+  for (node_idx = 0; node_idx < params_st->num_nodes; node_idx++) {\n+    int32_t param_col = 50;\n+    const char * const node_name = params_st->node_names[node_idx];\n+    if (NULL != node_name) {\n+      printf(\"%s\\n\", node_name);\n+    }\n+\n+    if (NULL != params_st->params) {\n+      char * param_name;\n+      rcl_variant_t * param_var;\n+      for (parameter_idx = 0; parameter_idx < params_st->params[node_idx].num_params;\n+        parameter_idx++)\n+      {\n+        if ((NULL != params_st->params[node_idx].parameter_names) &&\n+          (NULL != params_st->params[node_idx].parameter_values))\n+        {\n+          param_name = params_st->params[node_idx].parameter_names[parameter_idx];\n+          param_var = &(params_st->params[node_idx].parameter_values[parameter_idx]);\n+          if (NULL != param_name) {\n+            printf(\"%*s\", param_col, param_name);\n+          }\n+\n+          if (NULL != param_var) {\n+            if (NULL != param_var->bool_value) {\n+              printf(\": %s\\n\", *(param_var->bool_value) ? \"true\" : \"false\");\n+            } else if (NULL != param_var->integer_value) {\n+              printf(\": %\" PRId64 \"\\n\", *(param_var->integer_value));\n+            } else if (NULL != param_var->double_value) {\n+              printf(\": %lf\\n\", *(param_var->double_value));\n+            } else if (NULL != param_var->string_value) {\n+              printf(\": %s\\n\", param_var->string_value);\n+            } else if (NULL != param_var->bool_array_value) {\n+              printf(\": \");\n+              for (size_t i = 0; i < param_var->bool_array_value->size; i++) {\n+                if (param_var->bool_array_value->values) {\n+                  printf(\"%s, \",\n+                    (param_var->bool_array_value->values[i]) ? \"true\" : \"false\");\n+                }\n+              }\n+              printf(\"\\n\");\n+            } else if (NULL != param_var->integer_array_value) {\n+              printf(\": \");\n+              for (size_t i = 0; i < param_var->integer_array_value->size; i++) {\n+                if (param_var->integer_array_value->values) {\n+                  printf(\"%\" PRId64 \", \", param_var->integer_array_value->values[i]);\n+                }\n+              }\n+              printf(\"\\n\");\n+            } else if (NULL != param_var->double_array_value) {\n+              printf(\": \");\n+              for (size_t i = 0; i < param_var->double_array_value->size; i++) {\n+                if (param_var->double_array_value->values) {\n+                  printf(\"%lf, \", param_var->double_array_value->values[i]);\n+                }\n+              }\n+              printf(\"\\n\");\n+            } else if (NULL != param_var->string_array_value) {\n+              printf(\": \");\n+              for (size_t i = 0; i < param_var->string_array_value->size; i++) {\n+                if (param_var->string_array_value->data[i]) {\n+                  printf(\"%s, \", param_var->string_array_value->data[i]);\n+                }\n+              }\n+              printf(\"\\n\");\n+            }\n+          }\n+        }\n+      }\n+    }\n+  }\n+}\n+\n+///\n+/// Add a value to a bool array. Create the array if it does not exist\n+///\n+static rcl_ret_t add_val_to_bool_arr(\n+  rcl_bool_array_t * const val_array,\n+  bool * value,\n+  const rcl_allocator_t allocator)\n+{\n+  if ((NULL == value) || (NULL == val_array)) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  if (NULL == val_array->values) {\n+    val_array->values = value;\n+    val_array->size++;\n+  } else {\n+    /// Increase the array size by one and add the new value\n+    bool * tmp_arr = val_array->values;\n+    val_array->values = allocator.zero_allocate(val_array->size + 1U, sizeof(bool),\n+        allocator.state);\n+    if (NULL == val_array->values) {\n+      RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+      return RCL_RET_BAD_ALLOC;\n+    }\n+    memmove(val_array->values, tmp_arr, (val_array->size * sizeof(bool)));\n+    val_array->values[val_array->size] = *value;\n+    val_array->size++;\n+    allocator.deallocate(value, allocator.state);\n+    allocator.deallocate(tmp_arr, allocator.state);\n+  }\n+  return RCL_RET_OK;\n+}\n+\n+///\n+/// Add a value to an integer array. Create the array if it does not exist\n+///\n+static rcl_ret_t add_val_to_int_arr(\n+  rcl_int64_array_t * const val_array,\n+  int64_t * value,\n+  const rcl_allocator_t allocator)\n+{\n+  if ((NULL == value) || (NULL == val_array)) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  if (NULL == val_array->values) {\n+    val_array->values = value;\n+    val_array->size++;\n+  } else {\n+    /// Increase the array size by one and add the new value\n+    int64_t * tmp_arr = val_array->values;\n+    val_array->values = allocator.zero_allocate(val_array->size + 1U, sizeof(int64_t),\n+        allocator.state);\n+    if (NULL == val_array->values) {\n+      RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+      return RCL_RET_BAD_ALLOC;\n+    }\n+    memmove(val_array->values, tmp_arr, (val_array->size * sizeof(int64_t)));\n+    val_array->values[val_array->size] = *value;\n+    val_array->size++;\n+    allocator.deallocate(value, allocator.state);\n+    allocator.deallocate(tmp_arr, allocator.state);\n+  }\n+  return RCL_RET_OK;\n+}\n+\n+///\n+/// Add a value to a double array. Create the array if it does not exist\n+///\n+static rcl_ret_t add_val_to_double_arr(\n+  rcl_double_array_t * const val_array,\n+  double * value,\n+  const rcl_allocator_t allocator)\n+{\n+  if ((NULL == value) || (NULL == val_array)) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  if (NULL == val_array->values) {\n+    val_array->values = value;\n+    val_array->size++;\n+  } else {\n+    /// Increase the array size by one and add the new value\n+    double * tmp_arr = val_array->values;\n+    val_array->values = allocator.zero_allocate(val_array->size + 1U, sizeof(double),\n+        allocator.state);\n+    if (NULL == val_array->values) {\n+      RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+      return RCL_RET_BAD_ALLOC;\n+    }\n+    memmove(val_array->values, tmp_arr, (val_array->size * sizeof(double)));\n+    val_array->values[val_array->size] = *value;\n+    val_array->size++;\n+    allocator.deallocate(value, allocator.state);\n+    allocator.deallocate(tmp_arr, allocator.state);\n+  }\n+  return RCL_RET_OK;\n+}\n+\n+///\n+/// Add a value to a string array. Create the array if it does not exist\n+///\n+static rcl_ret_t add_val_to_string_arr(\n+  rcutils_string_array_t * const val_array,\n+  char * value,\n+  const rcl_allocator_t allocator)\n+{\n+  if ((NULL == value) || (NULL == val_array)) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  if (NULL == val_array->data) {\n+    rcl_ret_t res;\n+\n+    res = rcutils_string_array_init(val_array, 1, &allocator);\n+    if (RCL_RET_OK != res) {\n+      return res;\n+    }\n+    val_array->data[0U] = value;\n+  } else {\n+    /// Increase the array size by one and add the new value\n+    val_array->data = allocator.reallocate(val_array->data,\n+        ((val_array->size + 1U) * sizeof(char *)), allocator.state);\n+    if (NULL == val_array->data) {\n+      RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+      return RCL_RET_BAD_ALLOC;\n+    }\n+    val_array->data[val_array->size] = value;\n+    val_array->size++;\n+  }\n+  return RCL_RET_OK;\n+}\n+\n+///\n+/// Determine the type of the value and return the converted value\n+/// NOTE: Only canonical forms supported as of now\n+///\n+static void * get_value(\n+  const char * const value,\n+  data_types_t * val_type,\n+  const rcl_allocator_t allocator)\n+{\n+  void * ret_val;\n+  int64_t ival;\n+  double dval;\n+  char * endptr = NULL;\n+\n+  if ((NULL == value) || (NULL == val_type)) {\n+    RCL_SET_ERROR_MSG(\"Invalid arguments\", allocator);\n+    return NULL;\n+  }\n+\n+  /// Check if it is bool\n+  if ((0 == strncmp(value, \"Y\", strlen(value))) ||\n+    (0 == strncmp(value, \"y\", strlen(value))) ||\n+    (0 == strncmp(value, \"yes\", strlen(value))) ||\n+    (0 == strncmp(value, \"Yes\", strlen(value))) ||\n+    (0 == strncmp(value, \"YES\", strlen(value))) ||\n+    (0 == strncmp(value, \"true\", strlen(value))) ||\n+    (0 == strncmp(value, \"True\", strlen(value))) ||\n+    (0 == strncmp(value, \"TRUE\", strlen(value))) ||\n+    (0 == strncmp(value, \"on\", strlen(value))) ||\n+    (0 == strncmp(value, \"On\", strlen(value))) ||\n+    (0 == strncmp(value, \"ON\", strlen(value))))\n+  {\n+    *val_type = DATA_TYPE_BOOL;\n+    ret_val = allocator.zero_allocate(1U, sizeof(bool), allocator.state);\n+    if (NULL == ret_val) {\n+      return NULL;\n+    }\n+    *((bool *)ret_val) = true;\n+    return ret_val;\n+  }\n+\n+  if ((0 == strncmp(value, \"N\", strlen(value))) ||\n+    (0 == strncmp(value, \"n\", strlen(value))) ||\n+    (0 == strncmp(value, \"no\", strlen(value))) ||\n+    (0 == strncmp(value, \"No\", strlen(value))) ||\n+    (0 == strncmp(value, \"NO\", strlen(value))) ||\n+    (0 == strncmp(value, \"false\", strlen(value))) ||\n+    (0 == strncmp(value, \"False\", strlen(value))) ||\n+    (0 == strncmp(value, \"FALSE\", strlen(value))) ||\n+    (0 == strncmp(value, \"off\", strlen(value))) ||\n+    (0 == strncmp(value, \"Off\", strlen(value))) ||\n+    (0 == strncmp(value, \"OFF\", strlen(value))))\n+  {\n+    *val_type = DATA_TYPE_BOOL;\n+    ret_val = allocator.zero_allocate(1U, sizeof(bool), allocator.state);\n+    if (NULL == ret_val) {\n+      return NULL;\n+    }\n+    *((bool *)ret_val) = false;\n+    return ret_val;\n+  }\n+\n+  /// Check for int\n+  errno = 0;\n+  ival = strtol(value, &endptr, 0);\n+  if ((0 == errno) && (NULL != endptr)) {\n+    if ((NULL != endptr) && (endptr != value)) {\n+      if (('\\0' != *value) && ('\\0' == *endptr)) {\n+        *val_type = DATA_TYPE_INT64;\n+        ret_val = allocator.zero_allocate(1U, sizeof(int64_t), allocator.state);\n+        if (NULL == ret_val) {\n+          return NULL;\n+        }\n+        *((int64_t *)ret_val) = ival;\n+        return ret_val;\n+      }\n+    }\n+  }\n+\n+  /// Check for float\n+  errno = 0;\n+  endptr = NULL;\n+  dval = strtod(value, &endptr);\n+  if ((0 == errno) && (NULL != endptr)) {\n+    if ((NULL != endptr) && (endptr != value)) {\n+      if (('\\0' != *value) && ('\\0' == *endptr)) {\n+        *val_type = DATA_TYPE_DOUBLE;\n+        ret_val = allocator.zero_allocate(1U, sizeof(double), allocator.state);\n+        if (NULL == ret_val) {\n+          return NULL;\n+        }\n+        *((double *)ret_val) = dval;\n+        return ret_val;\n+      }\n+    }\n+  }\n+  errno = 0;\n+\n+  /// It is a string\n+  *val_type = DATA_TYPE_STRING;\n+  ret_val = rcutils_strdup(value, allocator);\n+  return ret_val;\n+}\n+\n+///\n+/// Parse the value part of the <key:value> pair\n+///\n+static rcl_ret_t parse_value(\n+  const yaml_event_t event,\n+  const bool is_seq,\n+  data_types_t * seq_data_type,\n+  rcl_params_t * params_st)\n+{\n+  void * ret_val;\n+  data_types_t val_type;\n+  int res = RCL_RET_OK;\n+  rcl_allocator_t allocator;\n+\n+  if ((NULL == params_st) || (0U == params_st->num_nodes) || (NULL == seq_data_type)) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+  allocator = params_st->allocator;\n+\n+  const size_t node_idx = (params_st->num_nodes - 1U);\n+  if (0U == params_st->params[node_idx].num_params) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  const size_t parameter_idx = ((params_st->params[node_idx].num_params) - 1U);\n+  const size_t val_size = event.data.scalar.length;\n+  const char * value = (char *)event.data.scalar.value;\n+  const uint32_t line_num = ((uint32_t)(event.start_mark.line) + 1U);\n+  rcl_variant_t * param_value;\n+\n+  if (val_size > MAX_STRING_SIZE) {\n+    RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"Scalar value at line %d\"\n+      \" is bigger than %d bytes\", line_num, MAX_STRING_SIZE);\n+    return RCL_RET_ERROR;\n+  } else {\n+    if (0U == val_size) {\n+      RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"No value at line %d\", line_num);\n+      return RCL_RET_ERROR;\n+    }\n+  }\n+\n+  if (NULL == value) {\n+    return RCL_RET_INVALID_ARGUMENT;\n+  }\n+\n+  if (NULL == params_st->params[node_idx].parameter_values) {\n+    RCL_SET_ERROR_MSG(\"Internal error: Invalid mem\", allocator);\n+    return RCL_RET_BAD_ALLOC;\n+  }\n+\n+  param_value = &(params_st->params[node_idx].parameter_values[parameter_idx]);\n+\n+  // param_value->string_value = rcutils_strdup(value, allocator);\n+  ret_val = get_value(value, &val_type, allocator);\n+  if (NULL == ret_val) {\n+    RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"Error parsing value %s at\"\n+      \" line %d\", value, line_num);\n+    return RCL_RET_ERROR;\n+  }\n+\n+  switch (val_type) {\n+    case DATA_TYPE_UNKNOWN:\n+      RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"Unknown data type of\"\n+        \" value %s at line %d\\n\", value, line_num);\n+      res = RCL_RET_ERROR;\n+      break;\n+    case DATA_TYPE_BOOL:\n+      if (false == is_seq) {\n+        param_value->bool_value = (bool *)ret_val;\n+      } else {\n+        if (DATA_TYPE_UNKNOWN == *seq_data_type) {\n+          *seq_data_type = val_type;\n+          param_value->bool_array_value =\n+            allocator.zero_allocate(1U, sizeof(rcl_bool_array_t), allocator.state);\n+          if (NULL == param_value->bool_array_value) {\n+            RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+            return RCL_RET_BAD_ALLOC;\n+          }\n+        } else {\n+          if (*seq_data_type != val_type) {\n+            RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"Sequence should be of same\"\n+              \" type. Value type 'bool' do not belong at line_num %d\", line_num);\n+            allocator.deallocate(ret_val, allocator.state);\n+            return RCL_RET_ERROR;\n+          }\n+        }\n+        res = add_val_to_bool_arr(param_value->bool_array_value, ret_val, allocator);\n+        if (RCL_RET_OK != res) {\n+          if (NULL != ret_val) {\n+            allocator.deallocate(ret_val, allocator.state);\n+          }\n+          return res;\n+        }\n+      }\n+      break;\n+    case DATA_TYPE_INT64:\n+      if (false == is_seq) {\n+        param_value->integer_value = (int64_t *)ret_val;\n+      } else {\n+        if (DATA_TYPE_UNKNOWN == *seq_data_type) {\n+          *seq_data_type = val_type;\n+          param_value->integer_array_value =\n+            allocator.zero_allocate(1U, sizeof(rcl_int64_array_t), allocator.state);\n+          if (NULL == param_value->integer_array_value) {\n+            RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+            return RCL_RET_BAD_ALLOC;\n+          }\n+        } else {\n+          if (*seq_data_type != val_type) {\n+            RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"Sequence should be of same\"\n+              \" type. Value type 'integer' do not belong at line_num %d\", line_num);\n+            allocator.deallocate(ret_val, allocator.state);\n+            return RCL_RET_ERROR;\n+          }\n+        }\n+        res = add_val_to_int_arr(param_value->integer_array_value, ret_val, allocator);\n+        if (RCL_RET_OK != res) {\n+          if (NULL != ret_val) {\n+            allocator.deallocate(ret_val, allocator.state);\n+          }\n+          return res;\n+        }\n+      }\n+      break;\n+    case DATA_TYPE_DOUBLE:\n+      if (false == is_seq) {\n+        param_value->double_value = (double *)ret_val;\n+      } else {\n+        if (DATA_TYPE_UNKNOWN == *seq_data_type) {\n+          *seq_data_type = val_type;\n+          param_value->double_array_value =\n+            allocator.zero_allocate(1U, sizeof(rcl_double_array_t), allocator.state);\n+          if (NULL == param_value->double_array_value) {\n+            RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+            return RCL_RET_BAD_ALLOC;\n+          }\n+        } else {\n+          if (*seq_data_type != val_type) {\n+            RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(allocator, \"Sequence should be of same\"\n+              \" type. Value type 'double' do not belong at line_num %d\", line_num);\n+            allocator.deallocate(ret_val, allocator.state);\n+            return RCL_RET_ERROR;\n+          }\n+        }\n+        res = add_val_to_double_arr(param_value->double_array_value, ret_val, allocator);\n+        if (RCL_RET_OK != res) {\n+          if (NULL != ret_val) {\n+            allocator.deallocate(ret_val, allocator.state);\n+          }\n+          return res;\n+        }\n+      }\n+      break;\n+    case DATA_TYPE_STRING:\n+      if (false == is_seq) {\n+        param_value->string_value = (char *)ret_val;\n+      } else {\n+        if (DATA_TYPE_UNKNOWN == *seq_data_type) {\n+          *seq_data_type = val_type;\n+          param_value->string_array_value =\n+            allocator.zero_allocate(1U, sizeof(rcutils_string_array_t), allocator.state);\n+          if (NULL == param_value->string_array_value) {\n+            RCUTILS_SAFE_FWRITE_TO_STDERR(\"Error allocating mem\");\n+            return RCL_RET_BAD_ALLOC;\n+          }\n+        } else {\n+          if (*seq_data_type != val_type) {","path":"rcl_yaml_param_parser/src/parser.c","position":883,"original_position":970,"commit_id":"530bd2b72522ed7d6d53cc76f863986167f3d614","original_commit_id":"530bd2b72522ed7d6d53cc76f863986167f3d614","user":{"login":"dirk-thomas","id":1335366,"avatar_url":"https://avatars1.githubusercontent.com/u/1335366?v=4","gravatar_id":"","url":"https://api.github.com/users/dirk-thomas","html_url":"https://github.com/dirk-thomas","followers_url":"https://api.github.com/users/dirk-thomas/followers","following_url":"https://api.github.com/users/dirk-thomas/following{/other_user}","gists_url":"https://api.github.com/users/dirk-thomas/gists{/gist_id}","starred_url":"https://api.github.com/users/dirk-thomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirk-thomas/subscriptions","organizations_url":"https://api.github.com/users/dirk-thomas/orgs","repos_url":"https://api.github.com/users/dirk-thomas/repos","events_url":"https://api.github.com/users/dirk-thomas/events{/privacy}","received_events_url":"https://api.github.com/users/dirk-thomas/received_events","type":"User","site_admin":false},"body":"This line resulted in a new compiler warning in [this job](https://ci.ros2.org/view/packaging/job/packaging_linux-aarch64/451/warnings23Result/new/). Please address the new warning as soon as feasible. Thanks.","created_at":"2018-05-29T23:58:44Z","updated_at":"2018-05-29T23:58:44Z","html_url":"https://github.com/ros2/rcl/pull/235#discussion_r191609548","pull_request_url":"https://api.github.com/repos/ros2/rcl/pulls/235","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ros2/rcl/pulls/comments/191609548"},"html":{"href":"https://github.com/ros2/rcl/pull/235#discussion_r191609548"},"pull_request":{"href":"https://api.github.com/repos/ros2/rcl/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/ros2/rcl/pulls/235","id":185886913,"html_url":"https://github.com/ros2/rcl/pull/235","diff_url":"https://github.com/ros2/rcl/pull/235.diff","patch_url":"https://github.com/ros2/rcl/pull/235.patch","issue_url":"https://api.github.com/repos/ros2/rcl/issues/235","number":235,"state":"closed","locked":false,"title":"YAML parameter parser","user":{"login":"anup-pem","id":5606439,"avatar_url":"https://avatars1.githubusercontent.com/u/5606439?v=4","gravatar_id":"","url":"https://api.github.com/users/anup-pem","html_url":"https://github.com/anup-pem","followers_url":"https://api.github.com/users/anup-pem/followers","following_url":"https://api.github.com/users/anup-pem/following{/other_user}","gists_url":"https://api.github.com/users/anup-pem/gists{/gist_id}","starred_url":"https://api.github.com/users/anup-pem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anup-pem/subscriptions","organizations_url":"https://api.github.com/users/anup-pem/orgs","repos_url":"https://api.github.com/users/anup-pem/repos","events_url":"https://api.github.com/users/anup-pem/events{/privacy}","received_events_url":"https://api.github.com/users/anup-pem/received_events","type":"User","site_admin":false},"body":"A basic yaml parameter parser to parse ros2 node parameters from a yaml file and populate a C data structure","created_at":"2018-05-04T03:43:53Z","updated_at":"2018-05-29T23:58:44Z","closed_at":"2018-05-29T16:07:03Z","merged_at":"2018-05-29T16:07:03Z","merge_commit_sha":"5edf27b032cdaa324349bbdc02a9772eb4d9443b","assignee":{"login":"anup-pem","id":5606439,"avatar_url":"https://avatars1.githubusercontent.com/u/5606439?v=4","gravatar_id":"","url":"https://api.github.com/users/anup-pem","html_url":"https://github.com/anup-pem","followers_url":"https://api.github.com/users/anup-pem/followers","following_url":"https://api.github.com/users/anup-pem/following{/other_user}","gists_url":"https://api.github.com/users/anup-pem/gists{/gist_id}","starred_url":"https://api.github.com/users/anup-pem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anup-pem/subscriptions","organizations_url":"https://api.github.com/users/anup-pem/orgs","repos_url":"https://api.github.com/users/anup-pem/repos","events_url":"https://api.github.com/users/anup-pem/events{/privacy}","received_events_url":"https://api.github.com/users/anup-pem/received_events","type":"User","site_admin":false},"assignees":[{"login":"anup-pem","id":5606439,"avatar_url":"https://avatars1.githubusercontent.com/u/5606439?v=4","gravatar_id":"","url":"https://api.github.com/users/anup-pem","html_url":"https://github.com/anup-pem","followers_url":"https://api.github.com/users/anup-pem/followers","following_url":"https://api.github.com/users/anup-pem/following{/other_user}","gists_url":"https://api.github.com/users/anup-pem/gists{/gist_id}","starred_url":"https://api.github.com/users/anup-pem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anup-pem/subscriptions","organizations_url":"https://api.github.com/users/anup-pem/orgs","repos_url":"https://api.github.com/users/anup-pem/repos","events_url":"https://api.github.com/users/anup-pem/events{/privacy}","received_events_url":"https://api.github.com/users/anup-pem/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"wjwwood","id":100427,"avatar_url":"https://avatars1.githubusercontent.com/u/100427?v=4","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":180241099,"url":"https://api.github.com/repos/ros2/rcl/labels/in%20progress","name":"in progress","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ros2/rcl/pulls/235/commits","review_comments_url":"https://api.github.com/repos/ros2/rcl/pulls/235/comments","review_comment_url":"https://api.github.com/repos/ros2/rcl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/rcl/issues/235/comments","statuses_url":"https://api.github.com/repos/ros2/rcl/statuses/530bd2b72522ed7d6d53cc76f863986167f3d614","head":{"label":"ros2:yaml_param_parser","ref":"yaml_param_parser","sha":"530bd2b72522ed7d6d53cc76f863986167f3d614","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":31091419,"name":"rcl","full_name":"ros2/rcl","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rcl","description":"Library to support implementation of language specific ROS Client Libraries.","fork":false,"url":"https://api.github.com/repos/ros2/rcl","forks_url":"https://api.github.com/repos/ros2/rcl/forks","keys_url":"https://api.github.com/repos/ros2/rcl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rcl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rcl/teams","hooks_url":"https://api.github.com/repos/ros2/rcl/hooks","issue_events_url":"https://api.github.com/repos/ros2/rcl/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rcl/events","assignees_url":"https://api.github.com/repos/ros2/rcl/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rcl/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rcl/tags","blobs_url":"https://api.github.com/repos/ros2/rcl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rcl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rcl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rcl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rcl/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rcl/languages","stargazers_url":"https://api.github.com/repos/ros2/rcl/stargazers","contributors_url":"https://api.github.com/repos/ros2/rcl/contributors","subscribers_url":"https://api.github.com/repos/ros2/rcl/subscribers","subscription_url":"https://api.github.com/repos/ros2/rcl/subscription","commits_url":"https://api.github.com/repos/ros2/rcl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rcl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rcl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rcl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rcl/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rcl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rcl/merges","archive_url":"https://api.github.com/repos/ros2/rcl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rcl/downloads","issues_url":"https://api.github.com/repos/ros2/rcl/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rcl/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rcl/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rcl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rcl/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rcl/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/rcl/deployments","created_at":"2015-02-21T00:06:40Z","updated_at":"2018-05-29T21:42:04Z","pushed_at":"2018-05-29T18:00:14Z","git_url":"git://github.com/ros2/rcl.git","ssh_url":"git@github.com:ros2/rcl.git","clone_url":"https://github.com/ros2/rcl.git","svn_url":"https://github.com/ros2/rcl","homepage":null,"size":783,"stargazers_count":18,"watchers_count":18,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":18,"open_issues":20,"watchers":18,"default_branch":"master"}},"base":{"label":"ros2:master","ref":"master","sha":"e8491ab8abba5c9653fdfc46064cc3b0d5ee18b9","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":31091419,"name":"rcl","full_name":"ros2/rcl","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rcl","description":"Library to support implementation of language specific ROS Client Libraries.","fork":false,"url":"https://api.github.com/repos/ros2/rcl","forks_url":"https://api.github.com/repos/ros2/rcl/forks","keys_url":"https://api.github.com/repos/ros2/rcl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rcl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rcl/teams","hooks_url":"https://api.github.com/repos/ros2/rcl/hooks","issue_events_url":"https://api.github.com/repos/ros2/rcl/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rcl/events","assignees_url":"https://api.github.com/repos/ros2/rcl/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rcl/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rcl/tags","blobs_url":"https://api.github.com/repos/ros2/rcl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rcl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rcl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rcl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rcl/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rcl/languages","stargazers_url":"https://api.github.com/repos/ros2/rcl/stargazers","contributors_url":"https://api.github.com/repos/ros2/rcl/contributors","subscribers_url":"https://api.github.com/repos/ros2/rcl/subscribers","subscription_url":"https://api.github.com/repos/ros2/rcl/subscription","commits_url":"https://api.github.com/repos/ros2/rcl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rcl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rcl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rcl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rcl/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rcl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rcl/merges","archive_url":"https://api.github.com/repos/ros2/rcl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rcl/downloads","issues_url":"https://api.github.com/repos/ros2/rcl/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rcl/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rcl/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rcl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rcl/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rcl/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/rcl/deployments","created_at":"2015-02-21T00:06:40Z","updated_at":"2018-05-29T21:42:04Z","pushed_at":"2018-05-29T18:00:14Z","git_url":"git://github.com/ros2/rcl.git","ssh_url":"git@github.com:ros2/rcl.git","clone_url":"https://github.com/ros2/rcl.git","svn_url":"https://github.com/ros2/rcl","homepage":null,"size":783,"stargazers_count":18,"watchers_count":18,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":18,"open_issues":20,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/rcl/pulls/235"},"html":{"href":"https://github.com/ros2/rcl/pull/235"},"issue":{"href":"https://api.github.com/repos/ros2/rcl/issues/235"},"comments":{"href":"https://api.github.com/repos/ros2/rcl/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/rcl/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/rcl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/rcl/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/rcl/statuses/530bd2b72522ed7d6d53cc76f863986167f3d614"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dirk-thomas"}}