/*
    CaPriCe Forever - Amstrad CPC 464/664/6128 emulator
    Copyright (C) 2014-2018 by Frédéric Coste

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef PASMO_H
#define PASMO_H

#include <iostream>
#include <sstream>


typedef struct 
{
  void* assembler;
  unsigned long selected_line;
  unsigned short selected_address;
  std::streambuf* oldCoutStreamBuf;
  std::stringstream ss;
  std::string filename;
} tPasmoEnv;


extern tPasmoEnv* pasmo_create(void);
extern void pasmo_terminate(tPasmoEnv* env);
extern void pasmo_setfilename(tPasmoEnv* env, char* filename);
extern void pasmo_setincludefolder(tPasmoEnv* env, char* folder);
extern void pasmo_setpredefines(tPasmoEnv* env, char* predefines);
extern int pasmo_assemble_lines(const char* lines,
                                unsigned short* origin,
                                unsigned char** code,
                                tPasmoEnv* env);
extern const char* pasmo_getcout(tPasmoEnv* env);

#endif /* PASMO_H */