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