/
Sapphire/bin/
Sapphire/db/
Sapphire/db/OLC_rooms/
Sapphire/db/abi/
Sapphire/db/em_src/
Sapphire/db/helps/
Sapphire/db/helps/emman/ifunc/
Sapphire/db/npcs/Tatt/
Sapphire/db/objects/Tatt/
Sapphire/db/q_data/
Sapphire/db/rooms/Tatt/
Sapphire/doc/
Sapphire/doc/em/
Sapphire/etc/
Sapphire/src/abic/
Sapphire/src/areacon/
Sapphire/src/client/
Sapphire/src/embc/
Sapphire/src/emi/
Sapphire/src/emi/test/
Sapphire/src/include/
Sapphire/src/sapphire/em/
Sapphire/src/tcon/
/*
 * Copyright (C) 1995-1997 Christopher D. Granz
 *
 * This header may not be removed.
 *
 * Refer to the file "License" included in this package for further
 * information and before using any of the following.
 */

#ifndef __EMI_H__
#define __EMI_H__

#include "emerald.h"


/*
 * Prototypes
 */

/*
 * main.c
 */
int              main                                 ( int, char *[] );
int              func_new                                      ( void );
int              em_load_obj_file                      ( char *, bool );
int              em_unload_func                                 ( int );
void             em_translate                                  ( void );
byte *           bct                                         ( byte * );
int              em_find_func                                ( char * );
int              em_call_func                                   ( int );

/*
 * memory.c
 */
void *           alloc_mem                          ( register size_t );
void *           realloc_mem       ( register void *, register size_t );
void             free_mem                          ( register void ** );
void             zero_out          ( register void *, register size_t );
char *           str_dup                            ( register char * );

/*
 * interp.c
 */
void             stack_init                                    ( void );
void             stack_free                                    ( void );
void             var_stack_push                 ( register EM_VALUE * );
void             var_stack_pop                   ( register short int );
void             var_stack_reset                               ( void );
bool             var_stack_overflow                            ( void );
void             interp_stack_push              ( register EM_VALUE * );
void             interp_stack_pop                ( register short int );
bool             interp_stack_overflow                         ( void );
void             init_value                     ( register EM_VALUE * );
void             delete_value                   ( register EM_VALUE * );
byte *           interpret_instruction                       ( byte * );

/*
 * array.c
 */
EM_ARRAY *       array_alloc                        ( register size_t );
void             array_free                     ( register EM_ARRAY * );
EM_ARRAY *       array_copy                     ( register EM_ARRAY * );

/*
 * error.c
 */
void             print_error                                   ( void );
void             error_check                                   ( void );
byte *           bcec                                        ( byte * );

/*
 * builtin.c
 */
void             em_get_values                            ( long, ... );
void             _lnullobj                                     ( void );
void             _lobjtype                                     ( void );
void             _lvstacksize                                  ( void );
void             _listacksize                                  ( void );
void             _lnumbfuncargs                                ( void );
void             _lnumfuncargs                                 ( void );
void             _lopentfile                                   ( void );
void             _lclosefile                                   ( void );
void             _lcoredump                                    ( void );
void             _lout /* temp */                              ( void );


/*
 * Globals
 */
extern char                                                   cNullChar;

extern int                                             iInterpStackSize;
extern int                                                iVarStackSize;

extern bool                                            bReportFuncUsage;
extern char *                                            pUsageFilename;

extern char                                                 cErrorBuf[];
extern int                                                     iEmError;
extern jmp_buf                                              jbAbortJump;

extern const struct em_extern_func_type                emefCFuncTable[];

extern EM_FUNC **                                               ppFuncs;
extern short int                                         siTopFuncIndex;

#endif /* __EMI_H__ */


/*
 * End of emi.h
 */