VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/util/environment.c@ 50311

最後變更 在這個檔案從50311是 15532,由 vboxsync 提交於 16 年 前

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 760 位元組
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "cr_environment.h"
8#include "cr_string.h"
9#include "cr_mem.h"
10#include <stdlib.h>
11#include <stdio.h>
12
13void crSetenv( const char *var, const char *value )
14{
15#if defined(LINUX) || defined(FREEBSD) || defined(DARWIN)
16 setenv( var, value, 1 /* replace */ );
17#else
18 unsigned long len;
19 char *buf;
20
21 len = crStrlen(var) + 1 + crStrlen(value) + 1;
22 buf = (char *) crAlloc( len );
23 sprintf( buf, "%s=%s", var, value );
24 putenv( buf );
25
26 /* don't free the buf, the string is *part* of the environment,
27 * and can't be reclaimed */
28#endif
29}
30
31const char *crGetenv( const char *var )
32{
33 return getenv( var );
34}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette