Blame src/include/problem_api.h

Packit 8ea169
/*
Packit 8ea169
    Copyright (C) ABRT Team
Packit 8ea169
    Copyright (C) RedHat inc.
Packit 8ea169
Packit 8ea169
    This program is free software; you can redistribute it and/or modify
Packit 8ea169
    it under the terms of the GNU General Public License as published by
Packit 8ea169
    the Free Software Foundation; either version 2 of the License, or
Packit 8ea169
    (at your option) any later version.
Packit 8ea169
Packit 8ea169
    This program is distributed in the hope that it will be useful,
Packit 8ea169
    but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8ea169
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 8ea169
    GNU General Public License for more details.
Packit 8ea169
Packit 8ea169
    You should have received a copy of the GNU General Public License along
Packit 8ea169
    with this program; if not, write to the Free Software Foundation, Inc.,
Packit 8ea169
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Packit 8ea169
*/
Packit 8ea169
Packit 8ea169
#include <glib.h>
Packit 8ea169
#include "libabrt.h"
Packit 8ea169
Packit 8ea169
Packit 8ea169
/*
Packit 8ea169
 * Function called for each problem directory in @for_each_problem_in_dir
Packit 8ea169
 *
Packit 8ea169
 * @param dd A dump directory
Packit 8ea169
 * @param arg User's arguments
Packit 8ea169
 * @returns 0 if everything is OK, a non zero value in order to break the iterator
Packit 8ea169
 */
Packit 8ea169
typedef int (* for_each_problem_in_dir_callback)(struct dump_dir *dd, void *arg);
Packit 8ea169
Packit 8ea169
/*
Packit 8ea169
 * Iterates over all dump directories placed in @path and call @callback.
Packit 8ea169
 *
Packit 8ea169
 * @param path Dump directories location
Packit 8ea169
 * @param caller_uid UID for access check. -1 for disabling this check
Packit 8ea169
 * @param callback Called for each applicable dump directory. Non zero
Packit 8ea169
 * value returned from @callback will breaks the iteration.
Packit 8ea169
 * @param arg User's arguments passed to @callback
Packit 8ea169
 * @returns 0 or the first non zero value returned from @callback
Packit 8ea169
 */
Packit 8ea169
int for_each_problem_in_dir(const char *path,
Packit 8ea169
                        uid_t caller_uid,
Packit 8ea169
                        for_each_problem_in_dir_callback callback,
Packit 8ea169
                        void *arg);
Packit 8ea169
Packit 8ea169
/* Retrieves the list of directories currently used as a problem storage
Packit 8ea169
 * The result must be freed by caller
Packit 8ea169
 * @returns List of strings representing the full path to dirs
Packit 8ea169
 */
Packit 8ea169
GList *get_problem_storages(void);
Packit 8ea169
GList *get_problem_dirs_for_uid(uid_t uid, const char *dump_location);
Packit 8ea169
Packit 8ea169
/*
Packit 8ea169
 * Gets list of problem directories not accessible by user
Packit 8ea169
 *
Packit 8ea169
 * @param uid User's uid
Packit 8ea169
 * @param dump_location Dump directories location
Packit 8ea169
 * @returns GList with mallocated absolute paths to dump directories
Packit 8ea169
 */
Packit 8ea169
GList *get_problem_dirs_not_accessible_by_uid(uid_t uid, const char *dump_location);
Packit 8ea169
Packit 8ea169
Packit 8ea169
/*
Packit 8ea169
 * Checks if problem dump directory contains all necessary data
Packit 8ea169
 *
Packit 8ea169
 * @param dd Dump directory
Packit 8ea169
 * @returns Non zero if problem data are complete, otherwise false
Packit 8ea169
 */
Packit 8ea169
int problem_dump_dir_is_complete(struct dump_dir *dd);