1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: appdef.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_tools.hxx"
38 #include "bootstrp/appdef.hxx"
40 const char* GetDefStandList()
43 char* pEnv
= getenv("STAR_STANDLST");
46 int nLen
= strlen( pEnv
);
47 pRet
= ( char *) malloc( nLen
+ 1 );
48 (void) strcpy( pRet
, pEnv
);
52 int nLen
= strlen( _DEF_STAND_LIST
);
53 pRet
= ( char *) malloc( nLen
+ 1 );
54 (void) strcpy( pRet
, _DEF_STAND_LIST
);
60 const char* GetIniRoot()
63 char* pEnv
= getenv("STAR_INIROOT");
66 int nLen
= strlen( pEnv
);
67 pRet
= ( char *) malloc( nLen
+ 1 );
68 (void) strcpy( pRet
, pEnv
);
72 int nLen
= strlen( _INIROOT
);
73 pRet
= ( char *) malloc( nLen
+ 1 );
74 (void) strcpy( pRet
, _INIROOT
);
79 const char* GetIniRootOld()
82 char* pEnv
= getenv("STAR_INIROOTOLD");
85 int nLen
= strlen( pEnv
);
86 pRet
= ( char *) malloc( nLen
+ 1 );
87 (void) strcpy( pRet
, pEnv
);
91 int nLen
= strlen( _INIROOT_OLD
);
92 pRet
= ( char *) malloc( nLen
+ 1 );
93 (void) strcpy( pRet
, _INIROOT_OLD
);
98 const char* GetSSolarIni()
101 char* pEnv
= getenv("STAR_SSOLARINI");
104 int nLen
= strlen( pEnv
);
105 pRet
= ( char *) malloc( nLen
+ 1 );
106 (void) strcpy( pRet
, pEnv
);
110 int nLen
= strlen( _DEF_SSOLARINI
);
111 pRet
= ( char *) malloc( nLen
+ 1 );
112 (void) strcpy( pRet
, _DEF_SSOLARINI
);
118 const char* GetSSCommon()
121 char* pEnv
= getenv("STAR_SSCOMMON");
124 int nLen
= strlen( pEnv
);
125 pRet
= ( char *) malloc( nLen
+ 1 );
126 (void) strcpy( pRet
, pEnv
);
130 int nLen
= strlen( _DEF_SSCOMMON
);
131 pRet
= ( char *) malloc( nLen
+ 1 );
132 (void) strcpy( pRet
, _DEF_SSCOMMON
);
138 const char* GetBServerRoot()
141 char* pEnv
= getenv("STAR_BSERVERROOT");
144 int nLen
= strlen( pEnv
);
145 pRet
= ( char *) malloc( nLen
+ 1 );
146 (void) strcpy( pRet
, pEnv
);
150 int nLen
= strlen( B_SERVER_ROOT
);
151 pRet
= ( char *) malloc( nLen
+ 1 );
152 (void) strcpy( pRet
, B_SERVER_ROOT
);
157 const char* GetEnv( const char *pVar
)
159 char const *pRet
= getenv( pVar
);
165 const char* GetEnv( const char *pVar
, const char *pDefault
)
167 char *pRet
= getenv( pVar
);