Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37888787
en ru br
ALT Linux repositórios
S:1.2.2-alt1
5.0: 1.0.3-alt2
4.1: 1.0.3-alt1
4.0: 1.0.3-alt1

Group :: Sistema/Bibliotecas
RPM: libXres

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

pax_global_header00006660000000000000000000000064121517720000014505gustar00rootroot0000000000000052 comment=b51a7b0ccf0d5ccb53fbd5d34ed8fe57603d2604
libXres-1.0.7/000075500000000000000000000000001215177200000131205ustar00rootroot00000000000000libXres-1.0.7/.gitignore000064400000000000000000000017501215177200000151130ustar00rootroot00000000000000#
# X.Org module default exclusion patterns
# The next section if for module specific patterns
#
# Do not edit the following section
# GNU Build System (Autotools)
aclocal.m4
autom4te.cache/
autoscan.log
ChangeLog
compile
config.guess
config.h
config.h.in
config.log
config-ml.in
config.py
config.status
config.status.lineno
config.sub
configure
configure.scan
depcomp
.deps/
INSTALL
install-sh
.libs/
libtool
libtool.m4
ltmain.sh
lt~obsolete.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
Makefile
Makefile.in
mdate-sh
missing
mkinstalldirs
*.pc
py-compile
stamp-h?
symlink-tree
texinfo.tex
ylwrap

# Do not edit the following section
# Edit Compile Debug Document Distribute
*~
*.[0-9]
*.[0-9]x
*.bak
*.bin
core
*.dll
*.exe
*-ISO*.bdf
*-JIS*.bdf
*-KOI8*.bdf
*.kld
*.ko
*.ko.cmd
*.lai
*.l[oa]
*.[oa]
*.obj
*.patch
*.so
*.pcf.gz
*.pdb
*.tar.bz2
*.tar.gz
#
# Add & Override patterns for libXRes
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
libXres-1.0.7/AUTHORS000064400000000000000000000000311215177200000141620ustar00rootroot00000000000000Mark Vojkovich, XFree86

libXres-1.0.7/COPYING000064400000000000000000000024131215177200000141530ustar00rootroot00000000000000 Copyright (c) 2002 XFree86 Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the XFree86 Project shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from the XFree86
Project.
libXres-1.0.7/Makefile.am000064400000000000000000000026251215177200000151610ustar00rootroot00000000000000#
# Copyright © 2003 Keith Packard, Noah Levitt
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Keith Packard not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Keith Packard makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

AUTOMAKE_OPTIONS = foreign

SUBDIRS = src man

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xres.pc

MAINTAINERCLEANFILES = ChangeLog INSTALL

.PHONY: ChangeLog INSTALL

INSTALL:
$(INSTALL_CMD)

ChangeLog:
$(CHANGELOG_CMD)

dist-hook: ChangeLog INSTALL
libXres-1.0.7/README000064400000000000000000000012451215177200000140020ustar00rootroot00000000000000libXRes - X-Resource extension client library

All questions regarding this software should be directed at the
Xorg mailing list:

http://lists.freedesktop.org/mailman/listinfo/xorg

Please submit bug reports to the Xorg bugzilla:

https://bugs.freedesktop.org/enter_bug.cgi?product=xorg

The master development code repository can be found at:

git://anongit.freedesktop.org/git/xorg/lib/libXRes

http://cgit.freedesktop.org/xorg/lib/libXRes

For patch submission instructions, see:

http://www.x.org/wiki/Development/Documentation/SubmittingPatches

For more information on the git code manager, see:

http://wiki.x.org/wiki/GitPage

libXres-1.0.7/autogen.sh000075500000000000000000000003031215177200000151150ustar00rootroot00000000000000#! /bin/sh

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`
cd $srcdir

autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?

$srcdir/configure --enable-maintainer-mode "$@"
libXres-1.0.7/configure.ac000064400000000000000000000051661215177200000154160ustar00rootroot00000000000000#
# Copyright © 2003 Keith Packard, Noah Levitt
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Keith Packard not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Keith Packard makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#

# Initialize Autoconf
AC_PREREQ([2.60])
#
# Version should match the current XRes version. XResQueryVersion
# returns the version from XResproto.h, NOT the version we set here. But we
# try to keep these the same. Note that the library has an extra
# digit in the version number to track changes which don't affect the
# protocol, so XRes version l.n.m corresponds to protocol version l.n
#
AC_INIT([libXres], [1.0.7],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXres])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])

# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE

# Initialize libtool
AC_PROG_LIBTOOL

# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
XORG_CHECK_MALLOC_ZERO

# Check xres configuration, strip extra digits from package version to
# find the required protocol version
RES_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`]

# Obtain compiler/linker options for depedencies
PKG_CHECK_MODULES(XRES, x11 xext xextproto [resourceproto >= $RES_VERSION])

# Check for _XEatDataWords function that may be patched into older Xlib release
SAVE_LIBS="$LIBS"
LIBS="$XRES_LIBS"
AC_CHECK_FUNCS([_XEatDataWords])
LIBS="$SAVE_LIBS"

AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
xres.pc])
AC_OUTPUT
libXres-1.0.7/include/000075500000000000000000000000001215177200000145435ustar00rootroot00000000000000libXres-1.0.7/include/X11/000075500000000000000000000000001215177200000151145ustar00rootroot00000000000000libXres-1.0.7/include/X11/extensions/000075500000000000000000000000001215177200000173135ustar00rootroot00000000000000libXres-1.0.7/include/X11/extensions/XRes.h000064400000000000000000000014451215177200000203510ustar00rootroot00000000000000/*
Copyright (c) 2002 XFree86 Inc
*/

#ifndef _XRES_H
#define _XRES_H

#include <X11/Xfuncproto.h>

typedef struct {
XID resource_base;
XID resource_mask;
} XResClient;

typedef struct {
Atom resource_type;
unsigned int count;
} XResType;

_XFUNCPROTOBEGIN


Bool XResQueryExtension (
Display *dpy,
int *event_base_return,
int *error_base_return
);

Status XResQueryVersion (
Display *dpy,
int *major_version_return,
int *minor_version_return
);

Status XResQueryClients (
Display *dpy,
int *num_clients,
XResClient **clients
);

Status XResQueryClientResources (
Display *dpy,
XID xid,
int *num_types,
XResType **types
);

Status XResQueryClientPixmapBytes (
Display *dpy,
XID xid,
unsigned long *bytes
);

_XFUNCPROTOEND

#endif /* _XRES_H */
libXres-1.0.7/man/000075500000000000000000000000001215177200000136735ustar00rootroot00000000000000libXres-1.0.7/man/Makefile.am000064400000000000000000000032231215177200000157270ustar00rootroot00000000000000#
# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

libmandir = $(LIB_MAN_DIR)

libman_PRE = \
XRes.man \
$(XRes_shadows:=.man)

XRes_shadows = \
XResQueryExtension \
XResQueryVersion \
XResQueryClients \
XResQueryClientResources \
XResQueryClientPixmapBytes

EXTRA_DIST = $(libman_PRE)
CLEANFILES = $(libman_DATA)

libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)

SUFFIXES = .$(LIB_MAN_SUFFIX) .man

# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(LIB_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
libXres-1.0.7/man/XRes.man000064400000000000000000000100611215177200000152470ustar00rootroot00000000000000.\"
.\" Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining
.\" a copy of this software and associated documentation files (the
.\" "Software"), to deal in the Software without restriction, including
.\" without limitation the rights to use, copy, modify, merge, publish,
.\" distribute, sublicense, and/or sell copies of the Software, and to
.\" permit persons to whom the Software is furnished to do so, subject to
.\" the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be
.\" included in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
.\" IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES
.\" OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of the XFree86 Project
.\" shall not be used in advertising or otherwise to promote the sale, use
.\" or other dealings in this Software without prior written authorization
.\" from the XFree86 Project.
.\"
.TH XRes __libmansuffix__ __vendorversion__
.SH NAME
XRes \- X-Resource extension client library
.SH SYNOPSIS
.B #include <X11/extensions/XRes.h>
.PP
.nf
.ta .5i 2i
typedef struct {
XID resource_base;
XID resource_mask;
} XResClient;

typedef struct {
Atom resource_type;
unsigned int count;
} XResType;
.fi
.HP
Bool XResQueryExtension(Display *\fIdpy\fP,
int *\fIevent_base_return\fP, int *\fIerror_base_return\fP\^);
.HP
Status XResQueryVersion(Display *\fIdpy\fP, int *\fImajor_version_return\fP,
int *\fIminor_version_return\fP\^);
.HP
Status XResQueryClients(Display *\fIdpy\fP, int *\fInum_clients\fP,
XResClient **\fIclients\fP\^);
.HP
Status XResQueryClientResources(Display *\fIdpy\fP, XID \fIxid\fP,
int *\fInum_types\fP, XResType **\fItypes\fP\^);
.HP
Status XResQueryClientPixmapBytes(Display *\fIdpy\fP, XID \fIxid\fP,
unsigned long *\fIbytes\fP\^);
.PP
.SH DESCRIPTION
.B X-Resource
is an extension that allows a client to query the X
server about its usage of various resources. It should not be confused
with the X resource database access functions.
.PP
.B XResQueryExtension
returns
.B True
if the
.I XRes
extension is available on the given display.
A client must call
.B XResQueryExtension
before calling any other XRes function in order
to negotiate a compatible protocol version; otherwise the client will
get undefined behavior (XRes may or may not work).
.PP
.B XResQueryVersion
returns
.B True
if the request succeeded; the values of the major and minor protocol
versions supported by the server are returned in
.I major_version_return
and
.I minor_version_return .
.PP
.PP
.B XResQueryClients
fills a list of clients of the given display. For each client it
returns in the
.I XResClient
structure a mask and a base value of the resources used by these
clients.
Returns
.B True
on success or
.B False
on failure.
.PP
.B XResQueryClientResources
fills a list of
XResType
structures, indicating for each resource type allocated by the client its
name (as an Atom) and the number of resources of this type allocated.
Returns
.B True
on success or
.B False
on failure.
.PP
.B XResQueryClientPixmapBytes
gives, for resources of type
.I PIXMAP
the total number of bytes allocated in the X server by the given
client.
Returns
.B True
on success or
.B False
on failure.
.SH "ERRORS"
.B XResQueryClientResources
and
.B XResQueryClientPixmapBytes
will return
.I BadValue
if passed an illegal client identifier.
.SH "SEE ALSO"
X(__miscmansuffix__)
.SH AUTHOR
Mark Vojkovich, originally for The XFree86 Project Inc.
.SH STABILITY
This API is considered as experimental. The XRes library major
revision may be incremented whenever incompatible changes are done to
the API without notice. Use with care.
libXres-1.0.7/man/XResQueryClientPixmapBytes.man000064400000000000000000000000561215177200000216250ustar00rootroot00000000000000.so man__libmansuffix__/XRes.__libmansuffix__
libXres-1.0.7/man/XResQueryClientResources.man000064400000000000000000000000561215177200000213320ustar00rootroot00000000000000.so man__libmansuffix__/XRes.__libmansuffix__
libXres-1.0.7/man/XResQueryClients.man000064400000000000000000000000561215177200000176220ustar00rootroot00000000000000.so man__libmansuffix__/XRes.__libmansuffix__
libXres-1.0.7/man/XResQueryExtension.man000064400000000000000000000000561215177200000201750ustar00rootroot00000000000000.so man__libmansuffix__/XRes.__libmansuffix__
libXres-1.0.7/man/XResQueryVersion.man000064400000000000000000000000561215177200000176460ustar00rootroot00000000000000.so man__libmansuffix__/XRes.__libmansuffix__
libXres-1.0.7/src/000075500000000000000000000000001215177200000137075ustar00rootroot00000000000000libXres-1.0.7/src/Makefile.am000064400000000000000000000006121215177200000157420ustar00rootroot00000000000000lib_LTLIBRARIES = libXRes.la

libXRes_la_SOURCES = \
XRes.c

libXRes_la_LIBADD = @XRES_LIBS@

AM_CFLAGS = \
$(CWARNFLAGS) \
$(XRES_CFLAGS) \
$(MALLOC_ZERO_CFLAGS)

AM_CPPFLAGS = -I$(top_srcdir)/include

libXRes_la_LDFLAGS = -version-number 1:0:0 -no-undefined

libXResincludedir = $(includedir)/X11/extensions
libXResinclude_HEADERS = $(top_srcdir)/include/X11/extensions/XRes.h

libXres-1.0.7/src/XRes.c000064400000000000000000000145361215177200000147450ustar00rootroot00000000000000/*
Copyright (c) 2002 XFree86 Inc
*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#include <X11/extensions/XResproto.h>
#include <X11/extensions/XRes.h>
#include <limits.h>

#ifndef HAVE__XEATDATAWORDS
static inline void _XEatDataWords(Display *dpy, unsigned long n)
{
# ifndef LONG64
if (n >= (ULONG_MAX >> 2))
_XIOError(dpy);
# endif
_XEatData (dpy, n << 2);
}
#endif

static XExtensionInfo _xres_ext_info_data;
static XExtensionInfo *xres_ext_info = &_xres_ext_info_data;
static const char *xres_extension_name = XRES_NAME;

#define XResCheckExtension(dpy,i,val) \
XextCheckExtension (dpy, i, xres_extension_name, val)

static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xres_ext_info)

static XExtensionHooks xres_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
NULL, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};

static XEXT_GENERATE_FIND_DISPLAY (find_display, xres_ext_info,
xres_extension_name,
&xres_extension_hooks,
0, NULL)

Bool XResQueryExtension (
Display *dpy,
int *event_base_return,
int *error_base_return
)
{
XExtDisplayInfo *info = find_display (dpy);

if (XextHasExtension(info)) {
*event_base_return = info->codes->first_event;
*error_base_return = info->codes->first_error;
return True;
} else {
return False;
}
}

Status XResQueryVersion(
Display *dpy,
int *major_version_return,
int *minor_version_return
)
{
XExtDisplayInfo *info = find_display (dpy);
xXResQueryVersionReply rep;
xXResQueryVersionReq *req;

XResCheckExtension (dpy, info, 0);

LockDisplay (dpy);
GetReq (XResQueryVersion, req);
req->reqType = info->codes->major_opcode;
req->XResReqType = X_XResQueryVersion;
req->client_major = XRES_MAJOR_VERSION;
req->client_minor = XRES_MINOR_VERSION;
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
UnlockDisplay (dpy);
SyncHandle ();
return 0;
}
*major_version_return = rep.server_major;
*minor_version_return = rep.server_minor;
UnlockDisplay (dpy);
SyncHandle ();
return 1;
}


Status XResQueryClients (
Display *dpy,
int *num_clients,
XResClient **clients
)
{
XExtDisplayInfo *info = find_display (dpy);
xXResQueryClientsReq *req;
xXResQueryClientsReply rep;
XResClient *clnts;
int result = 0;

*num_clients = 0;
*clients = NULL;

XResCheckExtension (dpy, info, 0);

LockDisplay (dpy);
GetReq (XResQueryClients, req);
req->reqType = info->codes->major_opcode;
req->XResReqType = X_XResQueryClients;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
UnlockDisplay (dpy);
SyncHandle ();
return 0;
}

if(rep.num_clients) {
if (rep.num_clients < (INT_MAX / sizeof(XResClient)))
clnts = Xmalloc(sizeof(XResClient) * rep.num_clients);
else
clnts = NULL;

if (clnts != NULL) {
xXResClient scratch;
int i;

for(i = 0; i < rep.num_clients; i++) {
_XRead(dpy, (char*)&scratch, sz_xXResClient);
clnts[i].resource_base = scratch.resource_base;
clnts[i].resource_mask = scratch.resource_mask;
}
*clients = clnts;
*num_clients = rep.num_clients;
result = 1;
} else {
_XEatDataWords(dpy, rep.length);
}
}

UnlockDisplay (dpy);
SyncHandle ();
return result;
}

Status XResQueryClientResources (
Display *dpy,
XID xid,
int *num_types,
XResType **types
)
{
XExtDisplayInfo *info = find_display (dpy);
xXResQueryClientResourcesReq *req;
xXResQueryClientResourcesReply rep;
XResType *typs;
int result = 0;

*num_types = 0;
*types = NULL;

XResCheckExtension (dpy, info, 0);

LockDisplay (dpy);
GetReq (XResQueryClientResources, req);
req->reqType = info->codes->major_opcode;
req->XResReqType = X_XResQueryClientResources;
req->xid = xid;
if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
UnlockDisplay (dpy);
SyncHandle ();
return 0;
}

if(rep.num_types) {
if (rep.num_types < (INT_MAX / sizeof(XResType)))
typs = Xmalloc(sizeof(XResType) * rep.num_types);
else
typs = NULL;

if (typs != NULL) {
xXResType scratch;
int i;

for(i = 0; i < rep.num_types; i++) {
_XRead(dpy, (char*)&scratch, sz_xXResType);
typs[i].resource_type = scratch.resource_type;
typs[i].count = scratch.count;
}
*types = typs;
*num_types = rep.num_types;
result = 1;
} else {
_XEatDataWords(dpy, rep.length);
}
}

UnlockDisplay (dpy);
SyncHandle ();
return result;
}

Status XResQueryClientPixmapBytes (
Display *dpy,
XID xid,
unsigned long *bytes
)
{
XExtDisplayInfo *info = find_display (dpy);
xXResQueryClientPixmapBytesReq *req;
xXResQueryClientPixmapBytesReply rep;

*bytes = 0;

XResCheckExtension (dpy, info, 0);

LockDisplay (dpy);
GetReq (XResQueryClientPixmapBytes, req);
req->reqType = info->codes->major_opcode;
req->XResReqType = X_XResQueryClientPixmapBytes;
req->xid = xid;
if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
UnlockDisplay (dpy);
SyncHandle ();
return 0;
}

#ifdef LONG64
*bytes = (rep.bytes_overflow * 4294967295) + rep.bytes;
#else
*bytes = rep.bytes_overflow ? 0xffffffff : rep.bytes;
#endif

UnlockDisplay (dpy);
SyncHandle ();
return 1;
}

libXres-1.0.7/xres.pc.in000064400000000000000000000004041215177200000150300ustar00rootroot00000000000000prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: XRes
Description: X Resource Information Extension Library
Version: @VERSION@
Requires: xproto
Requires.private: x11 xext
Cflags: -I${includedir}
Libs: -L${libdir} -lXRes
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009