#ifndef __IX_AMIGA_H
#define __IX_AMIGA_H

/* This header provides prototypes for Amiga specific functions available
 * in ixemul.library or libc.a.
 *
 * Each function is also documented in this header (or will be). Sometimes an Amiga
 * extension is described here, but for ease of use the original prototype
 * or macro is defined elsewhere.
 *
 */

/* Like vfork(), but the memory that the child allocates will be owned by
   the child. vfork() uses the parent's memory list, but since vfork2() is
   used as a fork() emulation, this would be undesirable, not in the least
   because that memory wouldn't be released until the parent exits. Causing
   a huge memory leak. */

int vfork2(void);

/* Obsolete function to pass pointers to the _ctype_ array and the sys_nerr
   variable from ixemul to the program. Do not use, use ix_get_vars2()
   instead. */

/* void ix_get_vars(char **ctype, int *_sys_nerr); */

void ix_get_vars2 (int argc, char **ctype, int *_sys_nerr, 
	           struct Library **sysbase, struct Library **dosbase,
	           FILE ***fpp, char ***environ_out, char ***environ_in,
	           int *real_errno, int *real_h_errno, struct __res_state *_res,
	           int *_res_socket);

#if 0
/* TODO */
use geta4 in callbacks installed using funopen() when -resident
SYSTEM_CALL (CreateExtIO, 27)
SYSTEM_CALL (CreatePort, 28)
SYSTEM_CALL (CreateStdIO, 29)
SYSTEM_CALL (CreateTask, 30)
SYSTEM_CALL (DeleteExtIO, 31)
SYSTEM_CALL (DeletePort, 32)
SYSTEM_CALL (DeleteStdIO, 33)
SYSTEM_CALL (DeleteTask, 34)
O_CASE
achmod
vfork_resume
__amiga_filehandle
ix_resident
ix_geta4
ix_check_cpu
tracecntl
SYSTEM_CALL (ix_get_gmt_offset, 473)
SYSTEM_CALL (ix_set_gmt_offset, 474)
SYSTEM_CALL (ix_get_default_settings, 475)
SYSTEM_CALL (ix_get_settings, 476)
SYSTEM_CALL (ix_set_settings, 477)
SYSTEM_CALL (__init_stk_limit, 480)
SYSTEM_CALL (__stkovf, 481)
SYSTEM_CALL (__stkext, 482)
SYSTEM_CALL (__stkext_f, 483)
SYSTEM_CALL (__stkrst, 484)
aselect
ix_get_variables
vfork_setup_child

#endif

#endif
