rcl  master
C API providing common ROS client library functionality.
arguments.h
1 // Copyright 2018 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCL__ARGUMENTS_H_
16 #define RCL__ARGUMENTS_H_
17 
18 #include "rcl/allocator.h"
19 #include "rcl/macros.h"
20 #include "rcl/types.h"
21 #include "rcl/visibility_control.h"
22 #include "rcl_yaml_param_parser/types.h"
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 struct rcl_arguments_impl_t;
30 
32 typedef struct rcl_arguments_t
33 {
35  struct rcl_arguments_impl_t * impl;
37 
38 #define RCL_ROS_ARGS_FLAG "--ros-args"
39 #define RCL_ROS_ARGS_EXPLICIT_END_TOKEN "--"
40 #define RCL_PARAM_FLAG "--param"
41 #define RCL_SHORT_PARAM_FLAG "-p"
42 #define RCL_PARAM_FILE_FLAG "--params-file"
43 #define RCL_REMAP_FLAG "--remap"
44 #define RCL_SHORT_REMAP_FLAG "-r"
45 #define RCL_ENCLAVE_FLAG "--enclave"
46 #define RCL_SHORT_ENCLAVE_FLAG "-e"
47 #define RCL_LOG_LEVEL_FLAG "--log-level"
48 #define RCL_EXTERNAL_LOG_CONFIG_FLAG "--log-config-file"
49 // To be prefixed with --enable- or --disable-
50 #define RCL_LOG_STDOUT_FLAG_SUFFIX "stdout-logs"
51 #define RCL_LOG_ROSOUT_FLAG_SUFFIX "rosout-logs"
52 #define RCL_LOG_EXT_LIB_FLAG_SUFFIX "external-lib-logs"
53 
55 RCL_PUBLIC
56 RCL_WARN_UNUSED
58 rcl_get_zero_initialized_arguments(void);
59 
61 
117 RCL_PUBLIC
118 RCL_WARN_UNUSED
119 rcl_ret_t
120 rcl_parse_arguments(
121  int argc,
122  const char * const argv[],
123  rcl_allocator_t allocator,
124  rcl_arguments_t * args_output);
125 
127 
140 RCL_PUBLIC
141 RCL_WARN_UNUSED
142 int
143 rcl_arguments_get_count_unparsed(
144  const rcl_arguments_t * args);
145 
147 
171 RCL_PUBLIC
172 RCL_WARN_UNUSED
173 rcl_ret_t
174 rcl_arguments_get_unparsed(
175  const rcl_arguments_t * args,
176  rcl_allocator_t allocator,
177  int ** output_unparsed_indices);
178 
180 
193 RCL_PUBLIC
194 RCL_WARN_UNUSED
195 int
196 rcl_arguments_get_count_unparsed_ros(
197  const rcl_arguments_t * args);
198 
200 
223 RCL_PUBLIC
224 RCL_WARN_UNUSED
225 rcl_ret_t
226 rcl_arguments_get_unparsed_ros(
227  const rcl_arguments_t * args,
228  rcl_allocator_t allocator,
229  int ** output_unparsed_ros_indices);
230 
232 
245 RCL_PUBLIC
246 RCL_WARN_UNUSED
247 int
248 rcl_arguments_get_param_files_count(
249  const rcl_arguments_t * args);
250 
251 
253 
272 RCL_PUBLIC
273 RCL_WARN_UNUSED
274 rcl_ret_t
275 rcl_arguments_get_param_files(
276  const rcl_arguments_t * arguments,
277  rcl_allocator_t allocator,
278  char *** parameter_files);
279 
281 
302 RCL_PUBLIC
303 RCL_WARN_UNUSED
304 rcl_ret_t
305 rcl_arguments_get_param_overrides(
306  const rcl_arguments_t * arguments,
307  rcl_params_t ** parameter_overrides);
308 
310 
336 RCL_PUBLIC
337 RCL_WARN_UNUSED
338 rcl_ret_t
339 rcl_remove_ros_arguments(
340  char const * const argv[],
341  const rcl_arguments_t * args,
342  rcl_allocator_t allocator,
343  int * nonros_argc,
344  const char ** nonros_argv[]);
345 
347 
364 RCL_PUBLIC
365 RCL_WARN_UNUSED
366 rcl_ret_t
367 rcl_arguments_copy(
368  const rcl_arguments_t * args,
369  rcl_arguments_t * args_out);
370 
372 
386 RCL_PUBLIC
387 RCL_WARN_UNUSED
388 rcl_ret_t
389 rcl_arguments_fini(
390  rcl_arguments_t * args);
391 
392 #ifdef __cplusplus
393 }
394 #endif
395 
396 #endif // RCL__ARGUMENTS_H_
rcl_arguments_t::impl
struct rcl_arguments_impl_t * impl
Private implementation pointer.
Definition: arguments.h:35
rcl_arguments_t
Hold output of parsing command line arguments.
Definition: arguments.h:32
rcutils_allocator_t