From b101f7547000aaa1354792aabc459de7cc9e91de Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 11 Jan 2016 12:41:40 -0800 Subject: [PATCH] Guarantee all the older Cydget bridge definitions. --- Analysis.cpp | 2 ++ Analyze.cpp | 8 ++--- Bridge.old | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 3 +- Makefile.in | 3 +- 5 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 Bridge.old diff --git a/Analysis.cpp b/Analysis.cpp index 23fc5a3..7da64f3 100644 --- a/Analysis.cpp +++ b/Analysis.cpp @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,7 @@ #include #include +#include #if TARGET_OS_IPHONE #include diff --git a/Analyze.cpp b/Analyze.cpp index 5bf4914..9a056e5 100644 --- a/Analyze.cpp +++ b/Analyze.cpp @@ -502,6 +502,10 @@ static CXChildVisitResult CYChildVisit(CXCursor cursor, CXCursor parent, CXClien } break; case CXCursor_EnumDecl: { + // the enum constants are implemented separately *also* + // XXX: maybe move output logic to function we can call + result = CXChildVisit_Recurse; + if (spelling[0] == '\0') goto skip; // XXX: this was blindly copied from StructDecl @@ -520,10 +524,6 @@ static CXChildVisitResult CYChildVisit(CXCursor cursor, CXCursor parent, CXClien value << ".withName(\"" << name << "\")"; name = "$cye" + name; flags = CYBridgeType; - - // the enum constants are implemented separately *also* - // XXX: maybe move output logic to function we can call - result = CXChildVisit_Recurse; } break; case CXCursor_MacroDefinition: { diff --git a/Bridge.old b/Bridge.old new file mode 100644 index 0000000..7a3d258 --- /dev/null +++ b/Bridge.old @@ -0,0 +1,92 @@ +CTCallRef|0"(typedef id)" +UIAbbreviatedMonthDayFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIAbbreviatedMonthDayFormat'))" +UIAbbreviatedWeekdayDateFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIAbbreviatedWeekdayDateFormat'))" +UIAbbreviatedWeekdayFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIAbbreviatedWeekdayFormat'))" +UIAbbreviatedWeekdayMonthDayFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIAbbreviatedWeekdayMonthDayFormat'))" +UIAbbreviatedWeekdayMonthDayMinutelessFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIAbbreviatedWeekdayMonthDayMinutelessFormat'))" +UIAbbreviatedWeekdayMonthDayTimeFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIAbbreviatedWeekdayMonthDayTimeFormat'))" +UIDatePickerDayFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIDatePickerDayFormat'))" +UIDatePickerMonthFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIDatePickerMonthFormat'))" +UIDatePickerYearFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIDatePickerYearFormat'))" +UIHourFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIHourFormat'))" +UIMinutelessTimeFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIMinutelessTimeFormat'))" +UIMonthYearFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIMonthYearFormat'))" +UINoAMPMTimeFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UINoAMPMTimeFormat'))" +UIShortMonthDayFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIShortMonthDayFormat'))" +UIWeekdayAbbreviatedDateFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIWeekdayAbbreviatedDateFormat'))" +UIWeekdayAbbreviatedNoYearDateFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIWeekdayAbbreviatedNoYearDateFormat'))" +UIWeekdayFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIWeekdayFormat'))" +UIWeekdayNoYearDateFormat|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIWeekdayNoYearDateFormat'))" +kUIButtonBarButtonAction|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonAction'))" +kUIButtonBarButtonInfo|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonInfo'))" +kUIButtonBarButtonInfoOffset|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonInfoOffset'))" +kUIButtonBarButtonSelectedInfo|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonSelectedInfo'))" +kUIButtonBarButtonSizeToFit|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonSizeToFit'))" +kUIButtonBarButtonStyle|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonStyle'))" +kUIButtonBarButtonTag|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonTag'))" +kUIButtonBarButtonTarget|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonTarget'))" +kUIButtonBarButtonTitle|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonTitle'))" +kUIButtonBarButtonTitleVerticalHeight|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonTitleVerticalHeight'))" +kUIButtonBarButtonTitleWidth|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonTitleWidth'))" +kUIButtonBarButtonType|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kUIButtonBarButtonType'))" +UIKeyboardRequiresInternationalKey|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIKeyboardRequiresInternationalKey'))" +UIKeyboardCandidateCorrectionDidChangeNotification|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIKeyboardCandidateCorrectionDidChangeNotification'))" +UIKeyboardCurrentInputModeDidChangeNotification|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIKeyboardCurrentInputModeDidChangeNotification'))" +UIKeyboardDefaultsDidChangeNotification|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIKeyboardDefaultsDidChangeNotification'))" +UIKeyboardEmptyDelegateNotification|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIKeyboardEmptyDelegateNotification'))" +UIWebViewDidReceiveMessageNotification|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIWebViewDidReceiveMessageNotification'))" +UIWebViewDidClearMessagesNotification|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'UIWebViewDidClearMessagesNotification'))" +CFGregorianCalendar|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'CFGregorianCalendar'))" +kCFLocaleCurrentLocaleDidChangeNotificatio|0"*(typedef id *)(dlsym(RTLD_DEFAULT, 'kCFLocaleCurrentLocaleDidChangeNotificatio'))" +UIEdgeInsetsMake|0"*(typedef UIEdgeInsets(*)(float, float, float, float))(dlsym(RTLD_DEFAULT, 'UIEdgeInsetsMake'))" +UIEdgeInsetsEqualToEdgeInsets|0"*(typedef bool(*)(UIEdgeInsets, UIEdgeInsets))(dlsym(RTLD_DEFAULT, 'UIEdgeInsetsEqualToEdgeInsets'))" +UIEdgeInsetsInsetRect|0"*(typedef CGRect (*)(CGRect,UIEdgeInsets))(dlsym(RTLD_DEFAULT, 'UIEdgeInsetsInsetRect'))" +UIGetScreenImage|0"*(typedef id (*)())(dlsym(RTLD_DEFAULT, 'UIGetScreenImage'))" +UIDateFormatStringForFormatType|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'UIDateFormatStringForFormatType'))" +UIApplicationUseLegacyEvents|0"*(typedef void (*)(bool))(dlsym(RTLD_DEFAULT, 'UIApplicationUseLegacyEvents'))" +UIKeyboardDisableAutomaticAppearance|0"*(typedef void (*)())(dlsym(RTLD_DEFAULT, 'UIKeyboardDisableAutomaticAppearance'))" +UIKeyboardEnableAutomaticAppearance|0"*(typedef void (*)())(dlsym(RTLD_DEFAULT, 'UIKeyboardEnableAutomaticAppearance'))" +UIKeyboardInputModeUsesKBStar|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'UIKeyboardInputModeUsesKBStar'))" +_UIImageWithName|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, '_UIImageWithName'))" +UIFormattedPhoneNumberFromString|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'UIFormattedPhoneNumberFromString'))" +UIUnformattedPhoneNumberFromString|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'UIUnformattedPhoneNumberFromString'))" +SecCertificateGetItem|0"*(typedef id(*)(id, id*))(dlsym(RTLD_DEFAULT, 'SecCertificateGetItem'))" +CPPhoneNumberCopyNetworkCountryCode|0"*(typedef id (*)())(dlsym(RTLD_DEFAULT, 'CPPhoneNumberCopyNetworkCountryCode'))" +ABCGetSharedAddressBook|0"*(typedef id (*)())(dlsym(RTLD_DEFAULT, 'ABCGetSharedAddressBook'))" +ABCFindPersonMatchingPhoneNumberWithCountry|0"*(typedef id(id, id, id, int *, int *))(dlsym(RTLD_DEFAULT, 'ABCFindPersonMatchingPhoneNumberWithCountry'))" +ABCRecordCopyCompositeName|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'ABCRecordCopyCompositeName'))" +ABCFindPersonMatchingPhoneNumber|0"*(typedef id(*)(id, id, int*, int*))(dlsym(RTLD_DEFAULT, 'ABCFindPersonMatchingPhoneNumber'))" +ABCCopyLocalizedPropertyOrLabel|0"*(typedef id (*)(int))(dlsym(RTLD_DEFAULT, 'ABCCopyLocalizedPropertyOrLabel'))" +CalDatabaseCopyEventOccurrencesInDateRange|0"*(typedef CFArrayRef(*)(CalDatabase*,CalFilter*,CFGregorianDate,CFGregorianDate,CFTimeZoneRef))(dlsym(RTLD_DEFAULT, 'CalDatabaseCopyEventOccurrencesInDateRange'))" +CalFilterCreateWithDatabase|0"*(typedef struct CalFilter *(*)(CalDatabase *))(dlsym(RTLD_DEFAULT, 'CalFilterCreateWithDatabase'))" +CalEventOccurrenceGetEvent|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'CalEventOccurrenceGetEvent'))" +CalEventCopySummary|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'CalEventCopySummary'))" +CalEventIsAllDay|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'CalEventIsAllDay'))" +CalEventOccurrenceGetDate|0"*(typedef unsigned int (*)(id))(dlsym(RTLD_DEFAULT, 'CalEventOccurrenceGetDate'))" +CFRangeMake|0"*(typedef CFRange (*)(CFIndex,CFIndex))(dlsym(RTLD_DEFAULT, 'CFRangeMake'))" +CTCallCopyAddress|0"*(typedef CFStringRef *(*)(CFAllocatorRef,CTCallRef))(dlsym(RTLD_DEFAULT, 'CTCallCopyAddress'))" +CTCallCopyAllMissedCallsAfterRowID|0"*(typedef CFArrayRef (*)(CFAllocatorRef, long))(dlsym(RTLD_DEFAULT, 'CTCallCopyAllMissedCallsAfterRowID'))" +CTCallCopyAllMissedCallsSince|0"*(typedef CFArrayRef(*)(CFAllocatorRef, CFDateRef))(dlsym(RTLD_DEFAULT, 'CTCallCopyAllMissedCallsSince'))" +CTCallGetGetRowIDOfLastInsert|0"*(typedef int (*)())(dlsym(RTLD_DEFAULT, 'CTCallGetGetRowIDOfLastInsert'))" +CTCallGetID|0"*(typedef long (*)(CTCallRef))(dlsym(RTLD_DEFAULT, 'CTCallGetID'))" +CTCallGetStartTime|0"*(typedef bool(*)(CTCallRef, double *))(dlsym(RTLD_DEFAULT, 'CTCallGetStartTime'))" +CTCallGetTypeID|0"*(typedef CFTypeID (*)())(dlsym(RTLD_DEFAULT, 'CTCallGetTypeID'))" +WiFiNetworkComparePriority|0"*(typedef bool (*)(id, id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkComparePriority'))" +WiFiNetworkCopyPassword|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkCopyPassword'))" +WiFiNetworkGetAssociationDate|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkGetAssociationDate'))" +WiFiNetworkGetSSID|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkGetSSID'))" +WiFiNetworkGetSSIDData|0"*(typedef id (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkGetSSIDData'))" +WiFiNetworkGetTypeID|0"*(typedef CFTypeID (*)())(dlsym(RTLD_DEFAULT, 'WiFiNetworkGetTypeID'))" +WiFiNetworkIsEAP|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkIsEAP'))" +WiFiNetworkIsEnabled|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkIsEnabled'))" +WiFiNetworkIsHidden|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkIsHidden'))" +WiFiNetworkIsHiddenSSID|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkIsHiddenSSID'))" +WiFiNetworkIsWEP|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkIsWEP'))" +WiFiNetworkIsWPA|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkIsWPA'))" +WiFiNetworkRemovePassword|0"*(typedef void (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkRemovePassword'))" +WiFiNetworkRequiresIdentity|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkRequiresIdentity'))" +WiFiNetworkRequiresOneTimePassword|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkRequiresOneTimePassword'))" +WiFiNetworkRequiresPassword|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkRequiresPassword'))" +WiFiNetworkRequiresUsername|0"*(typedef bool (*)(id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkRequiresUsername'))" +WiFiNetworkSetAssociationDate|0"*(typedef void (*)(id, id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkSetAssociationDate'))" +WiFiNetworkSetPassword|0"*(typedef void (*)(id, id))(dlsym(RTLD_DEFAULT, 'WiFiNetworkSetPassword'))" diff --git a/Makefile.am b/Makefile.am index 93a6560..341f993 100644 --- a/Makefile.am +++ b/Makefile.am @@ -102,8 +102,9 @@ Analyze: Analyze.cpp Error.cpp Output.cpp Replace.cpp Syntax.cpp $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) -std=c++11 $(LDFLAGS_FOR_BUILD) $(CY_LANGFLAGS) -I$(srcdir)/extra -o $@ $^ $(CY_LIBCLANG) -Wno-bitwise-op-parentheses -Wno-dangling-else -Wno-logical-op-parentheses CLEANFILES += Bridge.def -Bridge.def: Analysis.cpp Analyze +Bridge.def: Analysis.cpp Analyze Bridge.old ./Analyze $< $(OBJCXX) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) $(CY_LANGFLAGS) $(CY_ANDFLAGS) >$@ + cat $(srcdir)/Bridge.old >>$@ else CLEANFILES += Bridge.def Bridge.def: Bridge.def.in diff --git a/Makefile.in b/Makefile.in index 274ab82..cc2f245 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1430,8 +1430,9 @@ uninstall-am: uninstall-binPROGRAMS uninstall-datDATA \ @CY_EXECUTE_TRUE@ $(srcdir)/libcycript.py $(CY_SYSTEM) $@ $(srcdir) <$< @CY_EXECUTE_TRUE@@CY_PRELINK_TRUE@Analyze: Analyze.cpp Error.cpp Output.cpp Replace.cpp Syntax.cpp @CY_EXECUTE_TRUE@@CY_PRELINK_TRUE@ $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) -std=c++11 $(LDFLAGS_FOR_BUILD) $(CY_LANGFLAGS) -I$(srcdir)/extra -o $@ $^ $(CY_LIBCLANG) -Wno-bitwise-op-parentheses -Wno-dangling-else -Wno-logical-op-parentheses -@CY_EXECUTE_TRUE@@CY_PRELINK_TRUE@Bridge.def: Analysis.cpp Analyze +@CY_EXECUTE_TRUE@@CY_PRELINK_TRUE@Bridge.def: Analysis.cpp Analyze Bridge.old @CY_EXECUTE_TRUE@@CY_PRELINK_TRUE@ ./Analyze $< $(OBJCXX) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) $(CY_LANGFLAGS) $(CY_ANDFLAGS) >$@ +@CY_EXECUTE_TRUE@@CY_PRELINK_TRUE@ cat $(srcdir)/Bridge.old >>$@ @CY_EXECUTE_TRUE@@CY_PRELINK_FALSE@Bridge.def: Bridge.def.in @CY_EXECUTE_TRUE@@CY_PRELINK_FALSE@ cat $< >$@ @CY_JAVA_TRUE@Class/Cycript.class: Java/Cycript.java -- 2.45.2