Blame src/xftdbg.c

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