2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "datatypes_intern.h"
7 #include <datatypes/datatypesclass.h>
8 #include <utility/tagitem.h>
9 #include <dos/dostags.h>
10 #include <proto/alib.h>
11 #include <proto/dos.h>
12 #include <proto/exec.h>
13 #include <proto/utility.h>
14 #include <proto/workbench.h>
16 /* Putchar procedure needed by RawDoFmt() */
18 AROS_UFH2(void, dt_putchr
,
19 AROS_UFHA(UBYTE
, chr
, D0
),
20 AROS_UFHA(STRPTR
*, p
, A3
))
27 void dt__sprintf(struct Library
*DataTypesBase
, UBYTE
*buffer
,
30 RawDoFmt(format
, &format
+1, (VOID_FUNC
)dt_putchr
, &buffer
);
34 /*****************************************************************************
37 #include <proto/datatypes.h>
39 AROS_LH3(ULONG
, LaunchToolA
,
42 AROS_LHA(struct Tool
* , tool
, A0
),
43 AROS_LHA(STRPTR
, project
, A1
),
44 AROS_LHA(struct TagItem
*, attrs
, A2
),
47 struct Library
*, DataTypesBase
, 42, DataTypes
)
51 Launch an application with a particular project.
55 tool -- tool to use (may be NULL in which case this function
57 project -- name of the project to execute or NULL
58 attrs -- additional attributes
62 NP_Priority (BYTE) -- priority of the launched tool (default is the
63 priority of the currect process except for
64 Workbench applications where the default priority
65 is 0 if not overridden by the TOOLPRI tooltype).
67 NP_Synchronous (BOOL) -- don't return until lauched application process
68 finishes (defaults to FALSE).
72 Zero for failure, non-zero otherwise.
86 *****************************************************************************/
95 SetIoErr(ERROR_REQUIRED_ARG_MISSING
);
100 isSynchronous
= (BOOL
)GetTagData(NP_Synchronous
, (IPTR
)FALSE
, attrs
);
102 switch (tool
->tn_Flags
& TF_LAUNCH_MASK
)
111 DataTypesBase
, tBuffer
,
112 "\"%s\" \"%s\"", tool
->tn_Program
, project
115 output
= Open("CON:////Output window/AUTO/WAIT/CLOSE/INACTIVE",
120 struct TagItem tags
[] = { { SYS_Asynch
, !isSynchronous
},
121 { SYS_Input
, NULL
},
122 { SYS_Output
, (IPTR
)output
},
123 { TAG_DONE
, NULL
} };
126 ret
= SystemTagList(tBuffer
, tags
);
146 BOOL success
= FALSE
;
147 struct Library
*WorkbenchBase
= OpenLibrary("workbench.library", 39L);
149 if (WorkbenchBase
!= NULL
)
151 BPTR lock
= Lock(project
, ACCESS_READ
);
155 BPTR parent
= ParentDir(lock
);
157 success
= OpenWorkbenchObject
160 WBOPENA_ArgLock
, (IPTR
) parent
,
161 WBOPENA_ArgName
, (IPTR
) FilePart(project
),
168 CloseLibrary(WorkbenchBase
);
171 if (!success
) return 0;
176 /* Sorry, no Arexx in AROS yet. */
177 #warning No Arexx compatibility yet
179 /* Do some "RX command" here */