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: profile.h,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 #ifndef _OSL_PROFILE_H_
32 #define _OSL_PROFILE_H_
34 #include <sal/types.h>
35 #include <rtl/ustring.h>
41 typedef sal_uInt32 oslProfileOption
;
43 #define osl_Profile_DEFAULT 0x0000
44 #define osl_Profile_SYSTEM 0x0001 /* use system depended functinality */
45 #define osl_Profile_READLOCK 0x0002 /* lock file for reading */
46 #define osl_Profile_WRITELOCK 0x0004 /* lock file for writing */
47 #define osl_Profile_FLUSHWRITE 0x0010 /* writing only with flush */
50 typedef void* oslProfile
;
53 Open or create a configuration profile.
54 @return 0 if the profile could not be created, otherwise a handle to the profile.
57 oslProfile SAL_CALL
osl_openProfile(rtl_uString
*strProfileName
, oslProfileOption Options
);
60 Close the opened profile an flush all data to the disk.
61 @param Profile handle to a opened profile.
64 sal_Bool SAL_CALL
osl_closeProfile(oslProfile Profile
);
70 sal_Bool SAL_CALL
osl_flushProfile(oslProfile Profile
);
74 sal_Bool SAL_CALL
osl_readProfileString(oslProfile Profile
,
75 const sal_Char
* pszSection
, const sal_Char
* pszEntry
,
76 sal_Char
* pszString
, sal_uInt32 MaxLen
,
77 const sal_Char
* pszDefault
);
81 sal_Bool SAL_CALL
osl_readProfileBool(oslProfile Profile
,
82 const sal_Char
* pszSection
, const sal_Char
* pszEntry
,
87 sal_uInt32 SAL_CALL
osl_readProfileIdent(oslProfile Profile
,
88 const sal_Char
* pszSection
, const sal_Char
* pszEntry
,
89 sal_uInt32 FirstId
, const sal_Char
* Strings
[],
95 sal_Bool SAL_CALL
osl_writeProfileString(oslProfile Profile
,
96 const sal_Char
* pszSection
, const sal_Char
* pszEntry
,
97 const sal_Char
* pszString
);
101 sal_Bool SAL_CALL
osl_writeProfileBool(oslProfile Profile
,
102 const sal_Char
* pszSection
, const sal_Char
* pszEntry
,
107 sal_Bool SAL_CALL
osl_writeProfileIdent(oslProfile Profile
,
108 const sal_Char
* pszSection
, const sal_Char
* pszEntry
,
109 sal_uInt32 FirstId
, const sal_Char
* Strings
[],
113 Acquire the mutex, block if already acquired by another thread.
114 @param Profile handle to a opened profile.
115 @return False if section or entry could not be found.
118 sal_Bool SAL_CALL
osl_removeProfileEntry(oslProfile Profile
,
119 const sal_Char
*pszSection
, const sal_Char
*pszEntry
);
122 Get all entries belonging to the specified section.
123 @param Profile handle to a opened profile.
124 @return Pointer to a array of pointers.
127 sal_uInt32 SAL_CALL
osl_getProfileSectionEntries(oslProfile Profile
, const sal_Char
*pszSection
,
128 sal_Char
* pszBuffer
, sal_uInt32 MaxLen
);
131 Get all section entries
132 @param Profile handle to a opened profile.
133 @return Pointer to a array of pointers.
136 sal_uInt32 SAL_CALL
osl_getProfileSections(oslProfile Profile
, sal_Char
* pszBuffer
, sal_uInt32 MaxLen
);
142 #endif /* _OSL_PROFILE_H_ */