]>
Commit | Line | Data |
---|---|---|
14c7c974 | 1 | /* |
57c72a9a | 2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. |
14c7c974 A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
57c72a9a | 6 | * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights |
4f6e3300 A |
7 | * Reserved. This file contains Original Code and/or Modifications of |
8 | * Original Code as defined in and that are subject to the Apple Public | |
57c72a9a | 9 | * Source License Version 2.0 (the "License"). You may not use this file |
4f6e3300 A |
10 | * except in compliance with the License. Please obtain a copy of the |
11 | * License at http://www.apple.com/publicsource and read it before using | |
12 | * this file. | |
14c7c974 A |
13 | * |
14 | * The Original Code and all software distributed under the License are | |
4f6e3300 | 15 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
14c7c974 A |
16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
4f6e3300 A |
18 | * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the |
19 | * License for the specific language governing rights and limitations | |
20 | * under the License. | |
14c7c974 A |
21 | * |
22 | * @APPLE_LICENSE_HEADER_END@ | |
23 | */ | |
24 | ||
25 | #ifndef __BOOT_LIBSA_H | |
26 | #define __BOOT_LIBSA_H | |
27 | ||
28 | /* Exported API for standalone library */ | |
29 | ||
30 | #include <mach-o/loader.h> | |
31 | #include <stdarg.h> | |
32 | #include <stddef.h> | |
33 | ||
34 | /* | |
35 | * string.c | |
36 | */ | |
37 | #ifndef bcopy | |
75b89a82 | 38 | extern void bcopy(const void * src, void * dst, size_t len); |
14c7c974 A |
39 | #endif |
40 | ||
41 | #ifndef bzero | |
75b89a82 | 42 | extern void bzero(void * dst, size_t len); |
14c7c974 A |
43 | #endif |
44 | ||
45 | extern void * memset(void * dst, int c, size_t n); | |
46 | extern void * memcpy(void * dst, const void * src, size_t len); | |
47 | extern int strcmp(const char * s1, const char * s2); | |
48 | extern int strncmp(const char * s1, const char * s2, size_t n); | |
49 | extern char * strcpy(char * s1, const char * s2); | |
50 | extern char * strncpy(char * s1, const char * s2, size_t n); | |
f083c6c3 | 51 | extern char * strlcpy(char * s1, const char * s2, size_t n); |
14c7c974 | 52 | extern int atoi(const char * str); |
75b89a82 A |
53 | extern int ptol(const char * str); |
54 | extern int strlen(const char * str); | |
14c7c974 A |
55 | extern char * strcat(char * s1, const char * s2); |
56 | extern char * strncat(char * s1, const char * s2, size_t n); | |
57 | ||
58 | #if STRNCASECMP | |
59 | extern int strncasecmp(const char * s1, const char * s2, size_t n); | |
60 | #endif | |
61 | ||
62 | /* | |
63 | * error.c | |
64 | */ | |
65 | extern int errno; | |
66 | extern char * strerror(int errnum); | |
67 | ||
68 | /* | |
69 | * strtol.c | |
70 | */ | |
75b89a82 A |
71 | extern long strtol(const char * nptr, char ** endptr, int base); |
72 | extern unsigned long strtoul(const char * nptr, char ** endptr, int base); | |
57c72a9a | 73 | extern unsigned long long strtouq(const char *nptr, char ** endptr, int base); |
14c7c974 A |
74 | |
75 | /* | |
76 | * prf.c | |
77 | */ | |
75b89a82 A |
78 | extern void prf(const char * fmt, va_list ap, void (*putfn_p)(), |
79 | void * putfn_arg); | |
14c7c974 A |
80 | |
81 | /* | |
82 | * printf.c | |
83 | */ | |
84 | extern int sprintf(char *s, const char * format, ...); | |
75b89a82 | 85 | extern int slvprintf(char * buffer, int len, const char * fmt, va_list arg); |
14c7c974 A |
86 | |
87 | /* | |
88 | * zalloc.c | |
89 | */ | |
f083c6c3 | 90 | extern void malloc_init(char * start, int size, int nodes, void (*malloc_error)(char *, size_t)); |
14c7c974 A |
91 | extern void * malloc(size_t size); |
92 | extern void free(void * start); | |
93 | extern void * realloc(void * ptr, size_t size); | |
94 | ||
95 | /* | |
96 | * getsegbyname.c | |
97 | */ | |
98 | extern struct segment_command * | |
75b89a82 | 99 | getsegbynamefromheader(struct mach_header * mhp, char * segname); |
47b0a8bd | 100 | |
14c7c974 | 101 | #endif /* !__BOOT_LIBSA_H */ |