Whamcloud - gitweb
Fix edge case when i_size doesn't get fixed until second e2fsck run
[tools/e2fsprogs.git] / e2fsck / profile.h
1 /*
2  * profile.h
3  *
4  * Copyright (C) 2005 by Theodore Ts'o.
5  *
6  * %Begin-Header%
7  * This file may be redistributed under the terms of the GNU Public
8  * License.
9  * %End-Header%
10  * 
11  * Copyright (C) 1985-2005 by the Massachusetts Institute of Technology.
12  * 
13  * All rights reserved.
14  * 
15  * Export of this software from the United States of America may require
16  * a specific license from the United States Government.  It is the
17  * responsibility of any person or organization contemplating export to
18  * obtain such a license before exporting.
19  * 
20  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
21  * distribute this software and its documentation for any purpose and
22  * without fee is hereby granted, provided that the above copyright
23  * notice appear in all copies and that both that copyright notice and
24  * this permission notice appear in supporting documentation, and that
25  * the name of M.I.T. not be used in advertising or publicity pertaining
26  * to distribution of the software without specific, written prior
27  * permission.  Furthermore if you modify this software you must label
28  * your software as modified software and not distribute it in such a
29  * fashion that it might be confused with the original MIT software.
30  * M.I.T. makes no representations about the suitability of this software
31  * for any purpose.  It is provided "as is" without express or implied
32  * warranty.
33  * 
34  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
35  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
36  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
37  */
38
39 #ifndef _PROFILE_H
40 #define _PROFILE_H
41
42 typedef struct _profile_t *profile_t;
43
44 typedef void (*profile_syntax_err_cb_t)(const char *file, long err, 
45                                         int line_num);
46
47 /*
48  * Used by the profile iterator in prof_get.c
49  */
50 #define PROFILE_ITER_LIST_SECTION       0x0001
51 #define PROFILE_ITER_SECTIONS_ONLY      0x0002
52 #define PROFILE_ITER_RELATIONS_ONLY     0x0004
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif /* __cplusplus */
57
58 long profile_init
59         (const char * *files, profile_t *ret_profile);
60
61 void profile_release
62         (profile_t profile);
63
64 long profile_get_string
65         (profile_t profile, const char *name, const char *subname, 
66                         const char *subsubname, const char *def_val,
67                         char **ret_string);
68 long profile_get_integer
69         (profile_t profile, const char *name, const char *subname,
70                         const char *subsubname, int def_val,
71                         int *ret_default);
72
73 long profile_get_boolean
74         (profile_t profile, const char *name, const char *subname,
75                         const char *subsubname, int def_val,
76                         int *ret_default);
77
78 long profile_iterator_create
79         (profile_t profile, const char *const *names,
80                    int flags, void **ret_iter);
81
82 void profile_iterator_free
83         (void **iter_p);
84         
85 long profile_iterator
86         (void   **iter_p, char **ret_name, char **ret_value);
87
88 profile_syntax_err_cb_t profile_set_syntax_err_cb(profile_syntax_err_cb_t hook);
89
90 #ifdef __cplusplus
91 }
92 #endif /* __cplusplus */
93
94 #endif /* _KRB5_H */