|
From: <cre...@us...> - 2007-06-23 23:17:43
|
Revision: 1700
http://svn.sourceforge.net/frontierkernel/?rev=1700&view=rev
Author: creecode
Date: 2007-06-23 16:17:44 -0700 (Sat, 23 Jun 2007)
Log Message:
-----------
ported r1597:1673 from trunk
Modified Paths:
--------------
Frontier/branches/Frontier_Long_File_Paths/Common/headers/versions.h
Frontier/branches/Frontier_Long_File_Paths/Common/source/about.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/fileops.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/fileverbs.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/langhtml.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/langsqlite.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/langsystypes.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/langvalue.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/shell.c
Frontier/branches/Frontier_Long_File_Paths/Common/source/shellwindowverbs.c
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/headers/versions.h
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/headers/versions.h 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/headers/versions.h 2007-06-23 23:17:44 UTC (rev 1700)
@@ -43,7 +43,7 @@
/* common strings for all targets */
#define APP_COPYRIGHT_FROM "2004"
-#define APP_COPYRIGHT_TILL "2006"
+#define APP_COPYRIGHT_TILL "2007"
/* target-specific strings and version info */
@@ -54,25 +54,25 @@
/* version info for RADIO targets (formerly known as PIKE) */
#define APPNAME "Radio"
- #define APP_COPYRIGHT_HOLDER "UserLand Software, Inc"
+ #define APP_COPYRIGHT_HOLDER "UserLand Software, Inc"
#define bs_APP_NAME BIGSTRING ("\x05" "Radio")
#define bs_APP_SLOGAN BIGSTRING ("\x2b" "The power of Web publishing on your desktop")
#define bs_APP_COPYRIGHT BIGSTRING ("\x23" "\xA9 " APP_COPYRIGHT_FROM "-" APP_COPYRIGHT_TILL " UserLand Software, Inc.")
- #define bs_APP_URL BIGSTRING ("\x26" "http://frontierkernel.sourceforge.net/")
+ #define bs_APP_URL BIGSTRING ("\x26" "http://frontierkernel.sourceforge.net/")
#define APP_MAJOR_VERSION 10
- #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */
+ #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */
- #define APP_SUB_VERSION 1
+ #define APP_SUB_VERSION 1
#define APP_MINOR_VERSION 0
- #define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
-
+ #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 12 /* for non-final releases only */
- #define APP_BUILD_NUMBER 12 /* 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.1a12"
+ #define APP_VERSION_STRING "10.1a14"
#else
@@ -80,52 +80,52 @@
#define APPNAME "OPML"
- #define APP_COPYRIGHT_HOLDER "Scripting News, Inc"
+ #define APP_COPYRIGHT_HOLDER "Scripting News, Inc"
#define bs_APP_NAME BIGSTRING ("\x04" "OPML")
#define bs_APP_SLOGAN BIGSTRING ("\x25" "Powerful OPML editing on your desktop")
#define bs_APP_COPYRIGHT BIGSTRING ("\x20" "\xA9 " APP_COPYRIGHT_FROM "-" APP_COPYRIGHT_TILL " Scripting News, Inc.")
- #define bs_APP_URL BIGSTRING ("\x18" "http://support.opml.org/")
+ #define bs_APP_URL BIGSTRING ("\x18" "http://support.opml.org/")
#define APP_MAJOR_VERSION 10
- #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */
+ #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */
- #define APP_SUB_VERSION 1
+ #define APP_SUB_VERSION 1
#define APP_MINOR_VERSION 0
- #define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
+ #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 12 /* for non-final releases only */
- #define APP_BUILD_NUMBER 12 /* 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.1a12"
-
+ #define APP_VERSION_STRING "10.1a14"
+
#endif
#else
/* version info for FRONTIER targets */
#define APPNAME "Frontier"
- #define APP_COPYRIGHT_HOLDER "Frontier Kernel Project"
+ #define APP_COPYRIGHT_HOLDER "Frontier Kernel Project"
#define bs_APP_NAME BIGSTRING ("\x08" "Frontier")
#define bs_APP_SLOGAN BIGSTRING ("\x25" "Powerful cross-platform web scripting")
#define bs_APP_COPYRIGHT BIGSTRING ("\x23" "\xA9 " APP_COPYRIGHT_FROM "-" APP_COPYRIGHT_TILL " Frontier Kernel Project")
- #define bs_APP_URL BIGSTRING ("\x26" "http://frontierkernel.sourceforge.net/")
+ #define bs_APP_URL BIGSTRING ("\x26" "http://frontierkernel.sourceforge.net/")
#define APP_MAJOR_VERSION 10
- #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */
+ #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */
- #define APP_SUB_VERSION 1
+ #define APP_SUB_VERSION 1
#define APP_MINOR_VERSION 0
- #define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
+ #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 12 /* for non-final releases only */
- #define APP_BUILD_NUMBER 12 /* 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.1a12"
-
+ #define APP_VERSION_STRING "10.1a14"
+
#endif
#define bs_APP_COPYRIGHT2 BIGSTRING ("\x22" "\xA9 1992-2004 UserLand Software, Inc")
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/about.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/about.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/about.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -85,7 +85,7 @@
typedef struct tyaboutrecord {
-
+
Rect messagearea;
Rect aboutarea;
@@ -95,8 +95,9 @@
boolean flbigwindow;
boolean flextrastats;
-
- long refcon;
+
+ 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/Frontier_Long_File_Paths/Common/source/fileops.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/fileops.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/fileops.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -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
+
+ LSItemInfoRecord iteminfo;
+ OSStatus status;
+ bigstring bsext;
+ 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
@@ -3543,87 +3583,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/Frontier_Long_File_Paths/Common/source/fileverbs.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/fileverbs.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/fileverbs.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -2069,21 +2069,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/Frontier_Long_File_Paths/Common/source/langhtml.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/langhtml.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/langhtml.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -76,7 +76,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>")
@@ -207,7 +207,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")
@@ -247,6 +247,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
@@ -5781,37 +5782,88 @@
} /*webserverparsecookies*/
-static boolean webservergetserverstring (tyvaluerecord *vreturn) {
+static boolean webservergetpref ( bigstring bsprefname, tyvaluerecord *vreturn ) {
+
+ //
+ // 2007-06-23 creedon: support for long odb item names and file paths
+ //
+ // 6.1d4 AR: Reviewed for proper error handling and reporting.
+ //
+ // 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.
+ //
+ // 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.
+ //
+
+ boolean fl;
+ hdlhashnode hnode;
+ hdlhashtable hprefstable;
+ tyvaluerecord val;
+
+ disablelangerror ();
+
+ fl = langfastaddresstotable ( roottable, NULL, STR_P_USERWEBSERVERPREFS,
+ &hprefstable ) && langHashTableLookupBigstring ( 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
- /*
- 6.1d2 AR: Return a string identifying the server software, i.e. UserLand Frontier/6.1d2-WinNT
+
+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.
+ //
- 6.1d4 AR: Reviewed for proper error handling and reporting.
- */
-
- Handle h = NULL;
+ 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:
- disposehandle (h);
+ disposehandle ( h );
+
+ return ( false );
- return (false);
-
} // webservergetserverstring
@@ -6213,45 +6265,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 ( const Handle handleName, tyaddress *adr) {
//
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/langsqlite.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/langsqlite.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/langsqlite.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -76,7 +76,7 @@
include new files in the SQLite project, be sure that shell.c and tclsqlite.c are
NOT included in the Frontier project.
-That's it. For further tips, see the Frontier Lab Notebook article at:
+That's it. For further tips, see the Frontier Lab Notebook article:
http://manila.zatz.com/frontierkernel/stories/storyReader$29
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/langsystypes.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/langsystypes.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/langsystypes.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -580,25 +580,32 @@
#ifdef MACVERSION
static boolean stringtoalias ( tyvaluerecord *val ) {
-
+
//
+ // 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
+ // 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-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
+ // 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
+ // 1991-10-07 dmb: make sure we're actually passing a full path to the
+ // NewAlias routine
//
+ register Handle htext;
+
AliasHandle halias;
OSErr err;
- register Handle htext;
tyfilespec fs;
clearbytes ( &fs, sizeof ( fs ) );
@@ -696,7 +703,7 @@
return ( true );
} // stringtoalias
-
+
#endif
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/langvalue.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/langvalue.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/langvalue.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -3526,40 +3526,50 @@
boolean coercetostring (tyvaluerecord *val) {
-
+
//
- // 2007-02-24 creedon: support for long odb item names and file paths
+ // 2007-06-23 creedon: support for long odb item names and file paths
//
+ // 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;
- register tyvaluerecord *v = val;
+ 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;
@@ -3569,46 +3579,46 @@
case addressvaluetype:
return ( addressToHandle ( 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;
@@ -3620,43 +3630,43 @@
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:
if ( ! newemptyhandle ( &h ) )
@@ -3678,9 +3688,9 @@
if ( ! newemptyhandle ( &h ) )
return ( false );
-
- tyfilespec fs = **(*v).data.filespecvalue;
-
+
+ tyfilespec fs = **( *v ).data.filespecvalue;
+
filespectopath ( &fs, &h );
disposevaluerecord ( *v, true );
@@ -3692,17 +3702,17 @@
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);
@@ -3710,7 +3720,7 @@
case externalvaluetype:
if (!flcoerceexternaltostring) {
-
+
/* 4.1b4 dmb*/
/*
langbadexternaloperror (badexternaloperationerror, *v);
@@ -3731,11 +3741,11 @@
return (false);
}
-
+
disposevaluerecord (*v, true);
return (setheapvalue (h, stringvaluetype, v));
-
+
default:
langerror (stringcoerceerror);
@@ -3743,7 +3753,7 @@
return (false);
} // switch
-
+
disposevaluerecord (*v, true);
return (setstringvalue (bs, v));
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/shell.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/shell.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/shell.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -1303,7 +1303,7 @@
#if isFrontier || flruntime || winhybrid
initlang (); /*init callbacks and other basic inits*/
-
+
langcallbacks.processeventcallback = &shellprocessevent; /*4.1b13 dmb - new*/
if (!inittablestructure ()) /*create initial hashtable structure*/
@@ -1326,7 +1326,7 @@
xmlinitverbs ();
htmlinitverbs ();
-
+
sqliteinitverbs (); /* 2006-03-15 gewirtz: langsqlite.c */
#ifdef flregexpverbs
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/shellwindowverbs.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/shellwindowverbs.c 2007-06-23 19:41:49 UTC (rev 1699)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/shellwindowverbs.c 2007-06-23 23:17:44 UTC (rev 1700)
@@ -1107,26 +1107,36 @@
} /*settitleverb*/
-static boolean getfileverb (hdltreenode hparam1, tyvaluerecord *vreturned) {
+static boolean getfileverb ( hdltreenode hparam1, tyvaluerecord *vreturned ) {
+
+ //
+ // 2007-04-03 creedon: use getfilespecparent to return an unextended
+ // filespec
+ //
+ // 1992-06-24 dmb: get the title of the object or window indicated in
+ // hparam1. if it's not an external value or a window,
+ // always return the empty string
+ //
- /*
- 6/24/92 dmb: get the title of the object or window indicated in hparam1.
- if it's not an external value or a window, always return the empty string
- */
-
hdlwindowinfo hinfo;
tyfilespec fs;
flnextparamislast = true;
- if (!getwinparam (hparam1, 1, &hinfo))
- return (false);
+ if ( ! getwinparam ( hparam1, 1, &hinfo ) )
+ return ( false );
+
+ if ( ( hinfo != nil ) && windowgetfspec ( ( **hinfo ).macwindow, &fs ) ) {
- if ((hinfo != nil) && windowgetfspec ((**hinfo).macwindow, &fs))
- return (setfilespecvalue (&fs, vreturned));
+ getfilespecparent ( &fs );
+
+ return ( setfilespecvalue ( &fs, vreturned ) );
+
+ }
+
+ return ( setstringvalue ( zerostring, vreturned ) );
- return (setstringvalue (zerostring, vreturned));
- } /*getfileverb*/
+ } // getfileverb
static boolean windowfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|