summaryrefslogtreecommitdiffstats
path: root/lib/efl/native/ecore_getopt.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-02-27 15:48:45 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-02-27 15:48:45 +0100
commitef44077310b4ebf8d3cb31ccb57d15b96a94c9d3 (patch)
treec2bb690ccc1be37c03f6dcdcf892fbf3e17f5067 /lib/efl/native/ecore_getopt.rb
parentdbb2c5713e11489dfaeb318a82785017f1794dde (diff)
parentb030c490265bb13ee98a650da419a033495042ed (diff)
downloadffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.zip
ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.tar.gz
Merge branch 'wip'
Conflicts: tools/genruby.rb
Diffstat (limited to 'lib/efl/native/ecore_getopt.rb')
-rw-r--r--lib/efl/native/ecore_getopt.rb41
1 files changed, 17 insertions, 24 deletions
diff --git a/lib/efl/native/ecore_getopt.rb b/lib/efl/native/ecore_getopt.rb
index f84e15b..cb13303 100644
--- a/lib/efl/native/ecore_getopt.rb
+++ b/lib/efl/native/ecore_getopt.rb
@@ -1,18 +1,18 @@
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
-require 'efl/ffi'
+require 'efl/native'
+require 'efl/native/eina_list'
#
module Efl
#
module EcoreGetopt
#
- FCT_PREFIX = 'ecore_getopt_'
+ FCT_PREFIX = 'ecore_getopt_' unless const_defined? :FCT_PREFIX
#
- def self.method_missing m, *args, &block
- sym, args_s = ModuleHelper.find_function m, FCT_PREFIX
- self.module_eval "def self.#{m} *args, &block; r=Efl::Native.#{sym}(#{args_s}); yield r if block_given?; r; end"
- self.send m, *args, &block
+ def self.method_missing meth, *args, &block
+ sym = Efl::MethodResolver.resolve self, meth, FCT_PREFIX
+ self.send sym, *args, &block
end
#
end
@@ -23,12 +23,12 @@ module Efl
#
# ENUMS
# typedef enum {...} Ecore_Getopt_Action;
- enum :ecore_getopt_action, [ :ecore_getopt_action_store, :ecore_getopt_action_store_const, :ecore_getopt_action_store_true, :ecore_getopt_action_store_false,
- :ecore_getopt_action_choice, :ecore_getopt_action_append, :ecore_getopt_action_count, :ecore_getopt_action_callback, :ecore_getopt_action_help,
- :ecore_getopt_action_version, :ecore_getopt_action_copyright, :ecore_getopt_action_license ]
+ enum :ecore_getopt_action, [ :ecore_getopt_action_store, :ecore_getopt_action_store_const, :ecore_getopt_action_store_true,
+ :ecore_getopt_action_store_false, :ecore_getopt_action_choice, :ecore_getopt_action_append, :ecore_getopt_action_count, :ecore_getopt_action_callback,
+ :ecore_getopt_action_help, :ecore_getopt_action_version, :ecore_getopt_action_copyright, :ecore_getopt_action_license ]
# typedef enum {...} Ecore_Getopt_Type;
- enum :ecore_getopt_type, [ :ecore_getopt_type_str, :ecore_getopt_type_bool, :ecore_getopt_type_short, :ecore_getopt_type_int, :ecore_getopt_type_long,
- :ecore_getopt_type_ushort, :ecore_getopt_type_uint, :ecore_getopt_type_ulong, :ecore_getopt_type_double ]
+ enum :ecore_getopt_type, [ :ecore_getopt_type_str, :ecore_getopt_type_bool, :ecore_getopt_type_short, :ecore_getopt_type_int,
+ :ecore_getopt_type_long, :ecore_getopt_type_ushort, :ecore_getopt_type_uint, :ecore_getopt_type_ulong, :ecore_getopt_type_double ]
# typedef enum {...} Ecore_Getopt_Desc_Arg_Requirement;
enum :ecore_getopt_desc_arg_requirement, [ :ecore_getopt_desc_arg_requirement_no, 0, :ecore_getopt_desc_arg_requirement_yes, 1,
:ecore_getopt_desc_arg_requirement_optional, 3 ]
@@ -36,36 +36,29 @@ module Efl
# TYPEDEFS
# typedef union _Ecore_Getopt_Value Ecore_Getopt_Value;
typedef :pointer, :ecore_getopt_value
- typedef :pointer, :ecore_getopt_value_p
# typedef struct _Ecore_Getopt_Desc_Store Ecore_Getopt_Desc_Store;
typedef :pointer, :ecore_getopt_desc_store
# typedef struct _Ecore_Getopt_Desc_Callback Ecore_Getopt_Desc_Callback;
typedef :pointer, :ecore_getopt_desc_callback
# typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc;
typedef :pointer, :ecore_getopt_desc
- typedef :pointer, :ecore_getopt_desc_p
# typedef struct _Ecore_Getopt Ecore_Getopt;
typedef :pointer, :ecore_getopt
- typedef :pointer, :ecore_getopt_p
- #
- # CALLBACKS
- #
- # VARIABLES
#
# FUNCTIONS
fcts = [
# EAPI void ecore_getopt_help(FILE *fp, const Ecore_Getopt *info);
- [ :ecore_getopt_help, [ :pointer, :ecore_getopt_p ], :void ],
+ [ :ecore_getopt_help, [ :pointer, :ecore_getopt ], :void ],
# EAPI Eina_Bool ecore_getopt_parser_has_duplicates(const Ecore_Getopt *parser);
- [ :ecore_getopt_parser_has_duplicates, [ :ecore_getopt_p ], :eina_bool ],
+ [ :ecore_getopt_parser_has_duplicates, [ :ecore_getopt ], :bool ],
# EAPI int ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv);
- [ :ecore_getopt_parse, [ :ecore_getopt_p, :ecore_getopt_value_p, :int, :string_array ], :int ],
+ [ :ecore_getopt_parse, [ :ecore_getopt, :ecore_getopt_value, :int, :pointer ], :int ],
# EAPI Eina_List *ecore_getopt_list_free(Eina_List *list);
- [ :ecore_getopt_list_free, [ :eina_list_p ], :eina_list_p ],
+ [ :ecore_getopt_list_free, [ :eina_list ], :eina_list ],
# EAPI Eina_Bool ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
- [ :ecore_getopt_callback_geometry_parse, [ :ecore_getopt_p, :ecore_getopt_desc_p, :string, :void_p, :ecore_getopt_value_p ], :eina_bool ],
+ [ :ecore_getopt_callback_geometry_parse, [ :ecore_getopt, :ecore_getopt_desc, :string, :pointer, :ecore_getopt_value ], :bool ],
# EAPI Eina_Bool ecore_getopt_callback_size_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
- [ :ecore_getopt_callback_size_parse, [ :ecore_getopt_p, :ecore_getopt_desc_p, :string, :void_p, :ecore_getopt_value_p ], :eina_bool ],
+ [ :ecore_getopt_callback_size_parse, [ :ecore_getopt, :ecore_getopt_desc, :string, :pointer, :ecore_getopt_value ], :bool ],
]
#
attach_fcts fcts