<commit_before>//
//  EXTRuntimeExtensions.h
//  extobjc
//
//  Created by <NAME> on 2011-03-05.
//  Released into the public domain.
//

#import <objc/runtime.h>

/**
 * A callback indicating that the given method failed to be added to the given
 * class. The reason for the failure depends on the attempted task.
 */
typedef void (*ext_failedMethodCallback)(Class, Method);

/**
 * Used with #ext_injectMethods to determine injection behavior.
 */
typedef enum {
	/**
	 * Indicates that any existing methods on the destination class should be
	 * overwritten.
	 */
	ext_methodInjectionReplace                  = 0x00,

	/**
	 * Avoid overwriting methods on the immediate destination class.
	 */
	ext_methodInjectionFailOnExisting           = 0x01,
	
	/**
	 * Avoid overriding methods implemented in any superclass of the destination
	 * class.
	 */
	ext_methodInjectionFailOnSuperclassExisting = 0x02,

	/**
	 * Avoid overwriting methods implemented in the immediate destination class
	 * or any superclass. This is equivalent to
	 * <tt>ext_methodInjectionFailOnExisting | ext_methodInjectionFailOnSuperclassExisting</tt>.
	 */
	ext_methodInjectionFailOnAnyExisting        = 0x03,

	/**
	 * Ignore the \c +load class method. This does not affect instance method
	 * injection.
	 */
	ext_methodInjectionIgnoreLoad = 1U << 2,

	/**
	 * Ignore the \c +initialize class method. This does not affect instance method
	 * injection.
	 */
	ext_methodInjectionIgnoreInitialize = 1U << 3
} ext_methodInjectionBehavior;

/**
 * Describes the memory management policy of a property.
 */
typedef enum {
	/**
	 * The value is assigned.
	 */
	ext_propertyMemoryManagementPolicyAssign = 0,

	/**
	 * The value is retained.
	 */
	ext_propertyMemoryManagementPolicyRetain,

	/**
	 * The value is copied.
	 */
	ext_propertyMemoryManagementPolicyCopy
} ext_propertyMemoryManagementPolicy;

/**
 * Describes the attributes and type information of a property.
 */
typedef struct {
	/**
	 * Whether this property was declared with the \c readonly attribute.
	 */
	BOOL readonly;

	/**
	 * Whether this property was declared with the \c nonatomic attribute.
	 */
	BOOL nonatomic;

	/**
	 * Whether the property is a weak reference.
	 */
	BOOL weak;

	/**
	 * Whether the property is eligible for garbage collection.
	 */
	BOOL canBeCollected;

	/**
	 * The memory management policy for this property. This will always be
	 * #ext_propertyMemoryManagementPolicyAssign if #readonly is \c YES.
	 */
	ext_propertyMemoryManagementPolicy memoryManagementPolicy;

	/**
	 * The selector for the getter of this property. This will reflect any
	 * custom \c getter= attribute provided in the property declaration, or the
	 * inferred getter name otherwise.
	 */
	SEL getter;

	/**
	 * The selector for the setter of this property. This will reflect any
	 * custom \c setter= attribute provided in the property declaration, or the
	 * inferred setter name otherwise.
	 *
	 * @note If #readonly is \c YES, this value will represent what the setter
	 * \e would be, if the property were writable.
	 */
	SEL setter;

	/**
	 * The backing instance variable for this property, or \c NULL if the
	 * property is implemented dynamically.
	 */
	const char *ivar;

	/**
	 * The type encoding for the value of this property. This is the type as it
	 * would be returned by the \c @encode() directive.
	 */
	char type[];
} ext_propertyAttributes;

/**
 * A mask for the overwriting behavior flags of #ext_methodInjectionBehavior.
 */
static const ext_methodInjectionBehavior ext_methodInjectionOverwriteBehaviorMask = 0x3;

/**
 * Iterates through the first \a count entries in \a methods and attempts to add
 * each one to \a aClass. If a method by the same name already exists on \a
 * aClass, it is \e not overridden. If \a checkSuperclasses is \c YES, and<commit_msg>Put ext_methodInjectionOverwriteBehaviorMask back next to ext_methodInjectionBehavior, as was intended<commit_after>//
//  EXTRuntimeExtensions.h
//  extobjc
//
//  Created by <NAME> on 2011-03-05.
//  Released into the public domain.
//

#import <objc/runtime.h>

/**
 * A callback indicating that the given method failed to be added to the given
 * class. The reason for the failure depends on the attempted task.
 */
typedef void (*ext_failedMethodCallback)(Class, Method);

/**
 * Used with #ext_injectMethods to determine injection behavior.
 */
typedef enum {
	/**
	 * Indicates that any existing methods on the destination class should be
	 * overwritten.
	 */
	ext_methodInjectionReplace                  = 0x00,

	/**
	 * Avoid overwriting methods on the immediate destination class.
	 */
	ext_methodInjectionFailOnExisting           = 0x01,
	
	/**
	 * Avoid overriding methods implemented in any superclass of the destination
	 * class.
	 */
	ext_methodInjectionFailOnSuperclassExisting = 0x02,

	/**
	 * Avoid overwriting methods implemented in the immediate destination class
	 * or any superclass. This is equivalent to
	 * <tt>ext_methodInjectionFailOnExisting | ext_methodInjectionFailOnSuperclassExisting</tt>.
	 */
	ext_methodInjectionFailOnAnyExisting        = 0x03,

	/**
	 * Ignore the \c +load class method. This does not affect instance method
	 * injection.
	 */
	ext_methodInjectionIgnoreLoad = 1U << 2,

	/**
	 * Ignore the \c +initialize class method. This does not affect instance method
	 * injection.
	 */
	ext_methodInjectionIgnoreInitialize = 1U << 3
} ext_methodInjectionBehavior;

/**
 * A mask for the overwriting behavior flags of #ext_methodInjectionBehavior.
 */
static const ext_methodInjectionBehavior ext_methodInjectionOverwriteBehaviorMask = 0x3;

/**
 * Describes the memory management policy of a property.
 */
typedef enum {
	/**
	 * The value is assigned.
	 */
	ext_propertyMemoryManagementPolicyAssign = 0,

	/**
	 * The value is retained.
	 */
	ext_propertyMemoryManagementPolicyRetain,

	/**
	 * The value is copied.
	 */
	ext_propertyMemoryManagementPolicyCopy
} ext_propertyMemoryManagementPolicy;

/**
 * Describes the attributes and type information of a property.
 */
typedef struct {
	/**
	 * Whether this property was declared with the \c readonly attribute.
	 */
	BOOL readonly;

	/**
	 * Whether this property was declared with the \c nonatomic attribute.
	 */
	BOOL nonatomic;

	/**
	 * Whether the property is a weak reference.
	 */
	BOOL weak;

	/**
	 * Whether the property is eligible for garbage collection.
	 */
	BOOL canBeCollected;

	/**
	 * The memory management policy for this property. This will always be
	 * #ext_propertyMemoryManagementPolicyAssign if #readonly is \c YES.
	 */
	ext_propertyMemoryManagementPolicy memoryManagementPolicy;

	/**
	 * The selector for the getter of this property. This will reflect any
	 * custom \c getter= attribute provided in the property declaration, or the
	 * inferred getter name otherwise.
	 */
	SEL getter;

	/**
	 * The selector for the setter of this property. This will reflect any
	 * custom \c setter= attribute provided in the property declaration, or the
	 * inferred setter name otherwise.
	 *
	 * @note If #readonly is \c YES, this value will represent what the setter
	 * \e would be, if the property were writable.
	 */
	SEL setter;

	/**
	 * The backing instance variable for this property, or \c NULL if the
	 * property is implemented dynamically.
	 */
	const char *ivar;

	/**
	 * The type encoding for the value of this property. This is the type as it
	 * would be returned by the \c @encode() directive.
	 */
	char type[];
} ext_propertyAttributes;

/**
 * Iterates through the first \a count entries in \a methods and attempts to add
 * each one to \a aClass. If a method by the same name already exists on \a
 * aClass, it is \e not overridden. If \a checkSuperclasses is \c YES, and
{'fraction_non_alphanumeric': 0.08173014848289219, 'fraction_numerical': 0.00697224015493867, 'mean_word_length': 3.4187107815173987, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7471814', 'n_tokens_mistral': 2293, 'n_tokens_neox': 2072, 'n_words': 855}