1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 * This file is part of LibreOffice published API.
24 #ifndef INCLUDED_OSL_PROFILE_H
25 #define INCLUDED_OSL_PROFILE_H
27 #include "sal/config.h"
29 #include "rtl/ustring.h"
30 #include "sal/saldllapi.h"
31 #include "sal/types.h"
37 typedef sal_uInt32 oslProfileOption
;
39 #define osl_Profile_DEFAULT 0x0000
40 #define osl_Profile_SYSTEM 0x0001 /* use system depended functionality */
41 #define osl_Profile_READLOCK 0x0002 /* lock file for reading */
42 #define osl_Profile_WRITELOCK 0x0004 /* lock file for writing */
43 #define osl_Profile_FLUSHWRITE 0x0010 /* writing only with flush */
46 typedef void* oslProfile
;
49 Open or create a configuration profile.
50 @retval 0 if the profile could not be created, otherwise a handle to the profile.
53 SAL_DLLPUBLIC oslProfile SAL_CALL
osl_openProfile(
54 rtl_uString
*strProfileName
, oslProfileOption Options
) SAL_COLD
;
57 Close the opened profile an flush all data to the disk.
58 @param Profile handle to an opened profile.
61 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_closeProfile(
62 oslProfile Profile
) SAL_COLD
;
68 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_flushProfile(
69 oslProfile Profile
) SAL_COLD
;
73 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_readProfileString(
75 const char* pszSection
, const char* pszEntry
,
76 char* pszString
, sal_uInt32 MaxLen
,
77 const char* pszDefault
) SAL_COLD
;
81 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_readProfileBool(
83 const char* pszSection
, const char* pszEntry
,
84 sal_Bool Default
) SAL_COLD
;
88 SAL_DLLPUBLIC sal_uInt32 SAL_CALL
osl_readProfileIdent(
90 const char* pszSection
, const char* pszEntry
,
91 sal_uInt32 FirstId
, const char* Strings
[],
92 sal_uInt32 Default
) SAL_COLD
;
97 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_writeProfileString(
99 const char* pszSection
, const char* pszEntry
,
100 const char* pszString
) SAL_COLD
;
105 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_writeProfileBool(
107 const char* pszSection
, const char* pszEntry
,
108 sal_Bool Value
) SAL_COLD
;
113 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_writeProfileIdent(
115 const char* pszSection
, const char* pszEntry
,
116 sal_uInt32 FirstId
, const char* Strings
[],
117 sal_uInt32 Value
) SAL_COLD
;
120 Acquire the mutex, block if already acquired by another thread.
121 @retval False if section or entry could not be found.
124 SAL_DLLPUBLIC sal_Bool SAL_CALL
osl_removeProfileEntry(
126 const char *pszSection
, const char *pszEntry
) SAL_COLD
;
129 Get all entries belonging to the specified section.
130 @returns Pointer to an array of pointers.
133 SAL_DLLPUBLIC sal_uInt32 SAL_CALL
osl_getProfileSectionEntries(
134 oslProfile Profile
, const char *pszSection
,
135 char* pszBuffer
, sal_uInt32 MaxLen
) SAL_COLD
;
138 Get all section entries
139 @retval Pointer to an array of pointers.
142 SAL_DLLPUBLIC sal_uInt32 SAL_CALL
osl_getProfileSections(
143 oslProfile Profile
, char* pszBuffer
, sal_uInt32 MaxLen
) SAL_COLD
;
149 #endif // INCLUDED_OSL_PROFILE_H
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */