Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. @[Link("krb5")]
  2. lib LibKRB
  3. type Context = Void*
  4. fun init_context = krb5_init_context(context : Context*) : LibC::UInt
  5. fun free_context = krb5_free_context(context : Context)
  6. end
  7.  
  8. class Krb5
  9.  
  10. def initialize
  11. ret = LibKRB.init_context(out ctx)
  12. # same as
  13. ctx = uninitialized LibKRB::Context
  14. ret = LibKRB.init_context(pointerof(ctx))
  15.  
  16. raise "krb5_init_context() failed" if ret == 0
  17. end
  18.  
  19.  
  20.  
  21. end
  22.  
  23.  
  24. puts Krb5.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement