diff --git a/bin/xbps-install/defs.h b/bin/xbps-install/defs.h index dbd4f7a5..3a9b7188 100644 --- a/bin/xbps-install/defs.h +++ b/bin/xbps-install/defs.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2013 Juan Romero Pardines. + * Copyright (c) 2009-2014 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,10 +45,10 @@ bool yesno(const char *, ...); bool noyes(const char *, ...); /* from fetch_cb.c */ -void fetch_file_progress_cb(struct xbps_fetch_cb_data *, void *); +void fetch_file_progress_cb(const struct xbps_fetch_cb_data *, void *); /* from state_cb.c */ -int state_cb(struct xbps_state_cb_data *, void *); +int state_cb(const struct xbps_state_cb_data *, void *); /* From util.c */ void print_package_line(const char *, int, bool); diff --git a/bin/xbps-install/fetch_cb.c b/bin/xbps-install/fetch_cb.c index 162fcf76..6c0ac05f 100644 --- a/bin/xbps-install/fetch_cb.c +++ b/bin/xbps-install/fetch_cb.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2012 Juan Romero Pardines + * Copyright (c) 2009-2014 Juan Romero Pardines * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. * @@ -60,7 +60,7 @@ get_time(struct timeval *tvp) * Compute and display ETA */ static const char * -stat_eta(struct xbps_fetch_cb_data *xfpd, void *cbdata) +stat_eta(const struct xbps_fetch_cb_data *xfpd, void *cbdata) { struct xferstat *xfer = cbdata; static char str[16]; @@ -99,7 +99,7 @@ compare_double(const double a, const double b) * Compute and display transfer rate */ static const char * -stat_bps(struct xbps_fetch_cb_data *xfpd, void *cbdata) +stat_bps(const struct xbps_fetch_cb_data *xfpd, void *cbdata) { struct xferstat *xfer = cbdata; static char str[16]; @@ -122,7 +122,7 @@ stat_bps(struct xbps_fetch_cb_data *xfpd, void *cbdata) * Update the stats display */ static void -stat_display(struct xbps_fetch_cb_data *xfpd, void *cbdata) +stat_display(const struct xbps_fetch_cb_data *xfpd, void *cbdata) { struct xferstat *xfer = cbdata; struct timeval now; @@ -153,7 +153,7 @@ stat_display(struct xbps_fetch_cb_data *xfpd, void *cbdata) } void -fetch_file_progress_cb(struct xbps_fetch_cb_data *xfpd, void *cbdata) +fetch_file_progress_cb(const struct xbps_fetch_cb_data *xfpd, void *cbdata) { struct xferstat *xfer = cbdata; char size[8]; diff --git a/bin/xbps-install/main.c b/bin/xbps-install/main.c index 20c01886..67efeae3 100644 --- a/bin/xbps-install/main.c +++ b/bin/xbps-install/main.c @@ -64,7 +64,7 @@ usage(bool fail) } static void -unpack_progress_cb(struct xbps_unpack_cb_data *xpd, void *cbdata _unused) +unpack_progress_cb(const struct xbps_unpack_cb_data *xpd, void *cbdata _unused) { if (xpd->entry == NULL || xpd->entry_total_count <= 0) return; diff --git a/bin/xbps-install/state_cb.c b/bin/xbps-install/state_cb.c index 5e63e766..dffbf5e1 100644 --- a/bin/xbps-install/state_cb.c +++ b/bin/xbps-install/state_cb.c @@ -32,7 +32,7 @@ #include "defs.h" int -state_cb(struct xbps_state_cb_data *xscd, void *cbdata _unused) +state_cb(const struct xbps_state_cb_data *xscd, void *cbdata _unused) { xbps_dictionary_t pkgd; const char *instver, *newver; diff --git a/bin/xbps-reconfigure/main.c b/bin/xbps-reconfigure/main.c index dcc944b7..cbb37ed0 100644 --- a/bin/xbps-reconfigure/main.c +++ b/bin/xbps-reconfigure/main.c @@ -51,7 +51,7 @@ usage(bool fail) } static int -state_cb(struct xbps_state_cb_data *xscd, void *cbd _unused) +state_cb(const struct xbps_state_cb_data *xscd, void *cbd _unused) { bool slog = false; diff --git a/bin/xbps-remove/main.c b/bin/xbps-remove/main.c index d5808f2d..5c2f23ae 100644 --- a/bin/xbps-remove/main.c +++ b/bin/xbps-remove/main.c @@ -63,7 +63,7 @@ usage(bool fail) } static int -state_cb_rm(struct xbps_state_cb_data *xscd, void *cbdata _unused) +state_cb_rm(const struct xbps_state_cb_data *xscd, void *cbdata _unused) { bool slog = false; diff --git a/include/xbps.h.in b/include/xbps.h.in index ab20f018..b93317b3 100644 --- a/include/xbps.h.in +++ b/include/xbps.h.in @@ -48,7 +48,7 @@ * * This header documents the full API for the XBPS Library. */ -#define XBPS_API_VERSION "20140905" +#define XBPS_API_VERSION "20140906" #ifndef XBPS_VERSION #define XBPS_VERSION "UNSET" @@ -538,7 +538,7 @@ struct xbps_handle { * Pointer to the supplifed function callback to be used * in the XBPS possible states. */ - int (*state_cb)(struct xbps_state_cb_data *, void *); + int (*state_cb)(const struct xbps_state_cb_data *, void *); /** * @var state_cb_data * @@ -550,7 +550,7 @@ struct xbps_handle { * Pointer to the supplied function callback to be used in * xbps_unpack_binary_pkg(). */ - void (*unpack_cb)(struct xbps_unpack_cb_data *, void *); + void (*unpack_cb)(const struct xbps_unpack_cb_data *, void *); /** * @var unpack_cb_data * @@ -562,7 +562,7 @@ struct xbps_handle { * Pointer to the supplied function callback to be used in * xbps_fetch_file(). */ - void (*fetch_cb)(struct xbps_fetch_cb_data *, void *); + void (*fetch_cb)(const struct xbps_fetch_cb_data *, void *); /** * @var fetch_cb_data *