GNUstep CoreBase Library 0.2
CFNumber.h
1/* CFNumber.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: January, 2010
7
8 This file is part of GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library 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 GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFNUMBER_H__
28#define __COREFOUNDATION_CFNUMBER_H__
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
34typedef const struct __CFBoolean *CFBooleanRef;
36typedef const struct __CFNumber *CFNumberRef;
37
41CF_EXPORT const CFBooleanRef kCFBooleanTrue;
42CF_EXPORT const CFBooleanRef kCFBooleanFalse;
43
44CF_EXPORT CFTypeID CFBooleanGetTypeID (void);
45
46CF_EXPORT Boolean CFBooleanGetValue (CFBooleanRef boolean);
52CF_EXPORT const CFNumberRef kCFNumberNaN;
53CF_EXPORT const CFNumberRef kCFNumberNegativeInfinity;
54CF_EXPORT const CFNumberRef kCFNumberPositiveInfinity;
55
56typedef enum
57{
58 kCFNumberSInt8Type = 1,
59 kCFNumberSInt16Type = 2,
60 kCFNumberSInt32Type = 3,
61 kCFNumberSInt64Type = 4,
62 kCFNumberFloat32Type = 5,
63 kCFNumberFloat64Type = 6,
64 kCFNumberCharType = 7,
65 kCFNumberShortType = 8,
66 kCFNumberIntType = 9,
67 kCFNumberLongType = 10,
68 kCFNumberLongLongType = 11,
69 kCFNumberFloatType = 12,
70 kCFNumberDoubleType = 13,
71 kCFNumberCFIndexType = 14,
72#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
73 kCFNumberNSIntegerType = 15,
74 kCFNumberCGFloatType = 16,
75 kCFNumberMaxType = 16
76#else
77 kCFNumberMaxType = 14
78#endif
79} CFNumberType;
80
84CF_EXPORT CFNumberRef
85CFNumberCreate (CFAllocatorRef allocator, CFNumberType theType,
86 const void *valuePtr);
92CF_EXPORT CFIndex CFNumberGetByteSize (CFNumberRef number);
93
94CF_EXPORT CFNumberType CFNumberGetType (CFNumberRef number);
95
96CF_EXPORT Boolean
97CFNumberGetValue (CFNumberRef number, CFNumberType theType, void *valuePtr);
98
99CF_EXPORT Boolean CFNumberIsFloatType (CFNumberRef number);
105CF_EXPORT CFComparisonResult
106CFNumberCompare (CFNumberRef number, CFNumberRef otherNumber, void *context);
112CF_EXPORT CFTypeID CFNumberGetTypeID (void);
116CF_EXTERN_C_END
117#endif /* __COREFOUNDATION_CFNUMBER_H__ */
signed long CFIndex
Definition CFBase.h:165
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301