Motr
M0
validation.h
Go to the documentation of this file.
1
/* -*- C -*- */
2
/*
3
* Copyright (c) 2016-2020 Seagate Technology LLC and/or its Affiliates
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
* For any questions about this software or licensing,
18
* please email opensource@seagate.com or cortx-questions@seagate.com.
19
*
20
*/
21
22
#pragma once
23
#ifndef __MOTR_CONF_VALIDATION_H__
24
#define __MOTR_CONF_VALIDATION_H__
25
26
#include "
lib/types.h
"
/* bool */
27
28
struct
m0_conf_cache
;
29
struct
m0_conf_obj
;
30
struct
m0_fid
;
31
60
char
*
m0_conf_validation_error
(
struct
m0_conf_cache
*
cache
,
61
char
*
buf
,
size_t
buflen);
62
69
M0_INTERNAL
char
*
m0_conf_validation_error_locked
(
70
const
struct
m0_conf_cache
*
cache
,
char
*
buf
,
size_t
buflen);
71
73
struct
m0_conf_rule
{
74
/*
75
* Use the name of the function that .cvr_error points at.
76
* This simplifies finding the rule that failed.
77
*/
78
const
char
*
cvr_name
;
85
char
*(*cvr_error)(
const
struct
m0_conf_cache
*
cache
,
86
char
*
buf
,
size_t
buflen);
87
};
88
90
enum
{
M0_CONF_RULES_MAX
= 32 };
91
93
struct
m0_conf_ruleset
{
94
/*
95
* Use the name of m0_conf_ruleset variable. This simplifies
96
* finding the rule that failed.
97
*/
98
const
char
*
cv_name
;
99
/*
100
* This array must end with { NULL, NULL }.
101
*/
102
struct
m0_conf_rule
cv_rules
[
M0_CONF_RULES_MAX
];
103
};
104
106
#endif
/* __MOTR_CONF_VALIDATION_H__ */
107
108
/*
109
* Local variables:
110
* c-indentation-style: "K&R"
111
* c-basic-offset: 8
112
* tab-width: 8
113
* fill-column: 80
114
* scroll-step: 1
115
* End:
116
*/
117
/*
118
* vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
119
*/
cache
Definition:
beck.c:235
types.h
M0_CONF_RULES_MAX
Definition:
validation.h:90
m0_conf_cache
Definition:
cache.h:94
buf
static int void * buf
Definition:
dir.c:1019
buf
Definition:
sock.c:887
m0_conf_ruleset::cv_name
const char * cv_name
Definition:
validation.h:98
m0_conf_validation_error
char * m0_conf_validation_error(struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition:
validation.c:60
m0_conf_obj
Definition:
obj.h:206
m0_conf_ruleset
Definition:
validation.h:93
m0_fid
Definition:
fid.h:38
m0_conf_ruleset::cv_rules
struct m0_conf_rule cv_rules[M0_CONF_RULES_MAX]
Definition:
validation.h:102
m0_conf_validation_error_locked
M0_INTERNAL char * m0_conf_validation_error_locked(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition:
validation.c:72
m0_conf_rule
Definition:
validation.h:73
m0_conf_rule::cvr_name
const char * cvr_name
Definition:
validation.h:78
conf
validation.h
Generated on Thu Apr 14 2022 14:02:54 for Motr by
1.8.14