init.go 297 B

1234567891011121314151617181920
  1. package phpgo
  2. /*
  3. #include "extension.h"
  4. */
  5. import "C"
  6. import "unsafe"
  7. //export get_module
  8. func get_module() unsafe.Pointer {
  9. if len(ExtName) == 0 {
  10. panic("ext name not set.")
  11. }
  12. addBuiltins()
  13. mod := C.phpgo_get_module(C.CString(ExtName), C.CString(ExtVer))
  14. return unsafe.Pointer(mod)
  15. }