~libbls/libbls/libbls-package

« back to all changes in this revision

Viewing changes to src/segcol_internal.h

  • Committer: Alexandros Frantzis
  • Date: 2011-10-01 10:10:46 UTC
  • Revision ID: alf82@freemail.gr-20111001101046-etz52jurwzwc007x
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2008, 2009 Alexandros Frantzis, Michael Iatrou
 
3
 *
 
4
 * This file is part of libbls.
 
5
 *
 
6
 * libbls is free software: you can redistribute it and/or modify it under the
 
7
 * terms of the GNU Lesser General Public License as published by the Free Software
 
8
 * Foundation, either version 3 of the License, or (at your option) any later
 
9
 * version.
 
10
 *
 
11
 * libbls is distributed in the hope that it will be useful, but WITHOUT ANY
 
12
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
13
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
14
 * details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License along with
 
17
 * libbls.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
/**
 
21
 * @file segcol_internal.h
 
22
 *
 
23
 * Segcol definitions for internal use
 
24
 */
 
25
#ifndef _SEGCOL_INTERNAL_H
 
26
#define _SEGCOL_INTERNAL_H
 
27
 
 
28
#include "segcol.h"
 
29
 
 
30
/**
 
31
 * @addtogroup segcol
 
32
 *
 
33
 * @{
 
34
 */
 
35
 
 
36
/**
 
37
 * Struct that holds the function pointers for an implementation of segcol_t.
 
38
 */
 
39
struct segcol_funcs {
 
40
                int (*free)(segcol_t *segcol);
 
41
                int (*append)(segcol_t *segcol, segment_t *seg); 
 
42
                int (*insert)(segcol_t *segcol, off_t offset, segment_t *seg); 
 
43
                int (*delete)(segcol_t *segcol, segcol_t **deleted, off_t offset,
 
44
                                off_t length);
 
45
                int (*find)(segcol_t *segcol, segcol_iter_t **iter, off_t offset);
 
46
                int (*iter_new)(segcol_t *segcol, void **iter);
 
47
                int (*iter_next)(segcol_iter_t *iter);
 
48
                int (*iter_is_valid)(segcol_iter_t *iter, int *valid);
 
49
                int (*iter_get_segment)(segcol_iter_t *iter, segment_t **seg);
 
50
                int (*iter_get_mapping)(segcol_iter_t *iter, off_t *mapping);
 
51
                int (*iter_free)(segcol_iter_t *iter);
 
52
};
 
53
 
 
54
/**
 
55
 * @name Internal functions
 
56
 * 
 
57
 * @{
 
58
 */
 
59
int segcol_create_impl(segcol_t **segcol, void *impl,
 
60
                struct segcol_funcs *funcs);
 
61
 
 
62
void *segcol_get_impl(segcol_t *segcol);
 
63
 
 
64
void *segcol_iter_get_impl(segcol_iter_t *iter);
 
65
 
 
66
/** @} */
 
67
 
 
68
/** @} */
 
69
 
 
70
#endif /* _SEGCOL_INTERNAL_H */