xref: /aoo4110/main/sal/inc/osl/profile.h (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _OSL_PROFILE_H_
25 #define _OSL_PROFILE_H_
26 
27 #include <sal/types.h>
28 #include <rtl/ustring.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 typedef sal_uInt32 oslProfileOption;
35 
36 #define	osl_Profile_DEFAULT     0x0000
37 #define	osl_Profile_SYSTEM      0x0001    /* use system depended functinality */
38 #define	osl_Profile_READLOCK    0x0002    /* lock file for reading            */
39 #define	osl_Profile_WRITELOCK   0x0004    /* lock file for writing            */
40 #define	osl_Profile_FLUSHWRITE  0x0010    /* writing only with flush          */
41 
42 
43 typedef void* oslProfile;
44 
45 /** Deprecated API.
46 	Open or create a configuration profile.
47 	@return 0 if the profile could not be created, otherwise a handle to the profile.
48 	@deprecated
49 */
50 oslProfile SAL_CALL osl_openProfile(rtl_uString *strProfileName, oslProfileOption Options);
51 
52 /** Deprecated API.
53 	Close the opened profile an flush all data to the disk.
54 	@param Profile handle to a opened profile.
55 	@deprecated
56 */
57 sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile);
58 
59 
60 /** Deprecated API.
61     @deprecated
62 */
63 sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile);
64 /** Deprecated API.
65     @deprecated
66 */
67 sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
68                               const sal_Char* pszSection, const sal_Char* pszEntry,
69                               sal_Char* pszString, sal_uInt32 MaxLen,
70                               const sal_Char* pszDefault);
71 /** Deprecated API.
72     @deprecated
73 */
74 sal_Bool SAL_CALL osl_readProfileBool(oslProfile Profile,
75                             const sal_Char* pszSection, const sal_Char* pszEntry,
76 							sal_Bool Default);
77 /** Deprecated API.
78     @deprecated
79 */
80 sal_uInt32 SAL_CALL osl_readProfileIdent(oslProfile Profile,
81                               const sal_Char* pszSection, const sal_Char* pszEntry,
82 							  sal_uInt32 FirstId, const sal_Char* Strings[],
83 							  sal_uInt32 Default);
84 
85 /** Deprecated API.
86     @deprecated
87 */
88 sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
89                                const sal_Char* pszSection, const sal_Char* pszEntry,
90 							   const sal_Char* pszString);
91 /** Deprecated API.
92     @deprecated
93 */
94 sal_Bool SAL_CALL osl_writeProfileBool(oslProfile Profile,
95                              const sal_Char* pszSection, const sal_Char* pszEntry,
96 							 sal_Bool Value);
97 /** Deprecated API.
98     @deprecated
99 */
100 sal_Bool SAL_CALL osl_writeProfileIdent(oslProfile Profile,
101                               const sal_Char* pszSection, const sal_Char* pszEntry,
102 							  sal_uInt32 FirstId, const sal_Char* Strings[],
103 							  sal_uInt32 Value);
104 
105 /** Deprecated API.
106 	Acquire the mutex, block if already acquired by another thread.
107 	@param Profile handle to a opened profile.
108 	@return False if section or entry could not be found.
109 	@deprecated
110 */
111 sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile,
112                                const sal_Char *pszSection, const sal_Char *pszEntry);
113 
114 /** Deprecated API.
115 	Get all entries belonging to the specified section.
116 	@param Profile handle to a opened profile.
117 	@return Pointer to a array of pointers.
118 	@deprecated
119 */
120 sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, const sal_Char *pszSection,
121 	    						    sal_Char* pszBuffer, sal_uInt32 MaxLen);
122 
123 /** Deprecated API.
124 	Get all section entries
125 	@param Profile handle to a opened profile.
126 	@return Pointer to a array of pointers.
127 	@deprecated
128 */
129 sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile, sal_Char* pszBuffer, sal_uInt32 MaxLen);
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif	/* _OSL_PROFILE_H_ */
136 
137