GithubHelp home page GithubHelp logo

hackcatml / headers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opa334/theos_headers

0.0 0.0 0.0 1.2 MB

Headers. Not for documents. Not the opposite of footers.

License: Other

C++ 1.44% C 79.28% Objective-C 19.28%

headers's Introduction

theos/vendor/include

Headers included with Theos for easy compilation of most projects out of the box.

Contributions are welcome!

Please send us headers you’ve put together that would be useful to the wider community. Be aware that we are looking for “clean” headers, not generated output from class-dump or a similar tool.

Code rules

  • Create headers only for what you use.

  • Follow the existing coding style.

    • Objective-C properties should be in the style of @property (attributes) type name;
    • Objective-C methods should be in the style of - (type)methodName:(type)variableName parameter:(type)name;
    • Objective-C generics should be in the style of NSDictionary <NSString *, NSArray <NSObject *> *> *variable
  • C functions and variables (all symbols) should be declared using FOUNDATION_EXPORT

    #import <Foundation/Foundation.h>
    
    FOUNDATION_EXPORT int ExternalVariable;
    FOUNDATION_EXPORT const int ExternalConstant;
    FOUNDATION_EXPORT void ExternalFunction(int param);
  • Initialisers and singleton (e.g. sharedInstance) methods should return instancetype.

  • Don't just copy and paste lines from class-dumps - replace id with the appropriate class. Also change arg1 and the like, or in some cases class-dump-z’s guessed argument names, to something more appropriate. If you don’t know the type, Cycript or FLEX can be helpful:

    $ cycript -p SpringBoard
    cy# [SBBaconController sharedInstance].baconCurrentlyBeingEaten.class
    @"SBBacon"

    Additionally, ensure the appropriate types are used. The most common ones are:

    • float and double should usually become CGFloat or NSTimeInterval
    • int and long should usually become NSInteger
    • unsigned int and unsigned long should usually become NSUInteger

    This is especially important when using the headers as reference for hooking. An incorrect Objective-C type encoding can cause problems.

  • Import all relevant public SDK headers for types used in the header. This usually means using #import <Foundation/Foundation.h> or #import <UIKit/UIKit.h>. For private types, prefer to use @class and @protocol. If not possible, for instance for subclassing and protocol conformance, import the private header defining the type.

  • For compatibility, prefer classic imports for modules:

    // Do:
    #import <Foundation/Foundation.h>
    #import <objc/runtime.h>
    
    // Don’t:
    @import Foundation;
    @import ObjectiveC.runtime;

    If modules are supported by the compiler, #import of headers from a module will be translated to equivalent @import statements.

  • Any headers under an OSI-approved license can be included here. Please add its license to LICENSE.md.

headers's People

Contributors

aehmlo avatar akemin-dayo avatar benrosen78 avatar coolstar avatar dlevi309 avatar hirakujira avatar kabiroberai avatar kirb avatar l1ghtmann avatar leptos-null avatar lillieh1000 avatar mstg avatar nsexceptional avatar opa334 avatar poomsmart avatar rand01ph avatar ryannair05 avatar sbingner avatar shade-zepheri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.