@@ -34,6 +34,9 @@ typedef struct rcl_arguments_t
34
34
struct rcl_arguments_impl_t * impl ;
35
35
} rcl_arguments_t ;
36
36
37
+ #define RCL_ROS_ARGS_FLAG "--ros-args"
38
+ #define RCL_ROS_ARGS_EXPLICIT_END_TOKEN "--"
39
+
37
40
#define RCL_LOG_LEVEL_ARG_RULE "__log_level:="
38
41
#define RCL_EXTERNAL_LOG_CONFIG_ARG_RULE "__log_config_file:="
39
42
#define RCL_LOG_DISABLE_STDOUT_ARG_RULE "__log_disable_stdout:="
@@ -97,7 +100,7 @@ rcl_parse_arguments(
97
100
rcl_allocator_t allocator ,
98
101
rcl_arguments_t * args_output );
99
102
100
- /// Return the number of arguments that were not successfully parsed .
103
+ /// Return the number of arguments that were not ROS specific arguments .
101
104
/**
102
105
* <hr>
103
106
* Attribute | Adherence
@@ -117,10 +120,10 @@ int
117
120
rcl_arguments_get_count_unparsed (
118
121
const rcl_arguments_t * args );
119
122
120
- /// Return a list of indexes that weren't successfully parsed .
123
+ /// Return a list of indices to non ROS specific arguments .
121
124
/**
122
- * Some arguments may not have been successfully parsed, or were not intended as ROS arguments .
123
- * This function populates an array of indexes to these arguments in the original argv array.
125
+ * Non ROS specific arguments may have been provided i.e. arguments outside a '--ros-args' scope .
126
+ * This function populates an array of indices to these arguments in the original argv array.
124
127
* Since the first argument is always assumed to be a process name, the list will always contain
125
128
* the index 0.
126
129
*
@@ -150,6 +153,58 @@ rcl_arguments_get_unparsed(
150
153
rcl_allocator_t allocator ,
151
154
int * * output_unparsed_indices );
152
155
156
+ /// Return the number of ROS specific arguments that were not successfully parsed.
157
+ /**
158
+ * <hr>
159
+ * Attribute | Adherence
160
+ * ------------------ | -------------
161
+ * Allocates Memory | No
162
+ * Thread-Safe | Yes
163
+ * Uses Atomics | No
164
+ * Lock-Free | Yes
165
+ *
166
+ * \param[in] args An arguments structure that has been parsed.
167
+ * \return number of unparsed ROS specific arguments, or
168
+ * \return -1 if args is `NULL` or zero initialized.
169
+ */
170
+ RCL_PUBLIC
171
+ RCL_WARN_UNUSED
172
+ int
173
+ rcl_arguments_get_count_unparsed_ros (
174
+ const rcl_arguments_t * args );
175
+
176
+ /// Return a list of indices to ROS specific arguments that were not successfully parsed.
177
+ /**
178
+ * Some ROS specific arguments may not have been successfully parsed, or were not intended to be
179
+ * parsed by rcl.
180
+ * This function populates an array of indices to these arguments in the original argv array.
181
+ *
182
+ * <hr>
183
+ * Attribute | Adherence
184
+ * ------------------ | -------------
185
+ * Allocates Memory | Yes
186
+ * Thread-Safe | Yes
187
+ * Uses Atomics | No
188
+ * Lock-Free | Yes
189
+ *
190
+ * \param[in] args An arguments structure that has been parsed.
191
+ * \param[in] allocator A valid allocator.
192
+ * \param[out] output_unparsed_indices An allocated array of indices into the original argv array.
193
+ * This array must be deallocated by the caller using the given allocator.
194
+ * If there are no unparsed ROS specific arguments then the output will be set to NULL.
195
+ * \return `RCL_RET_OK` if everything goes correctly, or
196
+ * \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
197
+ * \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
198
+ * \return `RCL_RET_ERROR` if an unspecified error occurs.
199
+ */
200
+ RCL_PUBLIC
201
+ RCL_WARN_UNUSED
202
+ rcl_ret_t
203
+ rcl_arguments_get_unparsed_ros (
204
+ const rcl_arguments_t * args ,
205
+ rcl_allocator_t allocator ,
206
+ int * * output_unparsed_ros_indices );
207
+
153
208
/// Return the number of parameter yaml files given in the arguments.
154
209
/**
155
210
* <hr>
0 commit comments