diff options
-rw-r--r-- | Mac/scripts/bgenall.py | 56 | ||||
-rw-r--r-- | Mac/scripts/cachersrc.py | 45 | ||||
-rw-r--r-- | Mac/scripts/errors.txt | 1852 | ||||
-rw-r--r-- | Mac/scripts/genallsuites.py | 52 | ||||
-rw-r--r-- | Mac/scripts/mkestrres-errno.h | 7 | ||||
-rwxr-xr-x | Mac/scripts/mkestrres-macerrors.h | 13 | ||||
-rw-r--r-- | Mac/scripts/mkestrres.py | 157 | ||||
-rw-r--r-- | Tools/bgen/README | 7 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgen.py | 12 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenBuffer.py | 301 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenGenerator.py | 302 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenGeneratorGroup.py | 40 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenHeapBuffer.py | 145 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenModule.py | 94 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenObjectDefinition.py | 512 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenOutput.py | 219 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenStackBuffer.py | 62 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenStringBuffer.py | 67 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenType.py | 328 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenVariable.py | 112 | ||||
-rw-r--r-- | Tools/bgen/bgen/macsupport.py | 197 | ||||
-rw-r--r-- | Tools/bgen/bgen/scantools.py | 846 |
22 files changed, 0 insertions, 5426 deletions
diff --git a/Mac/scripts/bgenall.py b/Mac/scripts/bgenall.py deleted file mode 100644 index dc33163..0000000 --- a/Mac/scripts/bgenall.py +++ /dev/null @@ -1,56 +0,0 @@ -# bgenall - Generate all bgen-generated modules -# -import sys -import os -import string - -def bgenone(dirname, shortname): - os.chdir(dirname) - print('%s:'%shortname) - # Sigh, we don't want to lose CVS history, so two - # modules have funny names: - if shortname == 'carbonevt': - modulename = 'CarbonEvtscan' - elif shortname == 'ibcarbon': - modulename = 'IBCarbonscan' - else: - modulename = shortname + 'scan' - try: - m = __import__(modulename) - except: - print("Error:", shortname, sys.exc_info()[1]) - return 0 - try: - m.main() - except: - print("Error:", shortname, sys.exc_info()[1]) - return 0 - return 1 - -def main(): - success = [] - failure = [] - sys.path.insert(0, os.curdir) - if len(sys.argv) > 1: - srcdir = sys.argv[1] - else: - srcdir = os.path.join(os.path.join(sys.prefix, 'Mac'), 'Modules') - srcdir = os.path.abspath(srcdir) - contents = os.listdir(srcdir) - for name in contents: - moduledir = os.path.join(srcdir, name) - scanmodule = os.path.join(moduledir, name +'scan.py') - if os.path.exists(scanmodule): - if bgenone(moduledir, name): - success.append(name) - else: - failure.append(name) - print('Done:', string.join(success, ' ')) - if failure: - print('Failed:', string.join(failure, ' ')) - return 0 - return 1 - -if __name__ == '__main__': - rv = main() - sys.exit(not rv) diff --git a/Mac/scripts/cachersrc.py b/Mac/scripts/cachersrc.py deleted file mode 100644 index 49a20c0..0000000 --- a/Mac/scripts/cachersrc.py +++ /dev/null @@ -1,45 +0,0 @@ -# Scan the tree passed as argv[0] for .rsrc files, skipping .rsrc.df.rsrc -# files, and open these. The effect of this is to create the .rsrc.df.rsrc -# cache files if needed. -# These are needed on OSX: the .rsrc files are in reality AppleSingle-encoded -# files. We decode the resources into a datafork-based resource file. - -import macresource -import os -import sys -import getopt - -class NoArgsError(Exception): - pass - -def handler(arg1, dirname, fnames): - verbose, force = arg1 - for fn in fnames: - if fn[-5:] == '.rsrc' and fn[-13:] != '.rsrc.df.rsrc': - if force: - try: - os.unlink(os.path.join(dirname, fn + '.df.rsrc')) - except IOError: - pass - macresource.open_pathname(os.path.join(dirname, fn), verbose=verbose) - -def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], 'vf') - if not args: - raise NoArgsError - except (getopt.GetoptError, NoArgsError): - sys.stderr.write('Usage: cachersrc.py dirname ...\n') - sys.exit(1) - verbose = 0 - force = 0 - for o, v in opts: - if o == '-v': - verbose = 1 - if o == '-f': - force = 1 - for dir in sys.argv[1:]: - os.walk(dir, handler, (verbose, force)) - -if __name__ == '__main__': - main() diff --git a/Mac/scripts/errors.txt b/Mac/scripts/errors.txt deleted file mode 100644 index 0682e62..0000000 --- a/Mac/scripts/errors.txt +++ /dev/null @@ -1,1852 +0,0 @@ --32768 svTempDisable svTempDisable --32640 svDisabled Reserve range -32640 to -32768 for Apple temp disables. --32615 fontNotOutlineErr bitmap font passed to routine that does outlines only --30788 kURL68kNotSupportedError kURL68kNotSupportedError --30787 kURLAccessNotAvailableError kURLAccessNotAvailableError --30786 kURLInvalidConfigurationError kURLInvalidConfigurationError --30785 kURLExtensionFailureError kURLExtensionFailureError --30783 kURLFileEmptyError kURLFileEmptyError --30781 kURLInvalidCallError kURLInvalidCallError --30780 kURLUnsettablePropertyError kURLUnsettablePropertyError --30779 kURLPropertyBufferTooSmallError kURLPropertyBufferTooSmallError --30778 kURLUnknownPropertyError kURLUnknownPropertyError --30777 kURLPropertyNotYetKnownError kURLPropertyNotYetKnownError --30776 kURLAuthenticationError kURLAuthenticationError --30775 kURLServerBusyError kURLServerBusyError --30774 kURLUnsupportedSchemeError kURLUnsupportedSchemeError --30773 kURLInvalidURLError kURLInvalidURLError --30772 kURLDestinationExistsError kURLDestinationExistsError --30771 kURLProgressAlreadyDisplayedError kURLProgressAlreadyDisplayedError --30770 kURLInvalidURLReferenceError kURLInvalidURLReferenceError --30599 controlHandleInvalidErr controlHandleInvalidErr --30597 controlInvalidDataVersionErr controlInvalidDataVersionErr --30596 errItemNotControl errItemNotControl --30595 errCantEmbedRoot errCantEmbedRoot --30594 errCantEmbedIntoSelf errCantEmbedIntoSelf --30593 errWindowRegionCodeInvalid errWindowRegionCodeInvalid --30592 errControlHiddenOrDisabled errControlHiddenOrDisabled --30591 errDataSizeMismatch errDataSizeMismatch --30590 errControlIsNotEmbedder errControlIsNotEmbedder --30589 errControlsAlreadyExist errControlsAlreadyExist --30588 errInvalidPartCode errInvalidPartCode --30587 errRootAlreadyExists errRootAlreadyExists --30586 errNoRootControl errNoRootControl --30585 errCouldntSetFocus errCouldntSetFocus --30584 errUnknownControl errUnknownControl --30583 errWindowDoesntSupportFocus errWindowDoesntSupportFocus --30582 errControlDoesntSupportFocus errControlDoesntSupportFocus --30581 errDataNotSupported errDataNotSupported --30580 errMessageNotSupported errMessageNotSupported --30567 themeMonitorDepthNotSupportedErr theme not supported at monitor depth --30566 themeScriptFontNotFoundErr theme font requested for uninstalled script system --30565 themeBadCursorIndexErr themeBadCursorIndexErr --30564 themeHasNoAccentsErr themeHasNoAccentsErr --30563 themeBadTextColorErr themeBadTextColorErr --30562 themeProcessNotRegisteredErr themeProcessNotRegisteredErr --30561 themeProcessRegisteredErr themeProcessRegisteredErr --30560 themeInvalidBrushErr pattern index invalid --30555 qtvrUninitialized qtvrUninitialized --30554 qtvrLibraryLoadErr qtvrLibraryLoadErr --30553 streamingNodeNotReadyErr streamingNodeNotReadyErr --30552 noMemoryNodeFailedInitialize noMemoryNodeFailedInitialize --30551 invalidHotSpotIDErr invalidHotSpotIDErr --30550 invalidNodeFormatErr invalidNodeFormatErr --30549 limitReachedErr limitReachedErr --30548 settingNotSupportedByNodeErr settingNotSupportedByNodeErr --30547 propertyNotSupportedByNodeErr propertyNotSupportedByNodeErr --30546 timeNotInViewErr timeNotInViewErr --30545 invalidViewStateErr invalidViewStateErr --30544 invalidNodeIDErr invalidNodeIDErr --30543 selectorNotSupportedByNodeErr selectorNotSupportedByNodeErr --30542 callNotSupportedByNodeErr callNotSupportedByNodeErr --30541 constraintReachedErr constraintReachedErr --30540 notAQTVRMovieErr notAQTVRMovieErr --30532 kFBCnoSuchHit kFBCnoSuchHit --30531 kFBCbadSearchSession kFBCbadSearchSession --30530 kFBCindexDiskIOFailed kFBCindexDiskIOFailed --30529 kFBCsummarizationCanceled kFBCsummarizationCanceled --30528 kFBCbadIndexFileVersion kFBCbadIndexFileVersion --30527 kFBCanalysisNotAvailable kFBCanalysisNotAvailable --30526 kFBCillegalSessionChange tried to add/remove vols to a session --30525 kFBCsomeFilesNotIndexed kFBCsomeFilesNotIndexed --30524 kFBCsearchFailed kFBCsearchFailed --30523 kFBCindexNotAvailable kFBCindexNotAvailable --30522 kFBCindexFileDestroyed kFBCindexFileDestroyed --30521 kFBCaccessCanceled kFBCaccessCanceled --30520 kFBCindexingCanceled kFBCindexingCanceled --30519 kFBCnoSearchSession kFBCnoSearchSession --30518 kFBCindexNotFound kFBCindexNotFound --30517 kFBCflushFailed kFBCflushFailed --30516 kFBCaddDocFailed kFBCaddDocFailed --30515 kFBCaccessorStoreFailed kFBCaccessorStoreFailed --30514 kFBCindexCreationFailed couldn't create index --30513 kFBCmergingFailed couldn't merge index files --30512 kFBCtokenizationFailed couldn't read from document or query --30511 kFBCmoveFailed V-Twin exception caught --30510 kFBCdeletionFailed V-Twin exception caught --30509 kFBCcommitFailed V-Twin exception caught --30508 kFBCindexingFailed V-Twin exception caught --30507 kFBCvalidationFailed V-Twin exception caught --30506 kFBCcompactionFailed V-Twin exception caught --30505 kFBCbadIndexFile bad FSSpec, or bad data in file --30504 kFBCfileNotIndexed kFBCfileNotIndexed --30503 kFBCbadParam kFBCbadParam --30502 kFBCallocFailed probably low memory --30501 kFBCnoIndexesFound kFBCnoIndexesFound --30500 kFBCvTwinExceptionErr no telling what it was --30450 kDSpStereoContextErr kDSpStereoContextErr --30449 kDSpInternalErr kDSpInternalErr --30448 kDSpConfirmSwitchWarning kDSpConfirmSwitchWarning --30447 kDSpFrameRateNotReadyErr kDSpFrameRateNotReadyErr --30446 kDSpContextNotFoundErr kDSpContextNotFoundErr --30445 kDSpContextNotReservedErr kDSpContextNotReservedErr --30444 kDSpContextAlreadyReservedErr kDSpContextAlreadyReservedErr --30443 kDSpInvalidAttributesErr kDSpInvalidAttributesErr --30442 kDSpInvalidContextErr kDSpInvalidContextErr --30441 kDSpSystemSWTooOldErr kDSpSystemSWTooOldErr --30440 kDSpNotInitializedErr kDSpNotInitializedErr --30429 kISpListBusyErr kISpListBusyErr --30428 kISpDeviceActiveErr kISpDeviceActiveErr --30427 kISpSystemActiveErr kISpSystemActiveErr --30426 kISpDeviceInactiveErr kISpDeviceInactiveErr --30425 kISpSystemInactiveErr kISpSystemInactiveErr --30424 kISpElementNotInListErr kISpElementNotInListErr --30423 kISpElementInListErr kISpElementInListErr --30422 kISpBufferToSmallErr kISpBufferToSmallErr --30421 kISpSystemListErr kISpSystemListErr --30420 kISpInternalErr kISpInternalErr --30399 kNSpJoinFailedErr kNSpJoinFailedErr --30398 kNSpCantBlockErr kNSpCantBlockErr --30397 kNSpMessageTooBigErr kNSpMessageTooBigErr --30396 kNSpSendFailedErr kNSpSendFailedErr --30395 kNSpConnectFailedErr kNSpConnectFailedErr --30394 kNSpGameTerminatedErr kNSpGameTerminatedErr --30393 kNSpTimeoutErr kNSpTimeoutErr --30392 kNSpInvalidProtocolListErr kNSpInvalidProtocolListErr --30391 kNSpInvalidProtocolRefErr kNSpInvalidProtocolRefErr --30390 kNSpInvalidDefinitionErr kNSpInvalidDefinitionErr --30389 kNSpAddPlayerFailedErr kNSpAddPlayerFailedErr --30388 kNSpCreateGroupFailedErr kNSpCreateGroupFailedErr --30387 kNSpNoHostVolunteersErr kNSpNoHostVolunteersErr --30386 kNSpNoGroupsErr kNSpNoGroupsErr --30385 kNSpNoPlayersErr kNSpNoPlayersErr --30384 kNSpInvalidGroupIDErr kNSpInvalidGroupIDErr --30383 kNSpInvalidPlayerIDErr kNSpInvalidPlayerIDErr --30382 kNSpNameRequiredErr kNSpNameRequiredErr --30381 kNSpFeatureNotImplementedErr kNSpFeatureNotImplementedErr --30380 kNSpAddressInUseErr kNSpAddressInUseErr --30379 kNSpRemovePlayerFailedErr kNSpRemovePlayerFailedErr --30378 kNSpFreeQExhaustedErr kNSpFreeQExhaustedErr --30377 kNSpInvalidAddressErr kNSpInvalidAddressErr --30376 kNSpNotAdvertisingErr kNSpNotAdvertisingErr --30374 kNSpAlreadyAdvertisingErr kNSpAlreadyAdvertisingErr --30373 kNSpMemAllocationErr kNSpMemAllocationErr --30371 kNSpOTVersionTooOldErr kNSpOTVersionTooOldErr --30370 kNSpOTNotPresentErr kNSpOTNotPresentErr --30369 kNSpInvalidParameterErr kNSpInvalidParameterErr --30367 kNSpInvalidGameRefErr kNSpInvalidGameRefErr --30366 kNSpProtocolNotAvailableErr kNSpProtocolNotAvailableErr --30365 kNSpHostFailedErr kNSpHostFailedErr --30364 kNSpPipeFullErr kNSpPipeFullErr --30362 kNSpTopologyNotSupportedErr kNSpTopologyNotSupportedErr --30361 kNSpAlreadyInitializedErr kNSpAlreadyInitializedErr --30360 kNSpInitializationFailedErr kNSpInitializationFailedErr --30344 kSSpScaleToZeroErr kSSpScaleToZeroErr --30343 kSSpParallelUpVectorErr kSSpParallelUpVectorErr --30342 kSSpCantInstallErr kSSpCantInstallErr --30341 kSSpVersionErr kSSpVersionErr --30340 kSSpInternalErr kSSpInternalErr --30049 kALMInternalErr kALMInternalErr --30048 kALMGroupNotFoundErr kALMGroupNotFoundErr --30047 kALMNoSuchModuleErr kALMNoSuchModuleErr --30046 kALMModuleCommunicationErr kALMModuleCommunicationErr --30045 kALMDuplicateModuleErr kALMDuplicateModuleErr --30044 kALMInstallationErr kALMInstallationErr --30043 kALMDeferSwitchErr kALMDeferSwitchErr --30042 kALMRebootFlagsLevelErr kALMRebootFlagsLevelErr --30029 kLocalesDefaultDisplayStatus Requested display locale unavailable, used default --30002 kLocalesTableFormatErr kLocalesTableFormatErr --30001 kLocalesBufferTooSmallErr kLocalesBufferTooSmallErr --29589 kFNSNameNotFoundErr The name with the requested paramters was not found --29587 kFNSBadFlattenedSizeErr flattened size didn't match input or was too small --29586 kFNSInsufficientDataErr insufficient data for the operation --29585 kFNSMismatchErr reference didn't match or wasn't found in profile --29584 kFNSDuplicateReferenceErr the ref. being added is already in the profile --29583 kFNSBadProfileVersionErr profile version is out of known range --29582 kFNSInvalidProfileErr profile is NULL or otherwise bad --29581 kFNSBadReferenceVersionErr ref. version is out of known range --29580 kFNSInvalidReferenceErr ref. was NULL or otherwise bad --29507 kCollateInvalidCollationRef kCollateInvalidCollationRef --29506 kCollateBufferTooSmall kCollateBufferTooSmall --29505 kCollateInvalidChar kCollateInvalidChar --29504 kCollatePatternNotFoundErr kCollatePatternNotFoundErr --29503 kCollateUnicodeConvertFailedErr kCollateUnicodeConvertFailedErr --29502 kCollateMissingUnicodeTableErr kCollateMissingUnicodeTableErr --29501 kCollateInvalidOptions kCollateInvalidOptions --29500 kCollateAttributesNotFoundErr kCollateAttributesNotFoundErr --29299 kMPInvalidIDErr kMPInvalidIDErr --29298 kMPInsufficientResourcesErr kMPInsufficientResourcesErr --29297 kMPTaskAbortedErr kMPTaskAbortedErr --29296 kMPTimeoutErr kMPTimeoutErr --29295 kMPDeletedErr kMPDeletedErr --29293 kMPBlueBlockingErr kMPBlueBlockingErr --29292 kMPTaskStoppedErr A convention used with MPThrowException. --29291 kMPTaskBlockedErr kMPTaskBlockedErr --29290 kMPTaskCreatedErr kMPTaskCreatedErr --29289 kMPProcessTerminatedErr kMPProcessTerminatedErr --29288 kMPProcessCreatedErr kMPProcessCreatedErr --29276 kMPPrivilegedErr kMPPrivilegedErr --29275 kMPIterationEndErr kMPIterationEndErr --25341 kUCTextBreakLocatorMissingType Unicode text break error --25340 kUCOutputBufferTooSmall Output buffer too small for Unicode string result --25318 errKCCreateChainFailed errKCCreateChainFailed --25317 errKCDataNotModifiable errKCDataNotModifiable --25316 errKCDataNotAvailable errKCDataNotAvailable --25315 errKCInteractionRequired errKCInteractionRequired --25314 errKCNoPolicyModule errKCNoPolicyModule --25313 errKCNoCertificateModule errKCNoCertificateModule --25312 errKCNoStorageModule errKCNoStorageModule --25311 errKCKeySizeNotAllowed errKCKeySizeNotAllowed --25310 errKCWrongKCVersion errKCWrongKCVersion --25309 errKCReadOnlyAttr errKCReadOnlyAttr --25308 errKCInteractionNotAllowed errKCInteractionNotAllowed --25307 errKCNoDefaultKeychain errKCNoDefaultKeychain --25306 errKCNoSuchClass errKCNoSuchClass --25305 errKCInvalidSearchRef errKCInvalidSearchRef --25304 errKCInvalidItemRef errKCInvalidItemRef --25303 errKCNoSuchAttr errKCNoSuchAttr --25302 errKCDataTooLarge errKCDataTooLarge --25301 errKCBufferTooSmall errKCBufferTooSmall --25300 errKCItemNotFound errKCItemNotFound --25299 errKCDuplicateItem errKCDuplicateItem --25298 errKCInvalidCallback errKCInvalidCallback --25297 errKCDuplicateCallback errKCDuplicateCallback --25296 errKCDuplicateKeychain errKCDuplicateKeychain --25295 errKCInvalidKeychain errKCInvalidKeychain --25294 errKCNoSuchKeychain errKCNoSuchKeychain --25293 errKCAuthFailed errKCAuthFailed --25292 errKCReadOnly errKCReadOnly --25291 errKCNotAvailable errKCNotAvailable --25280 printerStatusOpCodeNotSupportedErr printerStatusOpCodeNotSupportedErr --22018 kTXNOutsideOfFrameErr kTXNOutsideOfFrameErr --22017 kTXNOutsideOfLineErr kTXNOutsideOfLineErr --22016 kTXNATSUIIsNotInstalledErr kTXNATSUIIsNotInstalledErr --22015 kTXNDataTypeNotAllowedErr kTXNDataTypeNotAllowedErr --22014 kTXNCopyNotAllowedInEchoModeErr kTXNCopyNotAllowedInEchoModeErr --22013 kTXNCannotTurnTSMOffWhenUsingUnicodeErr kTXNCannotTurnTSMOffWhenUsingUnicodeErr --22012 kTXNAlreadyInitializedErr kTXNAlreadyInitializedErr --22011 kTXNInvalidRunIndex kTXNInvalidRunIndex --22010 kTXNSomeOrAllTagsInvalidForRunErr kTXNSomeOrAllTagsInvalidForRunErr --22009 kTXNAttributeTagInvalidForRunErr dataValue is set to this per invalid tag --22008 kTXNNoMatchErr kTXNNoMatchErr --22007 kTXNRunIndexOutofBoundsErr kTXNRunIndexOutofBoundsErr --22006 kTXNCannotSetAutoIndentErr kTXNCannotSetAutoIndentErr --22005 kTXNBadDefaultFileTypeWarning kTXNBadDefaultFileTypeWarning --22004 kTXNUserCanceledOperationErr kTXNUserCanceledOperationErr --22003 kTXNIllegalToCrossDataBoundariesErr kTXNIllegalToCrossDataBoundariesErr --22002 kTXNInvalidFrameIDErr kTXNInvalidFrameIDErr --22001 kTXNCannotAddFrameErr kTXNCannotAddFrameErr --22000 kTXNEndIterationErr kTXNEndIterationErr --20002 invalidIndexErr The recordIndex parameter is not valid. --20001 recordDataTooBigErr The record data is bigger than buffer size (1024 bytes). --20000 unknownInsertModeErr There is no such an insert mode. --14002 kModemScriptMissing kModemScriptMissing --14001 kModemPreferencesMissing kModemPreferencesMissing --14000 kModemOutOfMemory kModemOutOfMemory --13950 kHIDBaseError kHIDBaseError --13949 kHIDNullStateErr kHIDNullStateErr --13948 kHIDBufferTooSmallErr kHIDBufferTooSmallErr --13947 kHIDValueOutOfRangeErr kHIDValueOutOfRangeErr --13946 kHIDUsageNotFoundErr kHIDUsageNotFoundErr --13945 kHIDNotValueArrayErr kHIDNotValueArrayErr --13944 kHIDInvalidPreparsedDataErr kHIDInvalidPreparsedDataErr --13943 kHIDIncompatibleReportErr kHIDIncompatibleReportErr --13942 kHIDBadLogPhysValuesErr kHIDBadLogPhysValuesErr --13941 kHIDInvalidReportTypeErr kHIDInvalidReportTypeErr --13940 kHIDInvalidReportLengthErr kHIDInvalidReportLengthErr --13939 kHIDNullPointerErr kHIDNullPointerErr --13938 kHIDBadParameterErr kHIDBadParameterErr --13937 kHIDNotEnoughMemoryErr kHIDNotEnoughMemoryErr --13936 kHIDEndOfDescriptorErr kHIDEndOfDescriptorErr --13935 kHIDUsagePageZeroErr kHIDUsagePageZeroErr --13934 kHIDBadLogicalMinimumErr kHIDBadLogicalMinimumErr --13933 kHIDBadLogicalMaximumErr kHIDBadLogicalMaximumErr --13932 kHIDInvertedLogicalRangeErr kHIDInvertedLogicalRangeErr --13931 kHIDInvertedPhysicalRangeErr kHIDInvertedPhysicalRangeErr --13930 kHIDUnmatchedUsageRangeErr kHIDUnmatchedUsageRangeErr --13929 kHIDInvertedUsageRangeErr kHIDInvertedUsageRangeErr --13928 kHIDUnmatchedStringRangeErr kHIDUnmatchedStringRangeErr --13927 kHIDUnmatchedDesignatorRangeErr kHIDUnmatchedDesignatorRangeErr --13926 kHIDReportSizeZeroErr kHIDReportSizeZeroErr --13925 kHIDReportCountZeroErr kHIDReportCountZeroErr --13924 kHIDReportIDZeroErr kHIDReportIDZeroErr --13923 kHIDInvalidRangePageErr kHIDInvalidRangePageErr --13910 kHIDDeviceNotReady The device is still initializing, try again later --13909 kHIDVersionIncompatibleErr kHIDVersionIncompatibleErr --13887 debuggingNoMatchErr debugging component or option not found at this index --13886 debuggingNoCallbackErr debugging component has no callback --13885 debuggingInvalidNameErr componentName or optionName is invalid (NULL) --13884 debuggingInvalidOptionErr optionSelectorNum is not registered --13883 debuggingInvalidSignatureErr componentSignature not registered --13882 debuggingDuplicateOptionErr optionSelectorNum already registered --13881 debuggingDuplicateSignatureErr componentSignature already registered --13880 debuggingExecutionContextErr routine cannot be called at this time --13038 kBridgeSoftwareRunningCantSleep kBridgeSoftwareRunningCantSleep --13020 kNoSuchPowerSource kNoSuchPowerSource --13014 kProcessorTempRoutineRequiresMPLib2 kProcessorTempRoutineRequiresMPLib2 --13013 kCantReportProcessorTemperatureErr kCantReportProcessorTemperatureErr --13010 kPowerMgtRequestDenied kPowerMgtRequestDenied --13009 kPowerMgtMessageNotHandled kPowerMgtMessageNotHandled --13008 kPowerHandlerNotFoundForProcErr kPowerHandlerNotFoundForProcErr --13007 kPowerHandlerNotFoundForDeviceErr kPowerHandlerNotFoundForDeviceErr --13006 kPowerHandlerExistsForDeviceErr kPowerHandlerExistsForDeviceErr --13005 pmRecvEndErr during receive, pmgr did not finish hs configured for this connection --13004 pmRecvStartErr during receive, pmgr did not start hs --13003 pmSendEndErr during send, pmgr did not finish hs --13002 pmSendStartErr during send, pmgr did not start hs --13001 pmReplyTOErr Timed out waiting for reply --13000 pmBusyErr Power Mgr never ready to start handshake --11005 pictureDataErr the picture data was invalid --11004 colorsRequestedErr the number of colors requested was illegal --11003 cantLoadPickMethodErr unable to load the custom pick proc --11002 pictInfoVerbErr the passed verb was invalid --11001 pictInfoIDErr the internal consistancy check for the PictInfoID is wrong --11000 pictInfoVersionErr wrong version of the PictInfo structure --10780 errTaskNotFound no task with that task id exists --10116 telNotEnoughdspBW not enough real-time for allocation --10115 telBadSampleRate incompatible sample rate --10114 telBadSWErr Software not installed properly --10113 telDetAlreadyOn detection is already turned on --10112 telAutoAnsNotOn autoAnswer in not turned on --10111 telValidateFailed telValidate failed --10110 telBadProcID invalid procID --10109 telDeviceNotFound device not found --10108 telBadCodeResource code resource not found --10107 telInitFailed initialization failed --10106 telNoCommFolder Communications/Extensions € not found --10103 telUnknownErr unable to set config --10102 telNoSuchTool unable to find tool with name specified --10091 telBadFunction bad msgCode specified --10090 telPBErr parameter block error, bad format --10082 telCANotDeflectable CA not "deflectable" --10081 telCANotRejectable CA not "rejectable" --10080 telCANotAcceptable CA not "acceptable" --10072 telTermNotOpen terminal not opened via TELOpenTerm --10071 telStillNeeded terminal driver still needed by someone else --10070 telAlreadyOpen terminal already open --10064 telNoCallbackRef no call back reference was specified, but is required --10063 telDisplayModeNotSupp display mode not supported by tool --10062 telBadDisplayMode bad display mode specified --10061 telFwdTypeNotSupp forward type not supported by tool --10060 telDNTypeNotSupp DN type not supported by tool --10059 telBadRate bad rate specified --10058 telBadBearerType bad bearerType specified --10057 telBadSelect unable to select or deselect DN --10056 telBadParkID bad park id specified --10055 telBadPickupGroupID bad pickup group ID specified --10054 telBadFwdType bad fwdType specified --10053 telBadFeatureID bad feature ID specified --10052 telBadIntercomID bad intercom ID specified --10051 telBadPageID bad page ID specified --10050 telBadDNType DN type invalid --10047 telConfLimitExceeded attempt to exceed switch conference limits --10046 telCBErr call back feature not set previously --10045 telTransferRej transfer request rejected --10044 telTransferErr transfer not prepared --10043 telConfRej conference request was rejected --10042 telConfErr conference was not prepared --10041 telConfNoLimit no limit was specified but required --10040 telConfLimitErr limit specified is too high for this configuration --10033 telFeatNotSupp feature program call not supported by this tool --10032 telFeatActive feature already active --10031 telFeatNotAvail feature subscribed but not available --10030 telFeatNotSub feature not subscribed --10025 errAEPropertiesClash illegal combination of properties settings for Set Data, make new, or duplicate --10024 errAECantPutThatThere in make new, duplicate, etc. class can't be an element of container --10023 errAENotAnEnumMember enumerated value in SetData is not allowed for this property --10022 telIntExtNotSupp internal external type not supported by this tool --10021 telBadIntExt bad internal external error --10020 telStateNotSupp device state not supported by tool --10019 telBadStateErr bad device state specified --10018 telIndexNotSupp index not supported by this tool --10017 telBadIndex bad index specified --10016 telAPattNotSupp alerting pattern not supported by tool --10015 telBadAPattErr bad alerting pattern specified --10014 telVTypeNotSupp volume type not supported by this tool --10013 telBadVTypeErr bad volume type error --10012 telBadLevelErr bad volume level setting --10011 telHTypeNotSupp hook type not supported by this tool --10010 telBadHTypeErr bad hook type specified --10009 errAECantSupplyType errAECantSupplyType --10008 telNoOpenErr unable to open terminal --10007 telNoMemErr no memory to allocate handle --10006 errOSACantAssign Signaled when an object cannot be set in a container. --10005 telBadProcErr bad msgProc specified --10004 telBadHandErr bad handle specified --10003 OSAIllegalAssign Signaled when an object can never be set in a container --10002 telBadDNErr TELDNHandle not found or invalid --10001 telBadTermErr invalid TELHandle or handle not found --10000 errAEEventFailed errAEEventFailed --9999 cannotMoveAttachedController cannotMoveAttachedController --9998 controllerHasFixedHeight controllerHasFixedHeight --9997 cannotSetWidthOfAttachedController cannotSetWidthOfAttachedController --9996 controllerBoundsNotExact controllerBoundsNotExact --9995 editingNotAllowed editingNotAllowed --9994 badControllerHeight badControllerHeight --9408 deviceCantMeetRequest deviceCantMeetRequest --9407 seqGrabInfoNotAvailable seqGrabInfoNotAvailable --9406 badSGChannel badSGChannel --9405 couldntGetRequiredComponent couldntGetRequiredComponent --9404 notEnoughDiskSpaceToGrab notEnoughDiskSpaceToGrab --9403 notEnoughMemoryToGrab notEnoughMemoryToGrab --9402 cantDoThatInCurrentMode cantDoThatInCurrentMode --9401 grabTimeComplete grabTimeComplete --9400 noDeviceForChannel noDeviceForChannel --9109 kNoCardBusCISErr No valid CIS exists for this CardBus card --9108 kNotZVCapableErr This socket does not support Zoomed Video --9107 kCardPowerOffErr Power to the card has been turned off --9106 kAttemptDupCardEntryErr The Enabler was asked to create a duplicate card entry --9105 kAlreadySavedStateErr The state has been saved on previous call --9104 kTooManyIOWindowsErr device requested more than one I/O window --9103 kNotReadyErr PC Card failed to go ready --9102 kClientRequestDenied CS Clients should return this code inorder to --9101 kNoCompatibleNameErr There is no compatible driver name for this device --9100 kNoEnablerForCardErr No Enablers were found that can support the card --9099 kNoCardEnablersFoundErr No Enablers were found --9098 kUnsupportedCardErr Card not supported by generic enabler --9097 kNoClientTableErr The client table has not be initialized yet --9096 kNoMoreInterruptSlotsErr All internal Interrupt slots are in use --9095 kNoMoreTimerClientsErr All timer callbacks are in use --9094 kNoIOWindowRequestedErr Request I/O window before calling configuration --9093 kBadCustomIFIDErr Custom interface ID is invalid --9092 kBadTupleDataErr Data in tuple is invalid --9091 kInvalidCSClientErr Card Services ClientID is not registered --9090 kUnsupportedVsErr Unsupported Voltage Sense --9089 kInvalidDeviceNumber kInvalidDeviceNumber --9088 kPostCardEventErr _PCCSLPostCardEvent failed and dropped an event --9087 kCantConfigureCardErr kCantConfigureCardErr --9086 kPassCallToChainErr kPassCallToChainErr --9085 kCardBusCardErr kCardBusCardErr --9084 k16BitCardErr k16BitCardErr --9083 kBadDeviceErr kBadDeviceErr --9082 kBadLinkErr kBadLinkErr --9081 kInvalidRegEntryErr kInvalidRegEntryErr --9080 kNoCardSevicesSocketsErr kNoCardSevicesSocketsErr --9079 kOutOfResourceErr Card Services has exhausted the resource --9078 kNoMoreItemsErr there are no more of the requested item --9077 kInUseErr requested resource is being used by a client --9076 kConfigurationLockedErr a configuration has already been locked --9075 kWriteProtectedErr media is write-protected --9074 kBusyErr unable to process request at this time - try later --9073 kUnsupportedModeErr mode is not supported --9072 kUnsupportedFunctionErr function is not supported by this implementation --9071 kNoCardErr no PC card in the socket --9070 kGeneralFailureErr an undefined error has occurred --9069 kWriteFailureErr unable to complete write request --9068 kReadFailureErr unable to complete read request --9067 kBadSpeedErr specified speed is unavailable --9066 kBadCISErr CIS on card is invalid --9065 kBadHandleErr clientHandle is invalid --9064 kBadArgsErr values in argument packet are invalid --9063 kBadArgLengthErr ArgLength argument is invalid --9062 kBadWindowErr specified window is invalid --9061 kBadVppErr specified Vpp1 or Vpp2 power level index is invalid --9060 kBadVccErr specified Vcc power level index is invalid --9059 kBadTypeErr specified window or interface type is invalid --9058 kBadSocketErr specified logical or physical socket number is invalid --9057 kBadSizeErr specified size is invalid --9056 kBadPageErr specified page is invalid --9055 kBadOffsetErr specified PC card memory array offset is invalid --9054 kBadIRQErr specified IRQ level is invalid --9053 kBadEDCErr specified EDC generator specified is invalid --9052 kBadBaseErr specified base system memory address is invalid --9051 kBadAttributeErr specified attributes field value is invalid --9050 kBadAdapterErr invalid adapter number --8992 codecOffscreenFailedPleaseRetryErr codecOffscreenFailedPleaseRetryErr --8991 lockPortBitsWrongGDeviceErr lockPortBitsWrongGDeviceErr --8990 directXObjectAlreadyExists directXObjectAlreadyExists --8989 codecDroppedFrameErr returned from ImageCodecDrawBand --8988 codecOffscreenFailedErr codecOffscreenFailedErr --8987 codecNeedAccessKeyErr codec needs password in order to decompress --8986 codecParameterDialogConfirm codecParameterDialogConfirm --8985 lockPortBitsSurfaceLostErr lockPortBitsSurfaceLostErr --8984 lockPortBitsBadPortErr lockPortBitsBadPortErr --8983 lockPortBitsWindowClippedErr lockPortBitsWindowClippedErr --8982 lockPortBitsWindowResizedErr lockPortBitsWindowResizedErr --8981 lockPortBitsWindowMovedErr lockPortBitsWindowMovedErr --8980 lockPortBitsBadSurfaceErr lockPortBitsBadSurfaceErr --8979 codecNeedToFlushChainErr codecNeedToFlushChainErr --8978 codecDisabledErr codec disabled itself -- pass codecFlagReenable to reset --8977 codecNoMemoryPleaseWaitErr codecNoMemoryPleaseWaitErr --8976 codecNothingToBlitErr codecNothingToBlitErr --8975 codecCantQueueErr codecCantQueueErr --8974 codecCantWhenErr codecCantWhenErr --8973 codecOpenErr codecOpenErr --8972 codecConditionErr codecConditionErr --8971 codecExtensionNotFoundErr codecExtensionNotFoundErr --8970 codecDataVersErr codecDataVersErr --8969 codecBadDataErr codecBadDataErr --8968 codecWouldOffscreenErr codecWouldOffscreenErr --8967 codecAbortErr codecAbortErr --8966 codecSpoolErr codecSpoolErr --8965 codecImageBufErr codecImageBufErr --8964 codecScreenBufErr codecScreenBufErr --8963 codecSizeErr codecSizeErr --8962 codecUnimpErr codecUnimpErr --8961 noCodecErr noCodecErr --8960 codecErr codecErr --8852 kIllegalClockValueErr kIllegalClockValueErr --8851 kUTCOverflowErr kUTCOverflowErr --8850 kUTCUnderflowErr kUTCUnderflowErr --8809 kATSULastErr The last ATSUI error code. --8808 kATSULineBreakInWord This is not an error code but is returned by ATSUBreakLine to --8807 kATSUCoordinateOverflowErr Used to indicate the coordinates provided to an ATSUI routine caused --8806 kATSUNoFontScalerAvailableErr Used when no font scaler is available for the font passed --8805 kATSUNoFontCmapAvailableErr Used when no CMAP table can be accessed or synthesized for the --8804 kATSULowLevelErr Used when an error was encountered within the low level ATS --8803 kATSUQuickDrawTextErr Used when QuickDraw Text encounters an error rendering or measuring --8802 kATSUNoStyleRunsAssignedErr Used when an attempt was made to measure, highlight or draw --8801 kATSUNotSetErr Used when the client attempts to retrieve an attribute, --8800 kATSUInvalidCacheErr Used when an attempt was made to read in style data --8799 kATSUInvalidAttributeTagErr Used when an attempt was made to use a tag value that --8798 kATSUInvalidAttributeSizeErr Used when an attempt was made to use an attribute with a --8797 kATSUInvalidAttributeValueErr Used when an attempt was made to use an attribute with --8796 kATSUInvalidFontErr Used when an attempt was made to use an invalid font ID. --8795 kATSUNoCorrespondingFontErr This value is retrned by font ID conversion --8794 kATSUFontsNotMatched This value is returned by ATSUMatchFontsToText() --8793 kATSUFontsMatched This is not an error code but is returned by --8792 kATSUInvalidTextRangeErr An attempt was made to extract information --8791 kATSUInvalidStyleErr An attempt was made to use a ATSUStyle which --8790 kATSUInvalidTextLayoutErr An attempt was made to use a ATSUTextLayout --8785 kTECOutputBufferFullStatus output buffer has no room for conversion of next input text element (partial conversion) --8784 kTECNeedFlushStatus kTECNeedFlushStatus --8783 kTECUsedFallbacksStatus kTECUsedFallbacksStatus --8771 kTECItemUnavailableErr item (e.g. name) not available for specified region (& encoding if relevant) --8770 kTECGlobalsUnavailableErr globals have already been deallocated (premature TERM) --8769 unicodeChecksumErr unicodeChecksumErr --8768 unicodeNoTableErr unicodeNoTableErr --8767 unicodeVariantErr unicodeVariantErr --8766 unicodeFallbacksErr unicodeFallbacksErr --8765 unicodePartConvertErr unicodePartConvertErr --8764 unicodeBufErr unicodeBufErr --8763 unicodeCharErr unicodeCharErr --8762 unicodeElementErr unicodeElementErr --8761 unicodeNotFoundErr unicodeNotFoundErr --8760 unicodeTableFormatErr unicodeTableFormatErr --8759 unicodeDirectionErr unicodeDirectionErr --8758 unicodeContextualErr unicodeContextualErr --8757 unicodeTextEncodingDataErr unicodeTextEncodingDataErr --8756 kTECDirectionErr direction stack overflow, etc. --8755 kTECIncompleteElementErr text element may be incomplete or is too long for internal buffers --8754 kTECUnmappableElementErr kTECUnmappableElementErr --8753 kTECPartialCharErr input buffer ends in the middle of a multibyte character, conversion stopped --8752 kTECBadTextRunErr kTECBadTextRunErr --8751 kTECArrayFullErr supplied name buffer or TextRun, TextEncoding, or UnicodeMapping array is too small --8750 kTECBufferBelowMinimumSizeErr output buffer too small to allow processing of first input text element --8749 kTECNoConversionPathErr kTECNoConversionPathErr --8748 kTECCorruptConverterErr invalid converter object reference --8747 kTECTableFormatErr kTECTableFormatErr --8746 kTECTableChecksumErr kTECTableChecksumErr --8745 kTECMissingTableErr kTECMissingTableErr --8740 kTextUndefinedElementErr text conversion errors --8739 kTextMalformedInputErr in DBCS, for example, high byte followed by invalid low byte --8738 kTextUnsupportedEncodingErr specified encoding not supported for this operation --7139 kRANotEnabled kRANotEnabled --7138 kRACallBackFailed kRACallBackFailed --7137 kRADuplicateIPAddr kRADuplicateIPAddr --7136 kRANCPRejectedbyPeer kRANCPRejectedbyPeer --7135 kRAExtAuthenticationFailed kRAExtAuthenticationFailed --7134 kRAATalkInactive kRAATalkInactive --7133 kRAPeerNotResponding kRAPeerNotResponding --7132 kRAPPPPeerDisconnected kRAPPPPeerDisconnected --7131 kRAPPPUserDisconnected kRAPPPUserDisconnected --7130 kRAPPPNegotiationFailed kRAPPPNegotiationFailed --7129 kRAPPPAuthenticationFailed kRAPPPAuthenticationFailed --7128 kRAPPPProtocolRejected kRAPPPProtocolRejected --7127 dcmBufferOverflowErr data is larger than buffer size --7126 kRANotPrimaryInterface when IPCP is not primary TCP/IP intf. --7125 kRATCPIPNotConfigured TCP/IP not configured, could be loaded --7124 kRATCPIPInactive TCP/IP inactive, cannot be loaded --7123 kRARemoteAccessNotReady kRARemoteAccessNotReady --7122 kRAInitOpenTransportFailed kRAInitOpenTransportFailed --7121 dcmProtectedErr need keyword to use dictionary --7120 kRAUserPwdEntryRequired kRAUserPwdEntryRequired --7119 kRAUserPwdChangeRequired kRAUserPwdChangeRequired --7118 dcmBadFindMethodErr no such find method supported --7117 kRAInvalidSerialProtocol kRAInvalidSerialProtocol --7116 kRAInvalidPortState kRAInvalidPortState --7115 dcmBadKeyErr bad key information --7114 kRAPortBusy kRAPortBusy --7113 kRAInstallationDamaged kRAInstallationDamaged --7112 dcmBadFieldTypeErr no such field type supported --7111 dcmBadFieldInfoErr incomplete information --7110 dcmNecessaryFieldErr lack required/identify field --7109 dcmDupRecordErr same record already exist --7108 kRANotConnected kRANotConnected --7107 dcmBlockFullErr dictionary block full --7106 kRAMissingResources kRAMissingResources --7105 dcmDictionaryBusyErr dictionary is busy --7104 dcmDictionaryNotOpenErr dictionary not opened --7103 dcmPermissionErr invalid permission --7102 dcmBadDictionaryErr invalid dictionary --7101 dcmNotDictionaryErr not dictionary --7100 kRAInvalidParameter kRAInvalidParameter --7000 laEngineNotFoundErr can't find the engine --6999 laPropertyErr Error in properties --6998 kUSBUnknownDeviceErr device ref not recognised --6997 laPropertyIsReadOnlyErr the property is read only --6996 laPropertyUnknownErr the property is unknown to this environment --6995 laPropertyValueErr Invalid property value --6994 laDictionaryTooManyErr too many dictionaries --6993 laDictionaryUnknownErr can't use this dictionary with this environment --6992 laDictionaryNotOpenedErr the dictionary is not opened --6991 laTextOverFlowErr text is too long --6990 laFailAnalysisErr analysis failed --6989 laNoMoreMorphemeErr nothing to read --6988 laInvalidPathErr path is not correct --6987 kUSBNotHandled Notification was not handled (same as NotFound) --6986 laEnvironmentNotFoundErr can't fint the specified environment --6985 laEnvironmentBusyErr specified environment is used --6984 laTooSmallBufferErr output buffer is too small to store any result --6983 kUSBFlagsError Unused flags not zeroed --6982 kUSBAbortedError Pipe aborted --6981 kUSBNoBandwidthError Not enough bandwidth available --6980 kUSBPipeIdleError Pipe is Idle, it will not accept transactions --6979 kUSBPipeStalledError Pipe has stalled, error needs to be cleared --6978 kUSBUnknownInterfaceErr Interface ref not recognised --6977 kUSBDeviceBusy Device is already being configured --6976 kUSBDevicePowerProblem Device has a power problem --6975 kUSBInvalidBuffer bad buffer, usually nil --6974 kUSBDeviceSuspended Device is suspended --6973 kUSBDeviceNotSuspended device is not suspended for resume --6972 kUSBDeviceDisconnected Disconnected during suspend or reset --6971 kUSBTimedOut Transaction timed out. --6970 kUSBQueueAborted Pipe zero stall cleared. --6969 kUSBPortDisabled The port you are attached to is disabled, use USBDeviceReset. --6950 kUSBBadDispatchTable Improper driver dispatch table --6949 kUSBUnknownNotification Notification type not defined --6948 kUSBQueueFull Internal queue maxxed --6916 kUSBLinkErr kUSBLinkErr --6915 kUSBCRCErr Pipe stall, bad CRC --6914 kUSBBitstufErr Pipe stall, bitstuffing --6913 kUSBDataToggleErr Pipe stall, Bad data toggle --6912 kUSBEndpointStallErr Device didn't understand --6911 kUSBNotRespondingErr Pipe stall, No device, device hung --6910 kUSBPIDCheckErr Pipe stall, PID CRC error --6909 kUSBWrongPIDErr Pipe stall, Bad or wrong PID --6908 kUSBOverRunErr Packet too large or more data than buffer --6907 kUSBUnderRunErr Less data than buffer --6906 kUSBRes1Err kUSBRes1Err --6905 kUSBRes2Err kUSBRes2Err --6904 kUSBBufOvrRunErr Host hardware failure on data in, PCI busy? --6903 kUSBBufUnderRunErr Host hardware failure on data out, PCI busy? --6902 kUSBNotSent1Err Transaction not sent --6901 kUSBNotSent2Err Transaction not sent --6232 kDMFoundErr Did not proceed because we found an item --6231 kDMMainDisplayCannotMoveErr Trying to move main display (or a display mirrored to it) --6230 kDMDisplayAlreadyInstalledErr Attempt to add an already installed display. --6229 kDMDisplayNotFoundErr Could not find item (will someday remove). --6228 kDMDriverNotDisplayMgrAwareErr Video Driver does not support display manager. --6227 kDMSWNotInitializedErr Required software not initialized (eg windowmanager or display mgr). --6226 kSysSWTooOld Missing critical pieces of System Software. --6225 kDMMirroringNotOn Returned by all calls that need mirroring to be on to do their thing. --6224 kDMCantBlock Mirroring is already on, canÕt Block now (call DMUnMirror() first). --6223 kDMMirroringBlocked DMBlockMirroring() has been called. --6222 kDMWrongNumberOfDisplays Can only handle 2 displays for now. --6221 kDMMirroringOnAlready Returned by all calls that need mirroring to be off to do their thing. --6220 kDMGenErr Unexpected Error --6150 kQTSSUnknownErr kQTSSUnknownErr --5753 collectionVersionErr collectionVersionErr --5752 collectionIndexRangeErr collectionIndexRangeErr --5751 collectionItemNotFoundErr collectionItemNotFoundErr --5750 collectionItemLockedErr collectionItemLockedErr --5699 kNavMissingKindStringErr kNavMissingKindStringErr --5698 kNavInvalidCustomControlMessageErr kNavInvalidCustomControlMessageErr --5697 kNavCustomControlMessageFailedErr kNavCustomControlMessageFailedErr --5696 kNavInvalidSystemConfigErr kNavInvalidSystemConfigErr --5695 kNavWrongDialogClassErr kNavWrongDialogClassErr --5694 kNavWrongDialogStateErr kNavWrongDialogStateErr --5640 dialogNoTimeoutErr dialogNoTimeoutErr --5623 menuInvalidErr menu is invalid --5622 menuItemNotFoundErr specified menu item wasn't found --5621 menuUsesSystemDefErr GetMenuDefinition failed because the menu uses the system MDEF --5620 menuNotFoundErr specified menu or menu ID wasn't found --5615 windowWrongStateErr window is not in a state that is valid for the current action --5614 windowManagerInternalErr something really weird happened inside the window manager --5613 windowAttributesConflictErr passed some attributes that are mutually exclusive --5612 windowAttributeImmutableErr tried to change attributes which can't be changed --5611 errWindowDoesNotFitOnscreen ConstrainWindowToScreen could not make the window fit onscreen --5610 errWindowNotFound returned from FindWindowOfClass --5609 errFloatingWindowsNotInitialized called HideFloatingWindows or ShowFloatingWindows without calling InitFloatingWindows --5608 errWindowsAlreadyInitialized tried to call InitFloatingWindows twice, or called InitWindows and then floating windows --5607 errUserWantsToDragWindow if returned from TrackWindowProxyDrag, you should call DragWindow on the window --5606 errCorruptWindowDescription tried to load a corrupt window description (size or version fields incorrect) --5605 errUnrecognizedWindowClass tried to create a window with a bad WindowClass --5604 errWindowPropertyNotFound tried to get a nonexistent property --5603 errInvalidWindowProperty tried to access a property tag with private creator --5602 errWindowDoesNotHaveProxy tried to do something requiring a proxy to a window which doesnÕt have a proxy --5601 errUnsupportedWindowAttributesForClass tried to create a window with WindowAttributes not supported by the WindowClass --5600 errInvalidWindowPtr tried to pass a bad WindowRef argument --5553 gestaltLocationErr gestalt function ptr wasn't in sysheap --5552 gestaltDupSelectorErr tried to add an entry that already existed --5551 gestaltUndefSelectorErr undefined selector was passed to Gestalt --5550 gestaltUnknownErr value returned if Gestalt doesn't know the answer --5502 envVersTooBig Version bigger than call can handle --5501 envBadVers Version non-positive --5500 envNotPresent returned by glue. --5421 qtsAddressBusyErr qtsAddressBusyErr --5420 qtsConnectionFailedErr qtsConnectionFailedErr --5408 qtsTimeoutErr qtsTimeoutErr --5407 qtsUnknownValueErr qtsUnknownValueErr --5406 qtsTooMuchDataErr qtsTooMuchDataErr --5405 qtsUnsupportedFeatureErr qtsUnsupportedFeatureErr --5404 qtsUnsupportedRateErr qtsUnsupportedRateErr --5403 qtsUnsupportedDataTypeErr qtsUnsupportedDataTypeErr --5402 qtsBadDataErr something is wrong with the data --5401 qtsBadStateErr qtsBadStateErr --5400 qtsBadSelectorErr qtsBadSelectorErr --5388 errIAEndOfTextRun errIAEndOfTextRun --5387 errIATextExtractionErr errIATextExtractionErr --5386 errIAInvalidDocument errIAInvalidDocument --5385 errIACanceled errIACanceled --5384 errIABufferTooSmall errIABufferTooSmall --5383 errIANoMoreItems errIANoMoreItems --5382 errIAParamErr errIAParamErr --5381 errIAAllocationErr errIAAllocationErr --5380 errIAUnknownErr errIAUnknownErr --5363 hrURLNotHandledErr hrURLNotHandledErr --5362 hrUnableToResizeHandleErr hrUnableToResizeHandleErr --5361 hrMiscellaneousExceptionErr hrMiscellaneousExceptionErr --5360 hrHTMLRenderingLibNotInstalledErr hrHTMLRenderingLibNotInstalledErr --5253 errCannotUndo errCannotUndo --5252 errNonContiuousAttribute errNonContiuousAttribute --5251 errUnknownElement errUnknownElement --5250 errReadOnlyText errReadOnlyText --5249 errEmptyScrap errEmptyScrap --5248 errNoHiliteText errNoHiliteText --5247 errOffsetNotOnElementBounday errOffsetNotOnElementBounday --5246 errInvalidRange errInvalidRange --5245 errIteratorReachedEnd errIteratorReachedEnd --5244 errEngineNotFound errEngineNotFound --5243 errAlreadyInImagingMode errAlreadyInImagingMode --5242 errNotInImagingMode errNotInImagingMode --5241 errMarginWilllNotFit errMarginWilllNotFit --5240 errUnknownAttributeTag errUnknownAttributeTag --5063 afpSameNodeErr An Attempt was made to connect to a file server running on the same machine --5062 afpAlreadyMounted The volume is already mounted --5061 afpCantMountMoreSrvre The Maximum number of server connections has been reached --5060 afpBadDirIDType afpBadDirIDType --5048 afpCallNotAllowed The server knows what you wanted to do, but won't let you do it just now --5047 afpAlreadyLoggedInErr User has been authenticated but is already logged in from another machine (and that's not allowed on this server) --5046 afpPwdPolicyErr Password does not conform to servers password policy --5045 afpPwdNeedsChangeErr The password needs to be changed --5044 afpInsideTrashErr The folder being shared is inside the trash folder OR the shared folder is being moved into the trash folder --5043 afpInsideSharedErr The folder being shared is inside a shared folder OR the folder contains a shared folder and is being moved into a shared folder --5042 afpPwdExpiredErr The password being used is too old: this requires the user to change the password before log-in can continue --5041 afpPwdTooShortErr The password being set is too short: there is a minimum length that must be met or exceeded --5040 afpPwdSameErr Someone tried to change their password to the same password on a mantadory password change --5039 afpBadIDErr afpBadIDErr --5038 afpSameObjectErr afpSameObjectErr --5037 afpCatalogChanged afpCatalogChanged --5036 afpDiffVolErr afpDiffVolErr --5035 afpIDExists afpIDExists --5034 afpIDNotFound afpIDNotFound --5033 afpContainsSharedErr the folder being shared contains a shared folder --5032 afpObjectLocked Object is M/R/D/W inhibited --5031 afpVolLocked Volume is Read-Only --5030 afpIconTypeError Icon size specified different from existing icon size --5029 afpDirNotFound Unknown directory specified --5028 afpCantRename AFPRename cannot rename volume --5027 afpServerGoingDown Server is shutting down --5026 afpTooManyFilesOpen Maximum open file count reached --5025 afpObjectTypeErr File/Directory specified where Directory/File expected --5024 afpCallNotSupported Unsupported AFP call was made --5023 afpUserNotAuth No AFPLogin call has successfully been made for this session --5022 afpSessClosed Session closed --5021 afpRangeOverlap Some or all of range already locked by same user --5020 afpRangeNotLocked Tried to unlock range that was not locked by user --5019 afpParmErr A specified parameter was out of allowable range --5018 afpObjectNotFound Specified file or directory does not exist --5017 afpObjectExists Specified destination file or directory already exists --5016 afpNoServer Server not responding --5015 afpNoMoreLocks Maximum lock limit reached --5014 afpMiscErr Unexpected error encountered during execution --5013 afpLockErr Some or all of requested range is locked by another user --5012 afpItemNotFound Unknown UserName/UserID or missing comment/APPL entry --5011 afpFlatVol Cannot create directory on specified volume --5010 afpFileBusy Cannot delete an open file --5009 afpEofError Read beyond logical end-of-file --5008 afpDiskFull Insufficient free space on volume for operation --5007 afpDirNotEmpty Cannot delete non-empty directory --5006 afpDenyConflict Specified open/deny modes conflict with current open modes --5005 afpCantMove Move destination is offspring of source, or root was specified --5004 afpBitmapErr Bitmap contained bits undefined for call --5003 afpBadVersNum Unknown AFP protocol version number specified --5002 afpBadUAM Unknown user authentication method specified --5001 afpAuthContinue Further information required to complete AFPLogin call --5000 afpAccessDenied Insufficient access privileges for operation --4999 illegalScrapFlavorSizeErr illegalScrapFlavorSizeErr --4998 illegalScrapFlavorTypeErr illegalScrapFlavorTypeErr --4997 illegalScrapFlavorFlagsErr illegalScrapFlavorFlagsErr --4996 scrapFlavorSizeMismatchErr scrapFlavorSizeMismatchErr --4995 scrapFlavorFlagsMismatchErr scrapFlavorFlagsMismatchErr --4994 nilScrapFlavorDataErr nilScrapFlavorDataErr --4993 noScrapPromiseKeeperErr noScrapPromiseKeeperErr --4992 scrapPromiseNotKeptErr scrapPromiseNotKeptErr --4991 processStateIncorrectErr processStateIncorrectErr --4990 badScrapRefErr badScrapRefErr --4989 duplicateScrapFlavorErr duplicateScrapFlavorErr --4988 internalScrapErr internalScrapErr --4960 coreFoundationUnknownErr coreFoundationUnknownErr --4276 badRoutingSizeErr badRoutingSizeErr --4275 routingNotFoundErr routingNotFoundErr --4274 duplicateRoutingErr duplicateRoutingErr --4273 invalidFolderTypeErr invalidFolderTypeErr --4272 noMoreFolderDescErr noMoreFolderDescErr --4271 duplicateFolderDescErr duplicateFolderDescErr --4270 badFolderDescErr badFolderDescErr --4217 cmCantGamutCheckError Gammut checking not supported by this ColorWorld --4216 cmNamedColorNotFound NamedColor not found --4215 cmCantCopyModifiedV1Profile Illegal to copy version 1 profiles that have been modified --4214 cmRangeOverFlow Color conversion warning that some output color values over/underflowed and were clipped --4213 cmInvalidProfileComment Bad Profile comment during drawpicture --4212 cmNoGDevicesError Begin/End Matching -- no gdevices available --4211 cmInvalidDstMap Destination pix/bit map was invalid --4210 cmInvalidSrcMap Source pix/bit map was invalid --4209 cmInvalidColorSpace Profile colorspace does not match bitmap type --4208 cmErrIncompatibleProfile Other ColorSync Errors --4207 cmSearchError cmSearchError --4206 cmInvalidSearch Bad Search Handle --4205 cmInvalidProfileLocation Operation not supported for this profile location --4204 cmInvalidProfile A Profile must contain a 'cs1 ' tag to be valid --4203 cmFatalProfileErr cmFatalProfileErr --4202 cmCantDeleteElement cmCantDeleteElement --4201 cmIndexRangeErr Tag index out of range --4200 kNSLInitializationFailed UNABLE TO INITIALIZE THE MANAGER!!!!! DO NOT CONTINUE!!!! --4199 kNSLNotInitialized kNSLNotInitialized --4198 kNSLInsufficientSysVer kNSLInsufficientSysVer --4197 kNSLInsufficientOTVer kNSLInsufficientOTVer --4196 kNSLNoElementsInList kNSLNoElementsInList --4195 kNSLBadReferenceErr kNSLBadReferenceErr --4194 kNSLBadServiceTypeErr kNSLBadServiceTypeErr --4193 kNSLBadDataTypeErr kNSLBadDataTypeErr --4192 kNSLBadNetConnection kNSLBadNetConnection --4191 kNSLNoSupportForService kNSLNoSupportForService --4190 kNSLInvalidPluginSpec kNSLInvalidPluginSpec --4189 kNSLRequestBufferAlreadyInList kNSLRequestBufferAlreadyInList --4188 kNSLNoContextAvailable (ContinueLookup function ptr invalid) --4187 kNSLBufferTooSmallForData (Client buffer too small for data from plugin) --4186 kNSLCannotContinueLookup (Can't continue lookup; error or bad state) --4185 kNSLBadClientInfoPtr (nil ClientAsyncInfoPtr; no reference available) --4184 kNSLNullListPtr (client is trying to add items to a nil list) --4183 kNSLBadProtocolTypeErr (client is trying to add a null protocol type) --4182 kNSLPluginLoadFailed (manager unable to load one of the plugins) --4181 kNSLNoPluginsFound (manager didn't find any valid plugins to load) --4180 kNSLSearchAlreadyInProgress (you can only have one ongoing search per clientRef) --4179 kNSLNoPluginsForSearch (no plugins will respond to search request; bad protocol(s)?) --4178 kNSLNullNeighborhoodPtr (client passed a null neighborhood ptr) --4177 kNSLSomePluginsFailedToLoad (one or more plugins failed to load, but at least one did load; this error isn't fatal) --4176 kNSLErrNullPtrError kNSLErrNullPtrError --4175 kNSLNotImplementedYet kNSLNotImplementedYet --4174 kNSLUILibraryNotAvailable The NSL UI Library needs to be in the Extensions Folder --4173 kNSLNoCarbonLib kNSLNoCarbonLib --4172 kNSLBadURLSyntax URL contains illegal characters --4171 kNSLSchedulerError A custom thread routine encountered an error --4170 kNSL68kContextNotSupported no 68k allowed --4009 noHelpForItem noHelpForItem --4008 badProfileError badProfileError --4007 colorSyncNotInstalled colorSyncNotInstalled --4006 pickerCantLive pickerCantLive --4005 cantLoadPackage cantLoadPackage --4004 cantCreatePickerWindow cantCreatePickerWindow --4003 cantLoadPicker cantLoadPicker --4002 pickerResourceError pickerResourceError --4001 requiredFlagsDontMatch requiredFlagsDontMatch --4000 firstPickerError firstPickerError --3285 kOTPortLostConnection --3284 kOTUserRequestedErr --3283 kOTConfigurationChangedErr --3282 kOTBadConfigurationErr --3281 kOTPortWasEjectedErr --3280 kOTPortHasDiedErr --3279 kOTClientNotInittedErr --3278 kENOMSGErr --3277 kESRCHErr --3276 kEINPROGRESSErr --3275 kENODATAErr --3274 kENOSTRErr --3273 kECANCELErr --3272 kEBADMSGErr --3271 kENOSRErr --3270 kETIMEErr --3269 kEPROTOErr ‚‚‚ fill out missing codes ‚‚‚ --3264 kEHOSTUNREACHErr No route to host --3263 kEHOSTDOWNErr Host is down --3260 kECONNREFUSEDErr Connection refused --3259 kETIMEDOUTErr Connection timed out --3258 kETOOMANYREFSErr Too many references: can't splice --3257 kESHUTDOWNErr Can't send after socket shutdown --3256 kENOTCONNErr Socket is not connected --3255 kEISCONNErr Socket is already connected --3254 kENOBUFSErr No buffer space available --3253 kECONNRESETErr Connection reset by peer --3252 kECONNABORTEDErr Software caused connection abort --3251 kENETRESETErr Network dropped connection on reset --3250 kENETUNREACHErr Network is unreachable --3249 kENETDOWNErr Network is down --3248 kEADDRNOTAVAILErr Can't assign requested address --3247 kEADDRINUSEErr Address already in use --3244 kEOPNOTSUPPErr Operation not supported on socket --3243 kESOCKTNOSUPPORTErr Socket type not supported --3242 kEPROTONOSUPPORTErr Protocol not supported --3241 kENOPROTOOPTErr Protocol not available --3240 kEPROTOTYPEErr Protocol wrong type for socket --3239 kEMSGSIZEErr Message too long --3238 kEDESTADDRREQErr Destination address required --3237 kENOTSOCKErr Socket operation on non-socket --3236 kEALREADYErr --3234 kEWOULDBLOCKErr Call would block, so was aborted --3233 kERANGEErr Message size too large for STREAM --3231 kEPIPEErr Broken pipe --3224 kENOTTYErr Not a character device --3221 kEINVALErr Invalid argument --3218 kENODEVErr No such device --3216 kOTDuplicateFoundErr OT generic duplicate found error --3215 kEBUSYErr Device or resource busy --3213 kEFAULTErr Bad address --3212 kEACCESErr Permission denied --3211 kOTOutOfMemoryErr OT ran out of memory, may be a temporary --3210 kEAGAINErr Try operation again later --3208 kEBADFErr Bad file number --3205 kENXIOErr No such device or address --3204 kEIOErr I/O error --3203 kEINTRErr Interrupted system service --3202 kENORSRCErr No such resource --3201 kOTNotFoundErr OT generic not found error --3200 kEPERMErr Permission denied --3180 kOTCanceledErr XTI2OSStatus(TCANCELED) The command was cancelled --3179 kOTBadSyncErr XTI2OSStatus(TBADSYNC) A synchronous call at interrupt time --3178 kOTProtocolErr XTI2OSStatus(TPROTO) An unspecified provider error occurred --3177 kOTQFullErr XTI2OSStatus(TQFULL) --3176 kOTResAddressErr XTI2OSStatus(TRESADDR) --3175 kOTResQLenErr XTI2OSStatus(TRESQLEN) --3174 kOTProviderMismatchErr XTI2OSStatus(TPROVMISMATCH) Tried to accept on incompatible endpoint --3173 kOTIndOutErr XTI2OSStatus(TINDOUT) Accept failed because of pending listen --3172 kOTAddressBusyErr XTI2OSStatus(TADDRBUSY) Address requested is already in use --3171 kOTBadQLenErr XTI2OSStatus(TBADQLEN) A Bind to an in-use addr with qlen > 0 --3170 kOTBadNameErr XTI2OSStatus(TBADNAME) A bad endpoint name was supplied --3169 kOTNoStructureTypeErr XTI2OSStatus(TNOSTRUCTYPE) Bad structure type requested for OTAlloc --3168 kOTStateChangeErr XTI2OSStatus(TSTATECHNG) State is changing - try again later --3167 kOTNotSupportedErr XTI2OSStatus(TNOTSUPPORT) Command is not supported --3166 kOTNoReleaseErr XTI2OSStatus(TNOREL) No orderly release indication available --3165 kOTBadFlagErr XTI2OSStatus(TBADFLAG) A Bad flag value was supplied --3164 kOTNoUDErrErr XTI2OSStatus(TNOUDERR) No Unit Data Error indication available --3163 kOTNoDisconnectErr XTI2OSStatus(TNODIS) No disconnect indication available --3162 kOTNoDataErr XTI2OSStatus(TNODATA) No data available for reading --3161 kOTFlowErr XTI2OSStatus(TFLOW) Provider is flow-controlled --3160 kOTBufferOverflowErr XTI2OSStatus(TBUFOVFLW) Passed buffer not big enough --3159 kOTBadDataErr XTI2OSStatus(TBADDATA) An illegal amount of data was specified --3158 kOTLookErr XTI2OSStatus(TLOOK) An event occurred - call Look() --3157 kOTSysErrorErr XTI2OSStatus(TSYSERR) A system error occurred --3156 kOTBadSequenceErr XTI2OSStatus(TBADSEQ) Sequence specified does not exist --3155 kOTOutStateErr XTI2OSStatus(TOUTSTATE) Call issued in wrong state --3154 kOTNoAddressErr XTI2OSStatus(TNOADDR) No address was specified --3153 kOTBadReferenceErr XTI2OSStatus(TBADF) Bad provider reference --3152 kOTAccessErr XTI2OSStatus(TACCES) Missing access permission --3151 kOTBadOptionErr XTI2OSStatus(TBADOPT) A Bad option was specified --3150 kOTBadAddressErr XTI2OSStatus(TBADADDR) A Bad address was specified --3109 sktClosedErr sktClosedErr --3108 recNotFnd recNotFnd --3107 atpBadRsp atpBadRsp --3106 atpLenErr atpLenErr --3105 readQErr readQErr --3104 extractErr extractErr --3103 ckSumErr ckSumErr --3102 noMPPErr noMPPErr --3101 buf2SmallErr buf2SmallErr --3032 noPrefAppErr noPrefAppErr --3031 badTranslationSpecErr badTranslationSpecErr --3030 noTranslationPathErr noTranslationPathErr --3026 couldNotParseSourceFileErr Source document does not contain source type --3025 invalidTranslationPathErr Source type to destination type not a valid path --3005 retryComponentRegistrationErr retryComponentRegistrationErr --3004 unresolvedComponentDLLErr unresolvedComponentDLLErr --3003 componentDontRegister componentDontRegister --3002 componentNotCaptured componentNotCaptured --3001 validInstancesExist validInstancesExist --3000 invalidComponentID invalidComponentID --2899 cfragLastErrCode The last value in the range of CFM errors. --2831 cfragOutputLengthErr An output parameter is too small to hold the value. --2830 cfragAbortClosureErr Used by notification handlers to abort a closure. --2829 cfragClosureIDErr The closure ID was not valid. --2828 cfragContainerIDErr The fragment container ID was not valid. --2827 cfragNoRegistrationErr The registration name was not found. --2826 cfragNotClosureErr The closure ID was actually a connection ID. --2825 cfragFileSizeErr A file was too large to be mapped. --2824 cfragFragmentUsageErr A semantic error in usage of the fragment. --2823 cfragArchitectureErr A fragment has an unacceptable architecture. --2822 cfragNoApplicationErr No application member found in the cfrg resource. --2821 cfragInitFunctionErr A fragment's initialization routine returned an error. --2820 cfragFragmentCorruptErr A fragment's container was corrupt (known format). --2819 cfragCFMInternalErr An internal inconstistancy has been detected. --2818 cfragCFMStartupErr Internal error during CFM initialization. --2817 cfragLibConnErr --2816 cfragInitAtBootErr A boot library has an initialization function. (System 7 only) --2815 cfragInitLoopErr Circularity in required initialization order. --2814 cfragImportTooNewErr An import library was too new for a client. --2813 cfragImportTooOldErr An import library was too old for a client. --2812 cfragInitOrderErr --2811 cfragNoIDsErr No more CFM IDs for contexts, connections, etc. --2810 cfragNoClientMemErr Out of memory for fragment mapping or section instances. --2809 cfragNoPrivateMemErr Out of memory for internal bookkeeping. --2808 cfragNoPositionErr The registration insertion point was not found. --2807 cfragUnresolvedErr A fragment had "hard" unresolved imports. --2806 cfragFragmentFormatErr A fragment's container format is unknown. --2805 cfragDupRegistrationErr The registration name was already in use. --2804 cfragNoLibraryErr The named library was not found. --2803 cfragNoSectionErr The specified section was not found. --2802 cfragNoSymbolErr The specified symbol was not found. --2801 cfragConnectionIDErr The connection ID was not valid. --2800 cfragFirstErrCode The first value in the range of CFM errors. --2780 errASInconsistentNames English errors: --2763 errASNoResultReturned The range -2780 thru -2799 is reserved for dialect specific error codes. (Error codes from different dialects may overlap.) --2762 errASParameterNotForEvent errASParameterNotForEvent --2761 errASIllegalFormalParameter errASIllegalFormalParameter --2760 errASTerminologyNestingTooDeep errASTerminologyNestingTooDeep --2755 OSAControlFlowError Signaled when illegal control flow occurs in an application (no catcher for throw, non-lexical loop exit, etc.) --2754 OSAInconsistentDeclarations Signaled when a variable is declared inconsistently in the same scope, such as both local and global --2753 OSAUndefinedVariable Signaled when a variable is accessed that has no value --2752 OSADuplicateHandler Signaled when more than one handler is defined with the same name in a scope where the language doesn't allow it --2751 OSADuplicateProperty Signaled when a formal parameter, local variable, or instance variable is specified more than once. --2750 OSADuplicateParameter Signaled when a formal parameter, local variable, or instance variable is specified more than once --2742 OSATokenTooLong Signaled when a name or number is too long to be parsed --2741 OSASyntaxTypeError Signaled when another form of syntax was expected. (e.g. "expected a <type> but found <this>") --2740 OSASyntaxError Signaled when a syntax error occurs. (e.g. "Syntax error" or "<this> can't go after <that>") --2721 errASCantCompareMoreThan32k Parser/Compiler errors: --2720 errASCantConsiderAndIgnore errASCantConsiderAndIgnore --2710 errOSACantCreate errOSACantCreate --2709 errOSACantGetTerminology errOSACantGetTerminology --2708 errOSADataBlockTooLarge Signaled when an intrinsic limitation is exceeded for the size of a value or data structure. --2707 errOSAInternalTableOverflow Signaled when a runtime internal data structure overflows --2706 errOSAStackOverflow Signaled when the runtime stack overflows --2705 errOSACorruptTerminology Signaled when an application's terminology resource is not readable --2704 errOSAAppNotHighLevelEventAware Signaled when an application can't respond to AppleEvents --2703 errOSACantLaunch Signaled when application can't be launched or when it is remote and program linking is not enabled --2702 errOSANumericOverflow Signaled when integer or real value is too large to be represented --2701 errOSADivideByZero Signaled when there is an attempt to divide by zero --2700 errOSAGeneralError Signaled by user scripts or applications when no actual error code is to be returned. --2582 noIconDataAvailableErr The necessary icon data is not available --2581 noSuchIconErr The requested icon could not be found --2580 invalidIconRefErr The icon ref is not valid --2557 nrCallNotSupported This call is not available or supported on this machine --2556 nrTransactionAborted transaction was aborted --2555 nrExitedIteratorScope outer scope of iterator was exited --2554 nrIterationDone iteration operation is done --2553 nrPropertyAlreadyExists property already exists --2552 nrInvalidEntryIterationOp invalid entry iteration operation --2551 nrPathBufferTooSmall buffer for path is too small --2550 nrPathNotFound a path component lookup failed --2549 nrResultCodeBase nrResultCodeBase --2548 nrOverrunErr nrOverrunErr --2547 nrNotModifiedErr nrNotModifiedErr --2546 nrTypeMismatchErr nrTypeMismatchErr --2545 nrPowerSwitchAbortErr nrPowerSwitchAbortErr --2544 nrPowerErr nrPowerErr --2543 nrDataTruncatedErr nrDataTruncatedErr --2542 nrNotSlotDeviceErr nrNotSlotDeviceErr --2541 nrNameErr nrNameErr --2540 nrNotCreatedErr nrNotCreatedErr --2539 nrNotFoundErr nrNotFoundErr --2538 nrInvalidNodeErr nrInvalidNodeErr --2537 nrNotEnoughMemoryErr nrNotEnoughMemoryErr --2536 nrLockedErr nrLockedErr --2526 mmInternalError mmInternalError --2524 tsmDefaultIsNotInputMethodErr Current Input source is KCHR or uchr, not Input Method (GetDefaultInputMethod) --2523 tsmNoStem No stem exists for the token --2522 tsmNoMoreTokens No more tokens are available for the source text --2521 tsmNoHandler No Callback Handler exists for callback --2520 tsmInvalidContext Invalid TSMContext specified in call --2519 tsmUnknownErr any other errors --2518 tsmUnsupportedTypeErr unSupported interface type error --2517 tsmScriptHasNoIMErr script has no imput method or is using old IM --2516 tsmInputMethodIsOldErr returned by GetDefaultInputMethod --2515 tsmComponentAlreadyOpenErr text service already opened for the document --2514 tsmTSNotOpenErr text service is not open --2513 tsmTSHasNoMenuErr the text service has no menu --2512 tsmUseInputWindowErr not TSM aware because we are using input window --2511 tsmDocumentOpenErr there are open documents --2510 tsmTextServiceNotFoundErr no text service found --2509 tsmCantOpenComponentErr canÕt open the component --2508 tsmNoOpenTSErr no open text service --2507 tsmDocNotActiveErr document is NOT active --2506 tsmTSMDocBusyErr document is still active --2505 tsmInvalidDocIDErr invalid TSM documentation id --2504 tsmNeverRegisteredErr app never registered error (not TSM aware) --2503 tsmAlreadyRegisteredErr want to register again error --2502 tsmNotAnAppErr not an application error --2501 tsmInputMethodNotFoundErr tsmInputMethodNotFoundErr --2500 tsmUnsupScriptLanguageErr tsmUnsupScriptLanguageErr --2499 kernelUnrecoverableErr kernelUnrecoverableErr --2422 kernelReturnValueErr kernelReturnValueErr --2421 kernelAlreadyFreeErr kernelAlreadyFreeErr --2419 kernelIDErr kernelIDErr --2418 kernelExceptionErr kernelExceptionErr --2417 kernelTerminatedErr kernelTerminatedErr --2416 kernelInUseErr kernelInUseErr --2415 kernelTimeoutErr kernelTimeoutErr --2414 kernelAsyncReceiveLimitErr kernelAsyncReceiveLimitErr --2413 kernelAsyncSendLimitErr kernelAsyncSendLimitErr --2412 kernelAttributeErr kernelAttributeErr --2411 kernelExecutionLevelErr kernelExecutionLevelErr --2410 kernelDeletePermissionErr kernelDeletePermissionErr --2409 kernelExecutePermissionErr kernelExecutePermissionErr --2408 kernelReadPermissionErr kernelReadPermissionErr --2407 kernelWritePermissionErr kernelWritePermissionErr --2406 kernelObjectExistsErr kernelObjectExistsErr --2405 kernelUnsupportedErr kernelUnsupportedErr --2404 kernelPrivilegeErr kernelPrivilegeErr --2403 kernelOptionsErr kernelOptionsErr --2402 kernelCanceledErr kernelCanceledErr --2401 kernelIncompleteErr kernelIncompleteErr --2209 badCallOrderErr Usually due to a status call being called prior to being setup first --2208 noDMAErr CanÕt do DMA digitizing (i.e. can't go to requested dest --2207 badDepthErr CanÕt digitize into this depth --2206 notExactSizeErr CanÕt do exact size requested --2205 noMoreKeyColorsErr all key indexes in use --2204 notExactMatrixErr warning of bad matrix, digitizer did its best --2203 matrixErr bad matrix, digitizer did nothing --2202 qtParamErr bad input parameter (out of range, etc) --2201 digiUnimpErr feature unimplemented --2159 qtXMLApplicationErr qtXMLApplicationErr --2158 qtXMLParseErr qtXMLParseErr --2157 qtActionNotHandledErr qtActionNotHandledErr --2149 notEnoughDataErr notEnoughDataErr --2148 urlDataHFTPURLErr urlDataHFTPURLErr --2147 urlDataHFTPServerDisconnectedErr urlDataHFTPServerDisconnectedErr --2146 urlDataHFTPNoPasswordErr urlDataHFTPNoPasswordErr --2145 urlDataHFTPNeedPasswordErr urlDataHFTPNeedPasswordErr --2144 urlDataHFTPBadNameListErr urlDataHFTPBadNameListErr --2143 urlDataHFTPNoNetDriverErr urlDataHFTPNoNetDriverErr --2142 urlDataHFTPFilenameErr urlDataHFTPFilenameErr --2141 urlDataHFTPPermissionsErr urlDataHFTPPermissionsErr --2140 urlDataHFTPQuotaErr urlDataHFTPQuotaErr --2139 urlDataHFTPNoDirectoryErr urlDataHFTPNoDirectoryErr --2138 urlDataHFTPDataConnectionErr urlDataHFTPDataConnectionErr --2137 urlDataHFTPServerErr urlDataHFTPServerErr --2136 urlDataHFTPBadPasswordErr urlDataHFTPBadPasswordErr --2135 urlDataHFTPBadUserErr urlDataHFTPBadUserErr --2134 urlDataHFTPShutdownErr urlDataHFTPShutdownErr --2133 urlDataHFTPProtocolErr urlDataHFTPProtocolErr --2132 urlDataHHTTPRedirectErr urlDataHHTTPRedirectErr --2131 urlDataHHTTPURLErr urlDataHHTTPURLErr --2130 urlDataHHTTPNoNetDriverErr urlDataHHTTPNoNetDriverErr --2129 urlDataHHTTPProtocolErr urlDataHHTTPProtocolErr --2127 qtNetworkAlreadyAllocatedErr qtNetworkAlreadyAllocatedErr --2126 notAllowedToSaveMovieErr notAllowedToSaveMovieErr --2125 fileOffsetTooBigErr fileOffsetTooBigErr --2124 ASDEntryNotFoundErr ASDEntryNotFoundErr --2123 ASDBadForkErr ASDBadForkErr --2122 ASDBadHeaderErr ASDBadHeaderErr --2121 AAPNotFoundErr AAPNotFoundErr --2120 AAPNotCreatedErr AAPNotCreatedErr --2119 qfcbNotCreatedErr qfcbNotCreatedErr --2118 qfcbNotFoundErr qfcbNotFoundErr --2117 wackBadMetaDataErr wackBadMetaDataErr --2116 wackForkNotFoundErr wackForkNotFoundErr --2115 wackBadFileErr wackBadFileErr --2114 unknownFormatErr unknownFormatErr --2113 pathNotVerifiedErr pathNotVerifiedErr --2112 noPathMappingErr noPathMappingErr --2111 emptyPathErr emptyPathErr --2110 pathTooLongErr pathTooLongErr --2109 cannotBeLeafAtomErr cannotBeLeafAtomErr --2108 invalidAtomTypeErr invalidAtomTypeErr --2107 invalidAtomContainerErr invalidAtomContainerErr --2106 invalidAtomErr invalidAtomErr --2105 duplicateAtomTypeAndIDErr duplicateAtomTypeAndIDErr --2104 atomIndexInvalidErr atomIndexInvalidErr --2103 atomsNotOfSameTypeErr atomsNotOfSameTypeErr --2102 notLeafAtomErr notLeafAtomErr --2101 cannotFindAtomErr cannotFindAtomErr --2097 unsupportedProcessorErr unsupportedProcessorErr --2096 unsupportedOSErr unsupportedOSErr --2095 qtmlUninitialized qtmlUninitialized --2094 qtmlDllEntryNotFoundErr Windows specific errors (when qtml is loading) --2093 qtmlDllLoadErr Windows specific errors (when qtml is loading) --2092 componentDllEntryNotFoundErr Windows specific errors (when component is loading) --2091 componentDllLoadErr Windows specific errors (when component is loading) --2090 videoOutputInUseErr videoOutputInUseErr --2089 noExportProcAvailableErr noExportProcAvailableErr --2087 tuneParseOSErr tuneParseOSErr --2086 tunePlayerFullOSErr tunePlayerFullOSErr --2085 noteChannelNotAllocatedOSErr noteChannelNotAllocatedOSErr --2084 illegalNoteChannelOSErr illegalNoteChannelOSErr --2083 synthesizerOSErr synthesizerOSErr --2082 synthesizerNotRespondingOSErr synthesizerNotRespondingOSErr --2081 midiManagerAbsentOSErr midiManagerAbsentOSErr --2080 illegalControllerOSErr illegalControllerOSErr --2079 illegalInstrumentOSErr illegalInstrumentOSErr --2078 illegalKnobValueOSErr illegalKnobValueOSErr --2077 illegalKnobOSErr illegalKnobOSErr --2076 illegalChannelOSErr illegalChannelOSErr --2075 illegalPartOSErr illegalPartOSErr --2074 illegalVoiceAllocationOSErr illegalVoiceAllocationOSErr --2073 cantReceiveFromSynthesizerOSErr cantReceiveFromSynthesizerOSErr --2072 cantSendToSynthesizerOSErr cantSendToSynthesizerOSErr --2071 notImplementedMusicOSErr notImplementedMusicOSErr --2070 internalComponentErr internalComponentErr --2069 invalidSpriteIDErr invalidSpriteIDErr --2068 invalidImageIndexErr invalidImageIndexErr --2067 invalidSpriteIndexErr invalidSpriteIndexErr --2066 gWorldsNotSameDepthAndSizeErr gWorldsNotSameDepthAndSizeErr --2065 invalidSpritePropertyErr invalidSpritePropertyErr --2064 invalidSpriteWorldPropertyErr invalidSpriteWorldPropertyErr --2063 missingRequiredParameterErr missingRequiredParameterErr --2062 movieTextNotFoundErr movieTextNotFoundErr --2061 sourceNotFoundErr sourceNotFoundErr --2060 noSourceTreeFoundErr noSourceTreeFoundErr --2059 samplesAlreadyInMediaErr samplesAlreadyInMediaErr --2058 auxiliaryExportDataUnavailable auxiliaryExportDataUnavailable --2057 unsupportedAuxiliaryImportData unsupportedAuxiliaryImportData --2056 soundSupportNotAvailableErr QT for Windows error --2055 noSoundTrackInMovieErr QT for Windows error --2054 noVideoTrackInMovieErr QT for Windows error --2053 featureUnsupported featureUnsupported --2052 couldNotUseAnExistingSample couldNotUseAnExistingSample --2051 noDefaultDataRef noDefaultDataRef --2050 badDataRefIndex badDataRefIndex --2049 invalidDataRefContainer invalidDataRefContainer --2048 noMovieFound noMovieFound --2047 dataNoDataRef dataNoDataRef --2046 endOfDataReached endOfDataReached --2045 dataAlreadyClosed dataAlreadyClosed --2044 dataAlreadyOpenForWrite dataAlreadyOpenForWrite --2043 dataNotOpenForWrite dataNotOpenForWrite --2042 dataNotOpenForRead dataNotOpenForRead --2041 invalidSampleDescription invalidSampleDescription --2040 invalidChunkCache invalidChunkCache --2039 invalidSampleDescIndex invalidSampleDescIndex --2038 invalidChunkNum invalidChunkNum --2037 invalidSampleNum invalidSampleNum --2036 invalidRect invalidRect --2035 cantEnableTrack cantEnableTrack --2034 internalQuickTimeError internalQuickTimeError --2033 badEditIndex badEditIndex --2032 timeNotInMedia timeNotInMedia --2031 timeNotInTrack timeNotInTrack --2030 trackNotInMovie trackNotInMovie --2029 trackIDNotFound trackIDNotFound --2028 badTrackIndex badTrackIndex --2027 maxSizeToGrowTooSmall maxSizeToGrowTooSmall --2026 userDataItemNotFound userDataItemNotFound --2025 staleEditState staleEditState --2024 nonMatchingEditState nonMatchingEditState --2023 invalidEditState invalidEditState --2022 cantCreateSingleForkFile happens when file already exists --2021 wfFileNotFound wfFileNotFound --2020 movieToolboxUninitialized movieToolboxUninitialized --2019 progressProcAborted progressProcAborted --2018 mediaTypesDontMatch mediaTypesDontMatch --2017 badEditList badEditList --2016 cantPutPublicMovieAtom cantPutPublicMovieAtom --2015 invalidTime invalidTime --2014 invalidDuration invalidDuration --2013 invalidHandler invalidHandler --2012 invalidDataRef invalidDataRef --2011 invalidSampleTable invalidSampleTable --2010 invalidMovie invalidMovie --2009 invalidTrack invalidTrack --2008 invalidMedia invalidMedia --2007 noDataHandler noDataHandler --2006 noMediaHandler noMediaHandler --2005 badComponentType badComponentType --2004 cantOpenHandler cantOpenHandler --2003 cantFindHandler cantFindHandler --2002 badPublicMovieAtom badPublicMovieAtom --2001 badImageDescription badImageDescription --2000 couldNotResolveDataRef couldNotResolveDataRef --1862 nonDragOriginatorErr illegal attempt at originator only data --1861 badImageErr bad translucent image PixMap --1860 badImageRgnErr bad translucent image region --1859 noSuitableDisplaysErr no displays support translucency --1858 unsupportedForPlatformErr call is for PowerPC only --1857 dragNotAcceptedErr drag was not accepted by receiver --1856 handlerNotFoundErr handler not found --1855 duplicateHandlerErr handler already exists --1854 cantGetFlavorErr error while trying to get flavor data --1853 duplicateFlavorErr flavor type already exists --1852 badDragFlavorErr unknown flavor type --1851 badDragItemErr unknown drag item reference --1850 badDragRefErr unknown drag reference --1813 errEndOfBody errEndOfBody --1812 errEndOfDocument errEndOfDocument --1811 errTopOfBody errTopOfBody --1810 errTopOfDocument errTopOfDocument --1801 errOffsetIsOutsideOfView errOffsetIsOutsideOfView --1800 errOffsetInvalid errOffsetInvalid --1762 errOSACantOpenComponent Can't connect to scripting system with that ID --1761 errOSAComponentMismatch Parameters are from 2 different components --1759 errOSADataFormatTooNew errOSADataFormatTooNew --1758 errOSADataFormatObsolete errOSADataFormatObsolete --1757 errOSANoSuchDialect errOSANoSuchDialect --1756 errOSASourceNotAvailable errOSASourceNotAvailable --1754 errOSABadSelector errOSABadSelector --1753 errOSAScriptError errOSAScriptError --1752 errOSABadStorageType errOSABadStorageType --1751 errOSAInvalidID errOSAInvalidID --1750 errOSASystemError errOSASystemError --1741 errAEBufferTooSmall buffer for AEFlattenDesc too small --1740 errAEBuildSyntaxError AEBuildDesc and friends detected a syntax error --1739 errAEDescIsNull attempting to perform an invalid operation on a null descriptor --1738 errAEStreamAlreadyConverted attempt to convert a stream that has already been converted --1737 errAEStreamBadNesting nesting violation while streaming --1736 errAEDuplicateHandler attempt to install handler in table for identical class and id (1.1 or greater) --1735 errAEEventFiltered event has been filtered, and should not be propogated (1.1 or greater) --1734 errAEReceiveEscapeCurrent break out of only lowest level of AEReceive (1.1 or greater) --1733 errAEReceiveTerminate break out of all levels of AEReceive to the topmost (1.1 or greater) --1732 errAERecordingIsAlreadyOn available only in version 1.0.1 or greater --1731 errAEUnknownObjectType available only in version 1.0.1 or greater --1730 errAEEmptyListContainer Attempt to pass empty list as container to accessor --1729 errAENegativeCount CountProc returned negative value --1728 errAENoSuchObject e.g.,: specifier asked for the 3rd, but there are only 2. Basically, this indicates a run-time resolution error. --1727 errAENotAnObjSpec Param to AEResolve not of type 'obj ' --1726 errAEBadTestKey Test is neither typeLogicalDescriptor nor typeCompDescriptor --1725 errAENoSuchLogical Something other than AND, OR, or NOT --1723 errAEAccessorNotFound Accessor proc matching wantClass and containerType or wildcards not found --1721 errAEWrongNumberArgs Logical op kAENOT used with other than 1 term --1720 errAEImpossibleRange A range like 3rd to 2nd, or 1st to all. --1719 errAEIllegalIndex index is out of range in a put operation --1718 errAEReplyNotArrived the contents of the reply you are accessing have not arrived yet --1717 errAEHandlerNotFound no handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler --1716 errAEUnknownAddressType the target address type is not known --1715 errAEParamMissed a required parameter was not accessed --1714 errAENotASpecialFunction there is no special function for/with this keyword --1713 errAENoUserInteraction no user interaction is allowed --1712 errAETimeout the AppleEvent timed out --1711 errAEWaitCanceled in AESend, the user cancelled out of wait loop for reply or receipt --1710 errAEUnknownSendMode mode wasn't NoReply, WaitReply, or QueueReply or Interaction level is unknown --1709 errAEReplyNotValid AEResetTimer was passed an invalid reply parameter --1708 errAEEventNotHandled the AppleEvent was not handled by any handler --1707 errAENotAppleEvent the event is not in AppleEvent format --1706 errAENewerVersion need newer version of the AppleEvent manager --1705 errAEBadListItem the specified list item does not exist --1704 errAENotAEDesc errAENotAEDesc --1703 errAEWrongDataType errAEWrongDataType --1702 errAECorruptData errAECorruptData --1701 errAEDescNotFound errAEDescNotFound --1700 errAECoercionFail bad parameter data or unable to coerce the data supplied --1424 errFSIteratorNotSupported The iterator's flags or container are not supported by this call --1423 errFSIteratorNotFound Passed FSIterator is not an open iterator --1422 errFSBadIteratorFlags Flags passed to FSOpenIterator are bad --1421 errFSForkExists Named fork already exists. --1420 errFSRefsDifferent FSCompareFSRefs; refs are for different objects --1419 errFSBadSearchParams Something wrong with CatalogSearch searchParams --1418 errFSBadItemCount maximumItems was zero --1417 errFSNoMoreItems Iteration ran out of items to return --1413 errFSBadAllocFlags Invalid bits set in allocationFlags --1412 errFSBadPosMode Newline bits set in positionMode --1411 errFSMissingName A Unicode name parameter was NULL or nameLength parameter was zero --1410 errFSNameTooLong File/fork name is too long to create/rename --1409 errFSForkNotFound Named fork does not exist --1407 errFSNotAFolder Expected a folder, got a file --1406 errFSMissingCatInfo A CatalogInfo parameter was NULL --1405 errFSBadInfoBitmap A CatalogInfoBitmap or VolumeInfoBitmap has reserved or invalid bits set --1404 errFSBadForkRef A ForkRefNum parameter was bad --1403 errFSBadBuffer A buffer parameter was bad --1402 errFSBadForkName Fork name parameter is bad --1401 errFSBadFSRef FSRef parameter is bad --1400 errFSUnknownCall selector is not recognized by this filesystem --1327 badFCBErr FCBRecPtr is not valid --1311 volVMBusyErr can't eject because volume is in use by VM --1310 fsDataTooBigErr file or volume is too big for system --1309 fileBoundsErr file's EOF, offset, mark or size is too big --1308 notARemountErr when _Mount allows only remounts and doesn't get one --1307 badFidErr file id is dangling or doesn't match with the file number --1306 sameFileErr can't exchange a file with itself --1305 desktopDamagedErr desktop database files are corrupted --1304 catChangedErr the catalog has been modified --1303 diffVolErr files on different volumes --1302 notAFileErr directory specified --1301 fidExists file id already exists --1300 fidNotFound no file thread exists. --1280 errRefNum bad connection refNum --1279 errAborted control call was aborted --1278 errState bad connection state for this operation --1277 errOpening open connection request failed --1276 errAttention attention message too long --1275 errFwdReset read terminated by forward reset --1274 errDSPQueueSize DSP Read/Write Queue Too small --1273 errOpenDenied open connection request was denied --1105 reqAborted reqAborted --1104 noDataArea noDataArea --1103 noSendResp noSendResp --1102 cbNotFound cbNotFound --1101 noRelErr noRelErr --1100 badBuffNum badBuffNum --1099 badATPSkt badATPSkt --1098 tooManySkts tooManySkts --1097 tooManyReqs tooManyReqs --1096 reqFailed reqFailed --1075 aspNoAck No ack on attention request (server err) --1074 aspTooMany Too many clients (server error) --1073 aspSizeErr Command block too big --1072 aspSessClosed Session closed --1071 aspServerBusy Server cannot open another session --1070 aspParamErr Parameter error --1069 aspNoServers No servers at that address --1068 aspNoMoreSess No more sessions on server --1067 aspBufTooSmall Buffer too small --1066 aspBadVersNum Server cannot support this ASP version --1029 nbpNISErr Error trying to open the NIS --1028 nbpNotFound Name not found on remove --1027 nbpDuplicate Duplicate name exists already --1026 nbpConfDiff Name confirmed at different socket --1025 nbpNoConfirm nbpNoConfirm --1024 nbpBuffOvr Buffer overflow in LookupName --1000 noMaskFoundErr Icon Utilties Error --985 kFMFontContainerAccessErr kFMFontContainerAccessErr --984 kFMFontTableAccessErr kFMFontTableAccessErr --983 kFMIterationScopeModifiedErr kFMIterationScopeModifiedErr --982 kFMInvalidFontErr kFMInvalidFontErr --981 kFMInvalidFontFamilyErr kFMInvalidFontFamilyErr --980 kFMIterationCompleted kFMIterationCompleted --932 guestNotAllowedErr destination port requires authentication --931 badLocNameErr location name malformed --930 badServiceMethodErr illegal service type, or not supported --928 noUserRecErr Invalid user reference number --927 authFailErr unable to authenticate user at destination --926 noInformErr PPCStart failed because destination did not have inform pending --925 networkErr An error has occurred in the network, not too likely --924 noUserRefErr unable to create a new userRefNum --923 notLoggedInErr The default userRefNum does not yet exist --922 noDefaultUserErr user hasn't typed in owners name in Network Setup Control Pannel --919 badPortNameErr PPCPortRec malformed --917 sessClosedErr session was closed --916 portClosedErr port was closed --915 noResponseErr unable to contact destination --914 noToolboxNameErr A system resource is missing, not too likely --913 noMachineNameErr user hasn't named his Macintosh in the Network Setup Control Panel --912 userRejectErr Destination rejected the session request --911 noUserNameErr user name unknown on destination machine --910 portNameExistsErr port is already open (perhaps in another app) --909 badReqErr bad parameter or invalid state for operation --908 noSessionErr Invalid session reference number --907 sessTableErr Out of session tables, try again later --906 destPortErr Port does not exist at destination --905 localOnlyErr Network activity is currently disabled --904 noGlobalsErr The system is hosed, better re-boot --903 noPortErr Unable to open port or bad portRefNum. If you're calling --902 nameTypeErr Invalid or inappropriate locationKindSelector in locationName --900 notInitErr PPCToolBox not initialized --877 notAppropriateForClassic This application won't or shouldn't run on Classic (Problem 2481058). --876 appVersionTooOld The application's creator and version are incompatible with the current version of Mac OS. --875 wrongApplicationPlatform The application could not launch because the required platform is not available --863 hmCloseViewActive Returned from HMRemoveBalloon if CloseView was active --862 hmNoBalloonUp Returned from HMRemoveBalloon if no balloon was visible when call was made --861 hmOperationUnsupported Returned from HMShowBalloon call if bad method passed to routine --859 hmUnknownHelpType Returned if help msg record contained a bad type --858 hmWrongVersion Returned if help mgr resource was the wrong version --857 hmSkippedBalloon Returned from calls if helpmsg specified a skip balloon --855 hmHelpManagerNotInited Returned from HMGetHelpMenuHandle if help menu not setup --854 hmSameAsLastBalloon Returned from HMShowMenuBalloon if menu & item is same as last time --853 hmBalloonAborted Returned if mouse was moving or mouse wasn't in window port rect --850 hmHelpDisabled Show Balloons mode was off, call to routine ignored --813 rcDBPackNotInited attempt to call other routine before InitDBPack --812 rcDBWrongVersion incompatible versions --811 rcDBNoHandler no app handler for specified data type --810 rcDBBadAsyncPB tried to kill a bad pb --809 rcDBAsyncNotSupp ddev does not support async calls --808 rcDBBadDDEV bad ddev specified on DBInit --807 rcDBBadSessNum bad session number for DBGetConnInfo --806 rcDBBadSessID rcDBBadSessID --805 rcDBExec rcDBExec --804 rcDBBreak rcDBBreak --803 rcDBBadType rcDBBadType --802 rcDBError rcDBError --801 rcDBValue rcDBValue --800 rcDBNull rcDBNull --677 icTooManyProfilesErr too many profiles in database --676 icProfileNotFoundErr profile not found --675 icConfigInappropriateErr incorrect manufacturer code --674 icConfigNotFoundErr no internet configuration was found --673 icNoURLErr no URL found --672 icNothingToOverrideErr no component for the override component to capture --671 icNoMoreWritersErr you cannot begin a write session because someone else is already doing it --670 icTruncatedErr more data was present than was returned --669 icInternalErr Internet Config internal error --668 icPrefDataErr problem with preference data --667 icPermErr cannot set preference --666 icPrefNotFoundErr Internet preference not found --648 vmInvalidOwningProcessErr current process does not own the BackingFileID or FileViewID --647 vmAddressNotInFileViewErr address is not in a FileView --646 vmNoMoreFileViewsErr no more FileViews were found --645 vmFileViewAccessErr requested FileViewAccess cannot be obtained --644 vmInvalidFileViewIDErr invalid FileViewID --643 vmNoMoreBackingFilesErr no more BackingFiles were found --642 vmBusyBackingFileErr open views found on BackingFile --641 vmMappingPrivilegesErr requested MappingPrivileges cannot be obtained --640 vmInvalidBackingFileIDErr invalid BackingFileID --626 noMMUErr no MMU present --625 cannotDeferErr unable to defer additional functions --624 interruptsMaskedErr donÕt call with interrupts masked --623 notLockedErr specified range of memory is not locked --622 cannotMakeContiguousErr cannot make specified range contiguous --621 notHeldErr specified range of memory is not held --620 notEnoughMemoryErr insufficient physical memory --619 threadProtocolErr threadProtocolErr --618 threadNotFoundErr threadNotFoundErr --617 threadTooManyReqsErr threadTooManyReqsErr --610 noUserInteractionAllowed no user interaction allowed --609 connectionInvalid connectionInvalid --608 noOutstandingHLE noOutstandingHLE --607 bufferIsSmall error returns from Post and Accept --606 appIsDaemon app is BG-only, and launch flags disallow this --605 appMemFullErr application SIZE not big enough for launch --604 hardwareConfigErr hardware configuration not correct for call --603 protocolErr app made module calls in improper order --602 appModeErr memory mode is 32-bit, but app not 32-bit clean --601 memFragErr not enough room to launch app w/special requirements --600 procNotFound no eligible process with specified descriptor --503 driverHardwareGoneErr disk driver's hardware was disconnected --502 hwParamErr bad selector for _HWPriv --501 teScrapSizeErr scrap item too big for text edit record --500 rgnTooBigErr rgnTooBigErr --492 exUserBreak user debugger break; execute debugger commands on stack --491 strUserBreak user debugger break; display string on stack --490 userBreak user debugger break --463 notThePublisherWrn not the first registered publisher for that container --462 containerAlreadyOpenWrn container already opened by this section --461 containerNotFoundWrn could not find editionContainer at this time --460 multiplePublisherWrn A Publisher is already registered for that container --454 badSubPartErr can not use sub parts in this release --453 badEditionFileErr edition file is corrupt --452 notRegisteredSectionErr not a registered SectionRecord --451 badSectionErr not a valid SectionRecord --450 editionMgrInitErr edition manager not inited by this app --438 fsmUnknownFSMMessageErr unknown message passed to FSM --437 fsmNoAlternateStackErr no alternate stack for HFS CI --436 fsmBadFSDVersionErr FSM version incompatible with FSD --435 fsmDuplicateFSIDErr FSID already exists on InstallFS --434 fsmBadFSDLenErr FSD size incompatible with current FSM vers --433 fsmBadFFSNameErr Name length not 1 <= length <= 31 --432 fsmBusyFFSErr File system is busy, cannot be removed --431 fsmFFSNotFoundErr Foreign File system does not exist - new Pack2 could return this error too --417 btKeyAttrErr There is no such a key attribute. --416 btKeyLenErr Maximum key length is too long or equal to zero. --415 btRecNotFnd Record cannot be found. --414 btDupRecErr Record already exists. --413 btNoSpace Can't allocate disk space. --410 notBTree The file is not a dictionary. --400 gcrOnMFMErr gcr format on high density media error --360 slotNumErr invalid slot # error --351 smRecNotFnd Record not found in the SRT. --350 smSRTOvrFlErr SRT over flow. --349 smNoGoodOpens No opens were successfull in the loop. --348 smOffsetErr Offset was too big (temporary error --347 smByteLanesErr NumByteLanes was determined to be zero. --346 smBadsPtrErr Bad pointer was passed to sCalcsPointer --345 smsGetDrvrErr Error occurred during _sGetDriver. --344 smNoMoresRsrcs No more sResources --343 smDisDrvrNamErr Error occurred during _sDisDrvrName. --342 smGetDrvrNamErr Error occurred during _sGetDrvrName. --341 smCkStatusErr Status of slot = fail. --340 smBlkMoveErr _BlockMove error --339 smNewPErr _NewPtr error --338 smSelOOBErr Selector out of bounds error --337 smSlotOOBErr Slot out of bounds error --336 smNilsBlockErr Nil sBlock error (Dont allocate and try to use a nil sBlock) --335 smsPointerNil LPointer is nil From sOffsetData. If this error occurs; check sInfo rec for more information. --334 smCPUErr Code revision is wrong --333 smCodeRevErr Code revision is wrong --332 smReservedErr Reserved field not zero --331 smBadsList Bad sList: Id1 < Id2 < Id3 ...format is not followed. --330 smBadRefId Reference Id not found in List --320 smBusErrTO BusError time out. --319 smBadBoardId BoardId was wrong; re-init the PRAM record. --318 smReservedSlot slot is reserved, VM should not use this address space. --317 smInitTblVErr An error occurred while trying to initialize the Slot Resource Table. --316 smInitStatVErr The InitStatusV field was negative after primary or secondary init. --315 smNoBoardId No Board Id. --314 smGetPRErr Error occurred during _sGetPRAMRec (See SIMStatus). --313 smNoBoardSRsrc No Board sResource. --312 smDisposePErr _DisposePointer error --311 smFHBlkDispErr Error occurred during _sDisposePtr (Dispose of FHeader block). --310 smFHBlockRdErr Error occurred during _sGetFHeader. --309 smBLFieldBad ByteLanes field was bad. --308 smUnExBusErr Unexpected BusError --307 smResrvErr Fatal reserved error. Resreved field <> 0. --306 smNosInfoArray No sInfoArray. Memory Mgr error. --305 smDisabledSlot This slot is disabled (-305 use to be smLWTstBad) --304 smNoDir Directory offset is Nil --303 smRevisionErr Wrong revison level --302 smFormatErr FHeader Format is not Apple's --301 smCRCFail CRC check failed for declaration data --300 smEmptySlot No card in slot --299 nmTypErr Notification Manager:wrong queue type --293 smPriInitErr Error; Cards could not be initialized. --292 smPRAMInitErr Error; Slot Resource Table could not be initialized. --291 smSRTInitErr Error; Slot Resource Table could not be initialized. --290 smSDMInitErr Error; SDM could not be initialized. --261 midiInvalidCmdErr command not supported for port type --260 midiDupIDErr duplicate client ID --259 midiNameLenErr name supplied is longer than 31 characters --258 midiWriteErr MIDIWritePacket couldn't write to all connected ports --257 midiNoConErr no connection exists between specified ports --256 midiVConnectRmvd pending virtual connection removed --255 midiVConnectMade pending virtual connection resolved --254 midiVConnectErr pending virtual connection created --253 midiTooManyConsErr too many connections made --252 midiTooManyPortsErr too many ports already installed in the system --251 midiNoPortErr no port with that ID found --250 midiNoClientErr no client with that ID found --247 badInputText badInputText --246 badDictFormat badDictFormat --245 incompatibleVoice incompatibleVoice --244 voiceNotFound voiceNotFound --243 bufTooSmall bufTooSmall --242 synthNotReady synthNotReady --241 synthOpenFailed synthOpenFailed --240 noSynthFound noSynthFound --232 siUnknownQuality invalid quality selector (returned by driver) --231 siUnknownInfoType invalid info type selector (returned by driver) --230 siInputDeviceErr input device hardware failure --229 siBadRefNum invalid input device reference number --228 siBadDeviceName input device could not be opened --227 siDeviceBusyErr input device already in use --226 siInvalidSampleSize invalid sample size --225 siInvalidSampleRate invalid sample rate --224 siHardDriveTooSlow hard drive too slow to record to disk --223 siInvalidCompression invalid compression type --222 siNoBufferSpecified returned by synchronous SPBRecord if nil buffer passed --221 siBadSoundInDevice invalid index passed to SoundInGetIndexedDevice --220 siNoSoundInHardware no Sound Input hardware --213 siVBRCompressionNotSupported vbr audio compression not supported for this operation --212 noMoreRealTime not enough CPU cycles left to add another task --211 channelNotBusy channelNotBusy --210 buffersTooSmall can not operate in the memory allowed --209 channelBusy the Channel is being used for a PFD already --208 badFileFormat was not type AIFF or was of bad format,corrupt --207 notEnoughBufferSpace could not allocate enough memory --206 badFormat Sound Manager Error Returns --205 badChannel Sound Manager Error Returns --204 resProblem Sound Manager Error Returns --203 queueFull Sound Manager Error Returns --201 notEnoughHardwareErr Sound Manager Error Returns --200 noHardwareErr Sound Manager Error Returns --199 mapReadErr map inconsistent with operation --198 resAttrErr attribute inconsistent with operation --197 rmvRefFailed RmveReference failed --196 rmvResFailed RmveResource failed --195 addRefFailed AddReference failed --194 addResFailed AddResource failed --193 resFNotFound Resource file not found --192 resNotFound Resource not found --190 inputOutOfBounds Offset of Count out of bounds --189 writingPastEnd Writing past end of file --188 resourceInMemory Resource already in memory --186 CantDecompress resource bent ("the bends") - can't decompress a compressed resource --185 badExtResource extended resource has a bad format. --182 cmNoCurrentProfile Responder error --181 cmUnsupportedDataType Responder error --180 cmCantDeleteProfile Responder error --179 cmCantXYZ CMM cant handle XYZ space --178 cmCantConcatenateError Profile can't be concatenated --177 cmProfilesIdentical Profiles the same --176 cmProfileNotFound Responder error --175 cmMethodNotFound CMM not present --171 cmMethodError cmMethodError --170 cmProfileError cmProfileError --157 cDepthErr invalid pixel depth --156 cResErr invalid resolution for MakeITable --155 cDevErr invalid type of graphics device --154 cProtectErr colorTable entry protection violation --153 cRangeErr range error on colorTable request --152 cNoMemErr failed to allocate memory for structure --151 cTempMemErr failed to allocate memory for temporary structures --150 cMatchErr Color2Index failed to find an index --149 insufficientStackErr insufficientStackErr --148 pixMapTooDeepErr pixMapTooDeepErr --147 rgnOverflowErr rgnOverflowErr --145 noMemForPictPlaybackErr noMemForPictPlaybackErr --128 userCanceledErr userCanceledErr --127 hMenuFindErr could not find HMenu's parent in MenuKey (wrong error code - obsolete) --126 mBarNFnd system error code for MBDF not found --125 updPixMemErr insufficient memory to update a pixmap --124 volGoneErr Server volume has been disconnected. --123 wrgVolTypErr Wrong volume type error [operation not supported for MFS] --122 badMovErr Move into offspring error --121 tmwdoErr No free WDCB available --120 dirNFErr Directory not found --117 memLockedErr trying to move a locked block (MoveHHi) --116 memSCErr Size Check failed --115 memBCErr Block Check failed --114 memPCErr Pointer Check failed --113 memAZErr Address in zone check failed --112 memPurErr trying to purge a locked or non-purgeable block --111 memWZErr WhichZone failed (applied to free block) --110 memAdrErr address was odd; or out of range --109 nilHandleErr Master Pointer was NIL in HandleZone or other --108 memFullErr Not enough room in heap zone --102 noTypeErr No object of that type in scrap --100 noScrapErr No scrap exists error --99 memROZWarn soft error in ROZ --98 portNotCf driver Open error code (parameter RAM not configured for this connection) --97 portInUse driver Open error code (port is in use) --96 portNotPwr serial port not currently powered --95 excessCollsns excessive collisions on write --94 lapProtErr error in attaching/detaching protocol --93 noBridgeErr no network bridge for non-local send --92 eLenErr Length error ddpLenErr --91 eMultiErr Multicast address error ddpSktErr --90 breakRecd Break received (SCC) --89 rcvrErr SCC receiver error (framing; parity; OR) --88 prInitErr InitUtil found the parameter ram uninitialized --87 prWrErr parameter ram written didn't read-verify --86 clkWrErr time written did not verify --85 clkRdErr unable to read same clock value twice --84 verErr track failed to verify --83 fmt2Err can't get enough sync --82 fmt1Err can't find sector 0 after track format --81 sectNFErr sector number never found on a track --80 seekErr track number wrong on address mark --79 spdAdjErr unable to correctly adjust disk speed --78 twoSideErr tried to read 2nd side on a 1-sided drive --77 initIWMErr unable to initialize IWM --76 tk0BadErr track 0 detect doesn't change --75 cantStepErr step handshake failed --74 wrUnderrun write underrun occurred --73 badDBtSlp bad data mark bit slip nibbles --72 badDCksum bad data mark checksum --71 noDtaMkErr couldn't find a data mark header --70 badBtSlpErr bad addr mark bit slip nibbles --69 badCksmErr addr mark checksum didn't check --68 dataVerErr read verify compare failed --67 noAdrMkErr couldn't find valid addr mark --66 noNybErr couldn't find 5 nybbles in 200 tries --65 offLinErr r/w requested for an off-line drive --64 fontDecError error during font declaration --61 wrPermErr write permissions error --60 badMDBErr bad master directory block --59 fsRnErr file system internal error:during rename the old entry was deleted but could not be restored. --58 extFSErr volume in question belongs to an external fs --57 noMacDskErr not a mac diskette (sig bytes are wrong) --56 nsDrvErr no such drive (tried to mount a bad drive num) --55 volOnLinErr drive volume already on-line at MountVol --54 permErr permissions error (on file open) --53 volOffLinErr volume not on line error (was Ejected) --52 gfpErr get file position error --51 rfNumErr refnum error --50 paramErr error in user parameter list --49 opWrErr file already open with with write permission --48 dupFNErr duplicate filename (rename) --47 fBsyErr File is busy (delete) --46 vLckdErr volume is locked --45 fLckdErr file is locked --44 wPrErr diskette is write protected. --43 fnfErr File not found --42 tmfoErr too many files open --41 mFulErr memory full (open) or file won't fit (load) --40 posErr tried to position to before start of file (r/w) --39 eofErr End of file --38 fnOpnErr File not open --37 bdNamErr there may be no bad names in the final system! --36 ioErr I/O error (bummers) --35 nsvErr no such volume --34 dskFulErr disk full --33 dirFulErr Directory full --30 dceExtErr dce extension error --29 unitTblFullErr unit table has no more entries --28 notOpenErr Couldn't rd/wr/ctl/sts cause driver not opened --27 iIOAbortErr IO abort error (Printing Manager) --26 dInstErr DrvrInstall couldn't find driver in resources --25 dRemovErr tried to remove an open driver --24 closErr I/O System Errors --23 openErr I/O System Errors --22 unitEmptyErr I/O System Errors --21 badUnitErr I/O System Errors --20 writErr I/O System Errors --19 readErr I/O System Errors --18 statusErr I/O System Errors --17 controlErr I/O System Errors --13 dsExtensionsDisabled say –Extensions Disabled” --12 dsHD20Installed say –HD20 Startup” --11 dsDisassemblerInstalled say –Disassembler Installed” --10 dsMacsBugInstalled say –MacsBug Installed” --8 seNoDB no debugger installed to handle debugger command --5 SlpTypeErr invalid queue element --4 unimpErr unimplemented core routine --3 corErr core routine number out of range --2 dsNoExtsDisassembler not a SysErr, just a placeholder --1 qErr queue element not found during deletion -0 tsmComponentNoErr component result = no error -1 EPERM Operation not permitted -2 ENOENT No such file or directory -3 ESRCH No such process -4 EINTR Interrupted system call -5 EIO Input/output error -6 ENXIO Device not configured -7 E2BIG Argument list too long -8 ENOEXEC Exec format error -9 EBADF Bad file descriptor -10 ECHILD No child processes -11 EDEADLK Resource deadlock avoided -12 ENOMEM Cannot allocate memory -13 EACCES Permission denied -14 EFAULT Bad address -15 ECANCELED Operation cancelled -16 EBUSY Device busy -17 EEXIST File exists -18 EXDEV Cross-device link -19 ENODEV Operation not supported by device -20 ENOTDIR Not a directory -21 EISDIR Is a directory -22 EINVAL Invalid argument -23 ENFILE Too many open files in system -24 EMFILE Too many open files -25 ENOTTY Inappropriate ioctl for device -26 ESIGPARM Signal error -27 EFBIG File too large -28 ENOSPC No space left on device -29 ESPIPE Illegal seek -30 EROFS Read-only file system -31 EMLINK Too many links -32 EPIPE Broken pipe -33 EDOM Numerical argument out of domain -34 ERANGE Result too large -35 EAGAIN Resource temporarily unavailable -36 EINPROGRESS Operation now in progress -37 EALREADY Operation already in progress -38 ENOTSOCK Socket operation on non-socket -39 EDESTADDRREQ Destination address required -40 EMSGSIZE Message too long -41 EPROTOTYPE Protocol wrong type for socket -42 ENOPROTOOPT Protocol not available -43 EPROTONOSUPPORT Protocol not supported -44 ESOCKTNOSUPPORT Socket type not supported -45 EOPNOTSUPP Operation not supported -46 EPFNOSUPPORT Protocol family not supported -47 EAFNOSUPPORT Address family not supported by protocol family -48 EADDRINUSE Address already in use -49 EADDRNOTAVAIL Can't assign requested address -50 ENETDOWN Network is down -51 ENETUNREACH Network is unreachable -52 ENETRESET Network dropped connection on reset -53 ECONNABORTED Software caused connection abort -54 ECONNRESET Connection reset by peer -55 ENOBUFS No buffer space available -56 EISCONN Socket is already connected -57 ENOTCONN Socket is not connected -58 ESHUTDOWN Can't send after socket shutdown -59 ETOOMANYREFS Too many references: can't splice -60 ETIMEDOUT Operation timed out -61 ECONNREFUSED Connection refused -62 ELOOP Too many levels of symbolic links -63 ENAMETOOLONG File name too long -64 EHOSTDOWN Host is down -65 EHOSTUNREACH No route to host -66 ENOTEMPTY Directory not empty -67 ELOOK Internal mapping for kOTLookErr, don't return to client -77 ENOLCK No locks available -78 ENOSYS Function not implemented -88 EILSEQ Wide character encoding error -99 EUNKNOWN Unknown error diff --git a/Mac/scripts/genallsuites.py b/Mac/scripts/genallsuites.py deleted file mode 100644 index a556847..0000000 --- a/Mac/scripts/genallsuites.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generate all the standard scripting suite packages. -# Note that this module needs *serious* hand-crafting because of all the -# absolute paths. It is, however, a great leap forward compared to the time -# when this information was only stored in Jack's brain:-) - -import sys -import os -import gensuitemodule - -verbose=sys.stdout - -DSTDIR="/Users/jack/src/python/Lib/plat-mac/lib-scriptpackages" -OS9DISK="/Volumes/Moes" - -APPLESCRIPT=OS9DISK + "/Systeemmap/Extensies/AppleScript" -SYSTEMEVENTS="/System/Library/CoreServices/System Events.app" - -CODEWARRIOR=OS9DISK + "/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.6" -EXPLORER="/Applications/Internet Explorer.app" -FINDER="/System/Library/CoreServices/Finder.app" -NETSCAPE=OS9DISK + "/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2" -TERMINAL="/Applications/Utilities/Terminal.app" - -gensuitemodule.processfile_fromresource(APPLESCRIPT, - output=os.path.join(DSTDIR, 'StdSuites'), - basepkgname='_builtinSuites', - edit_modnames=[], verbose=verbose) -gensuitemodule.processfile(SYSTEMEVENTS, - output=os.path.join(DSTDIR, 'SystemEvents'), - basepkgname='StdSuites', - edit_modnames=[('Disk_2d_Folder_2d_File_Suite', 'Disk_Folder_File_Suite')], - verbose=verbose) -gensuitemodule.processfile(CODEWARRIOR, - output=os.path.join(DSTDIR, 'CodeWarrior'), - basepkgname='StdSuites', - edit_modnames=[], verbose=verbose) -gensuitemodule.processfile(EXPLORER, - output=os.path.join(DSTDIR, 'Explorer'), - basepkgname='StdSuites', - edit_modnames=[], verbose=verbose) -gensuitemodule.processfile(FINDER, - output=os.path.join(DSTDIR, 'Finder'), - basepkgname='StdSuites', - edit_modnames=[], verbose=verbose) -gensuitemodule.processfile(NETSCAPE, - output=os.path.join(DSTDIR, 'Netscape'), - basepkgname='StdSuites', - edit_modnames=[('WorldWideWeb_suite_2c__as_d', 'WorldWideWeb_suite')], verbose=verbose) -gensuitemodule.processfile(TERMINAL, - output=os.path.join(DSTDIR, 'Terminal'), - basepkgname='StdSuites', - edit_modnames=[], verbose=verbose) diff --git a/Mac/scripts/mkestrres-errno.h b/Mac/scripts/mkestrres-errno.h deleted file mode 100644 index 702901b..0000000 --- a/Mac/scripts/mkestrres-errno.h +++ /dev/null @@ -1,7 +0,0 @@ -/* These are defined in MSL errno.h, but unfortunately not documented */ -#define EFPOS 35 /* File positioning error */ -#define ESIGPARM 36 /* Signal argument error */ -#define ENOMEM 37 /* Cannot allocate memory */ -#define EACCES 38 /* Permission denied */ -#define ENOENT 39 /* No such file or directory */ -#define ENOSYS 40 /* Function not implemented */ diff --git a/Mac/scripts/mkestrres-macerrors.h b/Mac/scripts/mkestrres-macerrors.h deleted file mode 100755 index 26c583d..0000000 --- a/Mac/scripts/mkestrres-macerrors.h +++ /dev/null @@ -1,13 +0,0 @@ - /* Errors from InternetConfig.h */ - icPrefNotFoundErr = -666, /* Internet preference not found */ - icPermErr = -667, /* cannot set preference */ - icPrefDataErr = -668, /* problem with preference data */ - icInternalErr = -669, /* Internet Config internal error */ - icTruncatedErr = -670, /* more data was present than was returned */ - icNoMoreWritersErr = -671, /* you cannot begin a write session because someone else is already doing it */ - icNothingToOverrideErr = -672, /* no component for the override component to capture */ - icNoURLErr = -673, /* no URL found */ - icConfigNotFoundErr = -674, /* no internet configuration was found */ - icConfigInappropriateErr = -675, /* incorrect manufacturer code */ - icProfileNotFoundErr = -676, /* profile not found */ - icTooManyProfilesErr = -677 /* too many profiles in database */ diff --git a/Mac/scripts/mkestrres.py b/Mac/scripts/mkestrres.py deleted file mode 100644 index 93af56e..0000000 --- a/Mac/scripts/mkestrres.py +++ /dev/null @@ -1,157 +0,0 @@ -"""Parse sys/errno.h and Errors.h and create Estr resource""" - -import re -import string -from Carbon import Res -import os - -READ = 1 -WRITE = 2 -smAllScripts = -3 - -ERRNO_PROG="#define[ \t]+" \ - "([A-Z0-9a-z_]+)" \ - "[ \t]+" \ - "([0-9]+)" \ - "[ \t]*/\*[ \t]*" \ - "(.*)" \ - "[ \t]*\*/" - -ERRORS_PROG="[ \t]*" \ - "([A-Z0-9a-z_]+)" \ - "[ \t]*=[ \t]*" \ - "([-0-9]+)" \ - "[, \t]*/\*[ \t]*" \ - "(.*)" \ - "[ \t]*\*/" - -ERRORS_PROG_2="[ \t]*" \ - "([A-Z0-9a-z_]+)" \ - "[ \t]*=[ \t]*" \ - "([-0-9]+)" \ - "[, \t]*" - -def Pstring(str): - if len(str) > 255: - raise ValueError('String too large') - return chr(len(str))+str - -def writeestr(dst, edict): - """Create Estr resource file given a dictionary of errors.""" - - os.unlink(dst.as_pathname()) - Res.FSpCreateResFile(dst, 'RSED', 'rsrc', smAllScripts) - output = Res.FSpOpenResFile(dst, WRITE) - Res.UseResFile(output) - for num in edict.keys(): - res = Res.Resource(Pstring(edict[num][0])) - res.AddResource('Estr', num, '') - res.WriteResource() - Res.CloseResFile(output) - -def writepython(fp, dict): - k = dict.keys() - k.sort() - for i in k: - fp.write("%s\t=\t%d\t#%s\n"%(dict[i][1], i, dict[i][0])) - - -def parse_errno_h(fp, dict): - errno_prog = re.compile(ERRNO_PROG) - for line in fp.readlines(): - m = errno_prog.match(line) - if m: - number = string.atoi(m.group(2)) - name = m.group(1) - desc = string.strip(m.group(3)) - - if not dict.has_key(number): - dict[number] = desc, name - else: - print('DUPLICATE', number) - print('\t', dict[number]) - print('\t', (desc, name)) - -def parse_errors_h(fp, dict): - errno_prog = re.compile(ERRORS_PROG) - errno_prog_2 = re.compile(ERRORS_PROG_2) - for line in fp.readlines(): - match = 0 - m = errno_prog.match(line) - m2 = errno_prog_2.match(line) - if m: - number = string.atoi(m.group(2)) - name = m.group(1) - desc = string.strip(m.group(3)) - match=1 - elif m2: - number = string.atoi(m2.group(2)) - name = m2.group(1) - desc = name - match=1 - if match: - if number > 0: continue - - if not dict.has_key(number): - dict[number] = desc, name - else: - print('DUPLICATE', number) - print('\t', dict[number]) - print('\t', (desc, name)) - if len(desc) > len(dict[number][0]): - print('Pick second one') - dict[number] = desc, name - -def main(): - dict = {} - pathname = EasyDialogs.AskFileForOpen(message="Where is GUSI sys/errno.h?") - if pathname: - fp = open(pathname) - parse_errno_h(fp, dict) - fp.close() - - pathname = EasyDialogs.AskFileForOpen(message="Select cerrno (MSL) or cancel") - if pathname: - fp = open(pathname) - parse_errno_h(fp, dict) - fp.close() - - pathname = EasyDialogs.AskFileForOpen(message="Where is MacErrors.h?") - if pathname: - fp = open(pathname) - parse_errors_h(fp, dict) - fp.close() - - pathname = EasyDialogs.AskFileForOpen(message="Where is mkestrres-MacErrors.h?") - if pathname: - fp = open(pathname) - parse_errors_h(fp, dict) - fp.close() - - if not dict: - return - - pathname = EasyDialogs.AskFileForSave(message="Resource output file?", savedFileName="errors.rsrc") - if pathname: - writeestr(fss, dict) - - pathname = EasyDialogs.AskFileForSave(message="Python output file?", savedFileName="macerrors.py") - if pathname: - fp = open(pathname, "w") - writepython(fp, dict) - fp.close() - fss.SetCreatorType('Pyth', 'TEXT') - - pathname = EasyDialogs.AskFileForSave(message="Text output file?", savedFileName="errors.txt") - if pathname: - fp = open(pathname, "w") - - k = dict.keys() - k.sort() - for i in k: - fp.write("%d\t%s\t%s\n"%(i, dict[i][1], dict[i][0])) - fp.close() - - -if __name__ == '__main__': - main() diff --git a/Tools/bgen/README b/Tools/bgen/README deleted file mode 100644 index 70700c6..0000000 --- a/Tools/bgen/README +++ /dev/null @@ -1,7 +0,0 @@ -BGEN -- Automatic Generation of Extension Modules -================================================= - -This directory contains BGEN -- a package that helps in generating -complete source code for Python extension module. For examples of its -use, see the Mac Python source distribution (available separately -from the Python ftp archives). Note that BGEN is not Mac specific! diff --git a/Tools/bgen/bgen/bgen.py b/Tools/bgen/bgen/bgen.py deleted file mode 100644 index db28b0a..0000000 --- a/Tools/bgen/bgen/bgen.py +++ /dev/null @@ -1,12 +0,0 @@ -"Export everything in the various bgen submodules." - -from bgenType import * -from bgenVariable import * -from bgenBuffer import * -from bgenStackBuffer import * -from bgenHeapBuffer import * -from bgenStringBuffer import * -from bgenOutput import * -from bgenGenerator import * -from bgenModule import * -from bgenObjectDefinition import * diff --git a/Tools/bgen/bgen/bgenBuffer.py b/Tools/bgen/bgen/bgenBuffer.py deleted file mode 100644 index 98bbfe2..0000000 --- a/Tools/bgen/bgen/bgenBuffer.py +++ /dev/null @@ -1,301 +0,0 @@ -"""Buffers are character arrays that may contain null bytes. - -There are a number of variants depending on: -- how the buffer is allocated (for output buffers), and -- whether and how the size is passed into and/or out of the called function. -""" - - -from bgenType import Type, InputOnlyMixIn, OutputOnlyMixIn, InputOnlyType, OutputOnlyType -from bgenOutput import * - - -# Map common types to their format characters -type2format = { - 'long': 'l', - 'int': 'i', - 'short': 'h', - 'char': 'b', - 'unsigned long': 'l', - 'unsigned int': 'i', - 'unsigned short': 'h', - 'unsigned char': 'b', -} - - -# ----- PART 1: Fixed character buffers ----- - - -class FixedInputOutputBufferType(InputOnlyType): - - """Fixed buffer -- passed as (inbuffer, outbuffer).""" - - def __init__(self, size, datatype = 'char', sizetype = 'int', sizeformat = None): - self.typeName = "Buffer" - self.size = str(size) - self.datatype = datatype - self.sizetype = sizetype - self.sizeformat = sizeformat or type2format[sizetype] - self.label_needed = 0 - - def getArgDeclarations(self, name, reference=False, constmode=False, outmode=False): - if reference: - raise RuntimeError("Cannot pass buffer types by reference") - return (self.getBufferDeclarations(name, constmode, outmode) + - self.getSizeDeclarations(name, outmode)) - - def getBufferDeclarations(self, name, constmode=False, outmode=False): - return self.getInputBufferDeclarations(name, constmode) + \ - self.getOutputBufferDeclarations(name, constmode, outmode) - - def getInputBufferDeclarations(self, name, constmode=False): - if constmode: - const = "const " - else: - const = "" - return ["%s%s *%s__in__" % (const, self.datatype, name)] - - def getOutputBufferDeclarations(self, name, constmode=False, outmode=False): - if constmode: - raise RuntimeError("Cannot use const output buffer") - if outmode: - out = "*" - else: - out = "" - return ["%s%s %s__out__[%s]" % (self.datatype, out, name, self.size)] - - def getSizeDeclarations(self, name, outmode=False): - if outmode: - out = "*" - else: - out = "" - return ["%s%s %s__len__" %(self.sizetype, out, name)] - - def getAuxDeclarations(self, name): - return ["int %s__in_len__" %(name)] - - def getargsFormat(self): - return "s#" - - def getargsArgs(self, name): - return "&%s__in__, &%s__in_len__" % (name, name) - - def getargsCheck(self, name): - Output("if (%s__in_len__ != %s)", name, self.size) - OutLbrace() - Output('PyErr_SetString(PyExc_TypeError, "buffer length should be %s");', - self.size) - Output("goto %s__error__;", name) - self.label_needed = 1 - OutRbrace() - self.transferSize(name) - - def transferSize(self, name): - Output("%s__len__ = %s__in_len__;", name, name) - - def passOutput(self, name): - return "%s__in__, %s__out__" % (name, name) - - def mkvalueFormat(self): - return "s#" - - def mkvalueArgs(self, name): - return "%s__out__, (int)%s" % (name, self.size) - - def cleanup(self, name): - if self.label_needed: - DedentLevel() - Output(" %s__error__: ;", name) - IndentLevel() - - -class FixedCombinedInputOutputBufferType(FixedInputOutputBufferType): - - """Like fixed buffer -- but same parameter is input and output.""" - - def passOutput(self, name): - return "(%s *)memcpy(%s__out__, %s__in__, %s)" % \ - (self.datatype, name, name, self.size) - - -class InputOnlyBufferMixIn(InputOnlyMixIn): - - def getOutputBufferDeclarations(self, name, constmode=False, outmode=False): - return [] - - -class OutputOnlyBufferMixIn(OutputOnlyMixIn): - - def getInputBufferDeclarations(self, name, constmode=False): - return [] - -class OptionalInputBufferMixIn: - - """Add to input buffers if the buffer may be omitted: pass None in Python - and the C code will get a NULL pointer and zero size""" - - def getargsFormat(self): - return "z#" - - -class FixedInputBufferType(InputOnlyBufferMixIn, FixedInputOutputBufferType): - - """Fixed size input buffer -- passed without size information. - - Instantiate with the size as parameter. - """ - - def passInput(self, name): - return "%s__in__" % name - -class OptionalFixedInputBufferType(OptionalInputBufferMixIn, FixedInputBufferType): - pass - -class FixedOutputBufferType(OutputOnlyBufferMixIn, FixedInputOutputBufferType): - - """Fixed size output buffer -- passed without size information. - - Instantiate with the size as parameter. - """ - - def passOutput(self, name): - return "%s__out__" % name - - -class VarInputBufferType(FixedInputBufferType): - - """Variable size input buffer -- passed as (buffer, size). - - Instantiate without size parameter. - """ - - def __init__(self, datatype = 'char', sizetype = 'int', sizeformat = None): - FixedInputBufferType.__init__(self, "0", datatype, sizetype, sizeformat) - - def getargsCheck(self, name): - Output("%s__len__ = %s__in_len__;", name, name) - - def passInput(self, name): - return "%s__in__, %s__len__" % (name, name) - -class ReverseInputBufferMixin: - """ Mixin for input buffers that are passed as (size, buffer) """ - - def passInput(self, name): - return "%s__len__, %s__in__" % (name, name) - -class OptionalVarInputBufferType(OptionalInputBufferMixIn, VarInputBufferType): - pass - -# ----- PART 2: Structure buffers ----- - - -class StructInputOutputBufferType(FixedInputOutputBufferType): - - """Structure buffer -- passed as a structure pointer. - - Instantiate with the struct type as parameter. - """ - - def __init__(self, type): - FixedInputOutputBufferType.__init__(self, "sizeof(%s)" % type) - self.typeName = self.type = type - - def getInputBufferDeclarations(self, name, constmode=False): - if constmode: - const = "const " - else: - const = "" - return ["%s%s *%s__in__" % (const, self.type, name)] - - def getSizeDeclarations(self, name, outmode=False): - return [] - - def getAuxDeclarations(self, name): - return ["int %s__in_len__" % (name)] - - def getOutputBufferDeclarations(self, name, constmode=False, outmode=False): - if constmode: - raise RuntimeError("Cannot use const output buffer") - if outmode: - out = "*" - else: - out = "" - return ["%s%s %s__out__" % (self.type, out, name)] - - def getargsArgs(self, name): - return "(char **)&%s__in__, &%s__in_len__" % (name, name) - - def transferSize(self, name): - pass - - def passInput(self, name): - return "%s__in__" % name - - def passOutput(self, name): - return "%s__in__, &%s__out__" % (name, name) - - def mkvalueArgs(self, name): - return "(char *)&%s__out__, (int)%s" % (name, self.size) - - -class StructCombinedInputOutputBufferType(StructInputOutputBufferType): - - """Like structure buffer -- but same parameter is input and output.""" - - def passOutput(self, name): - return "(%s *)memcpy((char *)%s__out__, (char *)%s__in__, %s)" % \ - (self.type, name, name, self.size) - - -class StructInputBufferType(InputOnlyBufferMixIn, StructInputOutputBufferType): - - """Fixed size input buffer -- passed as a pointer to a structure. - - Instantiate with the struct type as parameter. - """ - - -class StructByValueBufferType(StructInputBufferType): - - """Fixed size input buffer -- passed as a structure BY VALUE. - - Instantiate with the struct type as parameter. - """ - - def passInput(self, name): - return "*%s__in__" % name - - -class StructOutputBufferType(OutputOnlyBufferMixIn, StructInputOutputBufferType): - - """Fixed size output buffer -- passed as a pointer to a structure. - - Instantiate with the struct type as parameter. - """ - - def getSizeDeclarations(self, name, outmode=False): - return [] - - def getAuxDeclarations(self, name): - return [] - - def passOutput(self, name): - return "&%s__out__" % name - - -class ArrayOutputBufferType(OutputOnlyBufferMixIn, StructInputOutputBufferType): - - """Fixed size output buffer -- declared as a typedef, passed as an array. - - Instantiate with the struct type as parameter. - """ - - def getSizeDeclarations(self, name, outmode=False): - return [] - - def getAuxDeclarations(self, name): - return [] - - def passOutput(self, name): - return "%s__out__" % name diff --git a/Tools/bgen/bgen/bgenGenerator.py b/Tools/bgen/bgen/bgenGenerator.py deleted file mode 100644 index bf00516..0000000 --- a/Tools/bgen/bgen/bgenGenerator.py +++ /dev/null @@ -1,302 +0,0 @@ -from bgenOutput import * -from bgenType import * -from bgenVariable import * - - -Error = "bgenGenerator.Error" - -DEBUG=0 - -# Strings to specify argument transfer modes in generator calls -IN = "in" -OUT = "out" -INOUT = IN_OUT = "in-out" - - -class BaseFunctionGenerator: - - def __init__(self, name, condition=None, callname=None, modifiers=None): - if DEBUG: print("<--", name) - self.name = name - if callname: - self.callname = callname - else: - self.callname = name - self.prefix = name - self.objecttype = "PyObject" # Type of _self argument to function - self.condition = condition - self.modifiers = modifiers - - def setprefix(self, prefix): - self.prefix = prefix - - def checkgenerate(self): - return True - - def generate(self): - if not self.checkgenerate(): - return - if DEBUG: print("-->", self.name) - if self.condition: - Output() - Output(self.condition) - self.functionheader() - self.functionbody() - self.functiontrailer() - if self.condition: - Output("#endif") - - def functionheader(self): - Output() - Output("static PyObject *%s_%s(%s *_self, PyObject *_args)", - self.prefix, self.name, self.objecttype) - OutLbrace() - Output("PyObject *_res = NULL;") - - def functionbody(self): - Output("/* XXX To be provided */") - - def functiontrailer(self): - OutRbrace() - - def reference(self, name = None): - if not self.checkgenerate(): - return - if name is None: - name = self.name - docstring = self.docstring() - if self.condition: - Output() - Output(self.condition) - Output("{\"%s\", (PyCFunction)%s_%s, METH_VARARGS,", name, self.prefix, self.name) - Output(" PyDoc_STR(%s)},", stringify(docstring)) - if self.condition: - Output("#endif") - - def docstring(self): - return None - - def __cmp__(self, other): - if not hasattr(other, 'name'): - return cmp(id(self), id(other)) - return cmp(self.name, other.name) - -_stringify_map = {'\n': '\\n', '\t': '\\t', '\r': '\\r', '\b': '\\b', - '\e': '\\e', '\a': '\\a', '\f': '\\f', '"': '\\"'} -def stringify(str): - if str is None: return "NULL" - res = '"' - map = _stringify_map - for c in str: - if c in map: res = res + map[c] - elif ' ' <= c <= '~': res = res + c - else: res = res + '\\%03o' % ord(c) - res = res + '"' - return res - - -class ManualGenerator(BaseFunctionGenerator): - - def __init__(self, name, body, condition=None): - BaseFunctionGenerator.__init__(self, name, condition=condition) - self.body = body - - def functionbody(self): - Output("%s", self.body) - - def setselftype(self, selftype, itselftype): - self.objecttype = selftype - self.itselftype = itselftype - - -class FunctionGenerator(BaseFunctionGenerator): - - def __init__(self, returntype, name, *argumentList, **conditionlist): - BaseFunctionGenerator.__init__(self, name, **conditionlist) - self.returntype = returntype - self.argumentList = [] - self.setreturnvar() - self.parseArgumentList(argumentList) - self.prefix = "XXX" # Will be changed by setprefix() call - self.itselftype = None # Type of _self->ob_itself, if defined - - def setreturnvar(self): - if self.returntype: - self.rv = self.makereturnvar() - self.argumentList.append(self.rv) - else: - self.rv = None - - def makereturnvar(self): - return Variable(self.returntype, "_rv", OutMode) - - def setselftype(self, selftype, itselftype): - self.objecttype = selftype - self.itselftype = itselftype - - def parseArgumentList(self, argumentList): - iarg = 0 - for type, name, mode in argumentList: - iarg = iarg + 1 - if name is None: name = "_arg%d" % iarg - arg = Variable(type, name, mode) - self.argumentList.append(arg) - - def docstring(self): - input = [] - output = [] - for arg in self.argumentList: - if arg.flags == ErrorMode or arg.flags == SelfMode: - continue - if arg.type is None: - str = 'void' - else: - if hasattr(arg.type, 'typeName'): - typeName = arg.type.typeName - if typeName is None: # Suppressed type - continue - else: - typeName = "?" - print("Nameless type", arg.type) - - str = typeName + ' ' + arg.name - if arg.mode in (InMode, InOutMode): - input.append(str) - if arg.mode in (InOutMode, OutMode): - output.append(str) - if not input: - instr = "()" - else: - instr = "(%s)" % ", ".join(input) - if not output or output == ["void"]: - outstr = "None" - else: - outstr = "(%s)" % ", ".join(output) - return instr + " -> " + outstr - - def functionbody(self): - self.declarations() - self.precheck() - self.getargs() - self.callit() - self.checkit() - self.returnvalue() - - def declarations(self): - for arg in self.argumentList: - arg.declare() - - def getargs(self): - sep = ",\n" + ' '*len("if (!PyArg_ParseTuple(") - fmt, lst = self.getargsFormatArgs(sep) - Output("if (!PyArg_ParseTuple(_args, \"%s\"%s))", fmt, lst) - IndentLevel() - Output("return NULL;") - DedentLevel() - for arg in self.argumentList: - if arg.flags == SelfMode: - continue - if arg.mode in (InMode, InOutMode): - arg.getargsCheck() - - def getargsFormatArgs(self, sep): - fmt = "" - lst = "" - for arg in self.argumentList: - if arg.flags == SelfMode: - continue - if arg.mode in (InMode, InOutMode): - arg.getargsPreCheck() - fmt = fmt + arg.getargsFormat() - args = arg.getargsArgs() - if args: - lst = lst + sep + args - return fmt, lst - - def precheck(self): - pass - - def beginallowthreads(self): - pass - - def endallowthreads(self): - pass - - def callit(self): - args = "" - s = "%s%s(" % (self.getrvforcallit(), self.callname) - sep = ",\n" + ' '*len(s) - for arg in self.argumentList: - if arg is self.rv: - continue - s = arg.passArgument() - if args: s = sep + s - args = args + s - self.beginallowthreads() - Output("%s%s(%s);", - self.getrvforcallit(), self.callname, args) - self.endallowthreads() - - def getrvforcallit(self): - if self.rv: - return "%s = " % self.rv.name - else: - return "" - - def checkit(self): - for arg in self.argumentList: - arg.errorCheck() - - def returnvalue(self): - sep = ",\n" + ' '*len("return Py_BuildValue(") - fmt, lst = self.mkvalueFormatArgs(sep) - if fmt == "": - Output("Py_INCREF(Py_None);") - Output("_res = Py_None;"); - else: - Output("_res = Py_BuildValue(\"%s\"%s);", fmt, lst) - tmp = self.argumentList[:] - tmp.reverse() - for arg in tmp: - if not arg: continue - arg.cleanup() - Output("return _res;") - - def mkvalueFormatArgs(self, sep): - fmt = "" - lst = "" - for arg in self.argumentList: - if not arg: continue - if arg.flags == ErrorMode: continue - if arg.mode in (OutMode, InOutMode): - arg.mkvaluePreCheck() - fmt = fmt + arg.mkvalueFormat() - lst = lst + sep + arg.mkvalueArgs() - return fmt, lst - -class MethodGenerator(FunctionGenerator): - - def parseArgumentList(self, args): - a0, args = args[0], args[1:] - t0, n0, m0 = a0 - if m0 != InMode: - raise ValueError("method's 'self' must be 'InMode'") - self.itself = Variable(t0, "_self->ob_itself", SelfMode) - self.argumentList.append(self.itself) - FunctionGenerator.parseArgumentList(self, args) - -def _test(): - void = None - eggs = FunctionGenerator(void, "eggs", - (stringptr, 'cmd', InMode), - (int, 'x', InMode), - (double, 'y', InOutMode), - (int, 'status', ErrorMode), - ) - eggs.setprefix("spam") - print("/* START */") - eggs.generate() - - -if __name__ == "__main__": - _test() diff --git a/Tools/bgen/bgen/bgenGeneratorGroup.py b/Tools/bgen/bgen/bgenGeneratorGroup.py deleted file mode 100644 index fd0a2c2..0000000 --- a/Tools/bgen/bgen/bgenGeneratorGroup.py +++ /dev/null @@ -1,40 +0,0 @@ -from bgenOutput import * - -class GeneratorGroup: - - def __init__(self, prefix): - self.prefix = prefix - self.generators = [] - - def add(self, g, dupcheck=0): - if dupcheck: - if g in self.generators: - print('DUP', g.name) - return - g.setprefix(self.prefix) - self.generators.append(g) - - def generate(self): - for g in self.generators: - g.generate() - Output() - Output("static PyMethodDef %s_methods[] = {", self.prefix) - IndentLevel() - for g in self.generators: - g.reference() - Output("{NULL, NULL, 0}") - DedentLevel() - Output("};") - - -def _test(): - void = None - from bgenGenerator import FunctionGenerator - group = GeneratorGroup("spam") - eggs = FunctionGenerator(void, "eggs") - group.add(eggs) - print("/* START */") - group.generate() - -if __name__ == "__main__": - _test() diff --git a/Tools/bgen/bgen/bgenHeapBuffer.py b/Tools/bgen/bgen/bgenHeapBuffer.py deleted file mode 100644 index fda8d30..0000000 --- a/Tools/bgen/bgen/bgenHeapBuffer.py +++ /dev/null @@ -1,145 +0,0 @@ -# Buffers allocated on the heap - -from bgenOutput import * -from bgenType import OutputOnlyMixIn -from bgenBuffer import FixedInputOutputBufferType - - -class HeapInputOutputBufferType(FixedInputOutputBufferType): - - """Input-output buffer allocated on the heap -- passed as (inbuffer, outbuffer, size). - - Instantiate without parameters. - Call from Python with input buffer. - """ - - def __init__(self, datatype = 'char', sizetype = 'int', sizeformat = None): - FixedInputOutputBufferType.__init__(self, "0", datatype, sizetype, sizeformat) - - def getOutputBufferDeclarations(self, name, constmode=False, outmode=False): - if constmode: - raise RuntimeError("Cannot use const output buffer") - if outmode: - out = "*" - else: - out = "" - return ["%s%s *%s__out__" % (self.datatype, out, name)] - - def getargsCheck(self, name): - Output("if ((%s__out__ = malloc(%s__in_len__)) == NULL)", name, name) - OutLbrace() - Output('PyErr_NoMemory();') - Output("goto %s__error__;", name) - self.label_needed = 1 - OutRbrace() - Output("%s__len__ = %s__in_len__;", name, name) - - def passOutput(self, name): - return "%s__in__, %s__out__, (%s)%s__len__" % \ - (name, name, self.sizetype, name) - - def mkvalueArgs(self, name): - return "%s__out__, (int)%s__len__" % (name, name) - - def cleanup(self, name): - Output("free(%s__out__);", name) - FixedInputOutputBufferType.cleanup(self, name) - - -class VarHeapInputOutputBufferType(HeapInputOutputBufferType): - - """same as base class, but passed as (inbuffer, outbuffer, &size)""" - - def passOutput(self, name): - return "%s__in__, %s__out__, &%s__len__" % (name, name, name) - - -class HeapCombinedInputOutputBufferType(HeapInputOutputBufferType): - - """same as base class, but passed as (inoutbuffer, size)""" - - def passOutput(self, name): - return "(%s *)memcpy(%s__out__, %s__in__, %s__len__)" % \ - (self.datatype, name, name, name) - - -class VarHeapCombinedInputOutputBufferType(HeapInputOutputBufferType): - - """same as base class, but passed as (inoutbuffer, &size)""" - - def passOutput(self, name): - return "(%s *)memcpy(%s__out__, %s__in__, &%s__len__)" % \ - (self.datatype, name, name, name) - - -class HeapOutputBufferType(OutputOnlyMixIn, HeapInputOutputBufferType): - - """Output buffer allocated on the heap -- passed as (buffer, size). - - Instantiate without parameters. - Call from Python with buffer size. - """ - - def getInputBufferDeclarations(self, name, constmode=False): - return [] - - def getargsFormat(self): - return "i" - - def getargsArgs(self, name): - return "&%s__in_len__" % name - - def passOutput(self, name): - return "%s__out__, %s__len__" % (name, name) - - -class VarHeapOutputBufferType(HeapOutputBufferType): - - """Output buffer allocated on the heap -- passed as (buffer, &size). - - Instantiate without parameters. - Call from Python with buffer size. - """ - - def passOutput(self, name): - return "%s__out__, &%s__len__" % (name, name) - - -class VarVarHeapOutputBufferType(VarHeapOutputBufferType): - - """Output buffer allocated on the heap -- passed as (buffer, size, &size). - - Instantiate without parameters. - Call from Python with buffer size. - """ - - def passOutput(self, name): - return "%s__out__, %s__len__, &%s__len__" % (name, name, name) - -class MallocHeapOutputBufferType(HeapOutputBufferType): - """Output buffer allocated by the called function -- passed as (&buffer, &size). - - Instantiate without parameters. - Call from Python without parameters. - """ - - def getargsCheck(self, name): - Output("%s__out__ = NULL;", name) - - def getAuxDeclarations(self, name): - return [] - - def passOutput(self, name): - return "&%s__out__, &%s__len__" % (name, name) - - def getargsFormat(self): - return "" - - def getargsArgs(self, name): - return None - - def mkvalueFormat(self): - return "z#" - - def cleanup(self, name): - Output("if( %s__out__ ) free(%s__out__);", name, name) diff --git a/Tools/bgen/bgen/bgenModule.py b/Tools/bgen/bgen/bgenModule.py deleted file mode 100644 index d41aa05..0000000 --- a/Tools/bgen/bgen/bgenModule.py +++ /dev/null @@ -1,94 +0,0 @@ -from bgenOutput import * -from bgenGeneratorGroup import GeneratorGroup - -class Module(GeneratorGroup): - - def __init__(self, name, prefix = None, - includestuff = None, - finalstuff = None, - initstuff = None, - variablestuff = None, - longname = None): - GeneratorGroup.__init__(self, prefix or name) - self.name = name - if longname: - self.longname = longname - else: - self.longname = name - self.includestuff = includestuff - self.initstuff = initstuff - self.finalstuff = finalstuff - self.variablestuff = variablestuff - self.typeobjects = [] - - def addobject(self, od): - self.generators.append(od) - self.typeobjects.append(od) - od.setmodulename(self.longname) - - def generate(self): - OutHeader1("Module " + self.name) - Output("#include \"Python.h\"") - Output() - - if self.includestuff: - Output() - Output("%s", self.includestuff) - - self.declareModuleVariables() - - GeneratorGroup.generate(self) - - if self.finalstuff: - Output() - Output("%s", self.finalstuff) - - Output() - Output("void init%s(void)", self.name) - OutLbrace() - Output("PyObject *m;") - Output("PyObject *d;") - Output() - - if self.initstuff: - Output("%s", self.initstuff) - Output() - - Output("m = Py_InitModule(\"%s\", %s_methods);", - self.name, self.prefix) - Output("d = PyModule_GetDict(m);") - self.createModuleVariables() - OutRbrace() - OutHeader1("End module " + self.name) - - def declareModuleVariables(self): - self.errorname = self.prefix + "_Error" - Output("static PyObject *%s;", self.errorname) - - def createModuleVariables(self): - Output("""%s = %s;""", self.errorname, self.exceptionInitializer()) - Output("""if (%s == NULL ||""", self.errorname) - Output(""" PyDict_SetItemString(d, "Error", %s) != 0)""", - self.errorname) - IndentLevel() - Output("""return;""") - DedentLevel() - for tp in self.typeobjects: - tp.outputTypeObjectInitializer() - if self.variablestuff: - Output("%s", self.variablestuff) - Output() - - def exceptionInitializer(self): - return """PyErr_NewException("%s.Error", NULL, NULL)""" % self.name - - -def _test(): - from bgenGenerator import FunctionGenerator - m = Module("spam", "", "#include <stdio.h>") - g = FunctionGenerator(None, "bacon") - m.add(g) - m.generate() - -if __name__ == "__main__": - _test() diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py deleted file mode 100644 index d926283..0000000 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ /dev/null @@ -1,512 +0,0 @@ -from bgenOutput import * -from bgenGeneratorGroup import GeneratorGroup - -class ObjectDefinition(GeneratorGroup): - "Spit out code that together defines a new Python object type" - basechain = "NULL" - tp_flags = "Py_TPFLAGS_DEFAULT" - basetype = None - argref = "" # set to "*" if arg to <type>_New should be pointer - argconst = "" # set to "const " if arg to <type>_New should be const - - def __init__(self, name, prefix, itselftype): - """ObjectDefinition constructor. May be extended, but do not override. - - - name: the object's official name, e.g. 'SndChannel'. - - prefix: the prefix used for the object's functions and data, e.g. 'SndCh'. - - itselftype: the C type actually contained in the object, e.g. 'SndChannelPtr'. - - XXX For official Python data types, rules for the 'Py' prefix are a problem. - """ - - GeneratorGroup.__init__(self, prefix or name) - self.name = name - self.itselftype = itselftype - self.objecttype = name + 'Object' - self.typename = name + '_Type' - self.static = "static " # set to "" to make <type>_New and <type>_Convert public - self.modulename = None - if hasattr(self, "assertions"): - self.assertions() - - def add(self, g, dupcheck=0): - g.setselftype(self.objecttype, self.itselftype) - GeneratorGroup.add(self, g, dupcheck) - - def reference(self): - # In case we are referenced from a module - pass - - def setmodulename(self, name): - self.modulename = name - - def generate(self): - # XXX This should use long strings and %(varname)s substitution! - - OutHeader2("Object type " + self.name) - - self.outputCheck() - - Output("typedef struct %s {", self.objecttype) - IndentLevel() - Output("PyObject_HEAD") - self.outputStructMembers() - DedentLevel() - Output("} %s;", self.objecttype) - - self.outputNew() - - self.outputConvert() - - self.outputDealloc() - - GeneratorGroup.generate(self) - - Output() - self.outputMethodChain() - - self.outputGetattr() - - self.outputSetattr() - - self.outputCompare() - - self.outputRepr() - - self.outputHash() - - self.outputPEP253Hooks() - - self.outputTypeObject() - - OutHeader2("End object type " + self.name) - - def outputCheck(self): - sf = self.static and "static " - Output("%sPyTypeObject %s;", sf, self.typename) - Output() - Output("#define %s_Check(x) ((x)->ob_type == &%s || PyObject_TypeCheck((x), &%s))", - self.prefix, self.typename, self.typename) - Output() - - def outputMethodChain(self): - Output("%sPyMethodChain %s_chain = { %s_methods, %s };", - self.static, self.prefix, self.prefix, self.basechain) - - def outputStructMembers(self): - Output("%s ob_itself;", self.itselftype) - - def outputNew(self): - Output() - Output("%sPyObject *%s_New(%s%s %sitself)", self.static, self.prefix, - self.argconst, self.itselftype, self.argref) - OutLbrace() - Output("%s *it;", self.objecttype) - self.outputCheckNewArg() - Output("it = PyObject_NEW(%s, &%s);", self.objecttype, self.typename) - Output("if (it == NULL) return NULL;") - if self.basetype: - Output("/* XXXX Should we tp_init or tp_new our basetype? */") - self.outputInitStructMembers() - Output("return (PyObject *)it;") - OutRbrace() - - def outputInitStructMembers(self): - Output("it->ob_itself = %sitself;", self.argref) - - def outputCheckNewArg(self): - "Override this method to apply additional checks/conversions" - - def outputConvert(self): - Output() - Output("%sint %s_Convert(PyObject *v, %s *p_itself)", self.static, self.prefix, - self.itselftype) - OutLbrace() - self.outputCheckConvertArg() - Output("if (!%s_Check(v))", self.prefix) - OutLbrace() - Output('PyErr_SetString(PyExc_TypeError, "%s required");', self.name) - Output("return 0;") - OutRbrace() - Output("*p_itself = ((%s *)v)->ob_itself;", self.objecttype) - Output("return 1;") - OutRbrace() - - def outputCheckConvertArg(self): - "Override this method to apply additional conversions" - - def outputDealloc(self): - Output() - Output("static void %s_dealloc(%s *self)", self.prefix, self.objecttype) - OutLbrace() - self.outputCleanupStructMembers() - if self.basetype: - Output("%s.tp_dealloc((PyObject *)self);", self.basetype) - elif hasattr(self, 'output_tp_free'): - # This is a new-style object with tp_free slot - Output("self->ob_type->tp_free((PyObject *)self);") - else: - Output("PyObject_Free((PyObject *)self);") - OutRbrace() - - def outputCleanupStructMembers(self): - self.outputFreeIt("self->ob_itself") - - def outputFreeIt(self, name): - Output("/* Cleanup of %s goes here */", name) - - def outputGetattr(self): - Output() - Output("static PyObject *%s_getattr(%s *self, char *name)", self.prefix, self.objecttype) - OutLbrace() - self.outputGetattrBody() - OutRbrace() - - def outputGetattrBody(self): - self.outputGetattrHook() - Output("return Py_FindMethodInChain(&%s_chain, (PyObject *)self, name);", - self.prefix) - - def outputGetattrHook(self): - pass - - def outputSetattr(self): - Output() - Output("#define %s_setattr NULL", self.prefix) - - def outputCompare(self): - Output() - Output("#define %s_compare NULL", self.prefix) - - def outputRepr(self): - Output() - Output("#define %s_repr NULL", self.prefix) - - def outputHash(self): - Output() - Output("#define %s_hash NULL", self.prefix) - - def outputTypeObject(self): - sf = self.static and "static " - Output() - Output("%sPyTypeObject %s = {", sf, self.typename) - IndentLevel() - Output("PyObject_HEAD_INIT(NULL)") - Output("0, /*ob_size*/") - if self.modulename: - Output("\"%s.%s\", /*tp_name*/", self.modulename, self.name) - else: - Output("\"%s\", /*tp_name*/", self.name) - Output("sizeof(%s), /*tp_basicsize*/", self.objecttype) - Output("0, /*tp_itemsize*/") - Output("/* methods */") - Output("(destructor) %s_dealloc, /*tp_dealloc*/", self.prefix) - Output("0, /*tp_print*/") - Output("(getattrfunc) %s_getattr, /*tp_getattr*/", self.prefix) - Output("(setattrfunc) %s_setattr, /*tp_setattr*/", self.prefix) - Output("(cmpfunc) %s_compare, /*tp_compare*/", self.prefix) - Output("(reprfunc) %s_repr, /*tp_repr*/", self.prefix) - Output("(PyNumberMethods *)0, /* tp_as_number */") - Output("(PySequenceMethods *)0, /* tp_as_sequence */") - Output("(PyMappingMethods *)0, /* tp_as_mapping */") - Output("(hashfunc) %s_hash, /*tp_hash*/", self.prefix) - DedentLevel() - Output("};") - - def outputTypeObjectInitializer(self): - Output("""%s.ob_type = &PyType_Type;""", self.typename) - if self.basetype: - Output("%s.tp_base = &%s;", self.typename, self.basetype) - Output("if (PyType_Ready(&%s) < 0) return;", self.typename) - Output("""Py_INCREF(&%s);""", self.typename) - Output("PyModule_AddObject(m, \"%s\", (PyObject *)&%s);", self.name, self.typename); - self.outputTypeObjectInitializerCompat() - - def outputTypeObjectInitializerCompat(self): - Output("/* Backward-compatible name */") - Output("""Py_INCREF(&%s);""", self.typename); - Output("PyModule_AddObject(m, \"%sType\", (PyObject *)&%s);", self.name, self.typename); - - def outputPEP253Hooks(self): - pass - -class PEP252Mixin: - getsetlist = [] - - def assertions(self): - # Check that various things aren't overridden. If they are it could - # signify a bgen-client that has been partially converted to PEP252. - assert self.outputGetattr.__func__ == PEP252Mixin.outputGetattr.__func__ - assert self.outputSetattr.__func__ == PEP252Mixin.outputSetattr.__func__ - assert self.outputGetattrBody == None - assert self.outputGetattrHook == None - assert self.basechain == "NULL" - - def outputGetattr(self): - pass - - outputGetattrBody = None - - outputGetattrHook = None - - def outputSetattr(self): - pass - - def outputMethodChain(self): - # This is a good place to output the getters and setters - self.outputGetSetList() - - def outputHook(self, name): - methodname = "outputHook_" + name - if hasattr(self, methodname): - func = getattr(self, methodname) - func() - else: - Output("0, /*%s*/", name) - - def outputTypeObject(self): - sf = self.static and "static " - Output() - Output("%sPyTypeObject %s = {", sf, self.typename) - IndentLevel() - Output("PyObject_HEAD_INIT(NULL)") - Output("0, /*ob_size*/") - if self.modulename: - Output("\"%s.%s\", /*tp_name*/", self.modulename, self.name) - else: - Output("\"%s\", /*tp_name*/", self.name) - Output("sizeof(%s), /*tp_basicsize*/", self.objecttype) - Output("0, /*tp_itemsize*/") - - Output("/* methods */") - Output("(destructor) %s_dealloc, /*tp_dealloc*/", self.prefix) - Output("0, /*tp_print*/") - Output("(getattrfunc)0, /*tp_getattr*/") - Output("(setattrfunc)0, /*tp_setattr*/") - Output("(cmpfunc) %s_compare, /*tp_compare*/", self.prefix) - Output("(reprfunc) %s_repr, /*tp_repr*/", self.prefix) - - Output("(PyNumberMethods *)0, /* tp_as_number */") - Output("(PySequenceMethods *)0, /* tp_as_sequence */") - Output("(PyMappingMethods *)0, /* tp_as_mapping */") - - Output("(hashfunc) %s_hash, /*tp_hash*/", self.prefix) - self.outputHook("tp_call") - Output("0, /*tp_str*/") - Output("PyObject_GenericGetAttr, /*tp_getattro*/") - Output("PyObject_GenericSetAttr, /*tp_setattro */") - - self.outputHook("tp_as_buffer") - Output("%s, /* tp_flags */", self.tp_flags) - self.outputHook("tp_doc") - self.outputHook("tp_traverse") - self.outputHook("tp_clear") - self.outputHook("tp_richcompare") - self.outputHook("tp_weaklistoffset") - self.outputHook("tp_iter") - self.outputHook("tp_iternext") - Output("%s_methods, /* tp_methods */", self.prefix) - self.outputHook("tp_members") - Output("%s_getsetlist, /*tp_getset*/", self.prefix) - self.outputHook("tp_base") - self.outputHook("tp_dict") - self.outputHook("tp_descr_get") - self.outputHook("tp_descr_set") - self.outputHook("tp_dictoffset") - self.outputHook("tp_init") - self.outputHook("tp_alloc") - self.outputHook("tp_new") - self.outputHook("tp_free") - DedentLevel() - Output("};") - - def outputGetSetList(self): - if self.getsetlist: - for name, get, set, doc in self.getsetlist: - if get: - self.outputGetter(name, get) - else: - Output("#define %s_get_%s NULL", self.prefix, name) - Output() - if set: - self.outputSetter(name, set) - else: - Output("#define %s_set_%s NULL", self.prefix, name) - Output() - - Output("static PyGetSetDef %s_getsetlist[] = {", self.prefix) - IndentLevel() - for name, get, set, doc in self.getsetlist: - if doc: - doc = '"' + doc + '"' - else: - doc = "NULL" - Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s},", - name, self.prefix, name, self.prefix, name, doc) - Output("{NULL, NULL, NULL, NULL},") - DedentLevel() - Output("};") - else: - Output("#define %s_getsetlist NULL", self.prefix) - Output() - - def outputGetter(self, name, code): - Output("static PyObject *%s_get_%s(%s *self, void *closure)", - self.prefix, name, self.objecttype) - OutLbrace() - Output(code) - OutRbrace() - Output() - - def outputSetter(self, name, code): - Output("static int %s_set_%s(%s *self, PyObject *v, void *closure)", - self.prefix, name, self.objecttype) - OutLbrace() - Output(code) - Output("return 0;") - OutRbrace() - Output() - -class PEP253Mixin(PEP252Mixin): - tp_flags = "Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE" - - def outputHook_tp_init(self): - Output("%s_tp_init, /* tp_init */", self.prefix) - - def outputHook_tp_alloc(self): - Output("%s_tp_alloc, /* tp_alloc */", self.prefix) - - def outputHook_tp_new(self): - Output("%s_tp_new, /* tp_new */", self.prefix) - - def outputHook_tp_free(self): - Output("%s_tp_free, /* tp_free */", self.prefix) - - def output_tp_initBody_basecall(self): - """If a type shares its init call with its base type set output_tp_initBody - to output_tp_initBody_basecall""" - if self.basetype: - Output("if (%s.tp_init)", self.basetype) - OutLbrace() - Output("if ( (*%s.tp_init)(_self, _args, _kwds) < 0) return -1;", self.basetype) - OutRbrace() - - output_tp_initBody = None - - def output_tp_init(self): - if self.output_tp_initBody: - Output("static int %s_tp_init(PyObject *_self, PyObject *_args, PyObject *_kwds)", self.prefix) - OutLbrace() - self.output_tp_initBody() - OutRbrace() - else: - Output("#define %s_tp_init 0", self.prefix) - Output() - - output_tp_allocBody = None - - def output_tp_alloc(self): - if self.output_tp_allocBody: - Output("static PyObject *%s_tp_alloc(PyTypeObject *type, int nitems)", - self.prefix) - OutLbrace() - self.output_tp_allocBody() - OutRbrace() - else: - Output("#define %s_tp_alloc PyType_GenericAlloc", self.prefix) - Output() - - def output_tp_newBody(self): - Output("PyObject *_self;"); - Output("%s itself;", self.itselftype); - Output("char *kw[] = {\"itself\", 0};") - Output() - Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"O&\", kw, %s_Convert, &itself)) return NULL;", - self.prefix); - if self.basetype: - Output("if (%s.tp_new)", self.basetype) - OutLbrace() - Output("if ( (*%s.tp_new)(type, _args, _kwds) == NULL) return NULL;", self.basetype) - Dedent() - Output("} else {") - Indent() - Output("if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;") - OutRbrace() - else: - Output("if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;") - Output("((%s *)_self)->ob_itself = itself;", self.objecttype) - Output("return _self;") - - def output_tp_new(self): - if self.output_tp_newBody: - Output("static PyObject *%s_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)", self.prefix) - OutLbrace() - self.output_tp_newBody() - OutRbrace() - else: - Output("#define %s_tp_new PyType_GenericNew", self.prefix) - Output() - - output_tp_freeBody = None - - def output_tp_free(self): - if self.output_tp_freeBody: - Output("static void %s_tp_free(PyObject *self)", self.prefix) - OutLbrace() - self.output_tp_freeBody() - OutRbrace() - else: - Output("#define %s_tp_free PyObject_Del", self.prefix) - Output() - - def outputPEP253Hooks(self): - self.output_tp_init() - self.output_tp_alloc() - self.output_tp_new() - self.output_tp_free() - -class GlobalObjectDefinition(ObjectDefinition): - """Like ObjectDefinition but exports some parts. - - XXX Should also somehow generate a .h file for them. - """ - - def __init__(self, name, prefix = None, itselftype = None): - ObjectDefinition.__init__(self, name, prefix or name, itselftype or name) - self.static = "" - -class ObjectIdentityMixin: - """A mixin class for objects that makes the identity of ob_itself - govern comparisons and dictionary lookups. Useful if the C object can - be returned by library calls and it is difficult (or impossible) to find - the corresponding Python objects. With this you can create Python object - wrappers on the fly""" - - def outputCompare(self): - Output() - Output("static int %s_compare(%s *self, %s *other)", self.prefix, self.objecttype, - self.objecttype) - OutLbrace() - Output("unsigned long v, w;") - Output() - Output("if (!%s_Check((PyObject *)other))", self.prefix) - OutLbrace() - Output("v=(unsigned long)self;") - Output("w=(unsigned long)other;") - OutRbrace() - Output("else") - OutLbrace() - Output("v=(unsigned long)self->ob_itself;") - Output("w=(unsigned long)other->ob_itself;") - OutRbrace() - Output("if( v < w ) return -1;") - Output("if( v > w ) return 1;") - Output("return 0;") - OutRbrace() - - def outputHash(self): - Output() - Output("static long %s_hash(%s *self)", self.prefix, self.objecttype) - OutLbrace() - Output("return (long)self->ob_itself;") - OutRbrace() diff --git a/Tools/bgen/bgen/bgenOutput.py b/Tools/bgen/bgen/bgenOutput.py deleted file mode 100644 index d84e50e..0000000 --- a/Tools/bgen/bgen/bgenOutput.py +++ /dev/null @@ -1,219 +0,0 @@ -"""Output primitives for the binding generator classes. - -This should really be a class, but then everybody would be passing -the output object to each other. I chose for the simpler approach -of a module with a global variable. Use SetOutputFile() or -SetOutputFileName() to change the output file. -""" - -_NeedClose = 0 - -def SetOutputFile(file = None, needclose = 0): - """Call this with an open file object to make it the output file. - - Call it without arguments to close the current file (if necessary) - and reset it to sys.stdout. - If the second argument is true, the new file will be explicitly closed - on a subsequence call. - """ - global _File, _NeedClose - if _NeedClose: - tmp = _File - _NeedClose = 0 - _File = None - tmp.close() - if file is None: - import sys - file = sys.stdout - _File = file - _NeedClose = file and needclose - -def SetOutputFileName(filename = None): - """Call this with a filename to make it the output file. - - Call it without arguments to close the current file (if necessary) - and reset it to sys.stdout. - """ - SetOutputFile() - if filename: - SetOutputFile(open(filename, 'w'), 1) - -SetOutputFile() # Initialize _File - -_Level = 0 # Indentation level - -def GetLevel(): - """Return the current indentation level.""" - return _Level - -def SetLevel(level): - """Set the current indentation level. - - This does no type or range checking -- use at own risk. - """ - global _Level - _Level = level - -def Output(format = "", *args): - VaOutput(format, args) - -def VaOutput(format, args): - """Call this with a format string and argument tuple for the format. - - A newline is always added. Each line in the output is indented - to the proper indentation level -- even if the result of the - format expansion contains embedded newlines. Exception: lines - beginning with '#' are not indented -- these are assumed to be - C preprprocessor lines. - """ - text = format % args - if _Level > 0: - indent = '\t' * _Level - lines = text.split('\n') - for i in range(len(lines)): - if lines[i] and lines[i][0] != '#': - lines[i] = indent + lines[i] - text = '\n'.join(lines) - _File.write(text + '\n') - -def IndentLevel(by = 1): - """Increment the indentation level by one. - - When called with an argument, adds it to the indentation level. - """ - global _Level - if _Level+by < 0: - raise Error("indentation underflow (internal error)") - _Level = _Level + by - -def DedentLevel(by = 1): - """Decrement the indentation level by one. - - When called with an argument, subtracts it from the indentation level. - """ - IndentLevel(-by) - -def OutIndent(format = "", *args): - """Combine Output() followed by IndentLevel(). - - If no text is given, acts like lone IndentLevel(). - """ - if format: VaOutput(format, args) - IndentLevel() - -def OutDedent(format = "", *args): - """Combine Output() followed by DedentLevel(). - - If no text is given, acts like loneDedentLevel(). - """ - if format: VaOutput(format, args) - DedentLevel() - -def OutLbrace(format = "", *args): - """Like Output, but add a '{' and increase the indentation level. - - If no text is given a lone '{' is output. - """ - if format: - format = format + " {" - else: - format = "{" - VaOutput(format, args) - IndentLevel() - -def OutRbrace(): - """Decrease the indentation level and output a '}' on a line by itself.""" - DedentLevel() - Output("}") - -def OutHeader(text, dash): - """Output a header comment using a given dash character.""" - n = 64 - len(text) - Output() - Output("/* %s %s %s */", dash * (n/2), text, dash * (n - n/2)) - Output() - -def OutHeader1(text): - """Output a level 1 header comment (uses '=' dashes).""" - OutHeader(text, "=") - -def OutHeader2(text): - """Output a level 2 header comment (uses '-' dashes).""" - OutHeader(text, "-") - -def Out(text): - """Output multiline text that's internally indented. - - Pass this a multiline character string. The whitespace before the - first nonblank line of the string will be subtracted from all lines. - The lines are then output using Output(), but without interpretation - of formatting (if you need formatting you can do it before the call). - Recommended use: - - Out(''' - int main(argc, argv) - int argc; - char *argv; - { - printf("Hello, world\\n"); - exit(0); - } - ''') - - Caveat: the indentation must be consistent -- if you use three tabs - in the first line, (up to) three tabs are removed from following lines, - but a line beginning with 24 spaces is not trimmed at all. Don't use - this as a feature. - """ - # (Don't you love using triple quotes *inside* triple quotes? :-) - - lines = text.split('\n') - indent = "" - for line in lines: - if line.strip(): - for c in line: - if not c.isspace(): - break - indent = indent + c - break - n = len(indent) - for line in lines: - if line[:n] == indent: - line = line[n:] - else: - for c in indent: - if line[:1] != c: break - line = line[1:] - VaOutput("%s", line) - - -def _test(): - """Test program. Run when the module is run as a script.""" - OutHeader1("test bgenOutput") - Out(""" - #include <Python.h> - #include <stdio.h> - - main(argc, argv) - int argc; - char **argv; - { - int i; - """) - IndentLevel() - Output("""\ -/* Here are a few comment lines. - Just to test indenting multiple lines. - - End of the comment lines. */ -""") - Output("for (i = 0; i < argc; i++)") - OutLbrace() - Output('printf("argv[%%d] = %%s\\n", i, argv[i]);') - OutRbrace() - Output("exit(0)") - OutRbrace() - OutHeader2("end test") - -if __name__ == '__main__': - _test() diff --git a/Tools/bgen/bgen/bgenStackBuffer.py b/Tools/bgen/bgen/bgenStackBuffer.py deleted file mode 100644 index 431bb73..0000000 --- a/Tools/bgen/bgen/bgenStackBuffer.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Buffers allocated on the stack.""" - - -from bgenBuffer import FixedInputBufferType, FixedOutputBufferType - - -class StackOutputBufferType(FixedOutputBufferType): - - """Fixed output buffer allocated on the stack -- passed as (buffer, size). - - Instantiate with the buffer size as parameter. - """ - - def passOutput(self, name): - return "%s__out__, %s" % (name, self.size) - - -class VarStackOutputBufferType(StackOutputBufferType): - - """Output buffer allocated on the stack -- passed as (buffer, &size). - - Instantiate with the buffer size as parameter. - """ - - def getSizeDeclarations(self, name): - return [] - - def getAuxDeclarations(self, name): - return ["int %s__len__ = %s" % (name, self.size)] - - def passOutput(self, name): - return "%s__out__, &%s__len__" % (name, name) - - def mkvalueArgs(self, name): - return "%s__out__, (int)%s__len__" % (name, name) - - -class VarVarStackOutputBufferType(VarStackOutputBufferType): - - """Output buffer allocated on the stack -- passed as (buffer, size, &size). - - Instantiate with the buffer size as parameter. - """ - - def passOutput(self, name): - return "%s__out__, %s__len__, &%s__len__" % (name, name, name) - - -class ReturnVarStackOutputBufferType(VarStackOutputBufferType): - - """Output buffer allocated on the stack -- passed as (buffer, size) -> size. - - Instantiate with the buffer size as parameter. - The function's return value is the size. - (XXX Should have a way to suppress returning it separately, too.) - """ - - def passOutput(self, name): - return "%s__out__, %s__len__" % (name, name) - - def mkvalueArgs(self, name): - return "%s__out__, (int)_rv" % name diff --git a/Tools/bgen/bgen/bgenStringBuffer.py b/Tools/bgen/bgen/bgenStringBuffer.py deleted file mode 100644 index a232f83..0000000 --- a/Tools/bgen/bgen/bgenStringBuffer.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Buffers used to hold null-terminated strings.""" - - -from bgenBuffer import FixedOutputBufferType -from bgenStackBuffer import StackOutputBufferType -from bgenHeapBuffer import HeapOutputBufferType - - -class StringBufferMixIn: - - """Mix-in class to create various string buffer types. - - Strings are character arrays terminated by a null byte. - (For input, this is also covered by stringptr.) - For output, there are again three variants: - - Fixed: size is a constant given in the documentation; or - - Stack: size is passed to the C function but we decide on a size at - code generation time so we can still allocate on the heap); or - - Heap: size is passed to the C function and we let the Python caller - pass a size. - (Note that this doesn't cover output parameters in which a string - pointer is returned. These are actually easier (no allocation) but far - less common. I'll write the classes when there is demand.) - """ - - def getSizeDeclarations(self, name): - return [] - - def getAuxDeclarations(self, name): - return [] - - def getargsFormat(self): - return "s" - - def getargsArgs(self, name): - return "&%s__in__" % name - - def mkvalueFormat(self): - return "s" - - def mkvalueArgs(self, name): - return "%s__out__" % name - - -class FixedOutputStringType(StringBufferMixIn, FixedOutputBufferType): - - """Null-terminated output string -- passed without size. - - Instantiate with buffer size as parameter. - """ - - -class StackOutputStringType(StringBufferMixIn, StackOutputBufferType): - - """Null-terminated output string -- passed as (buffer, size). - - Instantiate with buffer size as parameter. - """ - - -class HeapOutputStringType(StringBufferMixIn, HeapOutputBufferType): - - """Null-terminated output string -- passed as (buffer, size). - - Instantiate without parameters. - Call from Python with buffer size. - """ diff --git a/Tools/bgen/bgen/bgenType.py b/Tools/bgen/bgen/bgenType.py deleted file mode 100644 index dcb0f08..0000000 --- a/Tools/bgen/bgen/bgenType.py +++ /dev/null @@ -1,328 +0,0 @@ -"""Type classes and a modest collection of standard types.""" - - -from bgenOutput import * - - -class Type: - - """Define the various things you can do with a C type. - - Most methods are intended to be extended or overridden. - """ - - def __init__(self, typeName, fmt): - """Call with the C name and getargs format for the type. - - Example: int = Type("int", "i") - """ - self.typeName = typeName - self.fmt = fmt - - def declare(self, name, reference=False): - """Declare a variable of the type with a given name. - - Example: int.declare('spam') prints "int spam;" - """ - for decl in self.getArgDeclarations(name, reference): - Output("%s;", decl) - for decl in self.getAuxDeclarations(name): - Output("%s;", decl) - - def getArgDeclarations(self, name, reference=False, constmode=False, outmode=False): - """Return the main part of the declarations for this type: the items - that will be passed as arguments in the C/C++ function call.""" - if reference: - ref = "&" - else: - ref = "" - if constmode: - const = "const " - else: - const = "" - if outmode: - out = "*" - else: - out = "" - return ["%s%s%s%s %s" % (const, self.typeName, ref, out, name)] - - def getAuxDeclarations(self, name): - """Return any auxiliary declarations needed for implementing this - type, such as helper variables used to hold sizes, etc. These declarations - are not part of the C/C++ function call interface.""" - return [] - - def getargs(self): - return self.getargsFormat(), self.getargsArgs() - - def getargsFormat(self): - """Return the format for this type for use with PyArg_Parse(). - - Example: int.getargsFormat() returns the string "i". - (getargs is a very old name for PyArg_Parse, hence the name of this method). - """ - return self.fmt - - def getargsArgs(self, name): - """Return an argument for use with PyArg_Parse(). - - Example: int.getargsArgs("spam") returns the string "&spam". - """ - return "&" + name - - def getargsPreCheck(self, name): - """Perform any actions needed before calling getargs(). - - This could include declaring temporary variables and such. - """ - - def getargsCheck(self, name): - """Perform any needed post-[new]getargs() checks. - - This is type-dependent; the default does not check for errors. - An example would be a check for a maximum string length, or it - could do post-getargs() copying or conversion.""" - - def passInput(self, name): - """Return an argument for passing a variable into a call. - - Example: int.passInput("spam") returns the string "spam". - """ - return name - - def passOutput(self, name): - """Return an argument for returning a variable out of a call. - - Example: int.passOutput("spam") returns the string "&spam". - """ - return "&" + name - - def passReference(self, name): - """Return an argument for C++ pass-by-reference. - Default is to call passInput(). - """ - return self.passInput(name) - - def errorCheck(self, name): - """Check for an error returned in the variable. - - This is type-dependent; the default does not check for errors. - An example would be a check for a NULL pointer. - If an error is found, the generated routine should - raise an exception and return NULL. - - XXX There should be a way to add error clean-up code. - """ - Output("/* XXX no err check for %s %s */", self.typeName, name) - - def mkvalue(self): - return self.mkvalueFormat(), self.mkvalueArgs() - - def mkvalueFormat(self): - """Return the format for this type for use with Py_BuildValue(). - - This is normally the same as getargsFormat() but it is - a separate function to allow future divergence. - (mkvalue is a very old name for Py_BuildValue, hence the name of this - method). - """ - return self.getargsFormat() - - def mkvalueArgs(self, name): - """Return an argument for use with Py_BuildValue(). - - Example: int.mkvalueArgs("spam") returns the string "spam". - """ - return name - - def mkvaluePreCheck(self, name): - """Perform any actions needed before calling mkvalue(). - - This could include declaring temporary variables and such. - """ - - def cleanup(self, name): - """Clean up if necessary. - - This is normally empty; it may deallocate buffers etc. - """ - pass - -class ByAddressType(Type): - "Simple type that is also passed by address for input" - - def passInput(self, name): - return "&%s" % name - - - -# Sometimes it's useful to define a type that's only usable as input or output parameter - -class InputOnlyMixIn: - - "Mix-in class to boobytrap passOutput" - - def passOutput(self, name): - raise RuntimeError("Type '%s' can only be used for input parameters" % self.typeName) - -class InputOnlyType(InputOnlyMixIn, Type): - - "Same as Type, but only usable for input parameters -- passOutput is boobytrapped" - -class OutputOnlyMixIn: - - "Mix-in class to boobytrap passInput" - - def passInput(self, name): - raise RuntimeError("Type '%s' can only be used for output parameters" % self.typeName) - -class OutputOnlyType(OutputOnlyMixIn, Type): - - "Same as Type, but only usable for output parameters -- passInput is boobytrapped" - - -# A modest collection of standard C types. -void = None -char = Type("char", "c") -short = Type("short", "h") -unsigned_short = Type("unsigned short", "H") -int = Type("int", "i") -long = Type("long", "l") -unsigned_long = Type("unsigned long", "l") -float = Type("float", "f") -double = Type("double", "d") - - -# The most common use of character pointers is a null-terminated string. -# For input, this is easy. For output, and for other uses of char *, -# see the module bgenBuffer. -stringptr = InputOnlyType("char*", "s") -unicodestringptr = InputOnlyType("wchar_t *", "u") - - -# Some Python related types. -objectptr = Type("PyObject*", "O") -stringobjectptr = Type("PyStringObject*", "S") -# Etc. - - -class FakeType(InputOnlyType): - - """A type that is not represented in the Python version of the interface. - - Instantiate with a value to pass in the call. - """ - - def __init__(self, substitute): - self.substitute = substitute - self.typeName = None # Don't show this argument in __doc__ string - - def getArgDeclarations(self, name, reference=False, constmode=False, outmode=False): - return [] - - def getAuxDeclarations(self, name, reference=False): - return [] - - def getargsFormat(self): - return "" - - def getargsArgs(self, name): - return None - - def passInput(self, name): - return self.substitute - - -class OpaqueType(Type): - - """A type represented by an opaque object type, always passed by address. - - Instantiate with the type name and the names of the new and convert procs. - If fewer than three arguments are passed, the second argument is used - to derive the new and convert procs by appending _New and _Convert; it - defaults to the first argument. - """ - - def __init__(self, name, arg = None, extra = None): - self.typeName = name - if extra is None: - # Two arguments (name, usetype) or one (name) - arg = arg or name - self.new = arg + '_New' - self.convert = arg + '_Convert' - else: - # Three arguments (name, new, convert) - self.new = arg - self.convert = extra - - def getargsFormat(self): - return "O&" - - def getargsArgs(self, name): - return "%s, &%s" % (self.convert, name) - - def passInput(self, name): - return "&%s" % name - - def mkvalueFormat(self): - return "O&" - - def mkvalueArgs(self, name): - return "%s, &%s" % (self.new, name) - - -class OpaqueByValueType(OpaqueType): - - """A type represented by an opaque object type, on input passed BY VALUE. - - Instantiate with the type name, and optionally an object type name whose - New/Convert functions will be used. - """ - - def passInput(self, name): - return name - - def mkvalueArgs(self, name): - return "%s, %s" % (self.new, name) - -class OpaqueByRefType(OpaqueType): - """An opaque object type, passed by reference. - - Instantiate with the type name, and optionally an object type name whose - New/Convert functions will be used. - """ - - def passInput(self, name): - return name - -# def passOutput(self, name): -# return name - - def mkvalueFormat(self): - return "O" - - def mkvalueArgs(self, name): - return "%s(%s)" % (self.new, name) - -class OpaqueByValueStructType(OpaqueByValueType): - """Similar to OpaqueByValueType, but we also pass this to mkvalue by - address, in stead of by value. - """ - - def mkvalueArgs(self, name): - return "%s, &%s" % (self.new, name) - - -class OpaqueArrayType(OpaqueByValueType): - - """A type represented by an opaque object type, with ARRAY passing semantics. - - Instantiate with the type name, and optional an object type name whose - New/Convert functions will be used. - """ - - def getargsArgs(self, name): - return "%s, %s" % (self.convert, name) - - def passOutput(self, name): - return name diff --git a/Tools/bgen/bgen/bgenVariable.py b/Tools/bgen/bgen/bgenVariable.py deleted file mode 100644 index 0ad24b3..0000000 --- a/Tools/bgen/bgen/bgenVariable.py +++ /dev/null @@ -1,112 +0,0 @@ -"""Variables, arguments and argument transfer modes etc.""" - - -# Values to represent argument transfer modes -InMode = 1 # input-only argument -OutMode = 2 # output-only argument -InOutMode = 3 # input-output argument -ModeMask = 3 # bits to keep for mode - - -# Special cases for mode/flags argument -# XXX This is still a mess! -SelfMode = 4+InMode # this is 'self' -- don't declare it -ReturnMode = 8+OutMode # this is the function return value -ErrorMode = 16+OutMode # this is an error status -- turn it into an exception -RefMode = 32 -ConstMode = 64 - -class Variable: - - """A Variable holds a type, a name, a transfer mode and flags. - - Most of its methods call the correponding type method with the - variable name. - """ - - def __init__(self, type, name = None, flags = InMode): - """Call with a type, a name and flags. - - If name is None, it muse be set later. - flags defaults to InMode. - """ - self.type = type - self.name = name - self.flags = flags - self.mode = flags & ModeMask - - def declare(self): - """Declare the variable if necessary. - - If it is "self", it is not declared. - """ - if self.flags == ReturnMode+RefMode: - self.type.declare(self.name, reference=True) - elif self.flags != SelfMode: - self.type.declare(self.name) - - def getArgDeclarations(self, fullmodes=False): - refmode = (self.flags & RefMode) - constmode = False - outmode = False - if fullmodes: - constmode = (self.flags & ConstMode) - outmode = (self.flags & OutMode) - return self.type.getArgDeclarations(self.name, - reference=refmode, constmode=constmode, outmode=outmode) - - def getAuxDeclarations(self): - return self.type.getAuxDeclarations(self.name) - - def getargsFormat(self): - """Call the type's getargsFormatmethod.""" - return self.type.getargsFormat() - - def getargsArgs(self): - """Call the type's getargsArgsmethod.""" - return self.type.getargsArgs(self.name) - - def getargsCheck(self): - return self.type.getargsCheck(self.name) - - def getargsPreCheck(self): - return self.type.getargsPreCheck(self.name) - - def passArgument(self): - """Return the string required to pass the variable as argument. - - For "in" arguments, return the variable name. - For "out" and "in out" arguments, - return its name prefixed with "&". - """ - if self.mode == InMode: - return self.type.passInput(self.name) - if self.mode & RefMode: - return self.type.passReference(self.name) - if self.mode in (OutMode, InOutMode): - return self.type.passOutput(self.name) - # XXX Shouldn't get here - return "/*mode?*/" + self.type.passInput(self.name) - - def errorCheck(self): - """Check for an error if necessary. - - This only generates code if the variable's mode is ErrorMode. - """ - if self.flags == ErrorMode: - self.type.errorCheck(self.name) - - def mkvalueFormat (self): - """Call the type's mkvalueFormat method.""" - return self.type.mkvalueFormat() - - def mkvalueArgs(self): - """Call the type's mkvalueArgs method.""" - return self.type.mkvalueArgs(self.name) - - def mkvaluePreCheck(self): - return self.type.mkvaluePreCheck(self.name) - - def cleanup(self): - """Call the type's cleanup method.""" - return self.type.cleanup(self.name) diff --git a/Tools/bgen/bgen/macsupport.py b/Tools/bgen/bgen/macsupport.py deleted file mode 100644 index 7cd2b81..0000000 --- a/Tools/bgen/bgen/macsupport.py +++ /dev/null @@ -1,197 +0,0 @@ -"""\ -Augment the "bgen" package with definitions that are useful on the Apple Macintosh. - -Intended usage is "from macsupport import *" -- this implies all bgen's goodies. -""" - - -# Import everything from bgen (for ourselves as well as for re-export) -from bgen import * - - -# Simple types -Boolean = Type("Boolean", "b") -SignedByte = Type("SignedByte", "b") -Size = Type("Size", "l") -Style = Type("Style", "b") -StyleParameter = Type("StyleParameter", "h") -CharParameter = Type("CharParameter", "h") -TextEncoding = Type("TextEncoding", "l") -ByteCount = Type("ByteCount", "l") -Duration = Type("Duration", "l") -ByteOffset = Type("ByteOffset", "l") -OptionBits = Type("OptionBits", "l") -ItemCount = Type("ItemCount", "l") -PBVersion = Type("PBVersion", "l") -ScriptCode = Type("ScriptCode", "h") -LangCode = Type("LangCode", "h") -RegionCode = Type("RegionCode", "h") - -UInt8 = Type("UInt8", "b") -SInt8 = Type("SInt8", "b") -UInt16 = Type("UInt16", "H") -SInt16 = Type("SInt16", "h") -UInt32 = Type("UInt32", "l") -SInt32 = Type("SInt32", "l") -Float32 = Type("Float32", "f") - -wide = OpaqueByValueType("wide", "PyMac_Buildwide", "PyMac_Getwide") -wide_ptr = OpaqueType("wide", "PyMac_Buildwide", "PyMac_Getwide") - -# Pascal strings -ConstStr255Param = OpaqueArrayType("Str255", "PyMac_BuildStr255", "PyMac_GetStr255") -Str255 = OpaqueArrayType("Str255", "PyMac_BuildStr255", "PyMac_GetStr255") -StringPtr = OpaqueByValueType("StringPtr", "PyMac_BuildStr255", "PyMac_GetStr255") -ConstStringPtr = StringPtr - -# File System Specifications -FSSpec_ptr = OpaqueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec") -FSSpec = OpaqueByValueStructType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec") -FSRef_ptr = OpaqueType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef") -FSRef = OpaqueByValueStructType("FSRef", "PyMac_BuildFSRef", "PyMac_GetFSRef") - -# OSType and ResType: 4-byte character strings -def OSTypeType(typename): - return OpaqueByValueType(typename, "PyMac_BuildOSType", "PyMac_GetOSType") -OSType = OSTypeType("OSType") -ResType = OSTypeType("ResType") -FourCharCode = OSTypeType("FourCharCode") - -# Version numbers -NumVersion = OpaqueByValueType("NumVersion", "PyMac_BuildNumVersion", "BUG") - -# Handles (always resources in our case) -Handle = OpaqueByValueType("Handle", "ResObj") -MenuHandle = OpaqueByValueType("MenuHandle", "MenuObj") -MenuRef = MenuHandle -ControlHandle = OpaqueByValueType("ControlHandle", "CtlObj") -ControlRef = ControlHandle - -# Windows and Dialogs -WindowPtr = OpaqueByValueType("WindowPtr", "WinObj") -WindowRef = WindowPtr -DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj") -DialogRef = DialogPtr -ExistingWindowPtr = OpaqueByValueType("WindowPtr", "WinObj_WhichWindow", "BUG") -ExistingDialogPtr = OpaqueByValueType("DialogPtr", "DlgObj_WhichDialog", "BUG") - -# NULL pointer passed in as optional storage -- not present in Python version -NullStorage = FakeType("(void *)0") - -# More standard datatypes -Fixed = OpaqueByValueType("Fixed", "PyMac_BuildFixed", "PyMac_GetFixed") - -# Quickdraw data types -Rect = Rect_ptr = OpaqueType("Rect", "PyMac_BuildRect", "PyMac_GetRect") -Point = OpaqueByValueType("Point", "PyMac_BuildPoint", "PyMac_GetPoint") -Point_ptr = OpaqueType("Point", "PyMac_BuildPoint", "PyMac_GetPoint") - -# Event records -EventRecord = OpaqueType("EventRecord", "PyMac_BuildEventRecord", "PyMac_GetEventRecord") -EventRecord_ptr = EventRecord - -# CoreFoundation datatypes -CFTypeRef = OpaqueByValueType("CFTypeRef", "CFTypeRefObj") -CFStringRef = OpaqueByValueType("CFStringRef", "CFStringRefObj") -CFMutableStringRef = OpaqueByValueType("CFMutableStringRef", "CFMutableStringRefObj") -CFArrayRef = OpaqueByValueType("CFArrayRef", "CFArrayRefObj") -CFMutableArrayRef = OpaqueByValueType("CFMutableArrayRef", "CFMutableArrayRefObj") -CFDictionaryRef = OpaqueByValueType("CFDictionaryRef", "CFDictionaryRefObj") -CFMutableDictionaryRef = OpaqueByValueType("CFMutableDictionaryRef", "CFMutableDictionaryRefObj") -CFURLRef = OpaqueByValueType("CFURLRef", "CFURLRefObj") -OptionalCFURLRef = OpaqueByValueType("CFURLRef", "OptionalCFURLRefObj") - -# OSErr is special because it is turned into an exception -# (Could do this with less code using a variant of mkvalue("O&")?) -class OSErrType(Type): - def errorCheck(self, name): - Output("if (%s != noErr) return PyMac_Error(%s);", name, name) - self.used = 1 -OSErr = OSErrType("OSErr", 'h') -OSStatus = OSErrType("OSStatus", 'l') - - -# Various buffer types - -InBuffer = VarInputBufferType('char', 'long', 'l') # (buf, len) -UcharInBuffer = VarInputBufferType('unsigned char', 'long', 'l') # (buf, len) -OptionalInBuffer = OptionalVarInputBufferType('char', 'long', 'l') # (buf, len) - -InOutBuffer = HeapInputOutputBufferType('char', 'long', 'l') # (inbuf, outbuf, len) -VarInOutBuffer = VarHeapInputOutputBufferType('char', 'long', 'l') # (inbuf, outbuf, &len) - -OutBuffer = HeapOutputBufferType('char', 'long', 'l') # (buf, len) -VarOutBuffer = VarHeapOutputBufferType('char', 'long', 'l') # (buf, &len) -VarVarOutBuffer = VarVarHeapOutputBufferType('char', 'long', 'l') # (buf, len, &len) - -# Unicode arguments sometimes have reversed len, buffer (don't understand why Apple did this...) -class VarUnicodeInputBufferType(VarInputBufferType): - - def getargsFormat(self): - return "u#" - -class VarUnicodeReverseInputBufferType(ReverseInputBufferMixin, VarUnicodeInputBufferType): - pass - -UnicodeInBuffer = VarUnicodeInputBufferType('UniChar', 'UniCharCount', 'l') -UnicodeReverseInBuffer = VarUnicodeReverseInputBufferType('UniChar', 'UniCharCount', 'l') -UniChar_ptr = InputOnlyType("UniCharPtr", "u") - - -# Predefine various pieces of program text to be passed to Module() later: - -# Stuff added immediately after the system include files -includestuff = """ -#include "pymactoolbox.h" - -/* Macro to test whether a weak-loaded CFM function exists */ -#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\\ - PyErr_SetString(PyExc_NotImplementedError, \\ - "Not available in this shared library/OS version"); \\ - return NULL; \\ - }} while(0) - -""" - -# Stuff added just before the module's init function -finalstuff = """ -""" - -# Stuff added inside the module's init function -initstuff = """ -""" - - -# Generator classes with a twist -- if the function returns OSErr, -# its mode is manipulated so that it turns into an exception or disappears -# (and its name is changed to _err, for documentation purposes). -# This requires that the OSErr type (defined above) has a non-trivial -# errorCheck method. -class OSErrMixIn: - "Mix-in class to treat OSErr/OSStatus return values special" - def makereturnvar(self): - if self.returntype.__class__ == OSErrType: - return Variable(self.returntype, "_err", ErrorMode) - else: - return Variable(self.returntype, "_rv", OutMode) - -class OSErrFunctionGenerator(OSErrMixIn, FunctionGenerator): pass -class OSErrMethodGenerator(OSErrMixIn, MethodGenerator): pass - -class WeakLinkMixIn: - "Mix-in to test the function actually exists (!= NULL) before calling" - - def precheck(self): - Output('#ifndef %s', self.name) - Output('PyMac_PRECHECK(%s);', self.name) - Output('#endif') - -class WeakLinkFunctionGenerator(WeakLinkMixIn, FunctionGenerator): pass -class WeakLinkMethodGenerator(WeakLinkMixIn, MethodGenerator): pass -class OSErrWeakLinkFunctionGenerator(OSErrMixIn, WeakLinkMixIn, FunctionGenerator): pass -class OSErrWeakLinkMethodGenerator(OSErrMixIn, WeakLinkMixIn, MethodGenerator): pass - -class MacModule(Module): - "Subclass which gets the exception initializer from macglue.c" - def exceptionInitializer(self): - return "PyMac_GetOSErrException()" diff --git a/Tools/bgen/bgen/scantools.py b/Tools/bgen/bgen/scantools.py deleted file mode 100644 index 96f375d..0000000 --- a/Tools/bgen/bgen/scantools.py +++ /dev/null @@ -1,846 +0,0 @@ -"""\ - -Tools for scanning header files in search of function prototypes. - -Often, the function prototypes in header files contain enough information -to automatically generate (or reverse-engineer) interface specifications -from them. The conventions used are very vendor specific, but once you've -figured out what they are they are often a great help, and it sure beats -manually entering the interface specifications. (These are needed to generate -the glue used to access the functions from Python.) - -In order to make this class useful, almost every component can be overridden. -The defaults are (currently) tuned to scanning Apple Macintosh header files, -although most Mac specific details are contained in header-specific subclasses. -""" - -import re -import sys -import os -import fnmatch -from types import * -try: - import MacOS -except ImportError: - MacOS = None - -try: - from bgenlocations import CREATOR, INCLUDEDIR -except ImportError: - CREATOR = None - INCLUDEDIR = os.curdir - -Error = "scantools.Error" - -BEGINHTMLREPORT="""<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html> -<head> -<style type="text/css"> -.unmatched { } -.commentstripping { color: grey; text-decoration: line-through } -.comment { text-decoration: line-through } -.notcomment { color: black } -.incomplete { color: maroon } -.constant { color: green } -.pyconstant { background-color: yellow } -.blconstant { background-color: yellow; color: red } -.declaration { color: blue } -.pydeclaration { background-color: yellow } -.type { font-style: italic } -.name { font-weight: bold } -.value { font-style: italic } -.arglist { text-decoration: underline } -.blacklisted { background-color: yellow; color: red } -</style> -<title>Bgen scan report</title> -</head> -<body> -<h1>Bgen scan report</h1> -<h2>Legend</h2> -<p>This scan report is intended to help you debug the regular expressions -used by the bgen scanner. It consists of the original ".h" header file(s) -marked up to show you what the regular expressions in the bgen parser matched -for each line. NOTE: comments in the original source files may or may not be -shown.</p> -<p>The typographic conventions of this file are as follows:</p> -<dl> -<dt>comment stripping</dt> -<dd><pre><span class="commentstripping"><span class="notcomment">comment stripping is </span><span class="comment">/* marked up */</span><span class="notcomment"> and the line is repeated if needed</span></span></pre> -<p>If anything here does not appear to happen correctly look at -<tt>comment1_pat</tt> and <tt>comment2_pat</tt>.</p> -</dd> -<dt>constant definitions</dt> -<dd><pre><span class="constant">#define <span class="name">name</span> <span class="value">value</span></pre> -<p>Highlights name and value of the constant. Governed by <tt>sym_pat</tt>.</p> -</dd> -<dt>function declaration</dt> -<dd><pre><span class="declaration"><span class="type">char *</span><span class="name">rindex</span><span class="arglist">(<span class="type">const char *</span><span class="name">s</span>, <span class="type">int </span><span class="name">c</span>)</span>;</span></pre> -<p>Highlights type, name and argument list. <tt>type_pat</tt>, -<tt>name_pat</tt> and <tt>args_pat</tt> are combined into <tt>whole_pat</tt>, which -is what is used here.</p></dd> -</dd> -<dt>incomplete match for function declaration</dt> -<dd><pre><span class="incomplete"><span class="type">char *</span>foo;</span></pre> -<p>The beginning of this looked promising, but it did not match a function declaration. -In other words, it matched <tt>head_pat</tt> but not <tt>whole_pat</tt>. If the next -declaration has also been gobbled up you need to look at <tt>end_pat</tt>.</p> -</dd> -<dt>unrecognized input</dt> -<dd><pre><span class="unmatched">#include "type.h"</span></pre> -<p>If there are function declarations the scanner has missed (i.e. things -are in this class but you want them to be declarations) you need to adapt -<tt>head_pat</tt>. -</dd> -</dl> -<h2>Output</h2> -<pre> -<span class="unmatched"> -""" -ENDHTMLREPORT="""</span> -</pre> -</body> -</html> -""" - -class Scanner: - - # Set to 1 in subclass to debug your scanner patterns. - debug = 0 - - def __init__(self, input = None, output = None, defsoutput = None): - self.initsilent() - self.initblacklists() - self.initrepairinstructions() - self.initpaths() - self.initfiles() - self.initpatterns() - self.compilepatterns() - self.initosspecifics() - self.initusedtypes() - if output: - self.setoutput(output, defsoutput) - if input: - self.setinput(input) - - def initusedtypes(self): - self.usedtypes = {} - - def typeused(self, type, mode): - if type not in self.usedtypes: - self.usedtypes[type] = {} - self.usedtypes[type][mode] = None - - def reportusedtypes(self): - types = sorted(self.usedtypes.keys()) - for type in types: - modes = sorted(self.usedtypes[type].keys()) - self.report("%s %s", type, " ".join(modes)) - - def gentypetest(self, file): - fp = open(file, "w") - fp.write("types=[\n") - types = sorted(self.usedtypes.keys()) - for type in types: - fp.write("\t'%s',\n"%type) - fp.write("]\n") - fp.write("""missing=0 -for t in types: - try: - tt = eval(t) - except NameError: - print "** Missing type:", t - missing = 1 -if missing: raise "Missing Types" -""") - fp.close() - - def initsilent(self): - self.silent = 1 - - def error(self, format, *args): - if self.silent >= 0: - print(format%args) - - def report(self, format, *args): - if not self.silent: - print(format%args) - - def writeinitialdefs(self): - pass - - def initblacklists(self): - self.blacklistnames = self.makeblacklistnames() - self.blacklisttypes = ["unknown", "-"] + self.makeblacklisttypes() - self.greydictnames = self.greylist2dict(self.makegreylist()) - - def greylist2dict(self, list): - rv = {} - for define, namelist in list: - for name in namelist: - rv[name] = define - return rv - - def makeblacklistnames(self): - return [] - - def makeblacklisttypes(self): - return [] - - def makegreylist(self): - return [] - - def initrepairinstructions(self): - self.repairinstructions = self.makerepairinstructions() - self.inherentpointertypes = self.makeinherentpointertypes() - - def makerepairinstructions(self): - """Parse the repair file into repair instructions. - - The file format is simple: - 1) use \ to split a long logical line in multiple physical lines - 2) everything after the first # on a line is ignored (as comment) - 3) empty lines are ignored - 4) remaining lines must have exactly 3 colon-separated fields: - functionpattern : argumentspattern : argumentsreplacement - 5) all patterns use shell style pattern matching - 6) an empty functionpattern means the same as * - 7) the other two fields are each comma-separated lists of triples - 8) a triple is a space-separated list of 1-3 words - 9) a triple with less than 3 words is padded at the end with "*" words - 10) when used as a pattern, a triple matches the type, name, and mode - of an argument, respectively - 11) when used as a replacement, the words of a triple specify - replacements for the corresponding words of the argument, - with "*" as a word by itself meaning leave the original word - (no other uses of "*" is allowed) - 12) the replacement need not have the same number of triples - as the pattern - """ - f = self.openrepairfile() - if not f: return [] - print("Reading repair file", repr(f.name), "...") - list = [] - lineno = 0 - while 1: - line = f.readline() - if not line: break - lineno = lineno + 1 - startlineno = lineno - while line[-2:] == '\\\n': - line = line[:-2] + ' ' + f.readline() - lineno = lineno + 1 - i = line.find('#') - if i >= 0: line = line[:i] - words = [s.strip() for s in line.split(':')] - if words == ['']: continue - if len(words) != 3: - print("Line", startlineno, end=' ') - print(": bad line (not 3 colon-separated fields)") - print(repr(line)) - continue - [fpat, pat, rep] = words - if not fpat: fpat = "*" - if not pat: - print("Line", startlineno, end=' ') - print("Empty pattern") - print(repr(line)) - continue - patparts = [s.strip() for s in pat.split(',')] - repparts = [s.strip() for s in rep.split(',')] - patterns = [] - for p in patparts: - if not p: - print("Line", startlineno, end=' ') - print("Empty pattern part") - print(repr(line)) - continue - pattern = p.split() - if len(pattern) > 3: - print("Line", startlineno, end=' ') - print("Pattern part has > 3 words") - print(repr(line)) - pattern = pattern[:3] - else: - while len(pattern) < 3: - pattern.append("*") - patterns.append(pattern) - replacements = [] - for p in repparts: - if not p: - print("Line", startlineno, end=' ') - print("Empty replacement part") - print(repr(line)) - continue - replacement = p.split() - if len(replacement) > 3: - print("Line", startlineno, end=' ') - print("Pattern part has > 3 words") - print(repr(line)) - replacement = replacement[:3] - else: - while len(replacement) < 3: - replacement.append("*") - replacements.append(replacement) - list.append((fpat, patterns, replacements)) - return list - - def makeinherentpointertypes(self): - return [] - - def openrepairfile(self, filename = "REPAIR"): - try: - return open(filename, "rU") - except IOError as msg: - print(repr(filename), ":", msg) - print("Cannot open repair file -- assume no repair needed") - return None - - def initfiles(self): - self.specmine = 0 - self.defsmine = 0 - self.scanmine = 0 - self.htmlmine = 0 - self.specfile = sys.stdout - self.defsfile = None - self.scanfile = sys.stdin - self.htmlfile = None - self.lineno = 0 - self.line = "" - - def initpaths(self): - self.includepath = [os.curdir, INCLUDEDIR] - - def initpatterns(self): - self.head_pat = r"^EXTERN_API[^_]" - self.tail_pat = r"[;={}]" - self.type_pat = r"EXTERN_API" + \ - r"[ \t\n]*\([ \t\n]*" + \ - r"(?P<type>[a-zA-Z0-9_* \t]*[a-zA-Z0-9_*])" + \ - r"[ \t\n]*\)[ \t\n]*" - self.name_pat = r"(?P<name>[a-zA-Z0-9_]+)[ \t\n]*" - self.args_pat = r"\((?P<args>([^\(;=\)]+|\([^\(;=\)]*\))*)\)" - self.whole_pat = self.type_pat + self.name_pat + self.args_pat - self.sym_pat = r"^[ \t]*(?P<name>[a-zA-Z0-9_]+)[ \t]*=" + \ - r"[ \t]*(?P<defn>[-0-9_a-zA-Z'\"\(][^\t\n,;}]*),?" - self.asplit_pat = r"^(?P<type>.*[^a-zA-Z0-9_])(?P<name>[a-zA-Z0-9_]+)(?P<array>\[\])?$" - self.comment1_pat = r"(?P<rest>.*)//.*" - # note that the next pattern only removes comments that are wholly within one line - self.comment2_pat = r"(?P<rest1>.*)/\*.*\*/(?P<rest2>.*)" - - def compilepatterns(self): - for name in dir(self): - if name[-4:] == "_pat": - pat = getattr(self, name) - prog = re.compile(pat) - setattr(self, name[:-4], prog) - - def initosspecifics(self): - if MacOS and CREATOR: - self.filetype = 'TEXT' - self.filecreator = CREATOR - else: - self.filetype = self.filecreator = None - - def setfiletype(self, filename): - if MacOS and (self.filecreator or self.filetype): - creator, type = MacOS.GetCreatorAndType(filename) - if self.filecreator: creator = self.filecreator - if self.filetype: type = self.filetype - MacOS.SetCreatorAndType(filename, creator, type) - - def close(self): - self.closefiles() - - def closefiles(self): - self.closespec() - self.closedefs() - self.closescan() - self.closehtml() - - def closespec(self): - tmp = self.specmine and self.specfile - self.specfile = None - if tmp: tmp.close() - - def closedefs(self): - tmp = self.defsmine and self.defsfile - self.defsfile = None - if tmp: tmp.close() - - def closescan(self): - tmp = self.scanmine and self.scanfile - self.scanfile = None - if tmp: tmp.close() - - def closehtml(self): - if self.htmlfile: self.htmlfile.write(ENDHTMLREPORT) - tmp = self.htmlmine and self.htmlfile - self.htmlfile = None - if tmp: tmp.close() - - def setoutput(self, spec, defs = None): - self.closespec() - self.closedefs() - if spec: - if type(spec) == StringType: - file = self.openoutput(spec) - mine = 1 - else: - file = spec - mine = 0 - self.specfile = file - self.specmine = mine - if defs: - if type(defs) == StringType: - file = self.openoutput(defs) - mine = 1 - else: - file = defs - mine = 0 - self.defsfile = file - self.defsmine = mine - - def sethtmloutput(self, htmlfile): - self.closehtml() - if htmlfile: - if type(htmlfile) == StringType: - file = self.openoutput(htmlfile) - mine = 1 - else: - file = htmlfile - mine = 0 - self.htmlfile = file - self.htmlmine = mine - self.htmlfile.write(BEGINHTMLREPORT) - - def openoutput(self, filename): - try: - file = open(filename, 'w') - except IOError as arg: - raise IOError(filename, arg) - self.setfiletype(filename) - return file - - def setinput(self, scan = sys.stdin): - if not type(scan) in (TupleType, ListType): - scan = [scan] - self.allscaninputs = scan - self._nextinput() - - def _nextinput(self): - if not self.allscaninputs: - return 0 - scan = self.allscaninputs[0] - self.allscaninputs = self.allscaninputs[1:] - self.closescan() - if scan: - if type(scan) == StringType: - file = self.openinput(scan) - mine = 1 - else: - file = scan - mine = 0 - self.scanfile = file - self.scanmine = mine - self.lineno = 0 - return 1 - - def openinput(self, filename): - if not os.path.isabs(filename): - for dir in self.includepath: - fullname = os.path.join(dir, filename) - #self.report("trying full name %r", fullname) - try: - return open(fullname, 'rU') - except IOError: - pass - # If not on the path, or absolute, try default open() - try: - return open(filename, 'rU') - except IOError as arg: - raise IOError(arg, filename) - - def getline(self): - if not self.scanfile: - raise Error("input file not set") - self.line = self.scanfile.readline() - if not self.line: - if self._nextinput(): - return self.getline() - raise EOFError - self.lineno = self.lineno + 1 - return self.line - - def scan(self): - if not self.scanfile: - self.error("No input file has been specified") - return - inputname = self.scanfile.name - self.report("scanfile = %r", inputname) - if not self.specfile: - self.report("(No interface specifications will be written)") - else: - self.report("specfile = %r", self.specfile.name) - self.specfile.write("# Generated from %r\n\n" % (inputname,)) - if not self.defsfile: - self.report("(No symbol definitions will be written)") - else: - self.report("defsfile = %r", (self.defsfile.name,)) - self.defsfile.write("# Generated from %r\n\n" % (os.path.split(inputname)[1],)) - self.writeinitialdefs() - self.alreadydone = [] - try: - while 1: - try: line = self.getline() - except EOFError: break - if self.debug: - self.report("LINE: %r" % (line,)) - match = self.comment1.match(line) - if match: - self.htmlreport(line, klass='commentstripping', ranges=[( - match.start('rest'), match.end('rest'), 'notcomment')]) - line = match.group('rest') - if self.debug: - self.report("\tafter comment1: %r" % (line,)) - match = self.comment2.match(line) - while match: - if match: - self.htmlreport(line, klass='commentstripping', ranges=[ - (match.start('rest1'), match.end('rest1'), 'notcomment'), - (match.start('rest2'), match.end('rest2'), 'notcomment')]) - line = match.group('rest1')+match.group('rest2') - if self.debug: - self.report("\tafter comment2: %r" % (line,)) - match = self.comment2.match(line) - if self.defsfile: - match = self.sym.match(line) - if match: - if self.debug: - self.report("\tmatches sym.") - self.dosymdef(match, line) - continue - match = self.head.match(line) - if match: - if self.debug: - self.report("\tmatches head.") - self.dofuncspec() - continue - self.htmlreport(line, klass='unmatched') - except EOFError: - self.error("Uncaught EOF error") - self.reportusedtypes() - - def dosymdef(self, match, line): - name, defn = match.group('name', 'defn') - self.htmlreport(line, klass='constant', ranges=[ - (match.start('name'), match.end('name'), 'name'), - (match.start('defn'), match.end('defn'), 'value')]) - defn = escape8bit(defn) - if self.debug: - self.report("\tsym: name=%r, defn=%r" % (name, defn)) - if not name in self.blacklistnames: - oline = "%s = %s\n" % (name, defn) - self.defsfile.write(oline) - self.htmlreport(oline, klass="pyconstant") - else: - self.defsfile.write("# %s = %s\n" % (name, defn)) - self.htmlreport("** no output: name is blacklisted", klass="blconstant") - # XXXX No way to handle greylisted names - - def dofuncspec(self): - raw = self.line - while not self.tail.search(raw): - line = self.getline() - if self.debug: - self.report("* CONTINUATION LINE: %r" % (line,)) - match = self.comment1.match(line) - if match: - line = match.group('rest') - if self.debug: - self.report("\tafter comment1: %r" % (line,)) - match = self.comment2.match(line) - while match: - line = match.group('rest1')+match.group('rest2') - if self.debug: - self.report("\tafter comment1: %r" % (line,)) - match = self.comment2.match(line) - raw = raw + line - if self.debug: - self.report("* WHOLE LINE: %r" % (raw,)) - self.processrawspec(raw) - return raw - - def processrawspec(self, raw): - match = self.whole.search(raw) - if not match: - self.report("Bad raw spec: %r", raw) - if self.debug: - match = self.type.search(raw) - if not match: - self.report("(Type already doesn't match)") - self.htmlreport(raw, klass='incomplete', ranges=[( - match.start('type'), match.end('type'), 'type')]) - else: - self.report("(but type matched)") - self.htmlreport(raw, klass='incomplete') - return - type, name, args = match.group('type', 'name', 'args') - ranges=[ - (match.start('type'), match.end('type'), 'type'), - (match.start('name'), match.end('name'), 'name'), - (match.start('args'), match.end('args'), 'arglist')] - self.htmlreport(raw, klass='declaration', ranges=ranges) - modifiers = self.getmodifiers(match) - type = self.pythonizename(type) - name = self.pythonizename(name) - if self.checkduplicate(name): - self.htmlreport("*** no output generated: duplicate name", klass="blacklisted") - return - self.report("==> %s %s <==", type, name) - if self.blacklisted(type, name): - self.htmlreport("*** no output generated: function name or return type blacklisted", klass="blacklisted") - self.report("*** %s %s blacklisted", type, name) - return - returnlist = [(type, name, 'ReturnMode')] - returnlist = self.repairarglist(name, returnlist) - [(type, name, returnmode)] = returnlist - arglist = self.extractarglist(args) - arglist = self.repairarglist(name, arglist) - if self.unmanageable(type, name, arglist): - self.htmlreport("*** no output generated: some argument blacklisted", klass="blacklisted") - ##for arg in arglist: - ## self.report(" %r", arg) - self.report("*** %s %s unmanageable", type, name) - return - if modifiers: - self.generate(type, name, arglist, modifiers) - else: - self.generate(type, name, arglist) - - def getmodifiers(self, match): - return [] - - def checkduplicate(self, name): - if name in self.alreadydone: - self.report("Name has already been defined: %r", name) - return True - self.alreadydone.append(name) - return False - - def pythonizename(self, name): - name = re.sub("\*", " ptr", name) - name = name.strip() - name = re.sub("[ \t]+", "_", name) - return name - - def extractarglist(self, args): - args = args.strip() - if not args or args == "void": - return [] - parts = [s.strip() for s in args.split(",")] - arglist = [] - for part in parts: - arg = self.extractarg(part) - arglist.append(arg) - return arglist - - def extractarg(self, part): - mode = "InMode" - part = part.strip() - match = self.asplit.match(part) - if not match: - self.error("Indecipherable argument: %r", part) - return ("unknown", part, mode) - type, name, array = match.group('type', 'name', 'array') - if array: - # array matches an optional [] after the argument name - type = type + " ptr " - type = self.pythonizename(type) - return self.modifyarg(type, name, mode) - - def modifyarg(self, type, name, mode): - if type[:6] == "const_": - type = type[6:] - elif type[-4:] == "_ptr": - type = type[:-4] - mode = "OutMode" - elif type in self.inherentpointertypes: - mode = "OutMode" - if type[-4:] == "_far": - type = type[:-4] - return type, name, mode - - def repairarglist(self, functionname, arglist): - arglist = arglist[:] - i = 0 - while i < len(arglist): - for item in self.repairinstructions: - if len(item) == 2: - pattern, replacement = item - functionpat = "*" - else: - functionpat, pattern, replacement = item - if not fnmatch.fnmatchcase(functionname, functionpat): - continue - n = len(pattern) - if i+n > len(arglist): continue - current = arglist[i:i+n] - for j in range(n): - if not self.matcharg(pattern[j], current[j]): - break - else: # All items of the pattern match - new = self.substituteargs( - pattern, replacement, current) - if new is not None: - arglist[i:i+n] = new - i = i+len(new) # No recursive substitutions - break - else: # No patterns match - i = i+1 - return arglist - - def matcharg(self, patarg, arg): - return len(f for f in map(fnmatch.fnmatchcase, arg, patarg) if f) == 3 - - def substituteargs(self, pattern, replacement, old): - new = [] - for k in range(len(replacement)): - item = replacement[k] - newitem = [item[0], item[1], item[2]] - for i in range(3): - if item[i] == '*': - newitem[i] = old[k][i] - elif item[i][:1] == '$': - index = int(item[i][1:]) - 1 - newitem[i] = old[index][i] - new.append(tuple(newitem)) - ##self.report("old: %r", old) - ##self.report("new: %r", new) - return new - - def generate(self, tp, name, arglist, modifiers=[]): - - self.typeused(tp, 'return') - if modifiers: - classname, listname = self.destination(tp, name, arglist, modifiers) - else: - classname, listname = self.destination(tp, name, arglist) - if not classname or not listname: - self.htmlreport("*** no output generated: self.destination() returned None", klass="blacklisted") - return - if not self.specfile: - self.htmlreport("*** no output generated: no output file specified", klass="blacklisted") - return - self.specfile.write("f = %s(%s, %r,\n" % (classname, tp, name)) - for atype, aname, amode in arglist: - self.typeused(atype, amode) - self.specfile.write(" (%s, %r, %s),\n" % - (atype, aname, amode)) - if name in self.greydictnames: - self.specfile.write(" condition=%r,\n"%(self.greydictnames[name],)) - self.generatemodifiers(classname, name, modifiers) - self.specfile.write(")\n") - self.specfile.write("%s.append(f)\n\n" % listname) - if self.htmlfile: - oline = "Adding to %s:\n%s(returntype=%s, name=%r" % (listname, classname, tp, name) - for atype, aname, amode in arglist: - oline += ",\n (%s, %r, %s)" % (atype, aname, amode) - oline += ")\n" - self.htmlreport(oline, klass="pydeclaration") - - def destination(self, type, name, arglist): - return "FunctionGenerator", "functions" - - def generatemodifiers(self, classname, name, modifiers): - pass - - def blacklisted(self, type, name): - if type in self.blacklisttypes: - ##self.report("return type %s is blacklisted", type) - return 1 - if name in self.blacklistnames: - ##self.report("function name %s is blacklisted", name) - return 1 - return 0 - - def unmanageable(self, type, name, arglist): - for atype, aname, amode in arglist: - if atype in self.blacklisttypes: - self.report("argument type %s is blacklisted", atype) - return 1 - return 0 - - def htmlreport(self, line, klass=None, ranges=None): - if not self.htmlfile: return - if ranges is None: - ranges = [] - if klass: - ranges.insert(0, (0, len(line), klass)) - oline = '' - i = 0 - for c in line: - for b, e, name in ranges: - if b == i: - oline += '<span class="%s">' % name - if e == i: - oline += '</span>' - i += 1 - - if c == '<': oline += '<' - elif c == '>': oline += '>' - else: oline += c - for b, e, name in ranges: - if b >= i: - oline += '<span class="%s">' % name - if e >= i: - oline += '</span>' - if not line or line[-1] != '\n': - oline += '\n' - self.htmlfile.write(oline) - -class Scanner_PreUH3(Scanner): - """Scanner for Universal Headers before release 3""" - def initpatterns(self): - Scanner.initpatterns(self) - self.head_pat = "^extern pascal[ \t]+" # XXX Mac specific! - self.type_pat = "pascal[ \t\n]+(?P<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_])[ \t\n]+" - self.whole_pat = self.type_pat + self.name_pat + self.args_pat - self.sym_pat = "^[ \t]*(?P<name>[a-zA-Z0-9_]+)[ \t]*=" + \ - "[ \t]*(?P<defn>[-0-9'\"][^\t\n,;}]*),?" - -class Scanner_OSX(Scanner): - """Scanner for modern (post UH3.3) Universal Headers """ - def initpatterns(self): - Scanner.initpatterns(self) - self.head_pat = "^EXTERN_API(_C)?" - self.type_pat = "EXTERN_API(_C)?" + \ - "[ \t\n]*\([ \t\n]*" + \ - "(?P<type>[a-zA-Z0-9_* \t]*[a-zA-Z0-9_*])" + \ - "[ \t\n]*\)[ \t\n]*" - self.whole_pat = self.type_pat + self.name_pat + self.args_pat - self.sym_pat = "^[ \t]*(?P<name>[a-zA-Z0-9_]+)[ \t]*=" + \ - "[ \t]*(?P<defn>[-0-9_a-zA-Z'\"\(][^\t\n,;}]*),?" - -_8bit = re.compile(r"[\200-\377]") - -def escape8bit(s): - if _8bit.search(s) is not None: - out = [] - for c in s: - o = ord(c) - if o >= 128: - out.append("\\" + hex(o)[1:]) - else: - out.append(c) - s = "".join(out) - return s - -def test(): - input = "D:Development:THINK C:Mac #includes:Apple #includes:AppleEvents.h" - output = "@aespecs.py" - defsoutput = "@aedefs.py" - s = Scanner(input, output, defsoutput) - s.scan() - -if __name__ == '__main__': - test() |