libalpm
Arch Linux Package Manager Library
callback.h
Go to the documentation of this file.
00001 /*
00002  *  callback.h
00003  *
00004  *  Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
00005  *  Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 #ifndef _PM_CALLBACK_H
00021 #define _PM_CALLBACK_H
00022 
00023 #include <sys/types.h> /* off_t */
00024 
00025 #include <alpm.h>
00026 
00027 /* callback to handle messages/notifications from libalpm */
00028 void cb_event(alpm_event_t event, void *data1, void *data2);
00029 
00030 /* callback to handle questions from libalpm (yes/no) */
00031 void cb_question(alpm_question_t event, void *data1, void *data2,
00032                    void *data3, int *response);
00033 
00034 /* callback to handle display of progress */
00035 void cb_progress(alpm_progress_t event, const char *pkgname, int percent,
00036                    size_t howmany, size_t remain);
00037 
00038 /* callback to handle receipt of total download value */
00039 void cb_dl_total(off_t total);
00040 /* callback to handle display of download progress */
00041 void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total);
00042 
00043 /* callback to handle messages/notifications from pacman library */
00044 void cb_log(alpm_loglevel_t level, const char *fmt, va_list args);
00045 
00046 #endif /* _PM_CALLBACK_H */
00047 
00048 /* vim: set ts=2 sw=2 noet: */