/*
Copyright 1988, 1998 The Open Group
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.
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 NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP 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 Open Group 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 Open Group.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <X11/Xauth.h>
#include <X11/Xos.h>
#ifdef XTHREADS
#include <X11/Xthreads.h>
#endif
#ifdef hpux
#define X_INCLUDE_NETDB_H
#define XOS_USE_NO_LOCKING
#include <X11/Xos_r.h>
#endif
static int
binaryEqual (_Xconst char *a, _Xconst char *b, int len)
{
while (len--)
if (*a++ != *b++)
return 0;
return 1;
}
Xauth *
XauGetBestAuthByAddr (
#if NeedWidePrototypes
unsigned int family,
unsigned int address_length,
#else
unsigned short family,
unsigned short address_length,
#endif
_Xconst char* address,
#if NeedWidePrototypes
unsigned int number_length,
#else
unsigned short number_length,
#endif
_Xconst char* number,
int types_length,
char** types,
_Xconst int* type_lengths)
{
FILE *auth_file;
char *auth_name;
Xauth *entry;
Xauth *best;
int best_type;
int type;
#ifdef hpux
char *fully_qual_address;
unsigned short fully_qual_address_length;
#endif
auth_name = XauFileName ();
if (!auth_name)
return NULL;
if (access (auth_name, R_OK) != 0) /* checks REAL id */
return NULL;
auth_file = fopen (auth_name, "rb");
if (!auth_file)
return NULL;
#ifdef hpux
if (family == FamilyLocal) {
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
_Xgethostbynameparams hparams;
#endif
struct hostent *hostp;
/* make sure we try fully-qualified hostname */
if ((hostp = _XGethostbyname(address,hparams)) != NULL) {
fully_qual_address = hostp->h_name;
fully_qual_address_length = strlen(fully_qual_address);
}
else
{
fully_qual_address = NULL;
fully_qual_address_length = 0;
}
}
#endif /* hpux */
best = NULL;
best_type = types_length;
for (;;) {
entry = XauReadAuth (auth_file);
if (!entry)
break;
/*
* Match when:
* either family or entry->family are FamilyWild or
* family and entry->family are the same and
* address and entry->address are the same
* and
* either number or entry->number are empty or
* number and entry->number are the same
* and
* either name or entry->name are empty or
* name and entry->name are the same
*/
if ((family == FamilyWild || entry->family == FamilyWild ||
(entry->family == family &&
((address_length == entry->address_length &&
binaryEqual (entry->address, address, (int)address_length))
#ifdef hpux
|| (family == FamilyLocal &&
fully_qual_address_length == entry->address_length &&
binaryEqual (entry->address, fully_qual_address,
(int) fully_qual_address_length))
#endif
))) &&
(number_length == 0 || entry->number_length == 0 ||
(number_length == entry->number_length &&
binaryEqual (entry->number, number, (int)number_length))))
{
if (best_type == 0)
{
best = entry;
break;
}
for (type = 0; type < best_type; type++)
if (type_lengths[type] == entry->name_length &&
!(strncmp (types[type], entry->name, entry->name_length)))
{
break;
}
if (type < best_type)
{
if (best)
XauDisposeAuth (best);
best = entry;
best_type = type;
if (type == 0)
break;
continue;
}
}
XauDisposeAuth (entry);
}
(void) fclose (auth_file);
return best;
}
没有合适的资源?快使用搜索试试~ 我知道了~
libXau-1.0.7源码
共95个文件
o:16个
man:9个
3:9个
需积分: 5 4 下载量 166 浏览量
2022-10-11
17:47:21
上传
评论
收藏 569KB ZIP 举报
温馨提示
下载libXau-1.0.7源码,解压缩到Home目录下,同样并新建了一个build和install的文件夹 cd到build目录下后,执行如下命令 CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ ../configure --prefix=/home/sxhlvye/libXau-1.0.7/install --host=arm-linux CPPFLAGS="-I/home/sxhlvye/xproto-7.0.23/install/include" LDFLAGS="-L/home/sxhlvye/xproto-7.0.23/install/lib" 再分别执行make和make install指令,成功后可以看到install目录下有了编译好后的文件(接下来的交叉编译libxcb需要依赖其)
资源详情
资源评论
资源推荐
收起资源包目录
libXau-1.0.7.zip (95个子文件)
libXau-1.0.7
AuLock.c 3KB
AuUnlock.c 2KB
AuDispose.c 2KB
xau.pc.in 237B
man
XauReadAuth.man 45B
XauFileName.man 45B
XauUnlockAuth.man 45B
XauGetAuthByAddr.man 45B
XauWriteAuth.man 45B
Makefile.am 2KB
XauDisposeAuth.man 45B
Makefile.in 14KB
XauLockAuth.man 45B
XauGetBestAuthByAddr.man 45B
Xau.man 5KB
config.h.in 2KB
depcomp 18KB
include
X11
Xauth.h 3KB
AuGetAddr.c 3KB
aclocal.m4 403KB
AuWrite.c 2KB
Autest.c 2KB
config.guess 44KB
Makefile.am 1KB
config.sub 34KB
README 9KB
Makefile.in 37KB
INSTALL 11KB
missing 11KB
install-sh 13KB
AUTHORS 71B
configure 591KB
AuFileName.c 2KB
ltmain.sh 276KB
AuGetBest.c 4KB
ChangeLog 23KB
COPYING 1KB
AuRead.c 3KB
configure.ac 3KB
build
config.h 2KB
stamp-h1 23B
.libs
libXau.lai 964B
AuGetBest.o 11KB
AuUnlock.o 5KB
libXau.so 42KB
libXau.so.6 42KB
AuLock.o 10KB
libXau.a 68KB
AuWrite.o 9KB
AuGetAddr.o 10KB
AuFileName.o 6KB
AuRead.o 10KB
libXau.la 963B
AuDispose.o 5KB
.deps
AuGetAddr.Plo 3KB
Autest.Po 8B
AuUnlock.Plo 3KB
AuDispose.Plo 2KB
AuGetBest.Plo 4KB
AuRead.Plo 2KB
AuFileName.Plo 3KB
AuLock.Plo 3KB
AuWrite.Plo 2KB
AuGetBest.o 11KB
man
XauGetBestAuthByAddr.3 15B
XauLockAuth.3 15B
XauDisposeAuth.3 15B
XauWriteAuth.3 15B
Xau.3 5KB
Makefile 17KB
XauGetAuthByAddr.3 15B
XauFileName.3 15B
XauReadAuth.3 15B
XauUnlockAuth.3 15B
AuUnlock.o 5KB
xau.pc 259B
AuLock.o 10KB
config.log 54KB
AuUnlock.lo 274B
libtool 286KB
AuGetAddr.lo 277B
AuFileName.lo 280B
AuWrite.o 9KB
AuGetAddr.o 10KB
AuWrite.lo 271B
AuLock.lo 268B
AuRead.lo 268B
config.status 65KB
AuFileName.o 6KB
Makefile 39KB
AuRead.o 10KB
libXau.la 963B
AuDispose.o 5KB
AuGetBest.lo 277B
AuDispose.lo 277B
共 95 条
- 1
SinceJan
- 粉丝: 5
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Java-美妆神域_3rm1m18i_221-wx.zip
- springboot高考志愿智能推荐系统 LW PPT.zip
- web学校课程管理系统(编号:07471106).zip
- SpringBoot的校园服务系统(编号:61189239).zip
- 百货中心管理系统(编号:745621100)(1).zip
- 毕业生就业推荐系统(编号:0225912).zip
- game_patch_1.29.13.13020.pak
- 毕业生追踪系统(编号:13356163).zip
- 宾馆客房管理系统设计与实现(编号:70764218).zip
- 餐品美食论坛(编号:3118587).zip
- 仓库管理系统(编号:6809848).zip
- 大学生就业系统.zip
- 宠物管理系统.zip
- 大学生心理咨询平台(编号:40361285).zip
- 大学生校园线上招聘系统(编号:0926903)(1).zip
- 大学生就业信息管理系统_xb8ce10b_229-wx.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0