Blame src/xftdbg.c

Packit Service 1b8107
/*
Packit Service 1b8107
 * Copyright © 2000 Keith Packard
Packit Service 1b8107
 *
Packit Service 1b8107
 * Permission to use, copy, modify, distribute, and sell this software and its
Packit Service 1b8107
 * documentation for any purpose is hereby granted without fee, provided that
Packit Service 1b8107
 * the above copyright notice appear in all copies and that both that
Packit Service 1b8107
 * copyright notice and this permission notice appear in supporting
Packit Service 1b8107
 * documentation, and that the name of Keith Packard not be used in
Packit Service 1b8107
 * advertising or publicity pertaining to distribution of the software without
Packit Service 1b8107
 * specific, written prior permission.  Keith Packard makes no
Packit Service 1b8107
 * representations about the suitability of this software for any purpose.  It
Packit Service 1b8107
 * is provided "as is" without express or implied warranty.
Packit Service 1b8107
 *
Packit Service 1b8107
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
Packit Service 1b8107
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
Packit Service 1b8107
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
Packit Service 1b8107
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
Packit Service 1b8107
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
Packit Service 1b8107
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
Packit Service 1b8107
 * PERFORMANCE OF THIS SOFTWARE.
Packit Service 1b8107
 */
Packit Service 1b8107
Packit Service 1b8107
#include "xftint.h"
Packit Service 1b8107
Packit Service 1b8107
_X_HIDDEN int
Packit Service 1b8107
XftDebug (void)
Packit Service 1b8107
{
Packit Service 1b8107
    static int  initialized;
Packit Service 1b8107
    static int  debug;
Packit Service 1b8107
Packit Service 1b8107
    if (!initialized)
Packit Service 1b8107
    {
Packit Service 1b8107
	char    *e;
Packit Service 1b8107
Packit Service 1b8107
	initialized = 1;
Packit Service 1b8107
        e = getenv ("XFT_DEBUG");
Packit Service 1b8107
	if (e)
Packit Service 1b8107
	{
Packit Service 1b8107
	    printf ("XFT_DEBUG=%s\n", e);
Packit Service 1b8107
	    debug = atoi (e);
Packit Service 1b8107
	    if (debug <= 0)
Packit Service 1b8107
		debug = 1;
Packit Service 1b8107
	}
Packit Service 1b8107
    }
Packit Service 1b8107
    return debug;
Packit Service 1b8107
}