|
From: <cre...@us...> - 2007-06-18 04:09:16
|
Revision: 1694
http://svn.sourceforge.net/frontierkernel/?rev=1694&view=rev
Author: creecode
Date: 2007-06-17 21:09:17 -0700 (Sun, 17 Jun 2007)
Log Message:
-----------
ported r1646:1693 from trunk
Modified Paths:
--------------
Frontier/branches/mysql/Common/headers/versions.h
Frontier/branches/mysql/Common/source/about.c
Frontier/branches/mysql/Common/source/fileops.c
Frontier/branches/mysql/Common/source/fileverbs.c
Frontier/branches/mysql/Common/source/langhtml.c
Frontier/branches/mysql/Common/source/langsystypes.c
Frontier/branches/mysql/Common/source/langvalue.c
Frontier/branches/mysql/Common/source/shell.c
Modified: Frontier/branches/mysql/Common/headers/versions.h
===================================================================
--- Frontier/branches/mysql/Common/headers/versions.h 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/headers/versions.h 2007-06-18 04:09:17 UTC (rev 1694)
@@ -69,10 +69,10 @@
#define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
#define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */
- #define APP_REVISION_LEVEL 13 /* for non-final releases only */
- #define APP_BUILD_NUMBER 13 /* increment by one for every release, final or not */
+ #define APP_REVISION_LEVEL 14 /* for non-final releases only */
+ #define APP_BUILD_NUMBER 14 /* increment by one for every release, final or not */
- #define APP_VERSION_STRING "10.1a13"
+ #define APP_VERSION_STRING "10.1a14"
#else
@@ -95,10 +95,10 @@
#define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
#define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */
- #define APP_REVISION_LEVEL 13 /* for non-final releases only */
- #define APP_BUILD_NUMBER 13 /* increment by one for every release, final or not */
+ #define APP_REVISION_LEVEL 14 /* for non-final releases only */
+ #define APP_BUILD_NUMBER 14 /* increment by one for every release, final or not */
- #define APP_VERSION_STRING "10.1a13"
+ #define APP_VERSION_STRING "10.1a14"
#endif
#else
@@ -121,10 +121,10 @@
#define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
#define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */
- #define APP_REVISION_LEVEL 13 /* for non-final releases only */
- #define APP_BUILD_NUMBER 13 /* increment by one for every release, final or not */
+ #define APP_REVISION_LEVEL 14 /* for non-final releases only */
+ #define APP_BUILD_NUMBER 14 /* increment by one for every release, final or not */
- #define APP_VERSION_STRING "10.1a13"
+ #define APP_VERSION_STRING "10.1a14"
#endif
Modified: Frontier/branches/mysql/Common/source/about.c
===================================================================
--- Frontier/branches/mysql/Common/source/about.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/about.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -85,7 +85,7 @@
typedef struct tyaboutrecord {
-
+
Rect messagearea;
Rect aboutarea;
@@ -95,8 +95,9 @@
boolean flbigwindow;
boolean flextrastats;
-
+
long refcon;
+
} tyaboutrecord, *ptraboutrecord, **hdlaboutrecord;
@@ -187,16 +188,17 @@
#ifdef WIN95VERSION
BIGSTRING ("\x14" "Handles Allocated: "),
#endif
-
+
BIGSTRING (""),
-
+
BIGSTRING ("\x10" "Visible Agent: "),
BIGSTRING ("\x0f" "Current Time: "),
bs_APP_NAME, /* 2006-02-06 aradke: see versions.h */
- BIGSTRING ("\x02" "^0"),
+ BIGSTRING ("\x02" "^0")
+
};
Modified: Frontier/branches/mysql/Common/source/fileops.c
===================================================================
--- Frontier/branches/mysql/Common/source/fileops.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/fileops.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -438,7 +438,7 @@
//
// 1993-09-21 dmb: take vnum as parameter, not volname. otherwise, we can't distinguish between two vols w/the
- // same name.
+ // same name.
//
// 1993-09-07 DW: determine if it's a network volume
//
@@ -488,13 +488,23 @@
void filegetinfofrompb ( FSRefParam *pb, tyfileinfo *info ) {
//
+ // 2007-06-11 creedon: fix for Mac OS X bundles/packages that are
+ // applications not setting creator/type
+ //
+ // fix for flbundle not being set to true for Mac
+ // OS X bundles/packages
+ //
+ // fix for file names that don't have extensions
+ //
// 2006-06-24 creedon: FSRef-ized
//
// 5.1.4 dmb: set finderbits for folders too.
//
- // 1993-09-24 dmb: handle volumes here, combining vol info with root directory folder info. I'm not sure if a
- // volume lock is always reflected in the root directory, so don't set fllocked false if the
- // attribute isn't set in the pb. (it starts out cleared anyway.)
+ // 1993-09-24 dmb: handle volumes here, combining vol info with root
+ // directory folder info. I'm not sure if a volume
+ // lock is always reflected in the root directory, so
+ // don't set fllocked false if the attribute isn't set
+ // in the pb. (it starts out cleared anyway.)
//
unsigned short finderbits;
@@ -534,56 +544,32 @@
if ( ( *info ).flfolder ) {
- boolean flisapplication, flisbundle;
+ ( *info ).flbusy = pb -> catInfo -> valence > 0; // folders are considered "busy" if there are any files within
+ // the folder
- LSIsApplication ( ( *pb ).ref, &flisapplication, &flisbundle );
-
- if ( flisapplication || flisbundle ) { // Mac OS X bundles/packages are not considered folders
-
- ( *info ).flfolder = false;
-
- ( *info ).flbundle = true;
-
- } // if
-
- ( *info ).flbusy = pb -> catInfo -> valence > 0; // Folders are considered "busy" if there are any files
- // within the folder
- if ( ( *info ).flfolder )
-
- ( *info ).filecreator = ( *info ).filetype = ' ';
-
- else {
-
- LSItemInfoRecord iteminfo;
- OSStatus status;
-
- status = LSCopyItemInfoForRef ( ( *pb ).ref, kLSRequestTypeCreator, &iteminfo );
-
- ( *info ).filecreator = iteminfo.creator;
-
- ( *info ).filetype = iteminfo.filetype;
-
- } // if
-
( *info ).iconposition = ( ( FolderInfo * ) pb -> catInfo -> finderInfo ) -> location;
if ( ! ( *info ).flvolume ) { // these aren't the same for a volume & its root dir
-
+
( *info ).ctfiles = pb -> catInfo -> valence;
} // if
- ( *info ).folderview = ( tyfolderview ) 0; // I can't find a way to get this info from FSRefParamPtr, I thought about trying to fake a DInfo structure and getting it from there but it may not even have the right value, I did find a reference to DRMacWindowView // dinfo.frView >> 8;
+ ( *info ).folderview = ( tyfolderview ) 0; // I can't find a way to get this info from FSRefParamPtr, I thought
+ // about trying to fake a DInfo structure and getting it from there
+ // but it may not even have the right value, I did find a reference
+ // to DRMacWindowView // dinfo.frView >> 8;
finderbits = ( ( FolderInfo * ) pb -> catInfo -> finderInfo ) -> finderFlags;
}
+
else { // fill in fields for a file, somewhat different format than a folder
( *info ).ixlabel = ( ( ( FileInfo * ) pb -> catInfo -> finderInfo ) -> finderFlags & kColor ) >> 1;
-
+
( *info ).flbusy = ( pb -> catInfo -> nodeFlags & kFSNodeForkOpenMask ) != 0;
-
+
( *info ).filecreator = ( ( FileInfo * ) pb -> catInfo -> finderInfo ) -> fileCreator;
( *info ).filetype = ( ( FileInfo * ) pb -> catInfo -> finderInfo ) -> fileType;
@@ -597,25 +583,79 @@
finderbits = ( ( FileInfo * ) pb -> catInfo -> finderInfo ) -> finderFlags;
} // if
-
- /* copy from the finder bits into the record */ {
+
+ /* copy many of the finder bits into the record */ {
+
+ ( *info ).flalias = ( finderbits & kIsAlias ) != 0;
+
+ ( *info ).flbundle = ( finderbits & kHasBundle ) != 0;
+
+ ( *info ).flinvisible = ( finderbits & kIsInvisible ) != 0;
+
+ ( *info ).flstationery = ( finderbits & kIsStationery ) != 0;
+
+ ( *info ).flshared = ( finderbits & kIsShared ) != 0;
+
+ ( *info ).flnamelocked = ( finderbits & kNameLocked ) != 0;
+
+ ( *info ).flcustomicon = ( finderbits & kHasCustomIcon ) != 0;
+
+ } // finder bits
+
+ if ( ( *info ).flfolder ) {
- ( *info ).flalias = (finderbits & kIsAlias) != 0;
+ boolean flIsApplication, flIsBundle;
+
+ LSIsApplication ( ( *pb ).ref, &flIsApplication, &flIsBundle );
+
+ if ( flIsApplication || flIsBundle ) { // Mac OS X bundles/packages are not considered folders
+
+ ( *info ).flfolder = false;
- ( *info ).flbundle = (finderbits & kHasBundle) != 0;
+ ( *info ).flbundle = true;
- ( *info ).flinvisible = (finderbits & kIsInvisible) != 0;
+ } // if
- ( *info ).flstationery = (finderbits & kIsStationery) != 0;
+ if ( flIsApplication ) { // for Mac OS X bundles/packages that are applications we need to grab creator/type
+
+ OSStatus status;
+ LSItemInfoRecord itemInfo;
- ( *info ).flshared = (finderbits & kIsShared) != 0;
+ status = LSCopyItemInfoForRef ( ( *pb ).ref, kLSRequestTypeCreator, &itemInfo );
- ( *info ).flnamelocked = (finderbits & kNameLocked) != 0;
+ ( *info ).filecreator = itemInfo.creator;
- ( *info ).flcustomicon = (finderbits & kHasCustomIcon) != 0;
+ ( *info ).filetype = itemInfo.filetype;
+
+ } // if
- } // finder bits
+ }
+
+ else {
+
+ if ( ! ( *info ).filetype ) { // try to get from file extension
+
+ bigstring bsext;
+ LSItemInfoRecord iteminfo;
+ OSStatus status;
+ clearbytes ( &iteminfo, sizeof ( iteminfo ) );
+
+ status = LSCopyItemInfoForRef ( ( *pb ).ref, kLSRequestExtension, &iteminfo );
+
+ if ( iteminfo.extension != NULL )
+ CFStringRefToStr255 ( iteminfo.extension, bsext );
+
+ if ( isemptystring ( bsext ) || ( stringlength ( bsext ) > 4 ) ) // no extension
+
+ stringtoostype ( "\x04" "????", &( *info ).filetype );
+ else
+ stringtoostype ( bsext, &( *info ).filetype );
+
+ } // if
+
+ } // if
+
} // filegetinfofrompb
@@ -3546,87 +3586,100 @@
} /*initfile*/
-boolean findapplication (OSType creator, ptrfilespec fsapp) {
-
- /*
- 2006-06-25 creedon: for Mac, FSRef-ized
-
- 2006-04-10 creedon: deleted old code, see revision 1246 for old code
-
- 2006-04-09 creedon: use LSFindApplicationForInfo if available
-
- 5.0.1 dmb: implemented for Win using the registry
+boolean findapplication ( OSType creator, ptrfilespec fsapp ) {
- 2.1b11 dmb: loop through all files in each db if necessary to find one that's actually an application
-
- 9/7/92 dmb: make two passes, skipping volumes mounted with a foreign
- file system the first time through. note: if this turns out not to be
- the best criteria, we could check for shared volumes instead by testing
- vMLocalHand in hasdesktopmanager.
+ //
+ // 2007-06-12 creedon: for Mac, use getfilespecparent
+ //
+ // 2006-06-25 creedon: for Mac, FSRef-ized
+ //
+ // 2006-04-10 creedon: deleted old code, see revision 1246 for old code
+ //
+ // 2006-04-09 creedon: use LSFindApplicationForInfo if available
+ //
+ // 5.0.1 dmb: implemented for Win using the registry
+ //
+ // 2.1b11 dmb: loop through all files in each db if necessary to find one
+ // that's actually an application
+ //
+ // 1992-09-07 dmb: make two passes, skipping volumes mounted with a foreign
+ // file system the first time through. note: if this turns
+ // out not to be the best criteria, we could check for
+ // shared volumes instead by testing vMLocalHand in
+ // hasdesktopmanager.
+ //
+ // also: since we don't maintain the desktop DB when we
+ // delete files, we need to verify that the file we locate
+ // still exists. added fileexists call before returning
+ // true.
+ //
+ // 1991-12-05 dmb: created
+ //
- also: since we don't maintain the desktop DB when we delete files, we
- need to verify that the file we locate still exists. added fileexists
- call before returning true.
+ #ifdef MACVERSION
- 12/5/91 dmb
- */
-
- #ifdef MACVERSION
-
- if ((UInt32) LSFindApplicationForInfo == (UInt32) kUnresolvedCFragSymbolAddress)
- return (false);
+ OSStatus status;
- if (LSFindApplicationForInfo (creator, NULL, NULL, &( *fsapp ).fsref, NULL) != noErr)
- return (false);
-
- return (true);
+ if ( ( UInt32 ) LSFindApplicationForInfo == ( UInt32 ) kUnresolvedCFragSymbolAddress )
+ return ( false );
+
+ status = LSFindApplicationForInfo ( creator, NULL, NULL, &( *fsapp ).fsref, NULL);
+
+ if ( status != noErr )
+ return ( false );
+
+ getfilespecparent ( fsapp );
+
+ return ( true );
+
+ #endif // MACVERSION
- #endif /* MACVERSION */
-
#ifdef WIN95VERSION
-
+
byte bsextension [8];
bigstring bsregpath, bsoptions;
-
+
ostypetostring (creator, bsextension);
-
+
poptrailingwhitespace (bsextension);
-
+
insertchar ('.', bsextension);
pushchar (chnul, bsextension);
// copyctopstring ("software\\Microsoft\\Windows\\CurrentVersion", bsregpath);
-
+
if (!getRegKeyString ((Handle) HKEY_CLASSES_ROOT, bsextension, NULL, bsregpath))
return (false);
+
+ pushstring ("\x13\\shell\\open\\command", bsregpath);
- pushstring ("\x13\\shell\\open\\command", bsregpath);
-
if (!getRegKeyString ((Handle) HKEY_CLASSES_ROOT, bsregpath, NULL, bsregpath))
return (false);
+
+ if (getstringcharacter (bsregpath, 0) == '"') {
- if (getstringcharacter (bsregpath, 0) == '"') {
+ popleadingchars (bsregpath, '"');
- popleadingchars (bsregpath, '"');
-
firstword (bsregpath, '"', bsregpath);
+
}
+
else {
+
+ lastword (bsregpath, ' ', bsoptions);
- lastword (bsregpath, ' ', bsoptions);
-
if (stringlength (bsoptions) < stringlength (bsregpath))
deletestring (bsregpath, stringlength (bsregpath) - stringlength (bsoptions) + 1, stringlength (bsoptions));
}
+
+ return (pathtofilespec (bsregpath, fsapp));
- return (pathtofilespec (bsregpath, fsapp));
+ #endif // WIN95VERSION
+
+ } // findapplication
- #endif /* WIN95VERSION */
- } /* findapplication */
-
-
boolean extendfilespec ( const ptrfilespec fsin, ptrfilespec fsout ) {
//
Modified: Frontier/branches/mysql/Common/source/fileverbs.c
===================================================================
--- Frontier/branches/mysql/Common/source/fileverbs.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/fileverbs.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -2035,21 +2035,22 @@
#endif
-static boolean findapplicationverb (hdltreenode hparam1, tyvaluerecord *v) {
-
+static boolean findapplicationverb ( hdltreenode hparam1, tyvaluerecord *v ) {
+
OSType creator;
tyfilespec fsapp;
flnextparamislast = true;
- if (!getostypevalue (hparam1, 1, &creator))
- return (false);
+ if ( ! getostypevalue ( hparam1, 1, &creator ) )
+ return ( false );
+
+ if ( ! findapplication ( creator, &fsapp ) )
+ clearbytes ( &fsapp, sizeof ( fsapp ) );
+
+ return ( setfilespecvalue ( &fsapp, v ) );
- if (!findapplication (creator, &fsapp))
- clearbytes (&fsapp, sizeof (fsapp));
-
- return (setfilespecvalue (&fsapp, v));
- } /*findapplicationverb*/
+ } // findapplicationverb
#ifdef WIN95VERSION
Modified: Frontier/branches/mysql/Common/source/langhtml.c
===================================================================
--- Frontier/branches/mysql/Common/source/langhtml.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/langhtml.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -74,7 +74,7 @@
#define fldebugwebsite false
-#define str_separatorline BIGSTRING ("\x17<hr size=2 width=100% />\r")/* 2005-12-18 creedon - end tag with space slash for compatibility with post HTML 4.01 standards */
+#define str_separatorline BIGSTRING ("\x17<hr size=\"2\" width=\"100%\" />\r")/* 2005-12-18 creedon - end tag with space slash for compatibility with post HTML 4.01 standards */
#define str_macroerror BIGSTRING ("\x20<b>[</b>Macro error: ^0<b>]</b>\r")
#define str_mailto BIGSTRING ("\x1A<a href=\"mailto:^0\">^0</a>")
#define str_hotlink BIGSTRING ("\x13<a href=\"^0\">^1</a>")
@@ -205,7 +205,7 @@
#define STR_P_CONDITION BIGSTRING ("\x09" "condition")
#define STR_P_RESPONDER BIGSTRING ("\x09" "responder")
#define STR_P_PATHARGS BIGSTRING ("\x08" "pathArgs")
-#define STR_P_ADRTABLE BIGSTRING ("\x08" "adrTable")
+#define STR_P_ADRTABLE BIGSTRING ("\x08" "adrTable")
#define STR_P_FLPARAMS BIGSTRING ("\x08" "flParams")
#define STR_P_ENABLED BIGSTRING ("\x07" "enabled")
#define STR_P_REQUEST BIGSTRING ("\x07" "request")
@@ -245,6 +245,7 @@
#define STR_P_DOLLAR BIGSTRING ("\x01" "$")
#define STR_P_SPACE BIGSTRING ("\x01" " ")
#define STR_P_EMPTY BIGSTRING ("\x00")
+#define STR_P_USERWEBSERVERSTRING BIGSTRING ( "\x11" "headerFieldServer" )
#define STR_STATUSCONTINUE "HTTP/1.1 100 CONTINUE\r\n\r\n"
#define sizestatuscontinue 25
@@ -5507,38 +5508,82 @@
}/*webserverparsecookies*/
-
-static boolean webservergetserverstring (tyvaluerecord *vreturn) {
-
+static boolean webservergetpref (bigstring bsprefname, tyvaluerecord *vreturn) {
+
/*
- 6.1d2 AR: Return a string identifying the server software, i.e. UserLand Frontier/6.1d2-WinNT
+ 6.1d2 AR: A utility function for getting a pref from user.webserver.prefs.
+ If no value is found in that table, we return false in vreturn.
6.1d4 AR: Reviewed for proper error handling and reporting.
+
+ 2007-06-02 aradke: Don't set *vreturn to false if the requested pref doesn't exist.
+ return false instead. This makes it possible for the caller to differentiate
+ between a non-existant pref and one that is actually set to false.
*/
+
+ hdlhashtable hprefstable;
+ tyvaluerecord val;
+ boolean fl;
+ hdlhashnode hnode;
+
+ disablelangerror ();
+
+ fl = langfastaddresstotable (roottable, STR_P_USERWEBSERVERPREFS, &hprefstable)
+ && langhashtablelookup (hprefstable, bsprefname, &val, &hnode);
+
+ if (fl)
+ fl = copyvaluerecord (val, vreturn);
+
+ if (fl)
+ if ((*vreturn).valuetype == externalvaluetype)
+ if (langexternalgettype (*vreturn) == idwordprocessor)
+ fl = coercetostring (vreturn);
+
+ enablelangerror ();
+
+ return (fl);
+ } /*webservergetpref*/
+
+static boolean webservergetserverstring ( tyvaluerecord *vreturn ) {
+
+ //
+ // 2007-06-02 creedon: call webservergetpref to grab value at
+ // user.webserver.prefs.headerFieldServer if defined
+ //
+ // 6.1d2 AR: Return a string identifying the server software, i.e.
+ // Frontier/6.1d2-WinNT
+ //
+ // 6.1d4 AR: Reviewed for proper error handling and reporting.
+ //
+
Handle h = nil;
tyvaluerecord vversion, vos;
- if (!newtexthandle (STR_P_SERVERSTRING, &h))
- return (false);
+ if ( webservergetpref ( STR_P_USERWEBSERVERSTRING, vreturn ) )
+ return ( true );
+
+ if ( ! newtexthandle ( STR_P_SERVERSTRING, &h ) )
+ return ( false );
- if (!frontierversion (&vversion))
+ if ( ! frontierversion ( &vversion ) )
goto exit;
- if (!sysos (&vos))
+ if ( ! sysos ( &vos ) )
goto exit;
- if (!parsedialoghandle (h, vversion.data.stringvalue, vos.data.stringvalue, nil, nil))
+ if ( ! parsedialoghandle ( h, vversion.data.stringvalue, vos.data.stringvalue, nil, nil ) )
goto exit;
- return (setheapvalue (h, stringvaluetype, vreturn));
+ return ( setheapvalue ( h, stringvaluetype, vreturn ) );
-exit:
+ exit:
- disposehandle (h);
+ disposehandle ( h );
- return (false);
- }/*webservergetserverstring*/
+ return ( false );
+
+ } // webservergetserverstring
static boolean webserverbuilderrorpage (Handle hshort, Handle hlong, Handle *hpage) {
@@ -5749,7 +5794,7 @@
exemptfromtmpstack (&val);
- /* add Server: UserLand Frontier/6.1d1-NT to header table */
+ /* add Server: Frontier/6.1d1-NT to header table */
if (!webservergetserverstring (&val))
goto exit;
@@ -5920,45 +5965,7 @@
505 HTTP Version Not Supported
*/
-#if 0
-static boolean webservergetpref (bigstring bsprefname, tyvaluerecord *vreturn) {
-
- /*
- 6.1d2 AR: A utility function for getting a pref from user.webserver.prefs.
- If no value is found in that table, we return false in vreturn.
-
- 6.1d4 AR: Reviewed for proper error handling and reporting.
- */
-
- hdlhashtable hprefstable;
- tyvaluerecord val;
- boolean fl;
- hdlhashnode hnode;
-
- disablelangerror ();
-
- fl = langfastaddresstotable (roottable, STR_P_USERWEBSERVERPREFS, &hprefstable)
- && langhashtablelookup (hprefstable, bsprefname, &val, &hnode);
-
- enablelangerror ();
-
- if (!fl)
- return (setbooleanvalue (false, vreturn));
-
- if (!copyvaluerecord (val, vreturn))
- return (false);
-
- if ((*vreturn).valuetype == externalvaluetype)
- if (langexternalgettype (*vreturn) == idwordprocessor)
- coercetostring (vreturn);
-
- return (true);
- } /*webservergetpref*/
-
-#endif
-
-
static boolean webservergetrespondertableaddress (bigstring bsname, tyaddress *adr) {
/*
@@ -6429,38 +6436,38 @@
tyvaluerecord vserve;
- if (!webservergetpref (BIGSTRING ("\x19" "flEnableDirectFileServing"), &vserve))
- goto internal_error;
+ if (webservergetpref (BIGSTRING ("\x19" "flEnableDirectFileServing"), &vserve)) {
- if (!coercetoboolean (&vserve))
- goto internal_error;
-
- if (vserve.data.flvalue) {
+ if (!coercetoboolean (&vserve))
+ goto internal_error;
- unsigned long stream;
- unsigned long fsize;
- tyvaluerecord vheader;
- tyfilespec fs = **val.data.filespecvalue;
-
- if (!filesize (&fs, &fsize))
- goto internal_error;
+ if (vserve.data.flvalue) {
+
+ unsigned long stream;
+ unsigned long fsize;
+ tyvaluerecord vheader;
+ tyfilespec fs = **val.data.filespecvalue;
+
+ if (!filesize (&fs, &fsize))
+ goto internal_error;
- if (!langassignlongvalue (hresponseheaderstable, STR_P_CONTENT_LENGTH, fsize))
- goto internal_error;
+ if (!langassignlongvalue (hresponseheaderstable, STR_P_CONTENT_LENGTH, fsize))
+ goto internal_error;
- if (!webserverbuildresponse (bscode, hresponseheaderstable, nil, &vheader))
- goto internal_error;
+ if (!webserverbuildresponse (bscode, hresponseheaderstable, nil, &vheader))
+ goto internal_error;
- if (!langlookuplongvalue (hparamtable, STR_P_STREAM, &stream))
- goto internal_error;
-
- if (!fwsNetEventWriteFileToStream (stream, vheader.data.stringvalue, nil, &fs))
- goto internal_error;
-
- if (!setbooleanvalue (true, vreturn))
- goto internal_error;
-
- goto done;
+ if (!langlookuplongvalue (hparamtable, STR_P_STREAM, &stream))
+ goto internal_error;
+
+ if (!fwsNetEventWriteFileToStream (stream, vheader.data.stringvalue, nil, &fs))
+ goto internal_error;
+
+ if (!setbooleanvalue (true, vreturn))
+ goto internal_error;
+
+ goto done;
+ }
}
}
#endif
Modified: Frontier/branches/mysql/Common/source/langsystypes.c
===================================================================
--- Frontier/branches/mysql/Common/source/langsystypes.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/langsystypes.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -512,53 +512,60 @@
#ifdef MACVERSION
-static boolean stringtoalias (tyvaluerecord *val) {
+ static boolean stringtoalias ( tyvaluerecord *val ) {
- //
- // 2006-06-24 creedon: FSRef-ized
- //
- // 2.1b2 dmb: try converting to a filespec first to ensure that partial path or
- // drive number if processed properly. also, in the filespec case, the alias isn't
- // minimal
- //
- // 1992-07-23 dmb: OK, try to getfullfilepath, but with errors disabled
- //
- // 1992-07-02 dmb: don't call getfullfilepath; makes it impossible to create aliases of
- // not-yet-existing files, or offline volumes
- //
- // 1991-10-07 dmb: make sure we're actually passing a full path to the NewAlias routine
- //
-
- register Handle htext;
- bigstring bspath;
- tyfilespec fs;
- AliasHandle halias;
- boolean flfolder;
- OSErr errcode;
-
- if (!langcanusealiases ())
- return (false);
-
- htext = (*val).data.stringvalue;
-
- texthandletostring (htext, bspath);
-
- if (pathtofilespec (bspath, &fs) && fileexists (&fs, &flfolder))
- errcode = FSNewAlias (nil, &fs.fsref, &halias);
- else
- errcode = NewAliasMinimalFromFullPath (stringlength (bspath), bspath + 1, nil, nil, &halias);
-
- if (oserror (errcode))
- return (false);
-
- if (!setheapvalue ((Handle) halias, aliasvaluetype, val))
- return (false);
-
- releaseheaptmp ((Handle) htext);
-
- return (true);
- } /*stringtoalias*/
-
+ //
+ // 2007-06-11 creedon: fileexists wasn't working, need to extend the
+ // filespec, if successful then file exists
+ //
+ // 2006-06-24 creedon: FSRef-ized
+ //
+ // 2.1b2 dmb: try converting to a filespec first to ensure that
+ // partial path or drive number if processed properly.
+ // also, in the filespec case, the alias isn't minimal
+ //
+ // 1992-07-23 dmb: OK, try to getfullfilepath, but with errors
+ // disabled
+ //
+ // 1992-07-02 dmb: don't call getfullfilepath; makes it impossible to
+ // create aliases of not-yet-existing files, or
+ // offline volumes
+ //
+ // 1991-10-07 dmb: make sure we're actually passing a full path to the
+ // NewAlias routine
+ //
+
+ register Handle htext;
+
+ AliasHandle halias;
+ OSErr errcode;
+ bigstring bspath;
+ tyfilespec fs;
+
+ if ( ! langcanusealiases ( ) )
+ return ( false );
+
+ htext = ( *val ).data.stringvalue;
+
+ texthandletostring ( htext, bspath );
+
+ if ( pathtofilespec ( bspath, &fs ) && extendfilespec ( &fs, &fs ) )
+ errcode = FSNewAlias ( NULL, &fs.fsref, &halias );
+ else
+ errcode = NewAliasMinimalFromFullPath ( stringlength ( bspath), bspath + 1, NULL, NULL, &halias );
+
+ if ( oserror ( errcode ) )
+ return ( false );
+
+ if ( ! setheapvalue ( ( Handle ) halias, aliasvaluetype, val ) )
+ return (false);
+
+ releaseheaptmp ( ( Handle ) htext );
+
+ return ( true );
+
+ } // stringtoalias
+
#endif
Modified: Frontier/branches/mysql/Common/source/langvalue.c
===================================================================
--- Frontier/branches/mysql/Common/source/langvalue.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/langvalue.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -3133,37 +3133,48 @@
boolean coercetostring (tyvaluerecord *val) {
-
+
//
+ // 2007-06-12 creedon: empty bs at start of function, fix for problem
+ // w/filespecvaluetype case returning gibberish for
+ // invalid fs
+ //
// 2006-06-24 creedon: for Mac, FSRef-ized
//
- // 4.1b4 dmb: if flcoerceexternaltostring is not enabled, create a reasonable display string for externals
+ // 4.1b4 dmb: if flcoerceexternaltostring is not enabled, create a
+ // reasonable display string for externals
//
// 2.1b3 dmb: don't ignore return value from objspectostring
//
- // 1992-08-10 dmb: added flcoerceexternaltostring flag to prevent external-to-string coercion except when explicitly requested by stringfunc in langverbs.c
+ // 1992-08-10 dmb: added flcoerceexternaltostring flag to prevent
+ // external-to-string coercion except when explicitly
+ // requested by stringfunc in langverbs.c
//
register tyvaluerecord *v = val;
+
+ Handle h;
bigstring bs;
- Handle h;
+ setemptystring ( bs );
+
if (!langheapallocated (v, &h))
h = nil;
+
+ switch ((*v).valuetype) {
- switch ((*v).valuetype) {
-
case stringvaluetype:
return (true);
+
+ case novaluetype: {
- case novaluetype:
- if (flinhibitnilcoercion)
- return (false);
+ if ( flinhibitnilcoercion )
+ return ( false );
+
+ break;
- setemptystring (bs);
+ }
- break;
-
/*
case passwordvaluetype:
(*v).valuetype = stringvaluetype;
@@ -3173,46 +3184,46 @@
case addressvaluetype:
return (addresstostring (v));
-
+
case booleanvaluetype:
if ((*v).data.flvalue)
copystring (bstrue, bs);
else
copystring (bsfalse, bs);
-
+
break;
case charvaluetype:
setstringwithchar ((*v).data.chvalue, bs);
break;
-
+
case intvaluetype:
shorttostring ((*v).data.intvalue, bs);
break;
-
+
case longvaluetype:
numbertostring ((*v).data.longvalue, bs);
break;
-
+
case ostypevaluetype:
case enumvaluetype:
ostypetostring ((*v).data.ostypevalue, bs);
break;
-
+
case directionvaluetype:
dirtostring ((*v).data.dirvalue, bs);
break;
-
+
case datevaluetype:
timedatestring ((*v).data.datevalue, bs);
break;
-
+
case fixedvaluetype: {
double x = (double) (*v).data.longvalue / 65536;
@@ -3224,72 +3235,72 @@
break;
}
-
+
case singlevaluetype:
floattostring ((*v).data.singlevalue, bs);
break;
-
+
case doublevaluetype:
floattostring (**(*v).data.doublevalue, bs);
break;
-
+
case pointvaluetype:
pointtostring ((*v).data.pointvalue, bs);
break;
-
+
case rectvaluetype:
recttostring (**(*v).data.rectvalue, bs);
break;
-
+
case rgbvaluetype:
rgbtostring (**(*v).data.rgbvalue, bs);
break;
-
+
case patternvaluetype:
patterntostring (**(*v).data.patternvalue, bs);
break;
-
+
case objspecvaluetype:
if (!objspectostring ((*v).data.objspecvalue, bs))
return (false);
+
+ break;
- break;
-
case aliasvaluetype:
aliastostring ((*v).data.aliasvalue, bs);
break;
+
+ case filespecvaluetype: {
- case filespecvaluetype: {
-
- tyfilespec fs = **(*v).data.filespecvalue;
-
+ tyfilespec fs = **( *v ).data.filespecvalue;
+
filespectopath ( &fs, bs );
break;
}
-
+
case binaryvaluetype:
if (!copyvaluedata (v))
return (false);
-
+
stripbinarytypeid ((*v).data.binaryvalue);
(*v).valuetype = stringvaluetype;
return (true);
-
+
case listvaluetype:
case recordvaluetype:
return (coercelistvalue (v, stringvaluetype));
-
+
case codevaluetype:
bigvaltostring (v, bs);
@@ -3297,7 +3308,7 @@
case externalvaluetype:
if (!flcoerceexternaltostring) {
-
+
/* 4.1b4 dmb*/
/*
langbadexternaloperror (badexternaloperationerror, *v);
@@ -3307,27 +3318,27 @@
break;
}
-
+
if (!newemptyhandle (&h))
return (false);
+
+ if (!langexternalpacktotext ((hdlexternalhandle) (*v).data.externalvalue, h)) {
- if (!langexternalpacktotext ((hdlexternalhandle) (*v).data.externalvalue, h)) {
-
disposehandle (h);
return (false);
}
-
+
disposevaluerecord (*v, true);
return (setheapvalue (h, stringvaluetype, v));
-
+
default:
langerror (stringcoerceerror);
return (false);
} /*switch*/
-
+
disposevaluerecord (*v, true);
return (setstringvalue (bs, v));
Modified: Frontier/branches/mysql/Common/source/shell.c
===================================================================
--- Frontier/branches/mysql/Common/source/shell.c 2007-06-17 21:28:42 UTC (rev 1693)
+++ Frontier/branches/mysql/Common/source/shell.c 2007-06-18 04:09:17 UTC (rev 1694)
@@ -1314,7 +1314,7 @@
htmlinitverbs ();
- sqliteinitverbs (); /* 2006-03-15 gewirtz: langsqlite.c */
+ sqliteinitverbs (); /* 2006-03-15 gewirtz: langsqlite.c */
mysqlinitverbs (); /* 2007-04-08 gewirtz: langmysql.c */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|