1 #include "__arosc_privdata.h"
3 #include <proto/exec.h>
5 #include <dos/dosextens.h>
10 #include "arosc_init.h"
15 #include <aros/debug.h>
17 extern struct Library
*aroscbase
;
19 struct arosc_userdata
* __get_arosc_userdata(void)
21 struct arosc_privdata
*acpd
= NULL
;
24 struct Task
*curtask
= FindTask(NULL
);
26 acpd
= GetIntETask(curtask
)->iet_acpd
;
30 #warning FIXME: This is a quick hack to make old programs which use
31 #warning the libc from inside newly created tasks/processes
32 #warning without going trough special libc routines
33 #warning (yet to be written).
35 struct Task
*parent
= GetETask(curtask
)->et_Parent
;
36 while (parent
!= NULL
)
38 acpd
= GetIntETask(parent
)->iet_acpd
;
39 if(acpd
!= NULL
) break;
40 parent
= GetETask(parent
)->et_Parent
;
47 /* No acpd found? Fall back to the builtin one. */
48 static struct arosc_privdata acpd_static
=
50 .acpd_acud
.acud_ctype_b
= &__ctype_b_array
[128],
51 .acpd_acud
.acud_ctype_toupper
= &__ctype_toupper_array
[128],
52 .acpd_acud
.acud_ctype_tolower
= &__ctype_tolower_array
[128],
55 return &acpd_static
.acpd_acud
;
58 return &acpd
->acpd_acud
;