Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

A higher-level class for loading dynamic libraries and resolving symbols in Crystal.

License

Notifications You must be signed in to change notification settings

fabianloewe/dynamic-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamic-library

A higher-level class for loading dynamic libraries and resolving symbols in Crystal.

Installation

Add this to your application's shard.yml:

dependencies:
  dynamic-library:
    github: hyronx/dynamic-library

Usage

require "dynamic-library"

library = DynamicLibrary.new "some_lib.so", LibC::RTLD_NOW
if symbol = library.symbol? "add"
  func = Proc(UInt32, UInt32, UInt32).new symbol, Pointer(Void).null
  func.call(1, 2) # -> 3
end

# library.close    (This is optional and otherwise automatically done.)

Contributing

  1. Fork it ( https://github.com/hyronx/dynamic-library/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • hyronx - creator, maintainer

About

A higher-level class for loading dynamic libraries and resolving symbols in Crystal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published