if (dbFlag) {
/* Check if the MESA_BACK_BUFFER env var is set */
- char *backbuffer = _mesa_getenv("MESA_BACK_BUFFER");
+ char *backbuffer = getenv("MESA_BACK_BUFFER");
if (backbuffer) {
if (backbuffer[0]=='p' || backbuffer[0]=='P') {
ximageFlag = GL_FALSE;
/* Comparing IDs uses less memory but sometimes fails. */
/* XXX revisit this after 3.0 is finished. */
- if (_mesa_getenv("MESA_GLX_VISUAL_HACK"))
+ if (getenv("MESA_GLX_VISUAL_HACK"))
comparePointers = GL_TRUE;
else
comparePointers = GL_FALSE;
/* Force the visual to have an alpha channel */
- if (rgbFlag && _mesa_getenv("MESA_GLX_FORCE_ALPHA"))
+ if (rgbFlag && getenv("MESA_GLX_FORCE_ALPHA"))
alphaFlag = GL_TRUE;
/* First check if a matching visual is already in the list */
default_depth_bits(void)
{
int zBits;
- const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS");
+ const char *zEnv = getenv("MESA_GLX_DEPTH_BITS");
if (zEnv)
zBits = atoi(zEnv);
else
default_alpha_bits(void)
{
int aBits;
- const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS");
+ const char *aEnv = getenv("MESA_GLX_ALPHA_BITS");
if (aEnv)
aBits = atoi(aEnv);
else
int depth, xclass = -1;
XVisualInfo *vis;
- if (!_mesa_getenv( varname )) {
+ if (!getenv( varname )) {
return NULL;
}
- strncpy( value, _mesa_getenv(varname), 100 );
+ strncpy( value, getenv(varname), 100 );
value[99] = 0;
sscanf( value, "%s %d", type, &depth );
if (b) {
XMesaDestroyBuffer(b);
}
- else if (_mesa_getenv("MESA_DEBUG")) {
+ else if (getenv("MESA_DEBUG")) {
_mesa_warning(NULL, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
}
}
if (buffer) {
XMesaSwapBuffers(buffer);
}
- else if (_mesa_getenv("MESA_DEBUG")) {
+ else if (getenv("MESA_DEBUG")) {
_mesa_warning(NULL, "glXSwapBuffers: invalid drawable 0x%x\n",
(int) drawable);
}
if (buffer) {
XMesaCopySubBuffer(buffer, x, y, width, height);
}
- else if (_mesa_getenv("MESA_DEBUG")) {
+ else if (getenv("MESA_DEBUG")) {
_mesa_warning(NULL, "Mesa: glXCopySubBufferMESA: invalid drawable\n");
}
}
* which can help Brian figure out what's going on when a user
* reports bugs.
*/
- if (_mesa_getenv("MESA_INFO")) {
+ if (getenv("MESA_INFO")) {
printf("X/Mesa visual = %p\n", (void *) v);
printf("X/Mesa level = %d\n", v->mesa_visual.level);
printf("X/Mesa depth = %d\n", v->visinfo->depth);
return NULL;
/* For debugging only */
- if (_mesa_getenv("MESA_XSYNC")) {
+ if (getenv("MESA_XSYNC")) {
/* This makes debugging X easier.
* In your debugger, set a breakpoint on _XError to stop when an
* X protocol error is generated.
if (dbFlag) {
/* Check if the MESA_BACK_BUFFER env var is set */
- char *backbuffer = _mesa_getenv("MESA_BACK_BUFFER");
+ char *backbuffer = getenv("MESA_BACK_BUFFER");
if (backbuffer) {
if (backbuffer[0]=='p' || backbuffer[0]=='P') {
ximageFlag = GL_FALSE;
/* Comparing IDs uses less memory but sometimes fails. */
/* XXX revisit this after 3.0 is finished. */
- if (_mesa_getenv("MESA_GLX_VISUAL_HACK"))
+ if (getenv("MESA_GLX_VISUAL_HACK"))
comparePointers = GL_TRUE;
else
comparePointers = GL_FALSE;
/* Force the visual to have an alpha channel */
- if (_mesa_getenv("MESA_GLX_FORCE_ALPHA"))
+ if (getenv("MESA_GLX_FORCE_ALPHA"))
alphaFlag = GL_TRUE;
/* First check if a matching visual is already in the list */
default_depth_bits(void)
{
int zBits;
- const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS");
+ const char *zEnv = getenv("MESA_GLX_DEPTH_BITS");
if (zEnv)
zBits = atoi(zEnv);
else
default_alpha_bits(void)
{
int aBits;
- const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS");
+ const char *aEnv = getenv("MESA_GLX_ALPHA_BITS");
if (aEnv)
aBits = atoi(aEnv);
else
int depth, xclass = -1;
XVisualInfo *vis;
- if (!_mesa_getenv( varname )) {
+ if (!getenv( varname )) {
return NULL;
}
- strncpy( value, _mesa_getenv(varname), 100 );
+ strncpy( value, getenv(varname), 100 );
value[99] = 0;
sscanf( value, "%s %d", type, &depth );
if (b) {
XMesaDestroyBuffer(b);
}
- else if (_mesa_getenv("MESA_DEBUG")) {
+ else if (getenv("MESA_DEBUG")) {
_mesa_warning(NULL, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
}
}
if (buffer) {
XMesaSwapBuffers(buffer);
}
- else if (_mesa_getenv("MESA_DEBUG")) {
+ else if (getenv("MESA_DEBUG")) {
_mesa_warning(NULL, "glXSwapBuffers: invalid drawable 0x%x\n",
(int) drawable);
}
if (buffer) {
XMesaCopySubBuffer(buffer, x, y, width, height);
}
- else if (_mesa_getenv("MESA_DEBUG")) {
+ else if (getenv("MESA_DEBUG")) {
_mesa_warning(NULL, "Mesa: glXCopySubBufferMESA: invalid drawable\n");
}
}
}
v->mesa_visual.indexBits = 0;
- if (_mesa_getenv("MESA_NO_DITHER")) {
+ if (getenv("MESA_NO_DITHER")) {
v->dithered_pf = v->undithered_pf;
}
* which can help Brian figure out what's going on when a user
* reports bugs.
*/
- if (_mesa_getenv("MESA_INFO")) {
+ if (getenv("MESA_INFO")) {
printf("X/Mesa visual = %p\n", (void *) v);
printf("X/Mesa dithered pf = %u\n", v->dithered_pf);
printf("X/Mesa undithered pf = %u\n", v->undithered_pf);
GLint red_bits, green_bits, blue_bits, alpha_bits;
/* For debugging only */
- if (_mesa_getenv("MESA_XSYNC")) {
+ if (getenv("MESA_XSYNC")) {
/* This makes debugging X easier.
* In your debugger, set a breakpoint on _XError to stop when an
* X protocol error is generated.
memcpy(v->visinfo, visinfo, sizeof(*visinfo));
/* check for MESA_GAMMA environment variable */
- gamma = _mesa_getenv("MESA_GAMMA");
+ gamma = getenv("MESA_GAMMA");
if (gamma) {
v->RedGamma = v->GreenGamma = v->BlueGamma = 0.0;
sscanf( gamma, "%f %f %f", &v->RedGamma, &v->GreenGamma, &v->BlueGamma );
ctx->CurrentDispatch = ctx->OutsideBeginEnd;
ctx->FragmentProgram._MaintainTexEnvProgram
- = (_mesa_getenv("MESA_TEX_PROG") != NULL);
+ = (getenv("MESA_TEX_PROG") != NULL);
ctx->VertexProgram._MaintainTnlProgram
- = (_mesa_getenv("MESA_TNL_PROG") != NULL);
+ = (getenv("MESA_TNL_PROG") != NULL);
if (ctx->VertexProgram._MaintainTnlProgram) {
/* this is required... */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
* first time each context is made current we'll print some useful
* information.
*/
- if (_mesa_getenv("MESA_INFO")) {
+ if (getenv("MESA_INFO")) {
_mesa_print_info(ctx);
}
}
void
_mesa_init_debug( struct gl_context *ctx )
{
- set_debug_flags(_mesa_getenv("MESA_DEBUG"));
- set_verbose_flags(_mesa_getenv("MESA_VERBOSE"));
+ set_debug_flags(getenv("MESA_DEBUG"));
+ set_verbose_flags(getenv("MESA_VERBOSE"));
}
/* If MESA_LOG_FILE env var is set, log Mesa errors, warnings,
* etc to the named file. Otherwise, output to stderr.
*/
- const char *logFile = _mesa_getenv("MESA_LOG_FILE");
+ const char *logFile = getenv("MESA_LOG_FILE");
if (logFile)
fout = fopen(logFile, "w");
if (!fout)
debug = 1;
#else
/* in release builds, be silent unless MESA_DEBUG is set */
- debug = _mesa_getenv("MESA_DEBUG") != NULL;
+ debug = getenv("MESA_DEBUG") != NULL;
#endif
}
/* Check debug environment variable only once:
*/
if (debug == -1) {
- const char *debugEnv = _mesa_getenv("MESA_DEBUG");
+ const char *debugEnv = getenv("MESA_DEBUG");
#ifdef DEBUG
if (debugEnv && strstr(debugEnv, "silent"))
void
_mesa_one_time_init_extension_overrides(void)
{
- const char *env_const = _mesa_getenv("MESA_EXTENSION_OVERRIDE");
+ const char *env_const = getenv("MESA_EXTENSION_OVERRIDE");
char *env;
char *ext;
int len;
/*@}*/
-/**********************************************************************/
-/** \name Environment vars */
-/*@{*/
-
-/**
- * Wrapper for getenv().
- */
-char *
-_mesa_getenv( const char *var )
-{
- return getenv(var);
-}
-
-/*@}*/
-
-
/**********************************************************************/
/** \name String */
/*@{*/
return h & 0x8000;
}
-extern char *
-_mesa_getenv( const char *var );
-
extern char *
_mesa_strdup( const char *s );
_mesa_get_shader_flags(void)
{
GLbitfield flags = 0x0;
- const char *env = _mesa_getenv("MESA_GLSL");
+ const char *env = getenv("MESA_GLSL");
if (env) {
if (strstr(env, "dump_on_error"))
if ( first_time ) {
first_time = 0;
- mesa_profile = _mesa_getenv( "MESA_PROFILE" );
+ mesa_profile = getenv( "MESA_PROFILE" );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( first_time ) {
first_time = 0;
- mesa_profile = _mesa_getenv( "MESA_PROFILE" );
+ mesa_profile = getenv( "MESA_PROFILE" );
}
#ifdef RUN_DEBUG_BENCHMARK
if ( first_time ) {
first_time = 0;
- mesa_profile = _mesa_getenv( "MESA_PROFILE" );
+ mesa_profile = getenv( "MESA_PROFILE" );
}
#ifdef RUN_DEBUG_BENCHMARK
vtx->codegen_emit = NULL;
#ifdef USE_SSE_ASM
- if (!_mesa_getenv("MESA_NO_CODEGEN"))
+ if (!getenv("MESA_NO_CODEGEN"))
vtx->codegen_emit = _tnl_generate_sse_emit;
#endif
}
#ifdef USE_X86_64_ASM
static void message( const char *msg )
{
- if (_mesa_getenv("MESA_DEBUG")) {
+ if (getenv("MESA_DEBUG")) {
_mesa_debug( NULL, "%s", msg );
}
}
#ifdef USE_X86_64_ASM
unsigned int regs[4];
- if ( _mesa_getenv( "MESA_NO_ASM" ) ) {
+ if ( getenv( "MESA_NO_ASM" ) ) {
return;
}
#ifdef USE_X86_ASM
_mesa_x86_cpu_features = 0x0;
- if (_mesa_getenv( "MESA_NO_ASM")) {
+ if (getenv( "MESA_NO_ASM")) {
return;
}
#ifdef USE_MMX_ASM
if ( cpu_has_mmx ) {
- if ( _mesa_getenv( "MESA_NO_MMX" ) == 0 ) {
+ if ( getenv( "MESA_NO_MMX" ) == 0 ) {
if (detection_debug)
_mesa_debug(NULL, "MMX cpu detected.\n");
} else {
#ifdef USE_3DNOW_ASM
if ( cpu_has_3dnow ) {
- if ( _mesa_getenv( "MESA_NO_3DNOW" ) == 0 ) {
+ if ( getenv( "MESA_NO_3DNOW" ) == 0 ) {
if (detection_debug)
_mesa_debug(NULL, "3DNow! cpu detected.\n");
} else {
#ifdef USE_SSE_ASM
if ( cpu_has_xmm ) {
- if ( _mesa_getenv( "MESA_NO_SSE" ) == 0 ) {
+ if ( getenv( "MESA_NO_SSE" ) == 0 ) {
if (detection_debug)
_mesa_debug(NULL, "SSE cpu detected.\n");
- if ( _mesa_getenv( "MESA_FORCE_SSE" ) == 0 ) {
+ if ( getenv( "MESA_FORCE_SSE" ) == 0 ) {
_mesa_check_os_sse_support();
}
} else {