abrt  2.11.0.18.gf1d99.dirty
A tool to inform users about various problems on the running system
problem_api.h
1 /*
2  Copyright (C) ABRT Team
3  Copyright (C) RedHat inc.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #include <glib.h>
21 #include "libabrt.h"
22 
23 
24 /*
25  * Function called for each problem directory in @for_each_problem_in_dir
26  *
27  * @param dd A dump directory
28  * @param arg User's arguments
29  * @returns 0 if everything is OK, a non zero value in order to break the iterator
30  */
31 typedef int (* for_each_problem_in_dir_callback)(struct dump_dir *dd, void *arg);
32 
33 /*
34  * Iterates over all dump directories placed in @path and call @callback.
35  *
36  * @param path Dump directories location
37  * @param caller_uid UID for access check. -1 for disabling this check
38  * @param callback Called for each applicable dump directory. Non zero
39  * value returned from @callback will breaks the iteration.
40  * @param arg User's arguments passed to @callback
41  * @returns 0 or the first non zero value returned from @callback
42  */
43 int for_each_problem_in_dir(const char *path,
44  uid_t caller_uid,
45  for_each_problem_in_dir_callback callback,
46  void *arg);
47 
48 /* Retrieves the list of directories currently used as a problem storage
49  * The result must be freed by caller
50  * @returns List of strings representing the full path to dirs
51  */
52 GList *get_problem_storages(void);
53 GList *get_problem_dirs_for_uid(uid_t uid, const char *dump_location);
54 
55 /*
56  * Gets list of problem directories not accessible by user
57  *
58  * @param uid User's uid
59  * @param dump_location Dump directories location
60  * @returns GList with mallocated absolute paths to dump directories
61  */
62 GList *get_problem_dirs_not_accessible_by_uid(uid_t uid, const char *dump_location);
63 
64 
65 /*
66  * Checks if problem dump directory contains all necessary data
67  *
68  * @param dd Dump directory
69  * @returns Non zero if problem data are complete, otherwise false
70  */
71 int problem_dump_dir_is_complete(struct dump_dir *dd);