gtdevcomm.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * GTools C compiler
  3. * =================
  4. * source file :
  5. * (on-calc) communication with the GT-Dev IDE
  6. *
  7. * Copyright 2001-2004 Paul Froissart.
  8. * Credits to Christoph van Wuellen and Matthew Brandt.
  9. * All commercial rights reserved.
  10. *
  11. * This compiler may be redistributed as long there is no
  12. * commercial interest. The compiler must not be redistributed
  13. * without its full sources. This notice must stay intact.
  14. */
  15. #include "GtDevComm.h"
  16. extern int has_error;
  17. char *in_file CGLOB,*out_file CGLOB;
  18. Msg_Callback_t msg_process CGLOB;
  19. Progr_Callback_t progr_process CGLOB;
  20. #include "identity.h"
  21. void _gtdevmain(void);
  22. int Compile(char *in,char *out,Msg_Callback_t _msg_process,Progr_Callback_t _progr_process) {
  23. void *old_a5=bssdata;
  24. int res;
  25. bssdata=malloc(BSS_SIZE);
  26. if (!bssdata) return;
  27. memset(bssdata,0,BSS_SIZE);
  28. in_file=in; out_file=out;
  29. msg_process=_msg_process;
  30. progr_process=_progr_process;
  31. _gtdevmain();
  32. bssdata=identity(bssdata);
  33. if (!bssdata)
  34. return 2;
  35. res=has_error;
  36. free(bssdata);
  37. bssdata=old_a5;
  38. return res;
  39. }
  40. // vim:ts=4:sw=4