5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 Desc: AROS version of BPTRs
13 # include <exec/types.h>
17 /* Replace BPTRs by simple APTRs for some machines. On Amiga with binary
18 compatibility, this would look like this:
21 #define MKBADDR(a) (((BPTR)(a))>>2)
22 #define BADDR(a) (((APTR)(a))<<2)
24 #ifndef AROS_BPTR_TYPE
25 # define AROS_FAST_BPTR
26 # define AROS_BPTR_TYPE APTR
27 # define MKBADDR(a) ((APTR)(a))
30 #ifndef AROS_BSTR_TYPE
31 # define AROS_BSTR_TYPE STRPTR
34 /* Macros to transparently handle BSTRs. */
36 # define AROS_BSTR_ADDR(s) ((STRPTR)(s))
37 # define AROS_BSTR_strlen(s) (strlen (s))
38 # define AROS_BSTR_setstrlen(s,l) (((BSTR)s)[l] = 0)
39 # define AROS_BSTR_getchar(s,l) (((BSTR)s)[l])
40 # define AROS_BSTR_putchar(s,l,c) (((BSTR)s)[l] = c)
42 # define AROS_BSTR_ADDR(s) (((STRPTR)BADDR(s))+1)
43 # define AROS_BSTR_strlen(s) (AROS_BSTR_ADDR(s)[-1])
44 # define AROS_BSTR_setstrlen(s,l) (AROS_BSTR_ADDR(s)[-1] = l)
45 # define AROS_BSTR_getchar(s,l) (AROS_BSTR_ADDR(s)[l])
46 # define AROS_BSTR_putchar(s,l,c) (AROS_BSTR_ADDR(s)[l] = c)
49 #ifndef __typedef_BPTR
50 # define __typedef_BPTR
51 typedef AROS_BPTR_TYPE BPTR
;
53 #ifndef __typedef_BSTR
54 # define __typedef_BSTR
55 typedef AROS_BSTR_TYPE BSTR
;
58 #endif /* DOS_BPTR_H */