⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xdisname.c

📁 早期freebsd实现
💻 C
字号:
/* $XConsortium: XDisName.c,v 11.6 91/05/11 17:03:04 gildea Exp $ *//*Permission to use, copy, modify, distribute, and sell this software and itsdocumentation for any purpose is hereby granted without fee, provided thatthe above copyright notice appear in all copies and that both thatcopyright notice and this permission notice appear in supportingdocumentation, and that the name of M.I.T. not be used in advertising orpublicity pertaining to distribution of the software without specific,written prior permission.  M.I.T. makes no representations about thesuitability of this software for any purpose.  It is provided "as is"without express or implied warranty.*//* XDisplayName.c *//*  * Returns the name of the display XOpenDisplay would use.  This is better * than just printing the "display" variable in a program because that * could be NULL and/or there could be an environment variable set. * This makes it easier for programmers to provide meaningful error * messages.  * *  * For example, this is used in XOpenDisplay() as *	strncpy( displaybuf, XDisplayName( display ), sizeof(displaybuf) ); *      if ( *displaybuf == '\0' ) return( NULL ); *  This check is actually unnecessary because the next thing is an index() *  call looking for a ':' which will fail and we'll return(NULL). *//* Written at Waterloo - JMSellens */#include <stdio.h>extern char *getenv();char *XDisplayName( display )    char *display;{    char *d;    if ( display != (char *)NULL && *display != '\0' )	return( display );    if ( (d = getenv( "DISPLAY" )) != (char *)NULL )	return( d );    return( "" );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -