From 22cf6ccfd778871f2ac0415b10e303a0af281e06 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 9 Oct 2002 10:46:23 +0000 Subject: Bring spacing into line with Tcl Engineering Manual guidelines. --- macosx/tclMacOSXBundle.c | 88 +++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/macosx/tclMacOSXBundle.c b/macosx/tclMacOSXBundle.c index 0761744..7e3dfe7 100644 --- a/macosx/tclMacOSXBundle.c +++ b/macosx/tclMacOSXBundle.c @@ -50,19 +50,19 @@ * software in accordance with the terms specified in this * license. */ - - #include - #include "tcl.h" + +#include +#include "tcl.h" /* *---------------------------------------------------------------------- * * Tcl_MacOSXOpenBundleResources -- * - * Given the bundle name for a shared library, this routine - * sets libraryPath to the Resources/Scripts directory - * in the framework package. If hasResourceFile is - * true, it will also open the main resource file for the bundle. + * Given the bundle name for a shared library, this routine sets + * libraryPath to the Resources/Scripts directory in the framework + * package. If hasResourceFile is true, it will also open the main + * resource file for the bundle. * * * Results: @@ -76,53 +76,51 @@ */ int -Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp, - CONST char *bundleName, - int hasResourceFile, - int maxPathLen, - char *libraryPath) +Tcl_MacOSXOpenBundleResources( + Tcl_Interp *interp, + CONST char *bundleName, + int hasResourceFile, + int maxPathLen, + char *libraryPath) { CFBundleRef bundleRef; CFStringRef bundleNameRef; - + libraryPath[0] = '\0'; - - bundleNameRef = CFStringCreateWithCString(NULL, - bundleName, kCFStringEncodingUTF8); - + + bundleNameRef = CFStringCreateWithCString(NULL, + bundleName, kCFStringEncodingUTF8); + bundleRef = CFBundleGetBundleWithIdentifier(bundleNameRef); CFRelease(bundleNameRef); - + if (bundleRef == 0) { - return TCL_ERROR; + return TCL_ERROR; } else { - CFURLRef libURL; - - if (hasResourceFile) { - short refNum; - refNum = CFBundleOpenBundleResourceMap(bundleRef); - } - - libURL = CFBundleCopyResourceURL(bundleRef, - CFSTR("Scripts"), - NULL, - NULL); + CFURLRef libURL; - if (libURL != NULL) { - /* - * FIXME: This is a quick fix, it is probably not right - * for internationalization. - */ - - if (CFURLGetFileSystemRepresentation (libURL, true, - libraryPath, maxPathLen)) { - } - CFRelease(libURL); - } else { - return TCL_ERROR; - } + if (hasResourceFile) { + short refNum; + refNum = CFBundleOpenBundleResourceMap(bundleRef); + } + + libURL = CFBundleCopyResourceURL(bundleRef, + CFSTR("Scripts"), NULL, NULL); + + if (libURL != NULL) { + /* + * FIXME: This is a quick fix, it is probably not right + * for internationalization. + */ + + if (CFURLGetFileSystemRepresentation(libURL, true, + libraryPath, maxPathLen)) { + } + CFRelease(libURL); + } else { + return TCL_ERROR; + } } - + return TCL_OK; } - -- cgit v0.12