DLL.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /******************************************************************************
  2. Use 'DLL' class to load a dll/so file.
  3. 'DLL' operates on DLL files on Windows platforms, and SO files on Unix platforms.
  4. /******************************************************************************/
  5. struct DLL // DLL/SO loader
  6. {
  7. // manage
  8. Bool createMem ( CPtr data, Int size); // create DLL from memory, false on fail
  9. Bool createFile(C Str &file ); // create DLL from file , false on fail
  10. Bool createFile(CChar *file ); // create DLL from file , false on fail
  11. // get
  12. Bool is ( )C; // if DLL is created
  13. Ptr getFunc(CChar8 *name)C; // get DLL function from its 'name'
  14. #if EE_PRIVATE
  15. void delForce(); // delete continuously until it's completely released
  16. #endif
  17. DLL& del(); // delete manually
  18. ~DLL() {del();}
  19. DLL();
  20. private:
  21. Ptr _dll_file, _dll_mem;
  22. NO_COPY_CONSTRUCTOR(DLL);
  23. };
  24. /******************************************************************************/