Motr  M0
catalogue.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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 
23 
24 #pragma once
25 
26 #ifndef __MOTR_DTM_CATALOGUE_H__
27 #define __MOTR_DTM_CATALOGUE_H__
28 
29 
35 /* import */
36 #include "lib/tlist.h"
37 struct m0_uint128;
38 struct m0_dtm_history;
39 struct m0_dtm;
40 struct m0_uint128;
41 
42 /* export */
43 struct m0_dtm_catalogue;
44 
46  struct m0_tl ca_el;
47 };
48 
49 M0_INTERNAL void m0_dtm_catalogue_init(struct m0_dtm_catalogue *cat);
50 M0_INTERNAL void m0_dtm_catalogue_fini(struct m0_dtm_catalogue *cat);
51 M0_INTERNAL int m0_dtm_catalogue_create(struct m0_dtm_catalogue *cat);
52 M0_INTERNAL int m0_dtm_catalogue_delete(struct m0_dtm_catalogue *cat);
53 M0_INTERNAL int m0_dtm_catalogue_lookup(struct m0_dtm_catalogue *cat,
54  const struct m0_uint128 *id,
55  struct m0_dtm_history **out);
56 M0_INTERNAL int m0_dtm_catalogue_add(struct m0_dtm_catalogue *cat,
57  struct m0_dtm_history *history);
58 M0_INTERNAL int m0_dtm_catalogue_del(struct m0_dtm_catalogue *cat,
59  struct m0_dtm_history *history);
60 typedef struct m0_dtm_history *
61 m0_dtm_catalogue_alloc_t(struct m0_dtm *, const struct m0_uint128 *, void *);
62 
63 M0_INTERNAL int m0_dtm_catalogue_find(struct m0_dtm_catalogue *cat,
64  struct m0_dtm *dtm,
65  const struct m0_uint128 *id,
67  void *datum,
68  struct m0_dtm_history **out);
69 
72 #endif /* __MOTR_DTM_CATALOGUE_H__ */
73 
74 
75 /*
76  * Local variables:
77  * c-indentation-style: "K&R"
78  * c-basic-offset: 8
79  * tab-width: 8
80  * fill-column: 80
81  * scroll-step: 1
82  * End:
83  */
84 /*
85  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
86  */
M0_INTERNAL void m0_dtm_catalogue_init(struct m0_dtm_catalogue *cat)
Definition: catalogue.c:44
struct m0_tl ca_el
Definition: catalogue.h:46
M0_INTERNAL int m0_dtm_catalogue_find(struct m0_dtm_catalogue *cat, struct m0_dtm *dtm, const struct m0_uint128 *id, m0_dtm_catalogue_alloc_t *alloc, void *datum, struct m0_dtm_history **out)
Definition: catalogue.c:92
M0_INTERNAL int m0_dtm_catalogue_add(struct m0_dtm_catalogue *cat, struct m0_dtm_history *history)
Definition: catalogue.c:78
Definition: tlist.h:251
static struct ff2c_term * alloc(void)
Definition: parser.c:37
M0_INTERNAL void m0_dtm_catalogue_fini(struct m0_dtm_catalogue *cat)
Definition: catalogue.c:49
struct m0_dtm_history * m0_dtm_catalogue_alloc_t(struct m0_dtm *, const struct m0_uint128 *, void *)
Definition: catalogue.h:61
Definition: dtm.h:529
#define out(...)
Definition: gen.c:41
M0_INTERNAL int m0_dtm_catalogue_create(struct m0_dtm_catalogue *cat)
Definition: catalogue.c:59
M0_INTERNAL int m0_dtm_catalogue_lookup(struct m0_dtm_catalogue *cat, const struct m0_uint128 *id, struct m0_dtm_history **out)
Definition: catalogue.c:69
M0_INTERNAL int m0_dtm_catalogue_delete(struct m0_dtm_catalogue *cat)
Definition: catalogue.c:64
M0_INTERNAL int m0_dtm_catalogue_del(struct m0_dtm_catalogue *cat, struct m0_dtm_history *history)
Definition: catalogue.c:85