]> git.saurik.com Git - apple/boot.git/blame - gen/libsa/libsa.h
boot-132.tar.gz
[apple/boot.git] / gen / libsa / libsa.h
CommitLineData
14c7c974
A
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
4f6e3300
A
6 * Portions Copyright (c) 1999 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 1.1 (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.
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/* Exported API for standalone library */
25#import <mach-o/loader.h>
26#import <mach/mach.h>
27#import <stdarg.h>
28#import <stddef.h>
29
30#ifndef bcopy
31extern char *bcopy(char *src, char *dst, int n);
32#endif
33extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
34#ifndef bzero
35extern int bzero(char *b, int length);
36#endif
37extern void *memset(void *s, int c, size_t n);
38
39/*
40 * These are defined internally by GCC
41 *
42 * extern void *memcpy(void *dst, const void *src, size_t len);
43 * extern size_t strlen(const char *s);
44 */
45
46extern int errno;
47extern struct segment_command *
48 getsegbynamefromheader(struct mach_header *mhp, char *segname);
49extern int ptol(char *str);
50
51/* setjmp/longjmp:
52 * #include <setjmp.h>
53 *
54 * extern int setjmp(jmp_buf env);
55 * extern void longjmp( jmp_buf env, int val);
56 */
57
58extern int slvprintf(char *buffer, int len, const char *fmt, va_list arg);
59extern int sprintf(char *s, const char *format, ...);
60
61extern char *strcat(char *s1, const char *s2);
62extern int strcmp(const char *s1, const char *s2);
63extern char *strcpy(char *s1, const char *s2);
64char *strerror(int errnum);
65extern int strncmp(const char *s1, const char *s2, size_t n);
66extern char *strncpy(char *s1, const char *s2, size_t n);
67extern long strtol(
68 const char *nptr,
69 char **endptr,
70 register int base
71);
72extern unsigned long strtoul(
73 const char *nptr,
74 char **endptr,
75 register int base
76);
77extern int atoi(const char *str);
78
79/* Mach */
80extern port_t task_self_;
81extern kern_return_t vm_allocate(
82 vm_task_t target_task,
83 vm_address_t *address,
84 vm_size_t size,
85 boolean_t anywhere
86);
87extern kern_return_t vm_deallocate(
88 vm_task_t target_task,
89 vm_address_t address,
90 vm_size_t size
91);
92extern kern_return_t host_info(
93 host_t host,
94 int flavor,
95 host_info_t host_info,
96 unsigned int *host_info_count
97);
98extern vm_size_t vm_page_size;
99extern host_t host_self(void);
100extern int getpagesize(void);
101extern char *mach_error_string(int errnum);
102
103/* Malloc */
104extern void malloc_init(char *start, int size, int nodes);
105extern void *malloc(size_t size);
106extern void free(void *start);
107extern void *realloc(void *ptr, size_t size);
108
109extern void prf(
110 const char *fmt,
111 va_list ap,
112 void (*putfn_p)(),
113 void *putfn_arg
114);
115extern int strncasecmp(const char *s1, const char *s2, size_t n);