]> git.saurik.com Git - apple/security.git/blob - SecureTransport/privateInc/sslalloc.h
Security-30.1.tar.gz
[apple/security.git] / SecureTransport / privateInc / sslalloc.h
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 File: sslalloc.h
21
22 Contains: memory allocator declarations
23
24 Written by: Doug Mitchell, based on Netscape RSARef 3.0
25
26 Copyright: (c) 1999 by Apple Computer, Inc., all rights reserved.
27
28 */
29 /* *********************************************************************
30 File: sslalloc.h
31
32 SSLRef 3.0 Final -- 11/19/96
33
34 Copyright (c)1996 by Netscape Communications Corp.
35
36 By retrieving this software you are bound by the licensing terms
37 disclosed in the file "LICENSE.txt". Please read it, and if you don't
38 accept the terms, delete this software.
39
40 SSLRef 3.0 was developed by Netscape Communications Corp. of Mountain
41 View, California <http://home.netscape.com/> and Consensus Development
42 Corporation of Berkeley, California <http://www.consensus.com/>.
43
44 *********************************************************************
45
46 File: sslalloc.h Allocation shell routines
47
48 These routines wrap the user-supplied callbacks to provide allocation
49 functionality.
50
51 ****************************************************************** */
52
53 #ifndef _SSLALLOC_H_
54 #define _SSLALLOC_H_ 1
55
56 #include "sslctx.h"
57 #include "sslerrs.h"
58 #include "sslPriv.h"
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63
64 /*
65 * General purpose allocators
66 */
67 void *sslMalloc(UInt32 length);
68 void sslFree(void *p);
69 void *sslRealloc(void *oldPtr, UInt32 oldLen, UInt32 newLen);
70
71 /*
72 * SSLBuffer-oriented allocators
73 */
74 SSLErr SSLAllocBuffer(SSLBuffer *buf, UInt32 length, const SystemContext *ctx);
75 SSLErr SSLFreeBuffer(SSLBuffer *buf, const SystemContext *ctx);
76 SSLErr SSLReallocBuffer(SSLBuffer *buf, UInt32 newSize, const SystemContext *ctx);
77
78 /*
79 * Set up/tear down CF allocators.
80 */
81 OSStatus cfSetUpAllocators(SSLContext *ctx);
82 void cfTearDownAllocators(SSLContext *ctx);
83
84 /*
85 * Convenience routines.
86 */
87 UInt8 *sslAllocCopy(const UInt8 *src, UInt32 len);
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif