home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
languages
/
c
/
oslib
/
Examples
/
p2-083
< prev
next >
Wrap
Text File
|
1994-05-11
|
645b
|
25 lines
#include "osfscontrol.h"
os_error *ex (char *command_tail_ptr, byte *execution_address,
char *command_name_ptr)
{ os_error *error = NULL;
os_error *(*fn) (void) =
(os_error *(*) (void)) ((bits) execution_address & ~0xFC000003);
/*address with no flags, user mode*/
if ((error = xosfscontrol_start_application (command_tail_ptr,
(byte *) fn, command_name_ptr)) != NULL)
goto finish;
/*assume not in SVC mode (mode-switching harder in C)*/
/*Enter application: assume CAO is function address*/
error = (*fn) ();
os_exit (error, 0); /*in case it returns*/
finish:
return error;
}