node/lib/metasm/metasm/exe_format/serialstruct.rb
def new_int_field(*types)
		recv = class << self ; self ; end
		types.each { |type|
			recv.send(:define_method, type) { |name, *args|
				new_field(name, "decode_#{type}".to_sym, "encode_#{type}".to_sym, args[0] || 0, args[1])
			}

			# shortcut to define multiple fields of this type with default values
			recv.send(:define_method, "#{type}s") { |*names|
				names.each { |name| send type, name }
			}
		}
	end
# creates a field constructor for a simple integer
# relies on exe implementing (en,de)code_#{type}
creates a field constructor for a simple integer
relies on exe implementing (en,de)code_#{type}
creates a field constructor for a simple integer relies on exe implementing ( en de ) code_# { type }
def new_int_field(*types)
		recv = class << self ; self ; end
		types.each { |type|
			recv.send(:define_method, type) { |name, *args|
				new_field(name, "decode_#{type}".to_sym, "encode_#{type}".to_sym, args[0] || 0, args[1])
			}
			recv.send(:define_method, "#{type}s") { |*names|
				names.each { |name| send type, name }
			}
		}
	end
def new_int_field ( * types ) recv = class << self ; self ; end types . each { | type | recv . send ( :define_method , type ) { | name , * args | new_field ( name , "decode_#{type}" . to_sym , "encode_#{type}" . to_sym , args [ 0 ] || 0 , args [ 1 ] ) } recv . send ( :define_method , "#{type}s" ) { | * names | names . each { | name | send type , name } } } end
creates a field constructor for a simple integer
relies on exe implementing (en,de)code_#{type}
creates a field constructor for a simple integer relies on exe implementing ( en de ) code_# { type }
# shortcut to define multiple fields of this type with default values
types