if(Tcl_InitStubs(interp, "8.3", 0) == NULL) return TCL_ERROR;
int Cflib_Init(Tcl_Interp *interp){	int i;	static cfSignature sig[] = {		/* CFBundle.h */		{			"CFBundleGetMainBundle", CFBundleGetMainBundle, "", "CFType", 0,			{ 				{ END, NULL, NULL }			}		},		{			"CFBundleGetBundleWithIdentifier", CFBundleGetBundleWithIdentifier, "", "CFType", 0,			{				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleGetAllBundles", CFBundleGetAllBundles, "", "CFType", 0,			{ 				{ END, NULL, NULL }			}		},		{			"CFBundleCreate", CFBundleCreate, "bundleURL", "CFType", 1,			{ 				{ LITERAL, NULL, NULL },				{ CFTYPE, "CFURL", tclObjToCFURL },				{ END, NULL, NULL }			}		},		{			"CFBundleCreateBundlesFromDirectory", CFBundleCreateBundlesFromDirectory, "directoryURL bundleType", "CFType", 1,			{ 				{ LITERAL, NULL, NULL },				{ CFTYPE, "CFURL", tclObjToCFURL },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyBundleURL", CFBundleCopyBundleURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleGetValueForInfoDictionaryKey", CFBundleGetValueForInfoDictionaryKey, "bundle key", "CFType", 0,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleGetInfoDictionary", CFBundleGetInfoDictionary, "bundle", "CFType", 0,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleGetLocalInfoDictionary", CFBundleGetLocalInfoDictionary, "bundle", "CFType", 0,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		// CFBundleGetPackageInfo		{			"CFBundleGetIdentifier", CFBundleGetIdentifier, "bundle", "CFType", 0,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleGetVersionNumber", CFBundleGetVersionNumber, "bundle", "CFIndex", 0,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleGetDevelopmentRegion", CFBundleGetDevelopmentRegion, "bundle", "CFType", 0,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopySupportFilesDirectoryURL", CFBundleCopySupportFilesDirectoryURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyResourcesDirectoryURL", CFBundleCopyResourcesDirectoryURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyPrivateFrameworksURL", CFBundleCopyPrivateFrameworksURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopySharedFrameworksURL", CFBundleCopySharedFrameworksURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopySharedSupportURL", CFBundleCopySharedSupportURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyBuiltInPlugInsURL", CFBundleCopyBuiltInPlugInsURL, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyInfoDictionaryInDirectory", CFBundleCopyResourcesDirectoryURL, "bundelURL", "CFType", 1,			{				{ CFTYPE, "CFURL", tclObjToCFURL },				{ END, NULL, NULL }			}		},		// CFBundleGetPackageInfoInDirectory		{			"CFBundleCopyResourceURL", CFBundleCopyResourceURL, "bundle resourceName resourceType subDirName", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyResourceURLsOfType", CFBundleCopyResourceURLsOfType, "bundle resourceType subDirName", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFType },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyLocalizedString", CFBundleCopyLocalizedString, "bundle key value tableName", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyResourceURLInDirectory", CFBundleCopyResourceURLInDirectory, "bundleURL resourceName resourceType subDirName", "CFType", 1,			{				{ CFTYPE, "CFURL", tclObjToCFURL },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyResourceURLsOfTypeInDirectory", CFBundleCopyResourceURLsOfTypeInDirectory, "bundleURL resourceType subDirName", "CFType", 1,			{				{ CFTYPE, "CFURL", tclObjToCFURL },				{ CFTYPE, "CFString", tclObjToCFString },				{ CFTYPE, "CFString", tclObjToCFString },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyBundleLocalizations", CFBundleCopyBundleLocalizations, "bundle", "CFType", 1,			{				{ CFTYPE, "CFBundle", tclObjToCFBundle },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyPreferredLocalizationsFromArray", CFBundleCopyPreferredLocalizationsFromArray, "locArray", "CFType", 1,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ END, NULL, NULL }			}		},		{			"CFBundleCopyLocalizationsForPreferences", CFBundleCopyPreferredLocalizationsFromArray, "locArray prefArray", "CFType", 1,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFTYPE, "CFArray", tclObjToCFArray },				{ END, NULL, NULL }			}		},		// CFBundleCopyResourceURLForLocalization		// CFBundleCopyResourceURLsOfTypeForLocalization		// CFBundleCopyInfoDictionaryForURL		// CFBundleCopyLocalizationsForURL		/* CFPropertyList.h */		{			"CFPropertyListCreateFromXMLData", CFPropertyListCreateFromXMLData, "xmlData mutabilityOption", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFTYPE, "CFData", tclObjToCFData },				{ CFTYPE, NULL, tclObjToCFMutabilityOption },				{ CFERRORSTR, NULL, NULL }, // xxx: error string				{ END, NULL, NULL }			}		},		{			"CFPropertyListCreateXMLData", CFPropertyListCreateXMLData, "propertyList", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFTYPE, NULL, tclObjToCFPropertyList }, 				{ END, NULL, NULL }			}		},		{			"CFPropertyListCreateDeepCopy", CFPropertyListCreateDeepCopy, "propertyList mutabilityOption", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFTYPE, NULL, tclObjToCFPropertyList },				{ CFTYPE, NULL, tclObjToCFMutabilityOption },				{ END, NULL, NULL }			}		},		{			"CFPropertyListIsValid", CFPropertyListIsValid, "propertyList format", "CFIndex", 1,			{				{ CFTYPE, NULL, tclObjToCFPropertyList },				{ CFTYPE, NULL, tclObjToCFPropertyListFormat },				{ END, NULL, NULL }			}		},				// CFPropertyListWriteToStream		// CFPropertyListCreateFromStream				/* CFArray.h */		// CFArrayCreate		{			"CFArrayCreateCopy", CFArrayCreateCopy, "theArray", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFTYPE, "CFArray", NULL },				{ END, NULL, NULL }			}		},		{			"CFArrayCreateMutable", CFArrayCreateMutable, "capacity", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFINDEX, "CFIndex", NULL },				{ LITERAL, NULL, (void*)&kCFTypeArrayCallBacks },	// xxx: func to handle callbacks				{ END, NULL, NULL }			}		},		{			"CFArrayCreateMutableCopy", CFArrayCreateMutableCopy, "capacity theArray", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFINDEX, "CFIndex", NULL },				{ CFTYPE, "CFArray", NULL },				{ END, NULL, NULL }			}		},		{			"CFArrayGetCount", CFDictionaryGetCount, "theArray", "CFIndex", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ END, NULL, NULL }			}		},		{			"CFArrayGetCountOfValue", CFArrayGetCountOfValue, "theArray start end value", "CFIndex", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },	// xxx: these part of CFRange				{ CFINDEX, NULL, NULL }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFArrayContainsValue", CFArrayContainsValue, "theArray start end value", "CFIndex", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },	// xxx: these part of CFRange				{ CFINDEX, NULL, NULL }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFArrayGetValueAtIndex", CFArrayGetValueAtIndex, "theArray index", "CFType", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL }, 				{ END, NULL, NULL }			}		},		// CFArrayGetValues		// CFArrayApplyFunction		{			"CFArrayGetFirstIndexOfValue", CFArrayGetFirstIndexOfValue, "theArray start end value", "CFIndex", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },	// xxx: these part of CFRange				{ CFINDEX, NULL, NULL }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFArrayGetLastIndexOfValue", CFArrayGetLastIndexOfValue, "theArray start end value", "CFIndex", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },	// xxx: these part of CFRange				{ CFINDEX, NULL, NULL }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		// CFArrayBSearchValues		{			"CFArrayAppendValue", CFArrayAppendValue, "theArray index", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFArrayInsertValueAtIndex", CFArrayInsertValueAtIndex, "theArray index value", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFArraySetValueAtIndex", CFArraySetValueAtIndex, "theArray index value", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFArrayRemoveValueAtIndex", CFArrayRemoveValueAtIndex, "theArray index", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },				{ END, NULL, NULL }			}		},		{			"CFArrayRemoveAllValues", CFArrayRemoveAllValues, "theArray", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ END, NULL, NULL }			}		},		// CFArrayReplaceValues		{			"CFArrayExchangeValuesAtIndices", CFArrayExchangeValuesAtIndices, "theArray idx1 idx2", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },				{ CFINDEX, NULL, NULL },				{ END, NULL, NULL }			}		},		// CFArraySortValues		{			"CFArrayAppendArray", CFArrayAppendArray, "theArray otherArray start end", "void", 0,			{				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFTYPE, "CFArray", tclObjToCFArray },				{ CFINDEX, NULL, NULL },				{ CFINDEX, NULL, NULL },				{ END, NULL, NULL }			}		},						/* CFDictionary.h */		// CFDictionaryCreate		{			"CFDictionaryCreateCopy", CFDictionaryCreateCopy, "theDict", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFTYPE, "CFDictionary", NULL },				{ END, NULL, NULL }			}		},		{			"CFDictionaryCreateMutable", CFDictionaryCreateMutable, "capacity", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFINDEX, "CFIndex", NULL },				{ LITERAL, NULL, (void*)&kCFTypeDictionaryKeyCallBacks },	// xxx: func to handle callbacks				{ LITERAL, NULL, (void*)&kCFTypeDictionaryValueCallBacks }, // xxx: func to handle callbacks				{ END, NULL, NULL }			}		},		{			"CFDictionaryCreateMutableCopy", CFDictionaryCreateMutableCopy, "capacity theDict", "CFType", 1,			{				{ LITERAL, NULL, NULL },				{ CFINDEX, "CFIndex", NULL },				{ CFTYPE, "CFDictionary", NULL },				{ END, NULL, NULL }			}		},		{			"CFDictionaryGetCount", CFDictionaryGetCount, "dictionary", "CFIndex", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ END, NULL, NULL }			}		},		{			"CFDictionaryGetCountOfKey", CFDictionaryGetCountOfKey, "dictionary key", "CFIndex", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryGetCountOfValue", CFDictionaryGetCountOfValue, "dictionary value", "CFIndex", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryContainsKey", CFDictionaryContainsKey, "dictionary key", "CFIndex", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryContainsValue", CFDictionaryContainsValue, "dictionary value", "CFIndex", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryGetValue", CFDictionaryGetValue, "dictionary key", "CFType", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		// CFDictionaryGetValueIfPresent		// CFDictionaryGetKeysAndValues		// CFDictionaryApplyFunction		{			"CFDictionaryAddValue", CFDictionaryAddValue, "dictionary key value", "void", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionarySetValue", CFDictionarySetValue, "dictionary key value", "void", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryReplaceValue", CFDictionaryReplaceValue, "dictionary key value", "void", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryRemoveValue", CFDictionaryRemoveValue, "dictionary key", "void", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ CFTYPE, NULL, tclObjToCFType }, 				{ END, NULL, NULL }			}		},		{			"CFDictionaryRemoveAllValues", CFDictionaryRemoveAllValues, "dictionary", "void", 0,			{				{ CFTYPE, "CFDictionary", tclObjToCFDictionary },				{ END, NULL, NULL }			}		},		{			NULL, NULL, NULL, NULL, 0, { { END, NULL, NULL } }		}	};	for (i = 0; sig[i].name != NULL; ++i) {		Tcl_CreateObjCommand(interp, sig[i].name, tclCFFunc, &sig[i], NULL);	}	cfTypeRegister();	cfStringRegister();	cfNumberRegister();	cfDataRegister();	cfBundleRegister();	cfURLRegister();	cfDictionaryRegister();	cfArrayRegister();		Tcl_CreateObjCommand(interp, "CFGetTypeID", tclCFGetTypeID, NULL, NULL);	Tcl_CreateObjCommand(interp, "CFStringGetTypeID", tclCFGetTypeID2, (void*)CFStringGetTypeID(), NULL);	Tcl_CreateObjCommand(interp, "CFNumberCreate", tclCFNumberCreate, NULL, NULL);	Tcl_CreateObjCommand(interp, "CFNumberGetTypeID", tclCFGetTypeID2, (void*)CFNumberGetTypeID(), NULL);	Tcl_CreateObjCommand(interp, "CFURLGetTypeID", tclCFGetTypeID2, (void*)CFURLGetTypeID(), NULL);	Tcl_CreateObjCommand(interp, "CFBundleGetTypeID", tclCFGetTypeID2, (void*)CFBundleGetTypeID(), NULL);	Tcl_CreateObjCommand(interp, "CFDictionaryGetTypeID", tclCFGetTypeID2, (void*)CFDictionaryGetTypeID(), NULL);	Tcl_CreateObjCommand(interp, "CFArrayGetTypeID", tclCFGetTypeID2, (void*)CFArrayGetTypeID(), NULL);	//Tcl_CreateObjCommand(interp, "CFBundleCreateBundlesFromDirectory", tclCFBundleCreateBundlesFromDirectory, NULL, NULL);	if(Tcl_PkgProvide(interp, "CFLib", "1.0") != TCL_OK)		return TCL_ERROR;	return TCL_OK;}