From 89ded69bedffc5593c12153246cbfaf333005e1d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 14 Jun 2013 09:33:27 +0200 Subject: [PATCH] xbps-query: use get_maxcols() from xbps-install. --- bin/xbps-query/Makefile | 2 +- bin/xbps-query/defs.h | 3 ++- bin/xbps-query/list.c | 11 ----------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/bin/xbps-query/Makefile b/bin/xbps-query/Makefile index 5cd39e17..41b37895 100644 --- a/bin/xbps-query/Makefile +++ b/bin/xbps-query/Makefile @@ -3,7 +3,7 @@ TOPDIR = ../.. BIN = xbps-query 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 include $(TOPDIR)/mk/prog.mk diff --git a/bin/xbps-query/defs.h b/bin/xbps-query/defs.h index 6b622968..d8eb509d 100644 --- a/bin/xbps-query/defs.h +++ b/bin/xbps-query/defs.h @@ -28,6 +28,8 @@ #include +#include "../xbps-install/defs.h" + #ifndef __UNCONST #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) #endif @@ -55,7 +57,6 @@ int ownedby(struct xbps_handle *, int, char **); int repo_ownedby(struct xbps_handle *, int, char **); /* From list.c */ -int get_maxcols(void); unsigned int find_longest_pkgver(struct xbps_handle *, prop_object_t); int list_pkgs_in_dict(struct xbps_handle *, prop_object_t, void *, bool *); diff --git a/bin/xbps-query/list.c b/bin/xbps-query/list.c index c12836b2..a1993806 100644 --- a/bin/xbps-query/list.c +++ b/bin/xbps-query/list.c @@ -38,17 +38,6 @@ struct list_pkgver_cb { int maxcols; }; -int -get_maxcols(void) -{ - struct winsize ws; - - if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0) - return ws.ws_col; - - return 80; -} - int list_pkgs_in_dict(struct xbps_handle *xhp, prop_object_t obj,