rcl  master
C API providing common ROS client library functionality.
validate_enclave_name.h
1 // Copyright 2020 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_ENCLAVE_NAME_H_
16 #define RCL__VALIDATE_ENCLAVE_NAME_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rmw/validate_namespace.h"
24 #include "rmw/validate_node_name.h"
25 
26 #include "rcl/macros.h"
27 #include "rcl/types.h"
28 #include "rcl/visibility_control.h"
29 
30 #define RCL_ENCLAVE_NAME_VALID RMW_NAMESPACE_VALID
31 #define RCL_ENCLAVE_NAME_INVALID_IS_EMPTY_STRING RMW_NAMESPACE_INVALID_IS_EMPTY_STRING
32 #define RCL_ENCLAVE_NAME_INVALID_NOT_ABSOLUTE RMW_NAMESPACE_INVALID_NOT_ABSOLUTE
33 #define RCL_ENCLAVE_NAME_INVALID_ENDS_WITH_FORWARD_SLASH \
34  RMW_NAMESPACE_INVALID_ENDS_WITH_FORWARD_SLASH
35 #define RCL_ENCLAVE_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS \
36  RMW_NAMESPACE_INVALID_CONTAINS_UNALLOWED_CHARACTERS
37 #define RCL_ENCLAVE_NAME_INVALID_CONTAINS_REPEATED_FORWARD_SLASH \
38  RMW_NAMESPACE_INVALID_CONTAINS_REPEATED_FORWARD_SLASH
39 #define RCL_ENCLAVE_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER \
40  RMW_NAMESPACE_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER
41 #define RCL_ENCLAVE_NAME_INVALID_TOO_LONG RMW_NAMESPACE_INVALID_TOO_LONG
42 
43 #define RCL_ENCLAVE_NAME_MAX_LENGTH RMW_NODE_NAME_MAX_NAME_LENGTH
44 
46 
57 RCL_PUBLIC
58 RCL_WARN_UNUSED
59 rcl_ret_t
60 rcl_validate_enclave_name(
61  const char * enclave,
62  int * validation_result,
63  size_t * invalid_index);
64 
66 
72 RCL_PUBLIC
73 RCL_WARN_UNUSED
74 rcl_ret_t
75 rcl_validate_enclave_name_with_size(
76  const char * enclave,
77  size_t enclave_length,
78  int * validation_result,
79  size_t * invalid_index);
80 
82 RCL_PUBLIC
83 RCL_WARN_UNUSED
84 const char *
85 rcl_enclave_name_validation_result_string(int validation_result);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif // RCL__VALIDATE_ENCLAVE_NAME_H_
validate_namespace.h
validate_node_name.h