rcl  master
C API providing common ROS client library functionality.
validate_enclave_name.h
Go to the documentation of this file.
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 
16 
17 #ifndef RCL__VALIDATE_ENCLAVE_NAME_H_
18 #define RCL__VALIDATE_ENCLAVE_NAME_H_
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "rmw/validate_namespace.h"
26 #include "rmw/validate_node_name.h"
27 
28 #include "rcl/macros.h"
29 #include "rcl/types.h"
30 #include "rcl/visibility_control.h"
31 
33 #define RCL_ENCLAVE_NAME_VALID RMW_NAMESPACE_VALID
34 
36 #define RCL_ENCLAVE_NAME_INVALID_IS_EMPTY_STRING RMW_NAMESPACE_INVALID_IS_EMPTY_STRING
37 
39 #define RCL_ENCLAVE_NAME_INVALID_NOT_ABSOLUTE RMW_NAMESPACE_INVALID_NOT_ABSOLUTE
40 
42 #define RCL_ENCLAVE_NAME_INVALID_ENDS_WITH_FORWARD_SLASH \
43  RMW_NAMESPACE_INVALID_ENDS_WITH_FORWARD_SLASH
44 
46 #define RCL_ENCLAVE_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS \
47  RMW_NAMESPACE_INVALID_CONTAINS_UNALLOWED_CHARACTERS
48 
50 #define RCL_ENCLAVE_NAME_INVALID_CONTAINS_REPEATED_FORWARD_SLASH \
51  RMW_NAMESPACE_INVALID_CONTAINS_REPEATED_FORWARD_SLASH
52 
54 #define RCL_ENCLAVE_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER \
55  RMW_NAMESPACE_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER
56 
58 #define RCL_ENCLAVE_NAME_INVALID_TOO_LONG RMW_NAMESPACE_INVALID_TOO_LONG
59 
61 #define RCL_ENCLAVE_NAME_MAX_LENGTH RMW_NODE_NAME_MAX_NAME_LENGTH
62 
64 
75 RCL_PUBLIC
76 RCL_WARN_UNUSED
79  const char * enclave,
80  int * validation_result,
81  size_t * invalid_index);
82 
84 
96 RCL_PUBLIC
97 RCL_WARN_UNUSED
100  const char * enclave,
101  size_t enclave_length,
102  int * validation_result,
103  size_t * invalid_index);
104 
106 
111 RCL_PUBLIC
112 RCL_WARN_UNUSED
113 const char *
114 rcl_enclave_name_validation_result_string(int validation_result);
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif // RCL__VALIDATE_ENCLAVE_NAME_H_
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_validate_enclave_name
rcl_ret_t rcl_validate_enclave_name(const char *enclave, int *validation_result, size_t *invalid_index)
Determine if a given enclave name is valid.
rcl_enclave_name_validation_result_string
const char * rcl_enclave_name_validation_result_string(int validation_result)
Return a validation result description, or NULL if unknown or RCL_ENCLAVE_NAME_VALID.
validate_namespace.h
rcl_validate_enclave_name_with_size
rcl_ret_t rcl_validate_enclave_name_with_size(const char *enclave, size_t enclave_length, int *validation_result, size_t *invalid_index)
Deterimine if a given enclave name is valid.
validate_node_name.h