You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.1 KiB

  1. /world/proc/_BSQL_Internal_Call(func, ...)
  2. var/list/call_args = args.Copy(2)
  3. BSQL_Debug("[.....]: [args[1]]([call_args.Join(", ")])")
  4. . = call(_BSQL_Library_Path(), func)(arglist(call_args))
  5. BSQL_Debug("Result: [. == null ? "NULL" : "\"[.]\""]")
  6. /world/proc/_BSQL_Library_Path()
  7. return system_type == MS_WINDOWS ? "BSQL.dll" : "libBSQL.so"
  8. /world/proc/_BSQL_InitCheck(datum/BSQL_Connection/caller)
  9. var/static/library_initialized = FALSE
  10. if(_BSQL_Initialized())
  11. return
  12. var/libPath = _BSQL_Library_Path()
  13. if(!fexists(libPath))
  14. BSQL_DEL_CALL(caller)
  15. BSQL_ERROR("Could not find [libPath]!")
  16. return
  17. var/result = _BSQL_Internal_Call("Initialize")
  18. if(result)
  19. BSQL_DEL_CALL(caller)
  20. BSQL_ERROR(result)
  21. return
  22. _BSQL_Initialized(TRUE)
  23. /world/proc/_BSQL_Initialized(new_val)
  24. var/static/bsql_library_initialized = FALSE
  25. if(new_val != null)
  26. bsql_library_initialized = new_val
  27. return bsql_library_initialized
  28. /world/BSQL_Shutdown()
  29. if(!_BSQL_Initialized())
  30. return
  31. _BSQL_Internal_Call("Shutdown")
  32. _BSQL_Initialized(FALSE)