/src/lib.rs

https://gitlab.com/cjcole/rust-lua53 · Rust · 68 lines · 34 code · 12 blank · 22 comment · 0 complexity · 7b74cc42b623dbe49f7dd0de051ca192 MD5 · raw file

  1. // The MIT License (MIT)
  2. //
  3. // Copyright (c) 2014 J.C. Moyer
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to deal
  7. // in the Software without restriction, including without limitation the rights
  8. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. // copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. // THE SOFTWARE.
  22. #![crate_name = "lua"]
  23. #![crate_type = "lib"]
  24. extern crate libc;
  25. #[macro_use]
  26. extern crate bitflags;
  27. pub use wrapper::state::{
  28. State,
  29. Arithmetic,
  30. Comparison,
  31. ThreadStatus,
  32. GcOption,
  33. Type,
  34. Library,
  35. Reference,
  36. REFNIL, NOREF,
  37. HookMask,
  38. MASKCALL, MASKRET, MASKLINE, MASKCOUNT,
  39. MULTRET, REGISTRYINDEX,
  40. RIDX_MAINTHREAD, RIDX_GLOBALS
  41. };
  42. pub use wrapper::convert::{
  43. ToLua,
  44. FromLua
  45. };
  46. pub use ffi::lua_Number as Number;
  47. pub use ffi::lua_Integer as Integer;
  48. pub use ffi::lua_CFunction as Function;
  49. pub use ffi::lua_Alloc as Allocator;
  50. pub use ffi::lua_Hook as Hook;
  51. /// Integer type used to index the Lua stack, usually `i32`.
  52. pub type Index = libc::c_int;
  53. pub mod ffi;
  54. mod wrapper;
  55. #[doc(hidden)]
  56. pub mod macros;