xref: /openbsd-src/gnu/usr.bin/perl/amigaos4/amigaio.h (revision 256a93a44f36679bee503f12e49566c2183f6181)
1*b8851fccSafresh1 #ifndef _AMIGAIO_H
2*b8851fccSafresh1 #define _AMIGAIO_H
3*b8851fccSafresh1 
4*b8851fccSafresh1 #ifndef H_PERL
5*b8851fccSafresh1 #include "../perl.h"
6*b8851fccSafresh1 #endif
7*b8851fccSafresh1 
8*b8851fccSafresh1 struct StdioStore
9*b8851fccSafresh1 {
10*b8851fccSafresh1         /* astdin...astderr are the amigaos file descriptors */
11*b8851fccSafresh1         long astdin;
12*b8851fccSafresh1         long astdout;
13*b8851fccSafresh1         long astderr;
14*b8851fccSafresh1         /* oldstdin...oldstderr are the amigados file handles */
15*b8851fccSafresh1         long oldstdin;
16*b8851fccSafresh1         long oldstdout;
17*b8851fccSafresh1         long oldstderr;
18*b8851fccSafresh1 };
19*b8851fccSafresh1 
20*b8851fccSafresh1 typedef struct StdioStore StdioStore;
21*b8851fccSafresh1 
22*b8851fccSafresh1 /* get the amigaos file descriptors */
23*b8851fccSafresh1 void amigaos_stdio_get(pTHX_ StdioStore *store);
24*b8851fccSafresh1 
25*b8851fccSafresh1 /* save the amigados file handles (calls amigaos_stdio_get) */
26*b8851fccSafresh1 void amigaos_stdio_save(pTHX_ StdioStore *store);
27*b8851fccSafresh1 
28*b8851fccSafresh1 /* restore the amigados file handles stored with amigaos_stdio_save */
29*b8851fccSafresh1 void amigaos_stdio_restore(pTHX_ const StdioStore *store);
30*b8851fccSafresh1 
31*b8851fccSafresh1 /* everything the child needs from the parent is in UserData,
32*b8851fccSafresh1  * then pass it through task->tc_UserData or as arg to new pthread */
33*b8851fccSafresh1 struct UserData
34*b8851fccSafresh1 {
35*b8851fccSafresh1         struct Task *parent;
36*b8851fccSafresh1         I32 did_pipes;
37*b8851fccSafresh1         int pp;
38*b8851fccSafresh1         SV **sp;
39*b8851fccSafresh1         SV **mark;
40*b8851fccSafresh1         PerlInterpreter *my_perl;
41*b8851fccSafresh1 };
42*b8851fccSafresh1 
43*b8851fccSafresh1 void amigaos_fork_set_userdata(
44*b8851fccSafresh1     pTHX_ struct UserData *userdata, I32 did_pipes, int pp, SV **sp, SV **mark);
45*b8851fccSafresh1 
46*b8851fccSafresh1 void *amigaos_system_child(void *userdata);
47*b8851fccSafresh1 
48*b8851fccSafresh1 void amigaos_post_exec(int fd, int do_report);
49*b8851fccSafresh1 
50*b8851fccSafresh1 Pid_t amigaos_fork();
51*b8851fccSafresh1 Pid_t amigaos_waitpid(pTHX_ int optype, Pid_t pid, void *argflags);
52*b8851fccSafresh1 
53*b8851fccSafresh1 #endif
54