#include clib
#include bastard_def

/* The _t naming is used to differentiate from Seer internal names */
struct address_t {
    unsigned int    rva;
    unsigned int    pa;
    unsigned short   size;
    int     flags;
    unsigned int    dataConst;
    unsigned int    structure;
    unsigned int    comment;
};
struct section_t {
    char    name[32];
    unsigned int    rva;
    unsigned int    size;
    int     flags;
};
struct xref_t {
    unsigned int    id;
    unsigned int    from_rva;
    unsigned int    to_rva;
    int     type;
};
struct code_t {
    unsigned int    rva;
    unsigned short   flags;
    char    mnemonic[16];
    char    dest[32];
    char    src[32];
    char    aux[32];
    int     mnemType;
    int     destType;
    int     srcType;
    int     auxType;
    unsigned int    destConst;
    unsigned int    srcConst;
    unsigned int    auxConst;
};
struct int_code_t {
    unsigned int    id;
    unsigned int    rva;
    int     size;
    char    lvalue[32];
    char    rvalue[64];
};
struct fin_code_t {
    unsigned int    id;
    unsigned int    rva;
    int     size;
    char    line[256];
};
struct export_t {
    unsigned int    rva;
};
struct import_t {
    int     library;
    int     type;
    unsigned int    rva;
};
struct lib_t {
    int     id;
    char    name[64];
    int     ver_hi;
    int     ver_lo;
};
struct string_t {
    unsigned int    rva;
    int     length;
    char    text[256];
};
struct name_t {
    unsigned int    rva;
    int     type;
    char    name[64];
};
struct comment_t {
    unsigned int    id;
    int     type;
    char    text[256];
};
struct function_t {
    unsigned int    id;
    unsigned int    rva;
    unsigned short   size;
    unsigned int    comment;
};
struct func_param_t {
    unsigned int    id;
    unsigned int    func;
    unsigned int    type;
    int     offset;
    char    name[32];
};
struct func_local_t {
    unsigned int    id;
    unsigned int    func;
    unsigned int    type;
    int     offset;
    char    name[32];
};
struct f_inline_t {
    unsigned int    id;
    unsigned int    type;
};
struct inline_type_t {
    unsigned int    id;
    char    name[64];
    unsigned int    rva;
    unsigned short   size;
};
struct structure_t {
    unsigned int    id;
    char    name[32];
    unsigned short   size;
};
struct struct_member_t {
    unsigned int    id;
    unsigned int    type;
    unsigned int    structure;
    int     order;
    char    name[32];
};
struct data_type_t {
    unsigned int    id;
    int     size;
    char    name[32];
};
struct constant_t {
    unsigned int    id;
    char    name[32];
    int    value;
};
struct seer_macro_t {
    unsigned int    id;
    int     type;
    char    name[32];
    char    macro[2048];
};
import int DBIndexFirst(int , void *);
import int DBIndexNext(int , void *);
import int DBIndexPrev(int , void *);
import int DBIndexLast(int , void *);
import int DBIndexFind(int , void *, void *);
import int DBTableFirst(int , void *);
import int DBTableNext(int , void *);
import int DBTablePrev(int , void *);
import int DBTableLast(int , void *);
import int DBRecordInsert(int , void *);
import int DBRecordUpdate(int , void *, void *);
import int DBRecordDelete(int , void *);
import address_t * GetAddressObject(int );
import code_t * GetCodeObject(int );
import section_t * GetSectionObject(char *);
import xref_t * GetXrefObject(int );
import int_code_t * GetIntCodeObject(int );
import fin_code_t * GetFinCodeObject(int );
import export_t * GetExportObject(int );
import import_t * GetImportObject(int );
import string_t * GetStringObject(int );
import name_t * GetNameObject(int );
import comment_t * GetCommentObject(int );
import function_t * GetFunctionObject(int );
import func_param_t * GetFuncParamObject(int );
import func_local_t * GetFuncLocalObject(int );
import f_inline_t * GetFInlineObject(int );
import inline_type_t * GetInlineTypeObject(int );
import structure_t * GetStructureTypeObject(int );
import struct_member_t * GetStructMemberObject(int );
import data_type_t * GetDataTypeObject(int );
import constant_t * GetConstantObject(int );
import seer_macro_t * GetSeerMacroObject(int );
import int DisPrologue(code_t **);
import int DisEpilogue(code_t **);
import int DisByteOrder();
import int DisAddrSize();
import int DisByteSize();
import int DisWordSize();
import int DisDwordSize();
import char* DisGetSP();
import char* DisGetIP();
import int LoadTarget( char *);
import int LoadBDB( char *);
import int SetFileFormat( char *);
import int SetFileArch( char *);
import void SaveDB( );
import void SaveDBBak( );
import void CloseDB( );
import void SaveDBAs( char *);
import int SaveAsASM( char *);
import int SaveAsDump( char *);
import int SaveAsDiff( char *);
import int SaveAsBinary( char *);
import int CreateSection( char *, int , int , int , int );
import int DeleteSection( char *);
import int GetSectionStart( char *);
import int GetSectionEnd( char *);
import int CreateHeader( char *);
import void PrintHeader( );
import int InitDisassembler( char *);
import int DisassembleFull( );
import int DisassembleDumb( );
import int DisassembleSection( char *);
import int DisassembleRange( int , int );
import int DisassembleForward( int );
import int DisassemblePass( int );
import int DisassembleAllPasses();
import int AddrExists( int );
import int FindClosestAddr( int );
import int DefineAddr( int , int , int , int );
import int UndefineAddr( int );
import int PrintAddress( int );
import int MakeCode( int );
import int MakeData( int );
import int GetPA( int );
import int GetRVA( int );
import int GetAddrType( int );
import int GetAddrSize( int );
import int GetFlags( int );
import int GetAddrBytes( int , char *);
import int GetNextAddr( int );
import int GetPrevAddr( int );
import int SetFlags( int , int );
import int SetName( int , char* , int );
import int GetName( int , char* );
import int GetNameType(int );
import int GetAddrByName( char *);
import int DefineAddrComment( int , char *);
import int GetAddrComment( int );
import int GetAddrConstant( int );
import int GetAddrStruct( int );
import int SetAddrComment( int , int );
import int SetAddrConstant( int , int );
import int SetAddrStruct( int , int );
import int GetNextCode( int );
import int GetNextData( int );
import int GetCodeRep( char *, char *, int ) ;
import int GetMnemonic( int , char *);
import int GetSrc( int , char *);
import int GetDest( int , char *);
import int GetAux( int , char *);
import int GetMnemType( int );
import int GetSrcType( int );
import int GetDestType( int );
import int GetAuxType( int );
import int GetString( int , char *, int );
import int DefineString( int , char *);
import int DumpStrings( ); 
import int DefineImport( int , char *, char* , int );
import int GetImportName( int , char *);
import int GetImportLib( int , char *);
import int GetImportType( int );
import int DumpImports( );
import int DefineLibrary( char *, int , int );
import int DumpLibs( );	
import int DefineExport( int , char *);
import int GetExport( char *);
import int DumpExports( ); 
import int GetRefTo( int , int ) ; 		
import int GetNextRefTo( int ) ; 
import int GetRefFrom( int , int ) ;
import int GetNextRefFrom( int ) ;
import int DefineRef( int , int , int );
import int DefineFunc( int , char * , int );
import int GetFuncName( int , char *);
import int GetFuncStart( int );
import int GetFuncEnd( int );
import int GetFuncByName( char *);
import int SetFuncName( int , char *);
import int SetFuncSize( int , int );
import int GetComment( int , char *);
import int DefineComment( char *, int );
import int SetComment( int , char *);
import int DelComment( int ) ;
import int DefineConstant( char *, int );
import int GetConstant(int , char *);
import int GetConstantNext( char *);
import int GetConstantName( unsigned int , char *);
import int DelConstant( unsigned int );
import int RunScript( char *);
import int RunScriptText( char *);
import int RunCompiledScript(char *);
import int CompileScript(char *);
import int DefineMacro( char *, char *);
import int UndefineMacro( char *);
import int RunMacro( char *);
import int RecordMacro( char *);
import int FindBytes( unsigned char *, int , int **);
import int FindOperand( char *, int **);
import int FindMnemonic( char *, int **);
import int FindConstant( int , int **);
import int FreeSearchHandle( int **);
import void Message(  char *) ;
import void ErrorMsg( int ,  char *) ;
import void Quit( ) ;
import int Exec( char *);
import int Debug( );
import int Core( ); 
import int Panic( ); 
import int GetValidArchs( );
import int GetValidFormats( char *);
import int GetEnvFlag( int );
import int SetEnvFlag( int );
import void SetTtyFmt( char *);
import void SetAsmFmt( char *);
import void SetLprFmt( char *);
import int SetLastError( int );
import int GetLastError( );
import char* GetLastErrorString( );
import void PrintErrorMsg(int );
import void SprintErrorMsg(char *, int );
