Custom DLL Test.c 644 B

1234567891011121314151617181920212223242526
  1. #define USE_TI89
  2. #define SAVE_SCREEN
  3. #include <tigcclib.h>
  4. #define HelloFromDLL _DLL_call(void,(void),0)
  5. #define SumFromDLL _DLL_call_attr(int,(int,int),__attribute__((stkparm)),1)
  6. #define MessageInDLL _DLL_reference(const char,2)
  7. #define GlobalVarInDLL _DLL_glbvar(long,3)
  8. void _main(void)
  9. {
  10. if (LoadDLL ("mydll", 372377271, 2, 11) != DLL_OK)
  11. {
  12. DlgMessage ("ERROR", "Error loading DLL!", BT_OK, BT_NONE);
  13. return;
  14. }
  15. clrscr ();
  16. GlobalVarInDLL = 1234567;
  17. HelloFromDLL ();
  18. printf ("Sum from DLL: 2+3=%d\n", SumFromDLL (2, 3));
  19. printf ("Message from DLL: %s\n", MessageInDLL);
  20. ngetchx ();
  21. UnloadDLL ();
  22. }