~wb-munzinger/+junk/ocfs2-tools

« back to all changes in this revision

Viewing changes to libocfs2/include/feature_string.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2009-07-06 07:26:30 UTC
  • mfrom: (1.1.7 upstream) (0.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090706072630-59335sl51k3rvu74
Tags: 1.4.2-1
* New upstream release (Closes: #535471).
* Drop patch for limits.h, included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c; c-basic-offset: 8; -*-
2
 
 * vim: noexpandtab sw=8 ts=8 sts=0:
3
 
 *
4
 
 * feature_strings.h
5
 
 *
6
 
 * Routines for analyzing a feature string.
7
 
 *
8
 
 * Copyright (C) 2007 Oracle.  All rights reserved.
9
 
 *
10
 
 * This program is free software; you can redistribute it and/or
11
 
 * modify it under the terms of the GNU General Public
12
 
 * License, version 2,  as published by the Free Software Foundation.
13
 
 *
14
 
 * This program is distributed in the hope that it will be useful,
15
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
 * General Public License for more details.
18
 
 *
19
 
 * You should have received a copy of the GNU General Public
20
 
 * License along with this program; if not, write to the
21
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
 
 * Boston, MA 021110-1307, USA.
23
 
 *
24
 
 */
25
 
 
26
 
#ifndef __FEATURE_STRING_H
27
 
#define __FEATURE_STRING_H
28
 
 
29
 
#include <ocfs2.h>
30
 
 
31
 
struct fs_feature_flags {
32
 
        const char *ff_str;
33
 
        /* this flag is the feature's own flag. */
34
 
        fs_options ff_own_flags;
35
 
        /*
36
 
         * this flag includes the feature's own flag and
37
 
         * all the other features' flag it depends on.
38
 
         */
39
 
        fs_options ff_flags;
40
 
};
41
 
 
42
 
enum feature_level_indexes {
43
 
        FEATURE_LEVEL_DEFAULT = 0,
44
 
        FEATURE_LEVEL_MAX_COMPAT,
45
 
        FEATURE_LEVEL_MAX_FEATURES,
46
 
};
47
 
 
48
 
errcode_t parse_feature(const char *opts,
49
 
                        fs_options *feature_flags,
50
 
                        fs_options *reverse_flags);
51
 
 
52
 
int parse_feature_level(const char *typestr,
53
 
                        enum feature_level_indexes *index);
54
 
 
55
 
int merge_feature_flags_with_level(fs_options *dest,
56
 
                                   int index,
57
 
                                   fs_options *feature_set,
58
 
                                   fs_options *reverse_set);
59
 
#endif /* __FEATURE_STIRNG_H */