xbps_handle: constify xbps_xxx_cb_data argument.
This commit is contained in:
parent
57a7967f0d
commit
05e7a59f03
@ -1,5 +1,5 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2009-2013 Juan Romero Pardines.
|
* Copyright (c) 2009-2014 Juan Romero Pardines.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -45,10 +45,10 @@ bool yesno(const char *, ...);
|
|||||||
bool noyes(const char *, ...);
|
bool noyes(const char *, ...);
|
||||||
|
|
||||||
/* from fetch_cb.c */
|
/* 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 */
|
/* 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 */
|
/* From util.c */
|
||||||
void print_package_line(const char *, int, bool);
|
void print_package_line(const char *, int, bool);
|
||||||
|
@ -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
|
* Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@ -60,7 +60,7 @@ get_time(struct timeval *tvp)
|
|||||||
* Compute and display ETA
|
* Compute and display ETA
|
||||||
*/
|
*/
|
||||||
static const char *
|
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;
|
struct xferstat *xfer = cbdata;
|
||||||
static char str[16];
|
static char str[16];
|
||||||
@ -99,7 +99,7 @@ compare_double(const double a, const double b)
|
|||||||
* Compute and display transfer rate
|
* Compute and display transfer rate
|
||||||
*/
|
*/
|
||||||
static const char *
|
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;
|
struct xferstat *xfer = cbdata;
|
||||||
static char str[16];
|
static char str[16];
|
||||||
@ -122,7 +122,7 @@ stat_bps(struct xbps_fetch_cb_data *xfpd, void *cbdata)
|
|||||||
* Update the stats display
|
* Update the stats display
|
||||||
*/
|
*/
|
||||||
static void
|
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 xferstat *xfer = cbdata;
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
@ -153,7 +153,7 @@ stat_display(struct xbps_fetch_cb_data *xfpd, void *cbdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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;
|
struct xferstat *xfer = cbdata;
|
||||||
char size[8];
|
char size[8];
|
||||||
|
@ -64,7 +64,7 @@ usage(bool fail)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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)
|
if (xpd->entry == NULL || xpd->entry_total_count <= 0)
|
||||||
return;
|
return;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
int
|
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;
|
xbps_dictionary_t pkgd;
|
||||||
const char *instver, *newver;
|
const char *instver, *newver;
|
||||||
|
@ -51,7 +51,7 @@ usage(bool fail)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
bool slog = false;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ usage(bool fail)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
bool slog = false;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
*
|
*
|
||||||
* This header documents the full API for the XBPS Library.
|
* This header documents the full API for the XBPS Library.
|
||||||
*/
|
*/
|
||||||
#define XBPS_API_VERSION "20140905"
|
#define XBPS_API_VERSION "20140906"
|
||||||
|
|
||||||
#ifndef XBPS_VERSION
|
#ifndef XBPS_VERSION
|
||||||
#define XBPS_VERSION "UNSET"
|
#define XBPS_VERSION "UNSET"
|
||||||
@ -538,7 +538,7 @@ struct xbps_handle {
|
|||||||
* Pointer to the supplifed function callback to be used
|
* Pointer to the supplifed function callback to be used
|
||||||
* in the XBPS possible states.
|
* 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
|
* @var state_cb_data
|
||||||
*
|
*
|
||||||
@ -550,7 +550,7 @@ struct xbps_handle {
|
|||||||
* Pointer to the supplied function callback to be used in
|
* Pointer to the supplied function callback to be used in
|
||||||
* xbps_unpack_binary_pkg().
|
* 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
|
* @var unpack_cb_data
|
||||||
*
|
*
|
||||||
@ -562,7 +562,7 @@ struct xbps_handle {
|
|||||||
* Pointer to the supplied function callback to be used in
|
* Pointer to the supplied function callback to be used in
|
||||||
* xbps_fetch_file().
|
* 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
|
* @var fetch_cb_data
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user