headers
headers copied to clipboard
Add libflex
Not sure how this all works when a .tbd is needed but I think I'm supposed to make another PR in theos/lib so I'm doing that next
For reference, the .tbd PR is https://github.com/theos/lib/pull/8
Looks good overall! One request: it would be ideal if you could add a module.modulemap file to allow automatic linkage as well as the ability to import FLEX from Swift. For example, see this. A framework would be even better than headers + a standalone tbd, but if that isn't possible then adding a modulemap here is acceptable. You can test to make sure the modulemap works by using @import
in Objective-C or import
in Swift (the latter may require the Orion branch though.)
@kabiroberai Added! Can you test it for me if you have a Swift project sitting around? It would probably take me a while to figure out how to even test that
Seems to work. Final nitpicks: can the dir be renamed to libFLEX to match the case of the library? Since the library is libFLEX and not libflex, the modulemap should also say link "FLEX"
. And lastly, avoid polluting the top level dir with flex.h
– following the convention of the other headers, if it's a single file it should be at the top-level and if it's multiple files they should all be in a directory without any "trampolines". In fact, single file headers should also be in directories going forward, to allow for modulemap support.
I named it flex
in the tbd and make it intentionally lowercase because typing out FLEX in all caps is incredibly annoying as a developer, and I wanted it to match libactivator and the like. I hate the name personally but by the time I took over it was too late to change it :P
Same for the directory name; I would not want to type out <libFLEX/…>
, unusual case and case sensitivity is a recipe for frustration.
I would actually rather go back and rename the dylib from libFLEX.dylib
to libflex.dylib
and backport it to the older versions if the names really should match up. 😅
I would also like to voice my appreciation of single file headers being top level so that I can just import "bootstrap."h
and not "rocketbootstrap/bootstrap.h"
, I would be sad if that were to change ;(
I will get rid of mine though if you want, I only added it for that same convenience; "flex.h"
is so simple.
might I introduce you to @import FLEX;
:)
I agree with @kabiroberai: flex.h
(at include root) should be removed in favor of @import FLEX;
. Other than that, I think this is ready to merge.
If #import <flex.h>
is of significant use to you, perhaps adding it to your personal $THEOS/include
is suitable?
@leptos-null the issue with that is if I do that and publish the code, I'm the only one who can compile my tweak because I'm using a header that doesn't exist in Theos :/
@leptos-null the issue with that is if I do that and publish the code, I'm the only one who can compile my tweak because I'm using a header that doesn't exist in Theos :/
Again, just use @import FLEX;
in that case, and if you have Clang modules disabled for whatever reason then #import <FLEX/FLEX.h>
is more idiomatic than #import <flex.h>
anyway. And if you're still insistent on the latter then you could always put the flex.h
file in your own projects, which should let you do #import "flex.h"
@NSExceptional, can we merge this? If not, could you update it? Thanks!
No idea why I felt so strongly about this before; I use <FLEX/FLEX.h>
in Xcode projects. Maybe I was jealous of the other libraries that have their own single header. I'll update this PR and you can merge, @kirb
I renamed the folder from libflex
to FLEX
so that the import statement is consistent with Xcode projects using FLEX. That'll still work with this modulemap file right?
module FLEX {
umbrella header "FLEX.h"
link "flex"
export *
module * { export * }
}
In testing the module map, I'm receiving the following errors:
Click to expand error log
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRealmDefines.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkCurlLogger.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeychain.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXObjectListViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKBToolbarButton.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXTabList.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputFontView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXASLLogController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FHSView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXBookmarkManager.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRealmDatabaseManager.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeychainQuery.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXLogController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputTextView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeKeyPathTokenizer.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeyboardHelpViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXObjcRuntimeViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkObserver.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXGlobalsViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'NSString+ObjcRuntime.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXHierarchyTableViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'NSMapTable+FLEX_Subscripting.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeyboardToolbar.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXAddressExplorerCoordinator.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXOSLogController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'NSString+FLEX.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXManager+Private.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXUIAppShortcuts.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FHSViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputNumberView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXCarouselCell.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputFontsPickerView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXVariableEditorViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXFieldEditorViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXHierarchyViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXDBQueryRowCell.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputNotSupportedView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeyPathSearchController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXViewControllersViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXBookmarksViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'NSDictionary+ObjcRuntime.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXFieldEditorView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXSQLiteDatabaseManager.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeExporter.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputViewFactory.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FHSSnapshotView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXCookiesViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXColor.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXHeapEnumerator.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkTransaction.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXFileBrowserSearchOperation.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXLiveObjectsController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FHSViewSnapshot.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeychainViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXTableLeftCell.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXHierarchyTableViewCell.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputColorView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'UIView+FLEX_Layout.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXExplorerViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXUtility.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputStringView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeClient.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXSystemLogCell.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'SceneKit+Snapshot.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkMITMViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXObjectRef.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXDatabaseManager.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputSwitchView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkRecorder.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkSettingsController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXSQLResult.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXImagePreviewViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXDefaultEditorViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXTabsViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXFileBrowserController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputDateView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXTableContentViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeUtility.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXGlobalsSection.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXWindow.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeBrowserToolbar.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputStructView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXSystemLogViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'flex_fishhook.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXRuntimeKeyPath.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXWebViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkTransactionDetailController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXKeyboardShortcutManager.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXWindowManagerController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FHSSnapshotNodes.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXNetworkTransactionCell.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXMultiColumnTableView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'ActivityStreamAPI.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXMethodCallingViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXTableColumnHeader.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXArgumentInputObjectView.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXTableListViewController.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXSearchToken.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FHSRangeSlider.h' [-Werror,-Wincomplete-umbrella]
theos/headers/FLEX/FLEX.h:26:1: error: umbrella header for module 'FLEX' does not include header 'FLEXSystemLogMessage.h' [-Werror,-Wincomplete-umbrella]
fatal error: could not build module 'FLEX'
@import FLEX;
~~~~~~~^~~~
103 errors generated.
After adding each of these headers to the umbrella header, the sample project compiled and linked, so I think the module map is otherwise working.
I'm not sure what the appropriate solution is to these errors though.
Are all of those headers actually in this PR? Some of those are private and shouldn't be exposed o_O
@NSExceptional yes, I was able to import all of them without error.
It sounds like this PR contains headers it does not intend to and the modulemap does not work (per previous comments). For these reasons, I'm moving this PR to draft status.
I'm also wondering what the intention of these headers are. In general, when using FLEX, the only interface we need is FLEXManager
(per https://github.com/FLEXTool/FLEX#usage).
FLEX is a large codebase (relative to the other projects mirrored in this repo) that I'm wondering if this is efficient (how often would headers here need to be updated for them to be relevant for clients, etc.)
This PR definitely needs some work, it's just not been a priority from me since I'm probably the only person who needs it, currently
I do want to respond to this though:
In general, when using FLEX, the only interface we need is
FLEXManager
FLEX exposes lots of APIs for app developers to extend it for their needs to enhance debugging their own apps. You can add entire tools to the FLEX itself, and you can customize the "shortcuts" that appear when inspecting your own objects, etc. All of these are powerful tools to tweak developers as well, but almost no one knows about them, probably because I don't explain how to use them in the readme (I should)
I see. Having FLEX "plugins" sounds super cool and it would be great to expose them here for developers. Thanks for explaining the use- I think this helps to have a better understanding of which headers we'd want in this repo. Thanks!