xbps-query: use get_maxcols() from xbps-install.
This commit is contained in:
parent
5f2bba7f4e
commit
89ded69bed
@ -3,7 +3,7 @@ TOPDIR = ../..
|
|||||||
|
|
||||||
BIN = xbps-query
|
BIN = xbps-query
|
||||||
OBJS = main.o list.o show-deps.o show-info-files.o
|
OBJS = main.o list.o show-deps.o show-info-files.o
|
||||||
OBJS += ownedby.o search.o
|
OBJS += ownedby.o search.o ../xbps-install/util.o
|
||||||
MAN = $(BIN).8
|
MAN = $(BIN).8
|
||||||
|
|
||||||
include $(TOPDIR)/mk/prog.mk
|
include $(TOPDIR)/mk/prog.mk
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include <xbps_api.h>
|
#include <xbps_api.h>
|
||||||
|
|
||||||
|
#include "../xbps-install/defs.h"
|
||||||
|
|
||||||
#ifndef __UNCONST
|
#ifndef __UNCONST
|
||||||
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
|
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
|
||||||
#endif
|
#endif
|
||||||
@ -55,7 +57,6 @@ int ownedby(struct xbps_handle *, int, char **);
|
|||||||
int repo_ownedby(struct xbps_handle *, int, char **);
|
int repo_ownedby(struct xbps_handle *, int, char **);
|
||||||
|
|
||||||
/* From list.c */
|
/* From list.c */
|
||||||
int get_maxcols(void);
|
|
||||||
unsigned int find_longest_pkgver(struct xbps_handle *, prop_object_t);
|
unsigned int find_longest_pkgver(struct xbps_handle *, prop_object_t);
|
||||||
|
|
||||||
int list_pkgs_in_dict(struct xbps_handle *, prop_object_t, void *, bool *);
|
int list_pkgs_in_dict(struct xbps_handle *, prop_object_t, void *, bool *);
|
||||||
|
@ -38,17 +38,6 @@ struct list_pkgver_cb {
|
|||||||
int maxcols;
|
int maxcols;
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
|
||||||
get_maxcols(void)
|
|
||||||
{
|
|
||||||
struct winsize ws;
|
|
||||||
|
|
||||||
if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0)
|
|
||||||
return ws.ws_col;
|
|
||||||
|
|
||||||
return 80;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
list_pkgs_in_dict(struct xbps_handle *xhp,
|
list_pkgs_in_dict(struct xbps_handle *xhp,
|
||||||
prop_object_t obj,
|
prop_object_t obj,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user