rcl  master
C API providing common ROS client library functionality.
validate_topic_name.h
Go to the documentation of this file.
1 // Copyright 2017 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__VALIDATE_TOPIC_NAME_H_
16 #define RCL__VALIDATE_TOPIC_NAME_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rcl/macros.h"
24 #include "rcl/types.h"
25 #include "rcl/visibility_control.h"
26 
27 #define RCL_TOPIC_NAME_VALID 0
28 #define RCL_TOPIC_NAME_INVALID_IS_EMPTY_STRING 1
29 #define RCL_TOPIC_NAME_INVALID_ENDS_WITH_FORWARD_SLASH 2
30 #define RCL_TOPIC_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS 3
31 #define RCL_TOPIC_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER 4
32 #define RCL_TOPIC_NAME_INVALID_UNMATCHED_CURLY_BRACE 5
33 #define RCL_TOPIC_NAME_INVALID_MISPLACED_TILDE 6
34 #define RCL_TOPIC_NAME_INVALID_TILDE_NOT_FOLLOWED_BY_FORWARD_SLASH 7
35 #define RCL_TOPIC_NAME_INVALID_SUBSTITUTION_CONTAINS_UNALLOWED_CHARACTERS 8
36 #define RCL_TOPIC_NAME_INVALID_SUBSTITUTION_STARTS_WITH_NUMBER 9
37 
39 
93  const char * topic_name,
94  int * validation_result,
95  size_t * invalid_index);
96 
98 
106 rcl_ret_t
108  const char * topic_name,
109  size_t topic_name_length,
110  int * validation_result,
111  size_t * invalid_index);
112 
116 const char *
117 rcl_topic_name_validation_result_string(int validation_result);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif // RCL__VALIDATE_TOPIC_NAME_H_
rmw_ret_t rcl_ret_t
Definition: types.h:20
const char * rcl_topic_name_validation_result_string(int validation_result)
Return a validation result description, or NULL if unknown or RCL_TOPIC_NAME_VALID.
#define RCL_WARN_UNUSED
Ignored return values of functions with this macro will emit a warning.
Definition: macros.h:25
#define RCL_PUBLIC
Definition: visibility_control.h:48
rcl_ret_t rcl_validate_topic_name_with_size(const char *topic_name, size_t topic_name_length, int *validation_result, size_t *invalid_index)
Validate a given topic name.
rcl_ret_t rcl_validate_topic_name(const char *topic_name, int *validation_result, size_t *invalid_index)
Validate a given topic name.