Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/libsa/libsa.h

1/*
2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
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
9 * Source License Version 2.0 (the "License"). You may not use this file
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.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
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
38extern void bcopy(const void * src, void * dst, size_t len);
39#endif
40
41#ifndef bzero
42extern void bzero(void * dst, size_t len);
43#endif
44
45extern void * memset(void * dst, int c, size_t n);
46extern void * memcpy(void * dst, const void * src, size_t len);
47extern int memcmp(const void * p1, const void * p2, int len);
48extern int strcmp(const char * s1, const char * s2);
49extern int strncmp(const char * s1, const char * s2, size_t n);
50extern char * strcpy(char * s1, const char * s2);
51extern char * strncpy(char * s1, const char * s2, size_t n);
52extern char * strlcpy(char * s1, const char * s2, size_t n);
53extern char * strstr(const char *in, const char *str);
54extern int atoi(const char * str);
55extern int ptol(const char * str);
56extern int strlen(const char * str);
57extern char * strcat(char * s1, const char * s2);
58extern char * strncat(char * s1, const char * s2, size_t n);
59
60#if STRNCASECMP
61extern int strncasecmp(const char * s1, const char * s2, size_t n);
62#endif
63
64extern uint8_t checksum8( void * start, unsigned int length );
65
66/*
67 * error.c
68 */
69extern int errno;
70extern char * strerror(int errnum);
71
72/*
73 * strtol.c
74 */
75extern long strtol(const char * nptr, char ** endptr, int base);
76extern unsigned long strtoul(const char * nptr, char ** endptr, int base);
77extern unsigned long long strtouq(const char *nptr, char ** endptr, int base);
78
79/*
80 * prf.c
81 */
82extern void prf(const char * fmt, va_list ap, void (*putfn_p)(),
83 void * putfn_arg);
84
85/*
86 * printf.c
87 */
88extern int sprintf(char *s, const char * format, ...);
89extern int slvprintf(char * buffer, int len, const char * fmt, va_list arg);
90
91/*
92 * zalloc.c
93 */
94extern void malloc_init(char * start, int size, int nodes, void (*malloc_error)(char *, size_t));
95extern void * malloc(size_t size);
96extern void free(void * start);
97extern void * realloc(void * ptr, size_t size);
98
99/*
100 * getsegbyname.c
101 */
102extern struct segment_command *
103 getsegbynamefromheader(struct mach_header * mhp, char * segname);
104
105#endif /* !__BOOT_LIBSA_H */
106

Archive Download this file

Revision: 1