xref: /aoo41x/main/sal/rtl/source/strimp.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_RTL_SOURCE_STRIMP_H
29 #define INCLUDED_RTL_SOURCE_STRIMP_H
30 
31 #include <osl/interlck.h>
32 
33 #include "sal/types.h"
34 
35 /* ======================================================================= */
36 /* Help functions for String and UString								   */
37 /* ======================================================================= */
38 
39 #if defined __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42 
43 /*
44  * refCount is opaqueincludes 2 bit-fields;
45  * MSB:   'interned' - is stored in the intern hash
46  * MSB-1: 'static'   - is a const / static string,
47  *                     do no ref counting
48  */
49 #define SAL_STRING_INTERN_FLAG 0x80000000
50 #define SAL_STRING_STATIC_FLAG 0x40000000
51 #define SAL_STRING_REFCOUNT(a) ((a) & 0x3fffffff)
52 
53 #define SAL_STRING_IS_INTERN(a) ((a)->refCount & SAL_STRING_INTERN_FLAG)
54 #define SAL_STRING_IS_STATIC(a) ((a)->refCount & SAL_STRING_STATIC_FLAG)
55 
56 sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix );
57 
58 sal_Bool rtl_ImplIsWhitespace( sal_Unicode c );
59 
60 #if defined __cplusplus
61 }
62 #endif /* __cplusplus */
63 
64 #endif /* INCLUDED_RTL_SOURCE_STRIMP_H */
65