iup_initialiser.e 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. expanded class IUP_INITIALISER
  2. insert
  3. IUP_ARGUMENTS
  4. create {} -- for Cecil
  5. init_from_c
  6. feature {}
  7. init_from_c
  8. local
  9. argc, i: INTEGER; argv: NATIVE_ARRAY[POINTER]; s: STRING; p: POINTER
  10. do
  11. argc := command_arguments.count
  12. argv := argv.calloc(argc)
  13. from
  14. i := argc - 1
  15. until
  16. i < 0
  17. loop
  18. s := command_arguments.item(i)
  19. argv.put(s.to_external, i)
  20. i := i - 1
  21. end
  22. argc := iup_init(argc, argv.to_external)
  23. command_arguments.resize(argc)
  24. from
  25. i := argc - 1
  26. until
  27. i < 0
  28. loop
  29. p := argv.item(i)
  30. create s.from_external_copy(p)
  31. command_arguments.put(s, i)
  32. i := i - 1
  33. end
  34. end
  35. iup_init (argc: INTEGER; argv: POINTER): INTEGER
  36. external "plug_in"
  37. alias "{
  38. location: "${sys}/plugins"
  39. module_name: "iup"
  40. feature_name: "iup_init"
  41. }"
  42. end
  43. end -- class IUP_INITIALISER
  44. -- The MIT License (MIT)
  45. -- Copyright (c) 2016 by German A. Arias
  46. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  47. -- of this software and associated documentation files (the "Software"), to deal
  48. -- in the Software without restriction, including without limitation the rights
  49. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  50. -- copies of the Software, and to permit persons to whom the Software is
  51. -- furnished to do so, subject to the following conditions:
  52. --
  53. -- The above copyright notice and this permission notice shall be included in
  54. -- all copies or substantial portions of the Software.
  55. --
  56. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  57. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  58. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  59. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  60. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  61. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  62. -- SOFTWARE.