You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(447) |
Nov
(163) |
Dec
(57) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(172) |
Feb
|
Mar
(123) |
Apr
(64) |
May
(1) |
Jun
(278) |
Jul
(89) |
Aug
(97) |
Sep
(62) |
Oct
(53) |
Nov
(119) |
Dec
(60) |
| 2006 |
Jan
(76) |
Feb
(1094) |
Mar
(363) |
Apr
(163) |
May
(57) |
Jun
(43) |
Jul
(39) |
Aug
(15) |
Sep
(33) |
Oct
(62) |
Nov
(8) |
Dec
|
| 2007 |
Jan
(9) |
Feb
(34) |
Mar
(2) |
Apr
(14) |
May
(8) |
Jun
(40) |
Jul
(21) |
Aug
(1) |
Sep
(20) |
Oct
(15) |
Nov
(26) |
Dec
|
| 2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <set...@us...> - 2006-04-19 18:50:52
|
Revision: 1314 Author: sethdill Date: 2006-04-19 11:50:44 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1314&view=rev Log Message: ----------- All work in converttextencoding, mac version. - larger output buffer - better error checking - replaced 0x08000100 with the mac's SDK-supplied constant - dispose of the converter if the conversion fails for any reason Still need to hook up a better error routine. Errors result in a silent death for the calling script. Modified Paths: -------------- Frontier/trunk/Common/source/strings.c Modified: Frontier/trunk/Common/source/strings.c =================================================================== --- Frontier/trunk/Common/source/strings.c 2006-04-19 18:47:17 UTC (rev 1313) +++ Frontier/trunk/Common/source/strings.c 2006-04-19 18:50:44 UTC (rev 1314) @@ -2355,16 +2355,19 @@ TECCreateConverter (&converter, inputcharset, outputcharset); - sizeoutputbuffer = lentext * 2; + sizeoutputbuffer = lentext * 4; if (sizeoutputbuffer < 32) /*docs say use 32 minimum*/ sizeoutputbuffer = 32; - sethandlesize (hresult, sizeoutputbuffer); + if (!sethandlesize (hresult, sizeoutputbuffer)) { // out of memory + TECDisposeConverter (converter); + return (false); + } // 2005-08-26 --- kw better bytemark detecting // see http://en.wikipedia.org/wiki/Byte_Order_Mark - if (inputcharset == 0x08000100) // we handle utf-8 input + if (inputcharset == kCFStringEncodingUTF8) // we handle utf-8 input { if ( (*h) [0] == '\xEF' && (*h) [1] == '\xBB' @@ -2394,8 +2397,10 @@ status = TECConvertText (converter, (ConstTextPtr)(*h), lentext, &ctorigbytes, (TextPtr)(*hresult), sizeoutputbuffer, &ctoutputbytes); - if (status != noErr) + if (status != noErr) { + TECDisposeConverter (converter); return (false); + } TECFlushText (converter, (TextPtr)(*hresult), sizeoutputbuffer, &ctflushedbytes); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-19 18:47:22
|
Revision: 1313 Author: sethdill Date: 2006-04-19 11:47:17 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1313&view=rev Log Message: ----------- Much improved initialization of the charsets table for the macintosh. It now queries the OS for a list of the available character sets. Windows still uses pre-defined list, and will until I figure out how to ask COM for this information. Modified Paths: -------------- Frontier/trunk/Common/source/langstartup.c Modified: Frontier/trunk/Common/source/langstartup.c =================================================================== --- Frontier/trunk/Common/source/langstartup.c 2006-04-19 08:34:26 UTC (rev 1312) +++ Frontier/trunk/Common/source/langstartup.c 2006-04-19 18:47:17 UTC (rev 1313) @@ -590,23 +590,6 @@ static boolean langinit_charset_consttable (void) { - /* - First pass at a way to populate a table with many of - the known charsets. Key is the MIME charset name (the - IANA-registered name), value is the platform-dependent - value that identifies that character set. (Constants on - Mac, code page id numbers on Windows.) - - There may be a one-hit memory leak here, because nothing is done - to release the table... but maybe it can't be released, because - it needs to stick around? - - A better approach on both platforms would be some routine that - asks the OS for a list of the character sets it supports. - I couldn't find anything like that on the Mac, and on Windows - it requires COM which I couldn't get to work! - */ - hdlhashtable hcharsetconsttable; if (!tablenewsystemtable (langtable, (ptrstring) "\x08" "charsets", &hcharsetconsttable)) @@ -615,6 +598,43 @@ pushhashtable (hcharsetconsttable); #if MACVERSION + #if 1 + OSStatus err; + ItemCount ct, actual_ct, i; + + err = TECCountAvailableTextEncodings( &ct ); + if ( err != noErr ) { + pophashtable(); + + return (true); // don't kill the whole startup + } + + TextEncoding enc; + TextEncoding availEncodings[ ct ]; + bigstring ianaName; + + err = TECGetAvailableTextEncodings ( availEncodings, ct, &actual_ct ); + if ( err != noErr ) { + pophashtable(); + + return (true); // we don't want to kill the whole startup here + } + + for ( i = 0; i < actual_ct; i++ ) { + enc = availEncodings[ i ]; + // enc = i; + + err = TECGetTextEncodingInternetName( enc, ianaName ); + if ( err != noErr ) + continue; + + nullterminate( ianaName ); + + if ( ! hashsymbolexists( ianaName ) ) + langassignlongvalue( hcharsetconsttable, ianaName, enc ); + } + #endif + #if 0 addlong( "ASCII", kCFStringEncodingASCII ); addlong( "MacRoman", kCFStringEncodingMacRoman ); addlong( "MACINTOSH", kCFStringEncodingMacRoman ); @@ -658,6 +678,7 @@ addlong( "UTF-16le", kCFStringEncodingUTF16LE ); addlong( "UTF-16be", kCFStringEncodingUTF16BE ); #endif + #endif #endif #if WIN95VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <has...@us...> - 2006-04-19 08:34:37
|
Revision: 1312 Author: hasseily Date: 2006-04-19 01:34:26 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1312&view=rev Log Message: ----------- Reverted to original op icon alignment of absolute center Modified Paths: -------------- Frontier/trunk/Common/source/opicons.c Modified: Frontier/trunk/Common/source/opicons.c =================================================================== --- Frontier/trunk/Common/source/opicons.c 2006-04-19 08:28:14 UTC (rev 1311) +++ Frontier/trunk/Common/source/opicons.c 2006-04-19 08:34:26 UTC (rev 1312) @@ -105,7 +105,7 @@ if (flselected) transform = kTransformSelected; - ploticonresource ((Rect *) r, kAlignCenterRight, transform, iconnum); + ploticonresource ((Rect *) r, kAlignAbsoluteCenter, transform, iconnum); #endif #ifdef WIN95VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <has...@us...> - 2006-04-19 08:28:44
|
Revision: 1311 Author: hasseily Date: 2006-04-19 01:28:14 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1311&view=rev Log Message: ----------- Cosmetic cleanup of code that uses obsolete icon drawing constants such as atVerticalCenter. Added a few comments as well. Modified Paths: -------------- Frontier/trunk/Common/IOAToolkit/ioaicon.c Frontier/trunk/Common/source/about.c Frontier/trunk/Common/source/claylinelayout.c Frontier/trunk/Common/source/icon.c Frontier/trunk/Common/source/opicons.c Frontier/trunk/Common/source/tabledisplay.c Frontier/trunk/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h Modified: Frontier/trunk/Common/IOAToolkit/ioaicon.c =================================================================== --- Frontier/trunk/Common/IOAToolkit/ioaicon.c 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/Common/IOAToolkit/ioaicon.c 2006-04-19 08:28:14 UTC (rev 1311) @@ -232,7 +232,7 @@ (**h).haslabel = true; - (**h).align = atVerticalCenter + atHorizontalCenter; + (**h).align = kAlignAbsoluteCenter; *hdata = h; Modified: Frontier/trunk/Common/source/about.c =================================================================== --- Frontier/trunk/Common/source/about.c 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/Common/source/about.c 2006-04-19 08:28:14 UTC (rev 1311) @@ -279,7 +279,7 @@ if (GetIconRefFromFile (&programfspec, &iconref, &label) == noErr) { - ec = PlotIconRef (&r, atVerticalCenter + atHorizontalCenter, flpressed? kTransformSelected : 0, kIconServicesNormalUsageFlag, iconref); + ec = PlotIconRef (&r, kAlignAbsoluteCenter, flpressed? kTransformSelected : 0, kIconServicesNormalUsageFlag, iconref); ReleaseIconRef (iconref); @@ -288,7 +288,7 @@ } /*if*/ #endif - ploticonresource (&rcicn, atVerticalCenter + atHorizontalCenter, flpressed? kTransformSelected : 0, idfrontiericon); + ploticonresource (&rcicn, kAlignAbsoluteCenter, flpressed? kTransformSelected : 0, idfrontiericon); } /*ccdrawfrontiericon*/ Modified: Frontier/trunk/Common/source/claylinelayout.c =================================================================== --- Frontier/trunk/Common/source/claylinelayout.c 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/Common/source/claylinelayout.c 2006-04-19 08:28:14 UTC (rev 1311) @@ -931,7 +931,7 @@ transform = 0x4000; #ifdef MACVERSION - ploticonresource ((Rect *) iconrect, atVerticalCenter + atHorizontalCenter, transform, iconnum); + ploticonresource ((Rect *) iconrect, kAlignAbsoluteCenter, transform, iconnum); #endif #ifdef WIN95VERSION Modified: Frontier/trunk/Common/source/icon.c =================================================================== --- Frontier/trunk/Common/source/icon.c 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/Common/source/icon.c 2006-04-19 08:28:14 UTC (rev 1311) @@ -74,6 +74,8 @@ 1.0b21 dmb: try geting normal b&w icon if all else fails 5.0a8 dmb: use srccopy, not srcand for win blits + + Note that the Windows version does NOT use the transform parameter */ #ifdef MACVERSION Modified: Frontier/trunk/Common/source/opicons.c =================================================================== --- Frontier/trunk/Common/source/opicons.c 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/Common/source/opicons.c 2006-04-19 08:28:14 UTC (rev 1311) @@ -92,20 +92,24 @@ void opdrawheadicon (short iconnum, const Rect *r, boolean flselected) { + /* + This function draws the triangle icons inside outlines (but not root tables). + Root table triangles are in tabledisplay.c, browserdrawnodeicon() + */ - short transform = 0; + operaserect (*r); +#ifdef MACVERSION + short transform = kTransformNone; + if (flselected) - transform = 0x4000; + transform = kTransformSelected; - operaserect (*r); - -#ifdef MACVERSION - ploticonresource ((Rect *) r, atVerticalCenter + atHorizontalCenter, transform, iconnum); + ploticonresource ((Rect *) r, kAlignCenterRight, transform, iconnum); #endif #ifdef WIN95VERSION - ploticonresource (r, 0, transform, iconnum); + ploticonresource (r, 0, 0, iconnum); #endif } /*opdrawheadicon*/ @@ -115,7 +119,7 @@ short transform = 0; if (flselected) - transform = 0x4000; + transform = kTransformSelected; operaserect (*r); Modified: Frontier/trunk/Common/source/tabledisplay.c =================================================================== --- Frontier/trunk/Common/source/tabledisplay.c 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/Common/source/tabledisplay.c 2006-04-19 08:28:14 UTC (rev 1311) @@ -1083,22 +1083,27 @@ void browserdrawnodeicon (const Rect *r, boolean flhighlighted, hdlheadrecord hnode) { + /* + This function draws the triangle icons inside tables (but not outlines). + Outline triangles are in opicons.c, opdrawheadicon() + */ + tybrowserinfo browserinfo; + browsergetrefcon (hnode, &browserinfo); + +#ifdef MACVERSION + short transform = kTransformNone; - tybrowserinfo browserinfo; - short transform = 0; - long align = 0; - if (flhighlighted) - transform = 0x4000; + transform = kTransformSelected; -#ifdef MACVERSION - align = atVerticalCenter + atHorizontalCenter; + ploticonresource (r, kAlignAbsoluteCenter, transform, opgetheadicon (hnode)); #endif + +#ifdef WIN95VERSION + ploticonresource (r, 0, 0, opgetheadicon (hnode)); +#endif - browsergetrefcon (hnode, &browserinfo); - ploticonresource (r, align, transform, opgetheadicon (hnode)); - #if 0 transform += ttLabel [browserinfo.ixlabel]; /*color it according to the file's label*/ Modified: Frontier/trunk/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h =================================================================== --- Frontier/trunk/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h 2006-04-19 06:21:33 UTC (rev 1310) +++ Frontier/trunk/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h 2006-04-19 08:28:14 UTC (rev 1311) @@ -9,13 +9,13 @@ -#define atNone 0x0 -#define atVerticalCenter 0x1 -#define atTop 0x2 -#define atBottom 0x3 -#define atHorizontalCenter 0x4 -#define atLeft 0x8 -#define atRight 0xC +#define atNone 0x00 +#define atVerticalCenter 0x01 +#define atTop 0x02 +#define atBottom 0x03 +#define atHorizontalCenter 0x04 +#define atLeft 0x08 +#define atRight 0x0C extern unsigned short ttLabel [8]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <dav...@us...> - 2006-04-19 06:21:47
|
Revision: 1310 Author: davidgewirtz Date: 2006-04-18 23:21:33 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1310&view=rev Log Message: ----------- First actual working SQLite code, integrated into Frontier. Code is still messy, needs tuning and debugging, but basic queries now work. -- DG Modified Paths: -------------- Frontier/branches/SQLite/Common/headers/kernelverbs.h Frontier/branches/SQLite/Common/headers/langsqlite.h Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc Frontier/branches/SQLite/Common/source/langsqlite.c Frontier/branches/SQLite/Common/source/shell.c Modified: Frontier/branches/SQLite/Common/headers/kernelverbs.h =================================================================== --- Frontier/branches/SQLite/Common/headers/kernelverbs.h 2006-04-19 00:24:16 UTC (rev 1309) +++ Frontier/branches/SQLite/Common/headers/kernelverbs.h 2006-04-19 06:21:33 UTC (rev 1310) @@ -56,3 +56,4 @@ extern boolean cryptinitverbs (void); /* langcrypt.c */ +extern boolean sqliteinitverbs (void); /* langsqlite.c */ \ No newline at end of file Modified: Frontier/branches/SQLite/Common/headers/langsqlite.h =================================================================== --- Frontier/branches/SQLite/Common/headers/langsqlite.h 2006-04-19 00:24:16 UTC (rev 1309) +++ Frontier/branches/SQLite/Common/headers/langsqlite.h 2006-04-19 06:21:33 UTC (rev 1310) @@ -33,6 +33,24 @@ extern boolean sqliteexecverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-03-18 gewirtz */ +extern boolean sqliteprepareverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitefinalizeverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitestepverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitecolumncountverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitecolumntypeverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitecolumnintverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitecolumndoubleverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitecolumntextverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + +extern boolean sqlitecolumnnameverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */ + extern boolean sqliteinitverbs (void); /* 2006-03-15 gewirtz */ /* boolean hmacmd5 (unsigned char *, int, unsigned char *, int, unsigned char *);*/ /* 2006-03-05 creedon */ Modified: Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r =================================================================== --- Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r 2006-04-19 00:24:16 UTC (rev 1309) +++ Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r 2006-04-19 06:21:33 UTC (rev 1310) @@ -1141,6 +1141,15 @@ "open", "exec", + "prepare", + "finalize", + "step", + "column_count", + "column_type", + "column_int", + "column_double", + "column_text", + "column_name", "close" } } Modified: Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc =================================================================== --- Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc 2006-04-19 00:24:16 UTC (rev 1309) +++ Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc 2006-04-19 06:21:33 UTC (rev 1310) @@ -1078,9 +1078,18 @@ 1, // Number of "blocks" in this resource "sqlite\0", // Function Processor name false, // Window required - 3, // Count of verbs + 12, // Count of verbs "open\0", "exec\0", + "prepare\0", + "finalize\0", + "step\0", + "column_count\0", + "column_type\0", + "column_int\0", + "column_double\0", + "column_text\0", + "column_name\0", "close\0" END Modified: Frontier/branches/SQLite/Common/source/langsqlite.c =================================================================== --- Frontier/branches/SQLite/Common/source/langsqlite.c 2006-04-19 00:24:16 UTC (rev 1309) +++ Frontier/branches/SQLite/Common/source/langsqlite.c 2006-04-19 06:21:33 UTC (rev 1310) @@ -49,7 +49,25 @@ openfunc, execfunc, + + preparefunc, + + finalizefunc, + + stepfunc, + + columncountfunc, + + columntypefunc, + + columnintfunc, + + columndoublefunc, + + columntextfunc, + columnnamefunc, + closefunc, ctsqliteverbs @@ -79,11 +97,55 @@ return (sqliteexecverb (hp1, v, bserror)); } /* execfunc */ + case preparefunc: { /* 2006-04-18 gewirtz: prepare an SQLite statement */ + + return (sqliteprepareverb (hp1, v, bserror)); + } /* preparefunc */ + + case finalizefunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitefinalizeverb (hp1, v, bserror)); + } /* finalizefunc */ + + case stepfunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitestepverb (hp1, v, bserror)); + } /* stepfunc */ + + case columncountfunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitecolumncountverb (hp1, v, bserror)); + } /* columncountfunc */ + + case columntypefunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitecolumntypeverb (hp1, v, bserror)); + } /* columntypefunc */ + + case columnintfunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitecolumnintverb (hp1, v, bserror)); + } /* columnintfunc */ + + case columndoublefunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitecolumndoubleverb (hp1, v, bserror)); + } /* columndoublefunc */ + + case columntextfunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitecolumntextverb (hp1, v, bserror)); + } /* columntextfunc */ + + case columnnamefunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */ + + return (sqlitecolumnnameverb (hp1, v, bserror)); + } /* columnnamefunc */ + case closefunc: { /* 2006-03-15 gewirtz: close an SQLite db */ return (sqlitecloseverb (hp1, v, bserror)); } /* closefunc */ - default: getstringlist (langerrorlist, unimplementedverberror, bserror); @@ -139,11 +201,6 @@ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ - /* This routine takes one parameter: the filename. - It returns a handle and a result code. See: - http://www.sqlite.org/capi3ref.html#sqlite3_open - */ - /* Enter the verb, convert the param to null-terminated string */ if (!getexempttextvalue (hparam1, 1, &h)) return (false); @@ -161,15 +218,7 @@ } return (setheapvalue ((Handle) db, longvaluetype, vreturned)); /* return the db address to the scripter */ - - /* for now, close the database, simply because we don't have any other code */ - /* sqlite3_close(db); */ - /* Exit the verb, converting string back to Frontier handle */ - /* newfilledhandle (*h, strlen (*h), &returnH); */ - /* disposehandle (h); */ /* get rid of the provided, original handle */ - /* return (setheapvalue (returnH, stringvaluetype, vreturned)); */ - } /* sqliteopenverb */ boolean sqlitecloseverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { @@ -180,11 +229,6 @@ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ - /* This routine takes one parameter: the database. - It true if the file closed successfully, or throws a script error if not. See: - http://www.sqlite.org/capi3ref.html#sqlite3_close - */ - if (!getlongvalue (hparam1, 1, &db)) /* Get the long value, which becomes the db pointer */ return (false); @@ -207,18 +251,6 @@ sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ int returnCode; /* return code from SQLite call */ - /* - This routine takes one parameter: the filename. - It returns a handle and a result code. See: - http://www.sqlite.org/capi3ref.html#sqlite3_exec - - We're not going to use the SQLite callback mechanism for the sqlite3_exec - function. The most obvious approach inside Frontier would be to pass a script - into SQLite, but the potential problems, bugs, and difficulty in debugging makes - this an unnecessary exercise. The sqlite3_exec function will return data, which - can then be munged by a script once it leaves SQLite. So sayeth the coder. -- DG - */ - if (!getlongvalue (hparam1, 1, &db)) /* Get the long value, which becomes the db pointer */ return (false); @@ -241,17 +273,261 @@ } return (setheapvalue ((Handle) db, longvaluetype, vreturned)); /* return the db address to the scripter */ - - /* for now, close the database, simply because we don't have any other code */ - /* sqlite3_close(db); */ - /* Exit the verb, converting string back to Frontier handle */ - /* newfilledhandle (*h, strlen (*h), &returnH); */ - /* disposehandle (h); */ /* get rid of the provided, original handle */ - /* return (setheapvalue (returnH, stringvaluetype, vreturned)); */ - } /* sqliteexecverb */ +boolean sqliteprepareverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; /* the compiled query */ + int returnCode; /* return code from SQLite call */ + + /* + Code that is a good example of prepare in use: + + http://souptonuts.sourceforge.net/code/eatblob.c.html + */ + + if (!getlongvalue (hparam1, 1, &db)) /* Get the long value, which becomes the db pointer */ + return (false); + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + /* Enter the verb, convert the param to null-terminated string */ + if (!getexempttextvalue (hparam1, 2, &h)) + return (false); + + pushcharhandle (0x00, h); /* this should convert *h to a string */ + + /* Process the SQLite sequence */ + + returnCode = sqlite3_prepare(db, *h, -1, &plineInfo, 0); + if(returnCode != SQLITE_OK || plineInfo == NULL) { + sqliteDatabaseError(sqlite3_errmsg(db), bserror); /* send database error */ + disposehandle(h); /* get rid of the provided, original handle */ + sqlite3_close(db); + return (false); + } + + return (setheapvalue ((Handle) plineInfo, longvaluetype, vreturned)); /* return the db address to the scripter */ + +} /* sqliteprepareverb */ + +boolean sqlitefinalizeverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + int returnCode; /* return code from SQLite call */ + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + /* Process the SQLite sequence */ + + returnCode = sqlite3_finalize(plineInfo); + if(returnCode != SQLITE_OK) { + sqliteDatabaseError(zErrMsg, bserror); /* send database open error */ + sqlite3_close(db); + return (false); + } + + return setbooleanvalue (true, vreturned); + +} /* sqlitefinalizeverb */ + +boolean sqlitestepverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + int returnCode; /* return code from SQLite call */ + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + /* Process the SQLite sequence */ + + returnCode = sqlite3_step(plineInfo); + if(returnCode == SQLITE_ERROR || returnCode == SQLITE_MISUSE) { + sqliteDatabaseError(zErrMsg, bserror); /* send database open error */ + sqlite3_close(db); + return (false); + } + + return setintvalue ((short) returnCode, vreturned); + +} /* sqlitestepverb */ + +boolean sqlitecolumntypeverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + int returnCode; /* return code from SQLite call */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + /* Enter the verb, convert the param to null-terminated string */ + if (!getlongvalue (hparam1, 2, &h)) + return (false); + + /* Process the SQLite sequence */ + + returnCode = sqlite3_column_type(plineInfo, h); + + return setintvalue ((short) returnCode, vreturned); + +} /* sqlitecolumntypeverb */ + +boolean sqlitecolumnnameverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char *column_name; + sqlite3_stmt *plineInfo = 0; + int returnCode; /* return code from SQLite call */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + /* Enter the verb, convert the param to null-terminated string */ + if (!getlongvalue (hparam1, 2, &h)) + return (false); + + /* Process the SQLite sequence */ + + column_name = sqlite3_column_name(plineInfo, h); + + /* Exit the verb, converting column_name back to Frontier handle */ + + newfilledhandle (column_name, strlen (column_name), &returnH); + return (setheapvalue (returnH, stringvaluetype, vreturned)); + +} /* sqlitecolumnnameverb */ + +boolean sqlitecolumncountverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + int returnCode; /* return code from SQLite call */ + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + /* Process the SQLite sequence */ + + returnCode = sqlite3_column_count(plineInfo); + + return setintvalue ((short) returnCode, vreturned); + +} /* sqlitecolumncountverb */ + +boolean sqlitecolumnintverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + long returnCode; /* return code from SQLite call */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + /* Enter the verb, convert the param to null-terminated string */ + if (!getlongvalue (hparam1, 2, &h)) + return (false); + + /* Process the SQLite sequence */ + + returnCode = sqlite3_column_int(plineInfo, h); + + return (setlongvalue ((long) returnCode, vreturned)); + +} /* sqlitecolumnintverb */ + +boolean sqlitecolumndoubleverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + double returnCode; /* return code from SQLite call */ + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + /* Enter the verb, convert the param to null-terminated string */ + if (!getlongvalue (hparam1, 2, &h)) + return (false); + + /* Process the SQLite sequence */ + + returnCode = sqlite3_column_double(plineInfo, h); + + return (setlongvalue ((double) returnCode, vreturned)); + +} /* sqlitecolumndoubleverb */ + +boolean sqlitecolumntextverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { + Handle h = nil; + Handle returnH = nil; + char *zErrMsg = 0; /* SQLite's error message */ + sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ + const char **pzTail; /* remainder of the statement, not used, ignored for now */ + sqlite3_stmt *plineInfo = 0; + int returnCode; /* return code from SQLite call */ + const unsigned char *column_text; + + if (!getlongvalue (hparam1, 1, &plineInfo)) /* Get the long value, which becomes the pline pointer */ + return (false); + + flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ + + /* Enter the verb, convert the param to null-terminated string */ + if (!getlongvalue (hparam1, 2, &h)) + return (false); + + /* Process the SQLite sequence */ + + column_text = sqlite3_column_text(plineInfo, h); + + /* Exit the verb, converting column_name back to Frontier handle */ + + newfilledhandle (column_text, strlen (column_text), &returnH); + return (setheapvalue (returnH, stringvaluetype, vreturned)); + +} /* sqlitecolumntextverb */ + /* boolean hmacmd5 (unsigned char * text, int text_len, unsigned char * key, int key_len, unsigned char * digest) function code went here Modified: Frontier/branches/SQLite/Common/source/shell.c =================================================================== --- Frontier/branches/SQLite/Common/source/shell.c 2006-04-19 00:24:16 UTC (rev 1309) +++ Frontier/branches/SQLite/Common/source/shell.c 2006-04-19 06:21:33 UTC (rev 1310) @@ -1335,6 +1335,8 @@ cryptinitverbs (); /* 2006-03-07 creedon: langcrypt.c */ + sqliteinitverbs (); /* 2006-03-15 gewirtz: langsqlite.c */ + if (keyboardescape ()) /*check again before landinit; after this, must do shellquit*/ exittooperatingsystem (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-19 00:24:20
|
Revision: 1309 Author: sethdill Date: 2006-04-18 17:24:16 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1309&view=rev Log Message: ----------- Some of the text encodings weren't available on 10.2.8 or 10.3.9, so now they're only included if MAC_OS_X_VERSION_MAX_ALLOWED >= 10.4 Modified Paths: -------------- Frontier/branches/Conversant/Common/source/langstartup.c Modified: Frontier/branches/Conversant/Common/source/langstartup.c =================================================================== --- Frontier/branches/Conversant/Common/source/langstartup.c 2006-04-19 00:23:49 UTC (rev 1308) +++ Frontier/branches/Conversant/Common/source/langstartup.c 2006-04-19 00:24:16 UTC (rev 1309) @@ -629,8 +629,11 @@ addlong( "iso-8859-7", kCFStringEncodingISOLatin7 ); addlong( "iso-8859-8", kCFStringEncodingISOLatin8 ); addlong( "iso-8859-9", kCFStringEncodingISOLatin9 ); - addlong( "iso-8859-10", kCFStringEncodingISOLatin10 ); + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + addlong( "iso-8859-10", kCFStringEncodingISOLatin10 ); + #endif + addlong( "windows-1250", kCFStringEncodingWindowsLatin2 ); addlong( "windows-latin-2", kCFStringEncodingWindowsLatin2 ); /* code page 1250, Central Europe */ @@ -650,8 +653,11 @@ addlong( "UTF-7", kCFStringEncodingNonLossyASCII ); addlong( "UTF-8", kCFStringEncodingUTF8 ); addlong( "UTF-16", kCFStringEncodingUnicode ); - addlong( "UTF-16le", kCFStringEncodingUTF16LE ); - addlong( "UTF-16be", kCFStringEncodingUTF16BE ); + + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + addlong( "UTF-16le", kCFStringEncodingUTF16LE ); + addlong( "UTF-16be", kCFStringEncodingUTF16BE ); + #endif #endif #if WIN95VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-19 00:23:54
|
Revision: 1308 Author: sethdill Date: 2006-04-18 17:23:49 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1308&view=rev Log Message: ----------- Andre's 'fat' version of Paige, for use on Intel macs. Modified Paths: -------------- Frontier/branches/Conversant/Common/Paige/libpaigefat.a Modified: Frontier/branches/Conversant/Common/Paige/libpaigefat.a =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-19 00:04:51
|
Revision: 1307 Author: sethdill Date: 2006-04-18 17:04:47 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1307&view=rev Log Message: ----------- Some of the text encodings weren't available on 10.2.8 or 10.3.9, so now they're only included if MAC_OS_X_VERSION_MAX_ALLOWED >= 10.4 Modified Paths: -------------- Frontier/trunk/Common/source/langstartup.c Modified: Frontier/trunk/Common/source/langstartup.c =================================================================== --- Frontier/trunk/Common/source/langstartup.c 2006-04-18 21:51:35 UTC (rev 1306) +++ Frontier/trunk/Common/source/langstartup.c 2006-04-19 00:04:47 UTC (rev 1307) @@ -629,8 +629,11 @@ addlong( "iso-8859-7", kCFStringEncodingISOLatin7 ); addlong( "iso-8859-8", kCFStringEncodingISOLatin8 ); addlong( "iso-8859-9", kCFStringEncodingISOLatin9 ); - addlong( "iso-8859-10", kCFStringEncodingISOLatin10 ); + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + addlong( "iso-8859-10", kCFStringEncodingISOLatin10 ); + #endif + addlong( "windows-1250", kCFStringEncodingWindowsLatin2 ); addlong( "windows-latin-2", kCFStringEncodingWindowsLatin2 ); /* code page 1250, Central Europe */ @@ -650,8 +653,11 @@ addlong( "UTF-7", kCFStringEncodingNonLossyASCII ); addlong( "UTF-8", kCFStringEncodingUTF8 ); addlong( "UTF-16", kCFStringEncodingUnicode ); - addlong( "UTF-16le", kCFStringEncodingUTF16LE ); - addlong( "UTF-16be", kCFStringEncodingUTF16BE ); + + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + addlong( "UTF-16le", kCFStringEncodingUTF16LE ); + addlong( "UTF-16be", kCFStringEncodingUTF16BE ); + #endif #endif #if WIN95VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 21:51:41
|
Revision: 1306 Author: sethdill Date: 2006-04-18 14:51:35 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1306&view=rev Log Message: ----------- Includes the files needed to build Conversant. Modified Paths: -------------- Frontier/branches/Conversant/build_VC2K5/Frontier.vcproj Modified: Frontier/branches/Conversant/build_VC2K5/Frontier.vcproj =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 21:09:37
|
Revision: 1305 Author: sethdill Date: 2006-04-18 14:09:34 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1305&view=rev Log Message: ----------- Merged in r1297 from trunk. Modified Paths: -------------- Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h Modified: Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h =================================================================== --- Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 21:05:10 UTC (rev 1304) +++ Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 21:09:34 UTC (rev 1305) @@ -187,7 +187,7 @@ #ifdef SWAP_BYTE_ORDER - unsigned short wastebits: 9; /* room for more booleans */ + unsigned short wastebits1: 1; /* room for more booleans */ unsigned short objectdisabled: 1; @@ -202,6 +202,8 @@ unsigned short objectflag: 1; unsigned short objecthasframe: 1; + + unsigned short wastebits2: 8; /* room for more booleans */ #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 21:05:16
|
Revision: 1304 Author: sethdill Date: 2006-04-18 14:05:10 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1304&view=rev Log Message: ----------- Added declaration of converttextencoding. Modified Paths: -------------- Frontier/trunk/Common/headers/strings.h Modified: Frontier/trunk/Common/headers/strings.h =================================================================== --- Frontier/trunk/Common/headers/strings.h 2006-04-18 20:59:29 UTC (rev 1303) +++ Frontier/trunk/Common/headers/strings.h 2006-04-18 21:05:10 UTC (rev 1304) @@ -266,5 +266,7 @@ extern boolean utf8tomacroman (Handle, Handle); /* 2006-02-25 creedon */ +extern boolean converttextencoding (Handle, Handle, long, long); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 20:59:32
|
Revision: 1303 Author: sethdill Date: 2006-04-18 13:59:29 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1303&view=rev Log Message: ----------- Added the convertcharset to the list of string verbs. Modified Paths: -------------- Frontier/trunk/Common/resources/Mac/kernelverbs.r Frontier/trunk/Common/resources/Win32/kernelverbs.rc Modified: Frontier/trunk/Common/resources/Mac/kernelverbs.r =================================================================== --- Frontier/trunk/Common/resources/Mac/kernelverbs.r 2006-04-18 20:34:03 UTC (rev 1302) +++ Frontier/trunk/Common/resources/Mac/kernelverbs.r 2006-04-18 20:59:29 UTC (rev 1303) @@ -600,7 +600,8 @@ "ansitoutf16", "multipleReplaceAll", "macromantoutf8", // 2006-02-25 creedon - "utf8tomacroman" // 2006-02-25 creedon + "utf8tomacroman", // 2006-02-25 creedon + "convertcharset" /* 2006-04-13 smd */ } } }; Modified: Frontier/trunk/Common/resources/Win32/kernelverbs.rc =================================================================== --- Frontier/trunk/Common/resources/Win32/kernelverbs.rc 2006-04-18 20:34:03 UTC (rev 1302) +++ Frontier/trunk/Common/resources/Win32/kernelverbs.rc 2006-04-18 20:59:29 UTC (rev 1303) @@ -514,7 +514,7 @@ 1, //Number of "blocks" in this resource "string\0", //Function Processor Name false, //Window required - 58, //Count of verbs + 59, //Count of verbs "delete\0", "insert\0", "popleading\0", @@ -573,6 +573,7 @@ "multiplereplaceall\0", "macromantoutf8\0", // 2006-02-25 creedon "utf8tomacroman\0", // 2006-02-25 creedon + "convertcharset\0" /* 2006-04-16 smd */ END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 20:34:06
|
Revision: 1302 Author: sethdill Date: 2006-04-18 13:34:03 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1302&view=rev Log Message: ----------- Create and initialize system.compiler.language.charsets with a big list of known character sets (per the current operating system). This is a first pass, could be much more complete on both operating systems. Modified Paths: -------------- Frontier/trunk/Common/source/langstartup.c Modified: Frontier/trunk/Common/source/langstartup.c =================================================================== --- Frontier/trunk/Common/source/langstartup.c 2006-04-18 20:27:25 UTC (rev 1301) +++ Frontier/trunk/Common/source/langstartup.c 2006-04-18 20:34:03 UTC (rev 1302) @@ -588,6 +588,117 @@ #define addstring(x,y) if (!langaddstringconst ((ptrstring) x, y)) return (false) +static boolean langinit_charset_consttable (void) { + + /* + First pass at a way to populate a table with many of + the known charsets. Key is the MIME charset name (the + IANA-registered name), value is the platform-dependent + value that identifies that character set. (Constants on + Mac, code page id numbers on Windows.) + + There may be a one-hit memory leak here, because nothing is done + to release the table... but maybe it can't be released, because + it needs to stick around? + + A better approach on both platforms would be some routine that + asks the OS for a list of the character sets it supports. + I couldn't find anything like that on the Mac, and on Windows + it requires COM which I couldn't get to work! + */ + + hdlhashtable hcharsetconsttable; + + if (!tablenewsystemtable (langtable, (ptrstring) "\x08" "charsets", &hcharsetconsttable)) + return (false); + + pushhashtable (hcharsetconsttable); + +#if MACVERSION + addlong( "ASCII", kCFStringEncodingASCII ); + addlong( "MacRoman", kCFStringEncodingMacRoman ); + addlong( "MACINTOSH", kCFStringEncodingMacRoman ); + + addlong( "iso-8859-1", kCFStringEncodingISOLatin1 ); + addlong( "iso-latin-1", kCFStringEncodingISOLatin1 ); + addlong( "iso-8859-2", kCFStringEncodingISOLatin2 ); + addlong( "iso-8859-3", kCFStringEncodingISOLatin3 ); + addlong( "iso-8859-4", kCFStringEncodingISOLatin4 ); + addlong( "iso-8859-5", kCFStringEncodingISOLatin5 ); + addlong( "iso-8859-6", kCFStringEncodingISOLatin6 ); + addlong( "iso-8859-7", kCFStringEncodingISOLatin7 ); + addlong( "iso-8859-8", kCFStringEncodingISOLatin8 ); + addlong( "iso-8859-9", kCFStringEncodingISOLatin9 ); + addlong( "iso-8859-10", kCFStringEncodingISOLatin10 ); + + addlong( "windows-1250", kCFStringEncodingWindowsLatin2 ); + addlong( "windows-latin-2", kCFStringEncodingWindowsLatin2 ); /* code page 1250, Central Europe */ + + addlong( "windows-1251", kCFStringEncodingWindowsCyrillic ); /* code page 1251, Slavic Cyrillic */ + + addlong( "windows-1252", kCFStringEncodingWindowsLatin1 ); + addlong( "windows-latin-1", kCFStringEncodingWindowsLatin1 ); /* ANSI 1252 */ + + addlong( "windows-1253", kCFStringEncodingWindowsLatin5 ); /* code page 1253 */ + addlong( "windows-1254", kCFStringEncodingWindowsLatin5 ); /* code page 1254, Turkish */ + addlong( "windows-1255", kCFStringEncodingWindowsHebrew ); /* code page 1255 */ + addlong( "windows-1256", kCFStringEncodingWindowsArabic ); /* code page 1256 */ + addlong( "windows-1257", kCFStringEncodingWindowsBalticRim ); /* code page 1257 */ + addlong( "windows-1258", kCFStringEncodingWindowsVietnamese ); /* code page 1258 */ + addlong( "windows-1361", kCFStringEncodingWindowsKoreanJohab ); /* code page 1361, for Windows NT */ + + addlong( "UTF-7", kCFStringEncodingNonLossyASCII ); + addlong( "UTF-8", kCFStringEncodingUTF8 ); + addlong( "UTF-16", kCFStringEncodingUnicode ); + addlong( "UTF-16le", kCFStringEncodingUTF16LE ); + addlong( "UTF-16be", kCFStringEncodingUTF16BE ); +#endif + +#if WIN95VERSION + addlong( "ASCII", 20127 ); + addlong( "MacRoman", 10000 ); + addlong( "MACINTOSH", 10000 ); + + addlong( "iso-8859-1", 28591 ); + addlong( "iso-latin-1", 28591 ); + addlong( "iso-8859-2", 28592 ); + addlong( "iso-8859-3", 28593 ); + addlong( "iso-8859-4", 28594 ); + addlong( "iso-8859-5", 28595 ); + addlong( "iso-8859-6", 28596 ); + addlong( "iso-8859-7", 28597 ); + addlong( "iso-8859-8", 28598 ); + addlong( "iso-8859-9", 28599 ); + addlong( "iso-8859-10", 28592 ); + + addlong( "windows-1250", 1250 ); + addlong( "windows-latin-2", 1250 ); /* code page 1250, Central Europe */ + + addlong( "windows-1251", 1251 ); /* code page 1251, Slavic Cyrillic */ + + addlong( "windows-1252", 1252 ); + addlong( "windows-latin-1", 1252 ); + + addlong( "windows-1253", 1253 ); /* code page 1253 */ + addlong( "windows-1254", 1254 ); /* code page 1254, Turkish */ + addlong( "windows-1255", 1255 ); /* code page 1255 */ + addlong( "windows-1256", 1256 ); /* code page 1256 */ + addlong( "windows-1257", 1257 ); /* code page 1257 */ + addlong( "windows-1258", 1258 ); /* code page 1258 */ + addlong( "windows-1361", 1361 ); /* code page 1361, for Windows NT */ + + addlong( "UTF-7", 65000 ); + addlong( "UTF-8", 65001 ); + addlong( "UTF-16", 0 ); + addlong( "UTF-16le", 1200 ); + addlong( "UTF-16be", 1201 ); +#endif + + pophashtable(); + + return (true); + } /* langinit_charset_consttable */ + static boolean langinitconsttable (void) { /* @@ -600,7 +711,7 @@ tyvaluetype type; bigstring bs; - if (!tablenewsystemtable (langtable, (ptrstring) BIGSTRING ("\x09" "constants"), &hconsttable)) + if (!tablenewsystemtable (langtable, (ptrstring) ("\x09" "constants"), &hconsttable)) return (false); pushhashtable (hconsttable); /*converted to constants by the scanner*/ @@ -658,7 +769,7 @@ lastword (bs, chspace, bs); - pushstring ((ptrstring) BIGSTRING ("\x04Type"), bs); + pushstring ((ptrstring) ("\x04Type"), bs); addtype (bs, type); @@ -817,6 +928,9 @@ if (!langinitconsttable ()) return (false); + if (!langinit_charset_consttable ()) + return (false); + if (!langinitbuiltintable ()) return (false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 20:27:28
|
Revision: 1301 Author: sethdill Date: 2006-04-18 13:27:25 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1301&view=rev Log Message: ----------- Added the string.convertCharset verb, and most of the charset-conversion verbs (like ansiToUtf8) now throw an error if they fail rather than just returning false. Modified Paths: -------------- Frontier/trunk/Common/source/stringverbs.c Modified: Frontier/trunk/Common/source/stringverbs.c =================================================================== --- Frontier/trunk/Common/source/stringverbs.c 2006-04-18 20:23:29 UTC (rev 1300) +++ Frontier/trunk/Common/source/stringverbs.c 2006-04-18 20:27:25 UTC (rev 1301) @@ -310,6 +310,8 @@ macromantoutf8func, // 2006-02-25 creedon utf8tomacromanfunc, // 2006-02-25 creedon + + convertcharsetfunc, /* 2006-04-14 smd */ ctstringverbs } tystringtoken; @@ -2196,7 +2198,8 @@ newemptyhandle (&hresult); - utf16toansi (h, hresult); + if (!utf16toansi (h, hresult)) + return (false); disposehandle(h); // kw 2005-07-23 --- memleak @@ -2214,7 +2217,8 @@ newemptyhandle (&hresult); - utf8toansi (h, hresult); + if (!utf8toansi (h, hresult)) + return (false); disposehandle(h); // kw 2005-07-23 --- memleak @@ -2232,7 +2236,8 @@ newemptyhandle (&hresult); - ansitoutf8 (h, hresult); + if (!ansitoutf8 (h, hresult)) + return (false); disposehandle(h); // kw 2005-07-23 --- memleak @@ -2250,7 +2255,8 @@ newemptyhandle (&hresult); - ansitoutf16 (h, hresult); + if (!ansitoutf16 (h, hresult)) + return (false); disposehandle (h); // kw 2005-07-23 --- memleak @@ -2268,12 +2274,13 @@ flnextparamislast = true; - if (!getexempttextvalue (hp1, 1, &h)) - return (false); + if (!getreadonlytextvalue (hp1, 1, &h)) + goto error; newemptyhandle (&hresult); - macromantoutf8 (h, hresult); + if (!macromantoutf8 (h, hresult)) + goto error; disposehandle (h); @@ -2286,17 +2293,44 @@ flnextparamislast = true; - if (!getexempttextvalue (hp1, 1, &h)) - return (false); + if (!getreadonlytextvalue (hp1, 1, &h)) + goto error; newemptyhandle (&hresult); - utf8tomacroman (h, hresult); + if (!utf8tomacroman (h, hresult)) + goto error; disposehandle (h); return (setheapvalue (hresult, stringvaluetype, v)); } + + case convertcharsetfunc: { /* 2006-04-13 smd: convert any character set to any other character set, if the os supports it */ + + Handle h, hresult; + long charsetIn, charsetOut; + + if (!getlongvalue (hp1, 1, &charsetIn)) + goto error; + + if (!getlongvalue (hp1, 2, &charsetOut)) + goto error; + + flnextparamislast = true; + + if (!getreadonlytextvalue (hp1, 3, &h)) + goto error; + + newemptyhandle (&hresult); + + if (! converttextencoding (h, hresult, charsetIn, charsetOut)) + goto error; + + disposehandle(h); + + return (setheapvalue (hresult, stringvaluetype, v)); + } default: errornum = notimplementederror; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 20:23:33
|
Revision: 1300 Author: sethdill Date: 2006-04-18 13:23:29 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1300&view=rev Log Message: ----------- Added support for the string.convertCharset verb, and equalized mac and windows support for utf-8/utf-16/ansi/macroman charset conversions. Modified Paths: -------------- Frontier/trunk/Common/source/strings.c Modified: Frontier/trunk/Common/source/strings.c =================================================================== --- Frontier/trunk/Common/source/strings.c 2006-04-18 20:00:27 UTC (rev 1299) +++ Frontier/trunk/Common/source/strings.c 2006-04-18 20:23:29 UTC (rev 1300) @@ -2265,10 +2265,10 @@ ULONG cbAnsi, cCharacters; long lentext; - + cCharacters = wcslen((const unsigned short*) *h)+1; - cbAnsi = cCharacters*2; + cbAnsi = cCharacters * 2; sethandlesize (hresult, cbAnsi); @@ -2313,16 +2313,17 @@ char ch = (*hresult) [ix]; if (ch == '\0') { + + if ((*hresult) [ix + 1] == '\0') { - if (lastch == '\0') { + sethandlesize (hresult, ix + 2); - sethandlesize (hresult, ix); - break; - } /*if*/ + } /* if */ + } /*if*/ - ix++; + ix += 2; if (ix > cbUni) break; @@ -2337,11 +2338,12 @@ #endif /*end Windows character conversion routines*/ +boolean converttextencoding (Handle h, Handle hresult, long inputcharset, long outputcharset) { + #ifdef MACVERSION /*Mac character conversion common routine*/ -static void converttextencoding (Handle h, Handle hresult, long inputcharset, long outputcharset) { - TECObjectRef converter; + OSStatus status; ByteCount ctorigbytes, ctoutputbytes, ctflushedbytes; long sizeoutputbuffer; long pullBytes = 0; @@ -2390,23 +2392,91 @@ lentext = gethandlesize (h); - TECConvertText (converter, (ConstTextPtr)(*h), lentext, &ctorigbytes, (TextPtr)(*hresult), sizeoutputbuffer, &ctoutputbytes); + status = TECConvertText (converter, (ConstTextPtr)(*h), lentext, &ctorigbytes, (TextPtr)(*hresult), sizeoutputbuffer, &ctoutputbytes); + + if (status != noErr) + return (false); TECFlushText (converter, (TextPtr)(*hresult), sizeoutputbuffer, &ctflushedbytes); TECDisposeConverter (converter); sethandlesize (hresult, ctoutputbytes + ctflushedbytes); + + return (true); // kwchange 2005-05-23 --- commented out to see if this is the missing trailing char bug // kwchange 2005-05-27 --- ran this the last week and have no complains //sethandlesize (hresult, gethandlesize (hresult) - 1); /*pop trailing terminator*/ - } /*converttextencoding*/ - #endif /*end Mac character conversion routine(s)*/ +#ifdef WIN95VERSION + long lentext; + + switch ( inputcharset ) { + + case 0: /* unicode with BOM, not handled as a code page. I Hatesk Windows. */ + lentext = gethandlesize (h); + + sethandlesize (h,lentext + 2); + + (*h) [lentext] = '\0'; + (*h) [lentext + 1] = '\0'; + + if (UnicodeToAnsi (h, hresult, outputcharset)) + return (false); + + if ((*h) [0] == '\xFF') + pullfromhandle (hresult,0, 1, NULL); /* Pop off the BOM */ + + default: { + lentext = gethandlesize (h); + + switch ( outputcharset ) { + case 0: /* unicode with BOM, not handled as a code page. I Sitll Hatesk Windows (and rrrabbits) */ + + if (AnsiToUnicode (h, hresult, inputcharset)) + return (false); + + default: { + Handle htemp; + boolean flResult = true; + + newemptyhandle (&htemp); + + sethandlesize (h, lentext + 1); + (*h) [lentext] = '\0'; + + if (AnsiToUnicode (h, htemp, inputcharset)) + flResult = false; + + if (flResult && ! UnicodeToAnsi (htemp, hresult, outputcharset)) { + + if ((*hresult) [0] == '\xFF') + pullfromhandle (hresult, 0, 1, NULL); /* pop BOM ? */ + + } /* unicodetoansi */ + else + flResult = false; + + disposehandle (htemp); + + return (flResult); + + } /* case default */ + + } /* switch outputcharset */ + + } /* case default */ + + } /* switch inputcharset */ + +#endif + } /*converttextencoding*/ + + boolean utf16toansi (Handle h, Handle hresult) { /* @@ -2442,7 +2512,8 @@ insertinhandle (h, 0, NULL, 1); */ - converttextencoding (h, hresult, kTextEncodingUnicodeDefault, kTextEncodingWindowsLatin1); + if (!converttextencoding (h, hresult, kTextEncodingUnicodeDefault, kTextEncodingWindowsLatin1)) + return (false); /* OSErr err = noErr; @@ -2523,7 +2594,8 @@ #ifdef MACVERSION - converttextencoding (h, hresult, 0x08000100, kTextEncodingWindowsLatin1); + if (!converttextencoding (h, hresult, kCFStringEncodingUTF8, kTextEncodingWindowsLatin1)) + return (false); /* OSErr err = noErr; @@ -2592,7 +2664,8 @@ #ifdef MACVERSION - converttextencoding (h, hresult, kTextEncodingWindowsLatin1, 0x08000100); + if (!converttextencoding (h, hresult, kTextEncodingWindowsLatin1, kCFStringEncodingUTF8)) + return (false); #endif @@ -2620,7 +2693,8 @@ #ifdef MACVERSION - converttextencoding (h, hresult, kTextEncodingWindowsLatin1, kTextEncodingUnicodeDefault); + if (!converttextencoding (h, hresult, kTextEncodingWindowsLatin1, kTextEncodingUnicodeDefault)) + return (false); #endif @@ -2703,13 +2777,15 @@ #ifdef WIN95VERSION - langerrormessage ("\x92" "Direct Mac Roman to UTF-8 string conversion currently only works on Mac OS. On Windows string.macToLatin and string.ansiToUtf8 verbs can be used."); + if (!converttextencoding (h, hresult, 10000, CP_UTF8)) + return (false); #endif #ifdef MACVERSION - converttextencoding (h, hresult, kTextEncodingMacRoman, 0x08000100); + if (!converttextencoding (h, hresult, kTextEncodingMacRoman, kCFStringEncodingUTF8)) + return (false); #endif @@ -2725,13 +2801,15 @@ #ifdef WIN95VERSION - langerrormessage ("\x92" "Direct UTF-8 to Mac Roman string conversion currently only works on Mac OS. On Windows string.utf8ToAnsi and string.latinToMac verbs can be used."); + if (!converttextencoding (h, hresult, CP_UTF8, 10000)) + return (false); #endif #ifdef MACVERSION - converttextencoding (h, hresult, 0x08000100, kTextEncodingMacRoman); + if (!converttextencoding (h, hresult, kCFStringEncodingUTF8, kTextEncodingMacRoman)) + return (false); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 20:00:30
|
Revision: 1299 Author: sethdill Date: 2006-04-18 13:00:27 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1299&view=rev Log Message: ----------- Added a big comment at langinit_charset_consttable() so it's clear why it's there and what it does. Modified Paths: -------------- Frontier/branches/Conversant/Common/source/langstartup.c Modified: Frontier/branches/Conversant/Common/source/langstartup.c =================================================================== --- Frontier/branches/Conversant/Common/source/langstartup.c 2006-04-18 19:40:22 UTC (rev 1298) +++ Frontier/branches/Conversant/Common/source/langstartup.c 2006-04-18 20:00:27 UTC (rev 1299) @@ -590,6 +590,23 @@ static boolean langinit_charset_consttable (void) { + /* + First pass at a way to populate a table with many of + the known charsets. Key is the MIME charset name (the + IANA-registered name), value is the platform-dependent + value that identifies that character set. (Constants on + Mac, code page id numbers on Windows.) + + There may be a one-hit memory leak here, because nothing is done + to release the table... but maybe it can't be released, because + it needs to stick around? + + A better approach on both platforms would be some routine that + asks the OS for a list of the character sets it supports. + I couldn't find anything like that on the Mac, and on Windows + it requires COM which I couldn't get to work! + */ + hdlhashtable hcharsetconsttable; if (!tablenewsystemtable (langtable, (ptrstring) "\x08" "charsets", &hcharsetconsttable)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-18 19:40:35
|
Revision: 1298 Author: andreradke Date: 2006-04-18 12:40:22 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1298&view=rev Log Message: ----------- Fix alignment of bit-field items in tydiskobject struct in iowacore.h for Intel Macs. Modified Paths: -------------- Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h Modified: Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h =================================================================== --- Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 19:33:35 UTC (rev 1297) +++ Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 19:40:22 UTC (rev 1298) @@ -187,7 +187,7 @@ #ifdef SWAP_BYTE_ORDER - unsigned short wastebits: 9; /* room for more booleans */ + unsigned short wastebits1: 1; /* room for more booleans */ unsigned short objectdisabled: 1; @@ -202,6 +202,8 @@ unsigned short objectflag: 1; unsigned short objecthasframe: 1; + + unsigned short wastebits2: 8; /* room for more booleans */ #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 19:34:11
|
Revision: 1297 Author: sethdill Date: 2006-04-18 12:33:35 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1297&view=rev Log Message: ----------- Merged trunk changes r1261:1296 into the Conversant branch, *excluding* changes made to the project file in xcode. Modified Paths: -------------- Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h Frontier/branches/Conversant/Common/IowaRuntime/Source/iowacore.c Frontier/branches/Conversant/Common/IowaRuntime/Source/iowaruntime.c Frontier/branches/Conversant/Common/Paige/libpaigemacho.a Frontier/branches/Conversant/Common/headers/byteorder.h Frontier/branches/Conversant/Common/headers/config.r Frontier/branches/Conversant/Common/headers/frontierconfig.h Frontier/branches/Conversant/Common/headers/macconv.h Frontier/branches/Conversant/Common/headers/shellprivate.h Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc Frontier/branches/Conversant/Common/source/FrontierWinMain.c Frontier/branches/Conversant/Common/source/OpenTransportNetEvents.c Frontier/branches/Conversant/Common/source/fileops.c Frontier/branches/Conversant/Common/source/fileverbs.c Frontier/branches/Conversant/Common/source/frontierconfig.c Frontier/branches/Conversant/Common/source/langipc.c Frontier/branches/Conversant/Common/source/langstartup.c Frontier/branches/Conversant/Common/source/langtree.c Frontier/branches/Conversant/Common/source/oppack.c Frontier/branches/Conversant/Common/source/osacomponent.c Frontier/branches/Conversant/Common/source/osawindows.c Frontier/branches/Conversant/Common/source/resources.c Frontier/branches/Conversant/Common/source/shelljuggler.c Frontier/branches/Conversant/Common/source/stringverbs.c Added Paths: ----------- Frontier/branches/Conversant/Common/Paige/libpaigefat.a Removed Paths: ------------- Frontier/branches/Conversant/Common/Paige/PaigePPC.lib Property Changed: ---------------- Frontier/branches/Conversant/build_XCode/tools/ Frontier/branches/Conversant/build_XCode/tools/postlinking.sh Modified: Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h =================================================================== --- Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 19:33:35 UTC (rev 1297) @@ -28,6 +28,7 @@ #ifndef iowacoreinclude #define iowacoreinclude +#include "byteorder.h" /* 2006-04-17 aradke: for SWAP_BYTE_ORDER */ #ifdef coderesource /*we're building into a UCMD*/ @@ -105,8 +106,26 @@ short defaulttextcolor; short defaultframecolor; + +#ifdef SWAP_BYTE_ORDER + unsigned short wastebits: 10; /*room for more booleans*/ + + unsigned short floater: 1; + + unsigned short flinvisiblegrid: 1; + + unsigned short flselection: 1; + + unsigned short flgrid: 1; + + unsigned short defaulttransparent: 1; + unsigned short defaulthasframe: 1; + +#else + + unsigned short defaulthasframe: 1; unsigned short defaulttransparent: 1; @@ -119,7 +138,9 @@ unsigned short floater: 1; unsigned short wastebits: 10; /*room for more booleans*/ - + +#endif + short gridunits; short rightborder, bottomborder; @@ -163,8 +184,28 @@ short objectlinespacing; short objectindentation; + +#ifdef SWAP_BYTE_ORDER + unsigned short wastebits: 9; /* room for more booleans */ + + unsigned short objectdisabled: 1; + + unsigned short objectfastscript: 1; + + unsigned short objecttransparent: 1; + + unsigned short lastinlist: 1; + + unsigned short objectinvisible: 1; + + unsigned short objectflag: 1; + unsigned short objecthasframe: 1; + +#else + + unsigned short objecthasframe: 1; unsigned short objectflag: 1; @@ -178,6 +219,10 @@ unsigned short objectdisabled: 1; + unsigned short wastebits: 9; /* room for more booleans */ + +#endif + long objecttype; /*room for lots of object types*/ RGBColor objectfillcolor, objecttextcolor, objectframecolor; Modified: Frontier/branches/Conversant/Common/IowaRuntime/Source/iowacore.c =================================================================== --- Frontier/branches/Conversant/Common/IowaRuntime/Source/iowacore.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/IowaRuntime/Source/iowacore.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -29,6 +29,7 @@ #include "standard.h" #include "shelltypes.h" +#include "byteorder.h" #ifdef iowaRuntime @@ -2728,12 +2729,60 @@ boolean unpackobject (hdlobject *hobject, boolean *lastinlist) { + /* + 2006-04-17 aradke: must convert packed data to native byte-order on Intel Macs + */ + tydiskobject info; tyobject obj; hdlobject h; moveleft (unpack.p, &info, longsizeof (info)); + disktomemshort (info.versionnumber); + + disktomemshort (info.objectrect.top); + disktomemshort (info.objectrect.left); + disktomemshort (info.objectrect.bottom); + disktomemshort (info.objectrect.right); + + disktomemlong (info.lenname); + disktomemlong (info.lenvalue); + disktomemlong (info.lenscript); + disktomemlong (info.lendata); + + disktomemshort (info.objectfontsize); + disktomemshort (info.objectstyle); + disktomemshort (info.objectjustification); + disktomemshort (info.objectrecalcstatus); + disktomemshort (info.objectrecalcperiod); + disktomemshort (info.unused1); + disktomemshort (info.objectdropshadowdepth); + disktomemshort (info.objectlinespacing); + disktomemshort (info.objectindentation); + + /* + 2006-04-17 aradke: The info.objecthasframe etc. bit-field doesn't need to be byte-swapped, + because this is already taken care of via the endian-specific definition in iowacore.h. + */ + + disktomemlong (info.objecttype); + + disktomemshort (info.objectfillcolor.red); + disktomemshort (info.objectfillcolor.green); + disktomemshort (info.objectfillcolor.blue); + + disktomemshort (info.objecttextcolor.red); + disktomemshort (info.objecttextcolor.green); + disktomemshort (info.objecttextcolor.blue); + + disktomemshort (info.objectframecolor.red); + disktomemshort (info.objectframecolor.green); + disktomemshort (info.objectframecolor.blue); + + disktomemlong (info.objectlanguage); + disktomemlong (info.lenrecalcscript); + if (info.versionnumber == 1) /*record format changed to allow 4 bytes for object type*/ info.objecttype = (unsigned long) info.v1objecttype; @@ -2898,6 +2947,10 @@ boolean iowaunpack (Handle hpacked) { + + /* + 2006-04-17 aradke: must convert packed data to native byte-order on Intel Macs + */ hdlcard hc = iowadata; hdlobject newlist; @@ -2917,6 +2970,8 @@ unpack.p += longsizeof (header); + disktomemshort (header.versionnumber); + if (header.versionnumber < 4) { /*the header grew by 66 bytes in version 4*/ header.lenwindowtitle = 0; @@ -2924,6 +2979,30 @@ unpack.p -= 66; } + disktomemshort (header.v2backcolor); + + disktomemlong (header.lenembeddedtable); + + disktomemshort (header.defaultfillcolor); + disktomemshort (header.defaulttextcolor); + disktomemshort (header.defaultframecolor); + + /* + 2006-04-17 aradke: The header.defaulthasframe etc. bit-field doesn't need to be byte-swapped, + because this is already taken care of via the endian-specific definition in iowacore.h. + */ + + disktomemshort (header.gridunits); + disktomemshort (header.rightborder); + disktomemshort (header.bottomborder); + + disktomemshort (header.backcolor.red); + disktomemshort (header.backcolor.green); + disktomemshort (header.backcolor.blue); + + disktomemlong (header.idwindow); + disktomemlong (header.lenwindowtitle); + if (header.versionnumber <= 2) /*back color was stored as an index, now stored as a RGBColor*/ oldclutconverter (header.v2backcolor, &header.backcolor); Modified: Frontier/branches/Conversant/Common/IowaRuntime/Source/iowaruntime.c =================================================================== --- Frontier/branches/Conversant/Common/IowaRuntime/Source/iowaruntime.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/IowaRuntime/Source/iowaruntime.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -28,6 +28,8 @@ #include "frontier.h" #include "standard.h" +#include "byteorder.h" + #include "shelltypes.h" #include <appletdefs.h> #include <iac.h> @@ -2051,6 +2053,8 @@ moveleft (*hpackedcard, &header, longsizeof (header)); + disktomemlong (header.idwindow); /* 2006-04-17 aradke: for Mac Intel */ + switch (header.idwindow) { case 1024: case 1025: Deleted: Frontier/branches/Conversant/Common/Paige/PaigePPC.lib =================================================================== (Binary files differ) Copied: Frontier/branches/Conversant/Common/Paige/libpaigefat.a (from rev 1296, Frontier/trunk/Common/Paige/libpaigefat.a) =================================================================== (Binary files differ) Modified: Frontier/branches/Conversant/Common/Paige/libpaigemacho.a =================================================================== (Binary files differ) Modified: Frontier/branches/Conversant/Common/headers/byteorder.h =================================================================== --- Frontier/branches/Conversant/Common/headers/byteorder.h 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/headers/byteorder.h 2006-04-18 19:33:35 UTC (rev 1297) @@ -76,6 +76,36 @@ #endif +/* + 2006-04-16 aradke: Carbon resource manager resources are in big endian format. + If we are running on an Intel Mac, we need to perform byte order conversion. +*/ + +#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1) && defined(SWAP_BYTE_ORDER)) + + #define SWAP_REZ_BYTE_ORDER 1 + + #define reztomemshort(x) shortswap(x) + #define reztomemlong(x) longswap(x) + #define reztomemrect(x) do {shortswap((x).top); shortswap((x).left); shortswap((x).bottom); shortswap((x).right);} while(0) + #define memtorezshort(x) shortswap(x) + #define memtorezlong(x) longswap(x) + #define memtorezrect(x) do {shortswap((x).top); shortswap((x).left); shortswap((x).bottom); shortswap((x).right);} while(0) + +#else + + #undef SWAP_REZ_BYTE_ORDER + + #define reztomemshort(x) + #define reztomemlong(x) + #define reztomemrect(x) + #define memtorezshort(x) + #define memtorezlong(x) + #define memtorezrect(x) + +#endif + + #define longswap(foo) do {foo = dolongswap(foo);} while (0) #define shortswap(foo) do {foo = doshortswap(foo);} while (0) Modified: Frontier/branches/Conversant/Common/headers/config.r =================================================================== --- Frontier/branches/Conversant/Common/headers/config.r 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/headers/config.r 2006-04-18 19:33:35 UTC (rev 1297) @@ -27,37 +27,37 @@ type'cnfg' { - boolean nohorizscroll, horizscroll; /*window has horiz scrollbar?*/ + integer nohorizscroll = 0, horizscroll = 1; /*window has horiz scrollbar?*/ - boolean novertscroll, vertscroll; + integer novertscroll = 0, vertscroll = 1; - boolean dontfloat, windowfloats; /*is it a floating palette window?*/ + integer dontfloat = 0, windowfloats = 1; /*is it a floating palette window?*/ - boolean nomessagearea, messagearea; /*allocate space for a message area?*/ + integer nomessagearea = 0, messagearea = 1; /*allocate space for a message area?*/ - boolean dontinsetcontentrect, insetcontentrect; /*if true we inset by 3 pixels*/ + integer dontinsetcontentrect = 0, insetcontentrect = 1; /*if true we inset by 3 pixels*/ - boolean nonewonlaunch, newonlaunch; + integer nonewonlaunch = 0, newonlaunch = 1; - boolean dontopenresfile, openresfile; + integer dontopenresfile = 0, openresfile = 1; - boolean normalwindow, dialogwindow; /*do a GetNewDialog on creating one of these windows?*/ + integer normalwindow = 0, dialogwindow = 1; /*do a GetNewDialog on creating one of these windows?*/ - boolean notgrowable, isgrowable; /*provide a grow box for window*/ + integer notgrowable = 0, isgrowable = 1; /*provide a grow box for window*/ - boolean dontcreateonnew, createonnew; + integer dontcreateonnew = 0, createonnew = 1; - boolean nowindoidscrollbars, windoidscrollbars; + integer nowindoidscrollbars = 0, windoidscrollbars = 1; - boolean notstoredindatabase, storedindatabase; + integer notstoredindatabase = 0, storedindatabase = 1; - boolean handlesownsave, parentwindowhandlessave; + integer handlesownsave = 0, parentwindowhandlessave = 1; - boolean donteraseonresize, eraseonresize; + integer donteraseonresize = 0, eraseonresize = 1; - boolean consumefrontclicks, dontconsumefrontclicks; + integer consumefrontclicks = 0, dontconsumefrontclicks = 1; - boolean monochromewindow, colorwindow; + integer monochromewindow = 0, colorwindow = 1; integer onehalf = 2, onethird = 3, onequarter = 4; Modified: Frontier/branches/Conversant/Common/headers/frontierconfig.h =================================================================== --- Frontier/branches/Conversant/Common/headers/frontierconfig.h 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/headers/frontierconfig.h 2006-04-18 19:33:35 UTC (rev 1297) @@ -71,41 +71,7 @@ typedef struct tyconfigrecord { -#ifdef MACVERSION - boolean flhorizscroll: 1; /*window has horiz scrollbar?*/ - - boolean flvertscroll: 1; - - boolean flwindowfloats: 1; /*is it a floating palette window?*/ // NOT USED - - boolean flmessagearea: 1; /*allocate space for a message area?*/ - - boolean flinsetcontentrect: 1; /*if true we inset by 3 pixels*/ - - boolean flnewonlaunch: 1; - - boolean flopenresfile: 1; - - boolean fldialog: 1; /*do a GetNewDialog on creating one of these windows?*/ - - boolean flgrowable: 1; /*provide a grow box for window*/ - - boolean flcreateonnew: 1; - - boolean flwindoidscrollbars: 1; - - boolean flstoredindatabase: 1; - - boolean flparentwindowhandlessave: 1; - - boolean fleraseonresize: 1; - - boolean fldontconsumefrontclicks: 1; - - boolean flcolorwindow: 1; -#endif - -#ifdef WIN95VERSION + short flhorizscroll; /*window has horiz scrollbar?*/ short flvertscroll; @@ -137,9 +103,7 @@ short fldontconsumefrontclicks; short flcolorwindow; -#endif - short messageareafraction; OSType filecreator, filetype; Modified: Frontier/branches/Conversant/Common/headers/macconv.h =================================================================== --- Frontier/branches/Conversant/Common/headers/macconv.h 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/headers/macconv.h 2006-04-18 19:33:35 UTC (rev 1297) @@ -67,7 +67,9 @@ #define wmouseUp 38 //Windows Only #define zoomEvt 39 //Windows Only - +#define suspendResumeMessage 0x0001 +#define resumeFlag 0x01 + #define everyEvent -1 #define activeFlag 256 #define activMask 256 Modified: Frontier/branches/Conversant/Common/headers/shellprivate.h =================================================================== --- Frontier/branches/Conversant/Common/headers/shellprivate.h 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/headers/shellprivate.h 2006-04-18 19:33:35 UTC (rev 1297) @@ -63,17 +63,6 @@ } tymenustate; -typedef struct tyjugglermessage { - - long eventtype: 8; /*bits 24 -- 31*/ - - long reservedbits: 22; /*bits 2 -- 23*/ - - long flconvertclipboard: 1; /*bit 1*/ - - long flresume: 1; /*bit 0*/ - } tyjugglermessage; - #ifdef version42orgreater #define cteditors 14 #else Modified: Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc =================================================================== --- Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc 2006-04-18 19:33:35 UTC (rev 1297) @@ -573,7 +573,7 @@ "multiplereplaceall\0", "macromantoutf8\0", // 2006-02-25 creedon "utf8tomacroman\0", // 2006-02-25 creedon - "convertcharset\0" /* 2006-04-16 */ + "convertcharset\0" /* 2006-04-16 smd */ END Modified: Frontier/branches/Conversant/Common/source/FrontierWinMain.c =================================================================== --- Frontier/branches/Conversant/Common/source/FrontierWinMain.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/FrontierWinMain.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -1820,22 +1820,23 @@ /* 5.0a22 dmb: added + + 2006-04-17 aradke: Removed tyjugglermessage for endianness-agnostic code. + See shellhandlejugglerevent in shelljuggler.c. */ EventRecord ev; - tyjugglermessage jmsg; ev.hwnd = hwnd; ev.winmsg = msg; ev.wparam = wParam; ev.lparam = lParam; + + ev.message = 0; + ev.message |= (suspendResumeMessage << 24); + ev.message |= ((wParam != 0) ? resumeFlag : 0); - *((long *)&jmsg) = 0; - jmsg.eventtype = 1; - jmsg.flresume = (BOOL) wParam; - ev.what = jugglerEvt; - ev.message = *(long *) &jmsg; ev.when = gettickcount (); ev.where.h = 0; ev.where.v = 0; Modified: Frontier/branches/Conversant/Common/source/OpenTransportNetEvents.c =================================================================== --- Frontier/branches/Conversant/Common/source/OpenTransportNetEvents.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/OpenTransportNetEvents.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -2464,6 +2464,8 @@ /* Initialize the NetEvents system + + 5.0.2b5 dmb: added hostData parameter and GUSI support to handle threading */ if (!frontierWinSockLoaded) { @@ -5140,3 +5142,4 @@ return (true); }/*fwsNetEventGetStats*/ + Modified: Frontier/branches/Conversant/Common/source/fileops.c =================================================================== --- Frontier/branches/Conversant/Common/source/fileops.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/fileops.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -53,8 +53,8 @@ #if TARGET_API_MAC_CARBON #include "MoreFilesX.h" #else - pascal OSErr XGetVInfo(short volReference, StringPtr volName, short *vRefNum, - UInt64 *freeBytes, UInt64 *totalBytes); + pascal OSErr XGetVInfo(short volReference, StringPtr volName, short *vRefNum, UInt64 *freeBytes, + UInt64 *totalBytes); #endif #ifdef flcomponent @@ -65,7 +65,7 @@ #ifndef __MOREFILESEXTRAS__ enum { /*permissions used by MoreFile 1.1 code*/ - dmNone = 0x0000, + dmNone = 0x0000, dmNoneDenyRd = 0x0010, dmNoneDenyWr = 0x0020, dmNoneDenyRdWr = 0x0030, @@ -75,9 +75,9 @@ dmRdDenyRdWr = 0x0031, dmWr = 0x0002, dmWrDenyRd = 0x0012, - dmWrDenyWr = 0x0022, + dmWrDenyWr = 0x0022, dmWrDenyRdWr = 0x0032, - dmRdWr = 0x0003, /* Shared access - equivalent to fsRdWrShPerm */ + dmRdWr = 0x0003, /* Shared access - equivalent to fsRdWrShPerm */ dmRdWrDenyRd = 0x0013, dmRdWrDenyWr = 0x0023, /* Single writer, multiple readers; the writer */ dmRdWrDenyRdWr = 0x0033 /* Exclusive access - equivalent to fsRdWrPerm */ @@ -170,6 +170,7 @@ return (false); } /*endswithpathsep*/ + boolean cleanendoffilename (bigstring bs) { if (endswithpathsep(bs)) { setstringlength (bs, stringlength(bs) - 1); @@ -595,9 +596,10 @@ return (true); } - wsprintf (stringbaseaddress(errmsg), "Can't complete function because \"%s\" is not a valid volume name.", stringbaseaddress(fsname(fs))); + wsprintf (stringbaseaddress (errmsg), "Can't complete function because \"%s\" is not a valid volume name.", + stringbaseaddress (fsname (fs))); - setstringlength (errmsg, strlen(stringbaseaddress(errmsg))); + setstringlength (errmsg, strlen (stringbaseaddress (errmsg))); shellerrormessage (errmsg); @@ -737,8 +739,8 @@ } } else { - fref = (Handle) CreateFile (stringbaseaddress(fn), GENERIC_READ | GENERIC_WRITE, 0, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + fref = (Handle) CreateFile (stringbaseaddress (fn), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); if (fref == INVALID_HANDLE_VALUE) { info->flbusy = true; @@ -753,7 +755,6 @@ return (true); } /*filegetinfo*/ - boolean filegetvolumename (short vnum, bigstring volname) { #ifdef MACVERSION @@ -803,7 +804,6 @@ } /*filegetvolumename*/ - boolean fileisbusy (const tyfilespec *fs, boolean *flbusy) { /* @@ -945,7 +945,6 @@ } /*filesetvisible*/ - boolean getfiletype (const tyfilespec *fs, OSType *type) { tyfileinfo info; @@ -976,7 +975,6 @@ } /*getfilecreator*/ - boolean filesize (const tyfilespec *fs, long *size) { tyfileinfo info; @@ -1794,8 +1792,15 @@ //Timothy Paustian's comments //warning the values returned by getspecialfolderpath on OS X are very different //than classic Mac OS + boolean getspecialfolderpath (bigstring bsvol, bigstring bsfolder, boolean flcreate, tyfilespec *fs) { - + /* + 2006-04-11 creedon: windows now honors flcreate + for windows added; CSIDL_PROGRAM_FILES, CSIDL_MYDOCUMENTS, CSIDL_MYMUSIC, + CSIDL_MYPICTURES, CSIDL_MYVIDEO; + for windows replaced more complex code with CSIDL_SYSTEM, CSIDL_WINDOWS + */ + #ifdef MACVERSION /* 9/1/92 dmb: last new verb for 2.0. (?) @@ -1865,13 +1870,12 @@ #ifdef WIN95VERSION int nFolder = -1; - int res; + // int res; ITEMIDLIST * il; // Global pointer to the shell's IMalloc interface. LPMALLOC g_pMalloc = NULL; - - if (equalidentifiers ("\x6" "system", bsfolder)) { + /* if (equalidentifiers ("\x6" "system", bsfolder)) { unsigned char str[MAX_PATH]; res = GetSystemDirectory (str, MAX_PATH); @@ -1905,7 +1909,7 @@ pushchar ('\\', fsname(fs)); nullterminate (fsname(fs)); return (true); - } + } */ if (equalidentifiers ("\x9" "bitbucket", bsfolder)) nFolder = CSIDL_BITBUCKET; @@ -1939,8 +1943,25 @@ nFolder = CSIDL_STARTUP; else if (equalidentifiers ("\x9" "templates", bsfolder)) nFolder = CSIDL_TEMPLATES; + else if (equalidentifiers ("\xD" "program files", bsfolder)) + nFolder = CSIDL_PROGRAM_FILES; + else if (equalidentifiers ("\x6" "system", bsfolder)) + nFolder = CSIDL_SYSTEM; + else if (equalidentifiers ("\x7" "windows", bsfolder)) + nFolder = CSIDL_WINDOWS; + else if (equalidentifiers ("\xC" "my documents", bsfolder)) + nFolder = CSIDL_MYDOCUMENTS; + else if (equalidentifiers ("\x8" "my music", bsfolder)) + nFolder = CSIDL_MYMUSIC; + else if (equalidentifiers ("\xB" "my pictures", bsfolder)) + nFolder = CSIDL_MYPICTURES; + else if (equalidentifiers ("\x8" "my video", bsfolder)) + nFolder = CSIDL_MYVIDEO; - if(nFolder != -1) { + if (flcreate) + nFolder += CSIDL_FLAG_CREATE; + +if (nFolder != -1) { // Get the shell's allocator. if (!SUCCEEDED(SHGetMalloc(&g_pMalloc))) { oserror (ERROR_INVALID_FUNCTION); @@ -2092,7 +2113,11 @@ #ifdef MACVERSION - /* 2005-01-24 creedon - reversed free and total parameters to match FSGetVInfo and XGetVInfo functions < http://groups.yahoo.com/group/frontierkernel/message/846 > */ + /* + 2005-01-24 creedon - reversed free and total parameters to match FSGetVInfo and XGetVInfo functions + < http://groups.yahoo.com/group/frontierkernel/message/846 > + */ + #if TARGET_API_MAC_CARBON errnum = FSGetVInfo (fs->vRefNum, nil, &ui64freebytes, &ui64totalbytes); #else @@ -2288,54 +2313,6 @@ #endif } /*lockvolume*/ - -#ifdef WIN95VERSION -boolean findapplication (OSType creator, tyfilespec *fsapp) { - - /* - 5.0.1 dmb: implemented for Win using the registry - */ - - 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); - - if (!getRegKeyString ((Handle) HKEY_CLASSES_ROOT, bsregpath, NULL, bsregpath)) - return (false); - - if (getstringcharacter (bsregpath, 0) == '"') { - - popleadingchars (bsregpath, '"'); - - firstword (bsregpath, '"', bsregpath); - } - else { - - lastword (bsregpath, ' ', bsoptions); - - if (stringlength (bsoptions) < stringlength (bsregpath)) - deletestring (bsregpath, stringlength (bsregpath) - stringlength (bsoptions) + 1, stringlength (bsoptions)); - } - - return (pathtofilespec (bsregpath, fsapp)); - } /*findapplication*/ -#endif - - #ifdef MACVERSION boolean unmountvolume (const tyfilespec *fs) { @@ -2386,114 +2363,6 @@ } /*hasdesktopmanager*/ -boolean findapplication (OSType creator, tyfilespec *fsapp) { - - /* - 2006-04-09 creedon: use LSFindApplicationForInfo if available - - 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. - - 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. - - 12/5/91 dmb - */ - - if ((UInt32) LSFindApplicationForInfo != (UInt32) kUnresolvedCFragSymbolAddress) { - - FSRef myRef; - - if (LSFindApplicationForInfo (creator, NULL, NULL, &myRef, NULL) != noErr) - return (false); - - if (FSRefMakeFSSpec (&myRef, fsapp) != noErr) - return (false); - - return (true); - } - else { - - bigstring bsapp; - DTPBRec dt; - HParamBlockRec pb; - OSType type; - register OSErr errcode; - boolean fltryremote = false; - boolean flremote; - - clearbytes (&pb, sizeof (pb)); - - while (true) { - - ++pb.volumeParam.ioVolIndex; - - errcode = PBHGetVInfoSync (&pb); - - if (errcode == nsvErr) { // index out of range - - if (fltryremote) // we've tried everything - return (false); - - pb.volumeParam.ioVolIndex = 0; // reset - - fltryremote = true; - - continue; - } - - if (errcode != noErr) - return (false); - - flremote = pb.volumeParam.ioVFSID != 0; // actually means foreign file system - - if (fltryremote != flremote) - continue; - - if (!hasdesktopmanager (pb.volumeParam.ioVRefNum)) - continue; - - dt.ioNamePtr = NULL; - dt.ioVRefNum = pb.volumeParam.ioVRefNum; - - if (PBDTGetPath (&dt) != noErr) - return (false); - - dt.ioNamePtr = (StringPtr) &bsapp; - dt.ioIndex = 0; - dt.ioFileCreator = creator; - - for (dt.ioIndex = 0; ; ++dt.ioIndex) { - - if (PBDTGetAPPLSync (&dt) != noErr) // go to next volume - break; - - if (FSMakeFSSpec (pb.volumeParam.ioVRefNum, dt.ioAPPLParID, bsapp, fsapp) != noErr) - continue; - - if (!getfiletype (fsapp, &type)) - return (false); - - if (type == 'APPL') // desktop db can contain references to non-apps - return (true); - } - - // if (PBDTGetAPPLSync (&dt) == noErr) { - - // if (FSMakeFSSpec (pb.volumeParam.ioVRefNum, dt.ioAPPLParID, bsapp, fsapp) == noErr) - // return (true); - // } - } - } /* if */ - } /* findapplication */ - - #if 0 static boolean getdesktopdatabasepath (short vnum, DTPBRec *dt) { @@ -2593,7 +2462,7 @@ /* new: pascal OSErr GetLabel(short labelNumber, RGBColor *labelColor, Str255 labelString) - = {0x303c, 0x050B, 0xABC9}; + = {0x303c, 0x050B, 0xABC9}; */ Handle hlabel; @@ -2878,7 +2747,6 @@ } /*fileparsevolname*/ - #ifdef MACVERSION boolean fileresolvealias (tyfilespec *fs) { @@ -3150,7 +3018,7 @@ #endif #ifdef WIN95VERSION - char fn[300]; + char fn [300]; bigstring bsfolder; if (!surefile (fs)) /*file doesn't exist -- catch error*/ @@ -3168,7 +3036,7 @@ nullterminate (bsfolder); - if (MoveFile (stringbaseaddress (fn), stringbaseaddress(bsfolder))) + if (MoveFile (stringbaseaddress (fn), stringbaseaddress (bsfolder))) return (true); winfileerror (fs); @@ -3276,8 +3144,8 @@ nullterminate (fn); - f = CreateFile (stringbaseaddress(fn), GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + f = CreateFile (stringbaseaddress(fn), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, NULL); if (f == INVALID_HANDLE_VALUE) { @@ -3359,4 +3227,86 @@ } /*initfile*/ +boolean findapplication (OSType creator, tyfilespec *fsapp) { + + /* + 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 + + 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. + + 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. + + 12/5/91 dmb + */ + + #ifdef MACVERSION + + if ((UInt32) LSFindApplicationForInfo == (UInt32) kUnresolvedCFragSymbolAddress) + return (false); + + FSRef myRef; + + if (LSFindApplicationForInfo (creator, NULL, NULL, &myRef, NULL) != noErr) + return (false); + + if (FSRefMakeFSSpec (&myRef, fsapp) != noErr) + return (false); + + return (true); + + #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); + + if (!getRegKeyString ((Handle) HKEY_CLASSES_ROOT, bsregpath, NULL, bsregpath)) + return (false); + + if (getstringcharacter (bsregpath, 0) == '"') { + + popleadingchars (bsregpath, '"'); + + firstword (bsregpath, '"', bsregpath); + } + else { + + lastword (bsregpath, ' ', bsoptions); + + if (stringlength (bsoptions) < stringlength (bsregpath)) + deletestring (bsregpath, stringlength (bsregpath) - stringlength (bsoptions) + 1, stringlength (bsoptions)); + } + + return (pathtofilespec (bsregpath, fsapp)); + + #endif /* WIN95VERSION */ + + } /* findapplication */ + Modified: Frontier/branches/Conversant/Common/source/fileverbs.c =================================================================== --- Frontier/branches/Conversant/Common/source/fileverbs.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/fileverbs.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -45,6 +45,7 @@ #include "tablestructure.h" #include "kernelverbdefs.h" #include "shell.rsrc.h" +#include "byteorder.h" /* 2006-04-16 aradke: for SWAP_REZ_BYTE_ORDER */ #ifdef MACVERSION @@ -1458,13 +1459,23 @@ */ typedef struct lNumVersion { +#ifdef SWAP_REZ_BYTE_ORDER + unsigned short nonRelRev2: 4; /* 2nd nibble of revision level*/ + unsigned short nonRelRev1 : 4; /*revision level of non-released version*/ + unsigned short stage : 8; /*stage code: dev, alpha, beta, final*/ + unsigned short bugFixRev : 4; /*3rd part is 1 nibble in BCD*/ + unsigned short minorRev : 4; /*2nd part is 1 nibble in BCD*/ + unsigned short majorRev2: 4; /* 2nd nibble of 1st part*/ unsigned short majorRev1: 4; /*1st part of version number in BCD*/ +#else + unsigned short majorRev1: 4; /*1st part of version number in BCD*/ unsigned short majorRev2: 4; /* 2nd nibble of 1st part*/ unsigned short minorRev : 4; /*2nd part is 1 nibble in BCD*/ unsigned short bugFixRev : 4; /*3rd part is 1 nibble in BCD*/ unsigned short stage : 8; /*stage code: dev, alpha, beta, final*/ unsigned short nonRelRev1 : 4; /*revision level of non-released version*/ unsigned short nonRelRev2: 4; /* 2nd nibble of revision level*/ +#endif } lNumVersion; typedef struct lVersRec { Modified: Frontier/branches/Conversant/Common/source/frontierconfig.c =================================================================== --- Frontier/branches/Conversant/Common/source/frontierconfig.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/frontierconfig.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -37,6 +37,7 @@ #include "shell.rsrc.h" #include "frontierconfig.h" #include "shell.h" +#include "byteorder.h" /* 2006-04-16 aradke: swap byte order in loadconfigresource */ #ifdef MACVERSION @@ -90,6 +91,8 @@ /* 2.1b5 dmb: release the config resource when done with it + + 2006-04-16 aradke: swap byte-order on Intel Macs */ register Handle h; @@ -100,14 +103,66 @@ if (h != nil) { moveleft (*h, cr, sizeof (tyconfigrecord)); + + releaseresourcehandle (h); + reztomemshort ((*cr).flhorizscroll); + + reztomemshort ((*cr).flvertscroll); + + reztomemshort ((*cr).flwindowfloats); + + reztomemshort ((*cr).flmessagearea); + + reztomemshort ((*cr).flinsetcontentrect); + + reztomemshort ((*cr).flnewonlaunch); + + reztomemshort ((*cr).flopenresfile); + + reztomemshort ((*cr).fldialog); + + reztomemshort ((*cr).flgrowable); + + reztomemshort ((*cr).flcreateonnew); + + reztomemshort ((*cr).flwindoidscrollbars); + + reztomemshort ((*cr).flstoredindatabase); + + reztomemshort ((*cr).flparentwindowhandlessave); + + reztomemshort ((*cr).fleraseonresize); + + reztomemshort ((*cr).fldontconsumefrontclicks); + + reztomemshort ((*cr).flcolorwindow); + + reztomemshort ((*cr).messageareafraction); + + reztomemlong ((*cr).filecreator); /* OSType */ + + reztomemlong ((*cr).filetype); /* OSType */ + + reztomemrect ((*cr).rmin); + + reztomemshort ((*cr).templateresnum); + + reztomemshort ((*cr).defaultfont); + + reztomemshort ((*cr).defaultsize); + + reztomemshort ((*cr).defaultstyle); + + reztomemshort ((*cr).idbuttonstringlist); + + reztomemrect ((*cr).defaultwindowrect); + getstringlist (fontnamelistnumber, (*cr).defaultfont, bs); fontgetnumber (bs, &(*cr).defaultfont); centerrectondesktop (&(*cr).defaultwindowrect); - - releaseresourcehandle (h); } else initconfigrecord (cr); Modified: Frontier/branches/Conversant/Common/source/langipc.c =================================================================== --- Frontier/branches/Conversant/Common/source/langipc.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/langipc.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -51,6 +51,7 @@ #include "meprograms.h" #include "process.h" #include "processinternal.h" +#include "byteorder.h" #ifdef flcomponent #include <uisharing.h> #include <uisinternal.h> @@ -2175,6 +2176,8 @@ 8/11/92 dmb: also special-case character values; they must go out as standard typeChar descriptors. + + 2006-04-17 aradke: Must byte-swap valtype id extracted from binary value on Intel Macs. */ register AEDesc *d = desc; @@ -2182,15 +2185,16 @@ #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ Handle hcopy; + DescType dtype; - newclearhandle (sizeof (DescType), &hcopy); + copyhandle (hbinary, &hcopy); - copyhandlecontents (hbinary, hcopy); + pullfromhandle (hcopy, 0L, sizeof (DescType), &dtype); - pullfromhandle (hcopy, 0L, sizeof (DescType), &(*d).descriptorType); - - newdescwithhandle (d, (*d).descriptorType, hcopy); + disktomemlong (dtype); + newdescwithhandle (d, dtype, hcopy); + disposehandle (hcopy); #else @@ -2198,6 +2202,8 @@ (*d).dataHandle = hbinary; pullfromhandle ((*d).dataHandle, 0L, sizeof (DescType), &(*d).descriptorType); + + disktomemlong ((*d).descriptorType); #endif Modified: Frontier/branches/Conversant/Common/source/langstartup.c =================================================================== --- Frontier/branches/Conversant/Common/source/langstartup.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/langstartup.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -42,6 +42,7 @@ #include "resources.h" #include "WinSockNetEvents.h" #include "sysshellcall.h" /* 2006-03-09 aradke: unixshellcall moved from CallMachOFramework.h */ +#include "byteorder.h" /* 2006-04-16 aradke: swap byte-order in loadfunctionprocessor */ #define str_isPike BIGSTRING ("\x06" "isPike") @@ -155,6 +156,8 @@ '040 instruction cache bug in Think C's run-time implementation of same, it's time to create the kernel tables directly from resources. that's what this routine does. + + 2006-04-16 aradke: swap byte-order on Intel Macs */ bigstring bsname; @@ -182,6 +185,8 @@ if (!loadfromhandle (hefps, &ix, 2, &ctefps)) return (false); + reztomemshort (ctefps); + while (--ctefps >= 0) { copyrezstring (BIGSTRING (*hefps + ix), bsname); @@ -191,12 +196,16 @@ if (!loadfromhandle (hefps, &ix, 2, &flwindow)) return (false); + reztomemshort (flwindow); + if (!newfunctionprocessor (bsname, valuecallback, (boolean) flwindow, &htable)) return (false); if (!loadfromhandle (hefps, &ix, 2, &ctverbs)) return (false); + reztomemshort (ctverbs); + pushhashtable (htable); while (--ctverbs >= 0 && fl) { Modified: Frontier/branches/Conversant/Common/source/langtree.c =================================================================== --- Frontier/branches/Conversant/Common/source/langtree.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/langtree.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -38,12 +38,11 @@ typedef struct tydisktreenode { -#ifdef MACVERSION +#ifdef SWAP_BYTE_ORDER + short nodetype; /*low byte will coincide with MAC enum*/ +#else tytreetype nodetype; /*add, subtract, if, etc.*/ #endif -#ifdef WIN95VERSION - short nodetype; /*low byte will coincide with MAC enum*/ -#endif long nodevalsize; @@ -70,7 +69,15 @@ typedef enum tydisktreenodeparaminfo { -#ifdef MACVERSION +#ifdef SWAP_BYTE_ORDER + ctparams_mask = 0x00f0, + ctparams_1 = 0x0010, + hasparam1_mask = 0x0008, + hasparam2_mask = 0x0004, + hasparam3_mask = 0x0002, + hasparam4_mask = 0x0001, + haslink_mask = 0x8000 +#else ctparams_mask = 0xf000, ctparams_1 = 0x1000, hasparam1_mask = 0x0800, @@ -79,16 +86,6 @@ hasparam4_mask = 0x0100, haslink_mask = 0x0080 #endif - -#ifdef WIN95VERSION - ctparams_mask = 0x00f0, - ctparams_1 = 0x0010, - hasparam1_mask = 0x0008, - hasparam2_mask = 0x0004, - hasparam3_mask = 0x0002, - hasparam4_mask = 0x0001, - haslink_mask = 0x8000 -#endif } tydisktreenodeparaminfo; @@ -108,10 +105,10 @@ typedef struct tyOLD42disktreenode { - #ifdef MACVERSION + #ifdef __BIG_ENDIAN__ tytreetype nodetype; /*add, subtract, if, etc.*/ #endif - #ifdef WIN95VERSION + #ifdef __LITTLE_ENDIAN__ short nodetype; #endif Modified: Frontier/branches/Conversant/Common/source/oppack.c =================================================================== --- Frontier/branches/Conversant/Common/source/oppack.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/oppack.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -47,7 +47,7 @@ typedef enum tylinetableitemflags { -#ifdef MACVERSION +#ifndef SWAP_BYTE_ORDER flexpanded = 0x8000, /*was the line expanded when the outline was closed?*/ flopenwindow = 0x4000, /*was the linked window open when its owner was closed?*/ appbit0 = 0x2000, /*application-defined bit*/ @@ -55,9 +55,7 @@ fllocked = 0x0800, /*is the line locked?*/ flcomment = 0x0400, /*is this line a comment?*/ flbreakpoint = 0x0200 /*is a breakpoint set on this line?*/ -#endif - -#ifdef WIN95VERSION +#else flexpanded = 0x0080, /*was the line expanded when the outline was closed?*/ flopenwindow = 0x0040, /*was the linked window open when its owner was closed?*/ appbit0 = 0x0020, /*application-defined bit*/ Modified: Frontier/branches/Conversant/Common/source/osacomponent.c =================================================================== --- Frontier/branches/Conversant/Common/source/osacomponent.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/osacomponent.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -66,6 +66,7 @@ #include "osaparseaete.h" #include "osawindows.h" #include <SetUpA5.h> +#include "byteorder.h" #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ #include "aeutils.h" @@ -2558,7 +2559,46 @@ break; } - err = OSARemoveStorageType ((AEDataStorage) hdata); + #ifdef SWAP_BYTE_ORDER + { + /* + 2006-04-17 aradke: This is a MAJOR HACK (FIXME)! + + Compiled osa scripts of the generic storage type have a 12-byte trailer: + + Bytes 0-3 contain the signature of the OSA component that knows + how to execute the script, e.g. 'LAND' for the UserTalk component. + The meaning of bytes 4-5 is unknown. + Bytes 6-7 seem to contain the length of the trailer as a 16bit integer. + Bytes 8-11 contain 0xFADEDEAD as a magic signature for the trailer. + + Example: 4C41 4E44 0001 000C FADE DEAD (see 'scpt' resource #1024 in iowaruntime.r) + + OSARemoveStorageType is supposed to remove this trailer if it is present. + However, it doesn't perform byte-order swapping on the length bytes in the trailer. + The call below ends up removing 3072 bytes instead of 12 bytes from hdata. + + Until we figure out how to properly deal with this bug(?), we use our own + implementation of OSARemoveStorageType on Intel Macs. + */ + + long hlen = gethandlesize (hdata); + char * p = *hdata; + long marker; + + p += (hlen - 4); + + marker = *(long *) p; + + disktomemlong (marker); + + if (marker == 0xFADEDEAD) { + sethandlesize (hdata, hlen - 12); //remove storage type trailer + } + } + #else + err = OSARemoveStorageType ((AEDataStorage) hdata); + #endif if (err == noErr) fl = langunpackvalue (hdata, &vscript); @@ -2571,7 +2611,7 @@ err = errOSABadStorageType; } - #if TARGET_API_MAC_CARBON + #if TARGET_API_MAC_CARBON == 1 if(descData != nil) { disposehandle(descData); /* AE OS X fix */ Modified: Frontier/branches/Conversant/Common/source/osawindows.c =================================================================== --- Frontier/branches/Conversant/Common/source/osawindows.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/osawindows.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -97,13 +97,13 @@ static boolean removewindowsharinghandlers (void); -static pascal ComponentResult -handlewindoweventcommand ( - Handle hglobals, - EventRecord *ev, - tyWindowSharingGlobals *pwsGlobals) -{ -#pragma unused (hglobals) +static pascal ComponentResult handlewindoweventcommand (Handle hglobals, EventRecord *ev, tyWindowSharingGlobals *pwsGlobals) { + + /* + 2006-04-17 aradke: update jugglerEvt case for Intel Macs using endianness-agnostic code + */ + + #pragma unused (hglobals) boolean flcloseallwindows = false; WindowPtr w; @@ -130,10 +130,9 @@ break; case jugglerEvt: { - tyjugglermessage *jmsg = (tyjugglermessage *) &(*ev).message; - if ((*jmsg).eventtype == 1) /*suspend or resume subevent*/ - shellactivatewindow (w, (*jmsg).flresume); + if ((((*ev).message >> 24) & 0xff) == suspendResumeMessage) /*suspend or resume subevent*/ + shellactivatewindow (w, ((*ev).message & resumeFlag) != 0); break; } Modified: Frontier/branches/Conversant/Common/source/resources.c =================================================================== --- Frontier/branches/Conversant/Common/source/resources.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/resources.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -50,7 +50,7 @@ is of zero length. */ - #ifdef fldebug + #if 0 //#ifdef fldebug /* 2006-04-16 aradke: disabled for Mac Intel build */ if (GetResource ('STR#', listnum) == nil) DebugStr ("\pmissing STR# resource"); Modified: Frontier/branches/Conversant/Common/source/shelljuggler.c =================================================================== --- Frontier/branches/Conversant/Common/source/shelljuggler.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/shelljuggler.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -93,11 +93,7 @@ } /*shellactivate*/ -static boolean -shelljugglervisit ( - WindowPtr w, - ptrvoid refcon) -{ +static boolean shelljugglervisit (WindowPtr w, ptrvoid refcon) { #pragma unused (refcon) shellpushglobals (w); @@ -116,18 +112,18 @@ 7/13/90 DW: deactivate the front window when we're swapped into the background on a juggler event. activate it when we're swapped back into the foreground. + + 2006-04-17 aradke: updated for Intel Macs using endianness-agnostic code */ register boolean flresume; - tyjugglermessage jmsg; + long message = shellevent.message; - moveleft (&shellevent.message, &jmsg, longsizeof (jmsg)); - - if (jmsg.eventtype == 1) { /*suspend or resume subevent*/ + if (((message >> 24) & 0xff) == suspendResumeMessage) { /*suspend or resume subevent*/ boolean fl; - flresume = jmsg.flresume; /*copy into register*/ + flresume = ((message & resumeFlag) != 0); /*copy into register*/ flshellactive = flresume; /*set global*/ @@ -142,14 +138,20 @@ if (fl) shellactivatewindow (shellwindow, flshellactive); - - if (jmsg.flconvertclipboard) { + + #if defined(TARGET_API_MAC_OS8) && (TARGET_API_MAC_OS8 == 1) + /* + 2006-04-17 aradke: convertClipboardFlag is never set on Carbon + */ - if (flresume) - ; /*shellreadscrap ()*/ /*12/28/90 dmb: see comment in shellreadscrap*/ - else - shellwritescrap (anyscraptype); - } + if ((message & convertClipboardFlag) != 0) { + + if (flresume) + ; /*shellreadscrap ()*/ /*12/28/90 dmb: see comment in shellreadscrap*/ + else + shellwritescrap (anyscraptype); + } + #endif if (fl) shellpopglobals (); Modified: Frontier/branches/Conversant/Common/source/stringverbs.c =================================================================== --- Frontier/branches/Conversant/Common/source/stringverbs.c 2006-04-18 19:08:25 UTC (rev 1296) +++ Frontier/branches/Conversant/Common/source/stringverbs.c 2006-04-18 19:33:35 UTC (rev 1297) @@ -2258,7 +2258,7 @@ if (!ansitoutf16 (h, hresult)) return (false); - disposehandle(h); // kw 2005-07-23 --- memleak + disposehandle (h); // kw 2005-07-23 --- memleak return (setheapvalue (hresult, stringvaluetype, v)); } @@ -2301,7 +2301,7 @@ if (!utf8tomacroman (h, hresult)) goto error; - disposehandle(h); + disposehandle (h); return (setheapvalue (hresult, stringvaluetype, v)); } Property changes on: Frontier/branches/Conversant/build_XCode/tools ___________________________________________________________________ Name: svn:ignore - libpaigemacho.a + libpaigemacho.a libpaigefat.a Property changes on: Frontier/branches/Conversant/build_XCode/tools/postlinking.sh ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-18 19:08:29
|
Revision: 1296 Author: sethdill Date: 2006-04-18 12:08:25 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1296&view=rev Log Message: ----------- Optimizations. Use getreadonlytextvalue() in the charset-conversion scripts, since the verb isn't going to change the string. Modified Paths: -------------- Frontier/branches/Conversant/Common/source/stringverbs.c Modified: Frontier/branches/Conversant/Common/source/stringverbs.c =================================================================== --- Frontier/branches/Conversant/Common/source/stringverbs.c 2006-04-18 18:34:24 UTC (rev 1295) +++ Frontier/branches/Conversant/Common/source/stringverbs.c 2006-04-18 19:08:25 UTC (rev 1296) @@ -2274,13 +2274,13 @@ flnextparamislast = true; - if (!getexempttextvalue (hp1, 1, &h)) - return (false); + if (!getreadonlytextvalue (hp1, 1, &h)) + goto error; newemptyhandle (&hresult); if (!macromantoutf8 (h, hresult)) - return (false); + goto error; disposehandle (h); @@ -2293,13 +2293,13 @@ flnextparamislast = true; - if (!getexempttextvalue (hp1, 1, &h)) - return (false); + if (!getreadonlytextvalue (hp1, 1, &h)) + goto error; newemptyhandle (&hresult); if (!utf8tomacroman (h, hresult)) - return (false); + goto error; disposehandle(h); @@ -2319,7 +2319,7 @@ flnextparamislast = true; - if (!getexempttextvalue (hp1, 3, &h)) + if (!getreadonlytextvalue (hp1, 3, &h)) goto error; newemptyhandle (&hresult); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-18 18:34:36
|
Revision: 1295 Author: andreradke Date: 2006-04-18 11:34:24 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1295&view=rev Log Message: ----------- Make MacBird cards work on Intel Macs, at least the standard Jump and Get Info dialogs. Integer values stored in packed cards need to be byte-swapped on Intel Macs. Modified Paths: -------------- Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h Frontier/trunk/Common/IowaRuntime/Source/iowacore.c Frontier/trunk/Common/IowaRuntime/Source/iowaruntime.c Modified: Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h =================================================================== --- Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 17:51:46 UTC (rev 1294) +++ Frontier/trunk/Common/IowaRuntime/Headers/iowacore.h 2006-04-18 18:34:24 UTC (rev 1295) @@ -28,6 +28,7 @@ #ifndef iowacoreinclude #define iowacoreinclude +#include "byteorder.h" /* 2006-04-17 aradke: for SWAP_BYTE_ORDER */ #ifdef coderesource /*we're building into a UCMD*/ @@ -105,8 +106,26 @@ short defaulttextcolor; short defaultframecolor; + +#ifdef SWAP_BYTE_ORDER + unsigned short wastebits: 10; /*room for more booleans*/ + + unsigned short floater: 1; + + unsigned short flinvisiblegrid: 1; + + unsigned short flselection: 1; + + unsigned short flgrid: 1; + + unsigned short defaulttransparent: 1; + unsigned short defaulthasframe: 1; + +#else + + unsigned short defaulthasframe: 1; unsigned short defaulttransparent: 1; @@ -119,7 +138,9 @@ unsigned short floater: 1; unsigned short wastebits: 10; /*room for more booleans*/ - + +#endif + short gridunits; short rightborder, bottomborder; @@ -163,8 +184,28 @@ short objectlinespacing; short objectindentation; + +#ifdef SWAP_BYTE_ORDER + unsigned short wastebits: 9; /* room for more booleans */ + + unsigned short objectdisabled: 1; + + unsigned short objectfastscript: 1; + + unsigned short objecttransparent: 1; + + unsigned short lastinlist: 1; + + unsigned short objectinvisible: 1; + + unsigned short objectflag: 1; + unsigned short objecthasframe: 1; + +#else + + unsigned short objecthasframe: 1; unsigned short objectflag: 1; @@ -178,6 +219,10 @@ unsigned short objectdisabled: 1; + unsigned short wastebits: 9; /* room for more booleans */ + +#endif + long objecttype; /*room for lots of object types*/ RGBColor objectfillcolor, objecttextcolor, objectframecolor; Modified: Frontier/trunk/Common/IowaRuntime/Source/iowacore.c =================================================================== --- Frontier/trunk/Common/IowaRuntime/Source/iowacore.c 2006-04-18 17:51:46 UTC (rev 1294) +++ Frontier/trunk/Common/IowaRuntime/Source/iowacore.c 2006-04-18 18:34:24 UTC (rev 1295) @@ -29,6 +29,7 @@ #include "standard.h" #include "shelltypes.h" +#include "byteorder.h" #ifdef iowaRuntime @@ -2728,12 +2729,60 @@ boolean unpackobject (hdlobject *hobject, boolean *lastinlist) { + /* + 2006-04-17 aradke: must convert packed data to native byte-order on Intel Macs + */ + tydiskobject info; tyobject obj; hdlobject h; moveleft (unpack.p, &info, longsizeof (info)); + disktomemshort (info.versionnumber); + + disktomemshort (info.objectrect.top); + disktomemshort (info.objectrect.left); + disktomemshort (info.objectrect.bottom); + disktomemshort (info.objectrect.right); + + disktomemlong (info.lenname); + disktomemlong (info.lenvalue); + disktomemlong (info.lenscript); + disktomemlong (info.lendata); + + disktomemshort (info.objectfontsize); + disktomemshort (info.objectstyle); + disktomemshort (info.objectjustification); + disktomemshort (info.objectrecalcstatus); + disktomemshort (info.objectrecalcperiod); + disktomemshort (info.unused1); + disktomemshort (info.objectdropshadowdepth); + disktomemshort (info.objectlinespacing); + disktomemshort (info.objectindentation); + + /* + 2006-04-17 aradke: The info.objecthasframe etc. bit-field doesn't need to be byte-swapped, + because this is already taken care of via the endian-specific definition in iowacore.h. + */ + + disktomemlong (info.objecttype); + + disktomemshort (info.objectfillcolor.red); + disktomemshort (info.objectfillcolor.green); + disktomemshort (info.objectfillcolor.blue); + + disktomemshort (info.objecttextcolor.red); + disktomemshort (info.objecttextcolor.green); + disktomemshort (info.objecttextcolor.blue); + + disktomemshort (info.objectframecolor.red); + disktomemshort (info.objectframecolor.green); + disktomemshort (info.objectframecolor.blue); + + disktomemlong (info.objectlanguage); + disktomemlong (info.lenrecalcscript); + if (info.versionnumber == 1) /*record format changed to allow 4 bytes for object type*/ info.objecttype = (unsigned long) info.v1objecttype; @@ -2898,6 +2947,10 @@ boolean iowaunpack (Handle hpacked) { + + /* + 2006-04-17 aradke: must convert packed data to native byte-order on Intel Macs + */ hdlcard hc = iowadata; hdlobject newlist; @@ -2917,6 +2970,8 @@ unpack.p += longsizeof (header); + disktomemshort (header.versionnumber); + if (header.versionnumber < 4) { /*the header grew by 66 bytes in version 4*/ header.lenwindowtitle = 0; @@ -2924,6 +2979,30 @@ unpack.p -= 66; } + disktomemshort (header.v2backcolor); + + disktomemlong (header.lenembeddedtable); + + disktomemshort (header.defaultfillcolor); + disktomemshort (header.defaulttextcolor); + disktomemshort (header.defaultframecolor); + + /* + 2006-04-17 aradke: The header.defaulthasframe etc. bit-field doesn't need to be byte-swapped, + because this is already taken care of via the endian-specific definition in iowacore.h. + */ + + disktomemshort (header.gridunits); + disktomemshort (header.rightborder); + disktomemshort (header.bottomborder); + + disktomemshort (header.backcolor.red); + disktomemshort (header.backcolor.green); + disktomemshort (header.backcolor.blue); + + disktomemlong (header.idwindow); + disktomemlong (header.lenwindowtitle); + if (header.versionnumber <= 2) /*back color was stored as an index, now stored as a RGBColor*/ oldclutconverter (header.v2backcolor, &header.backcolor); Modified: Frontier/trunk/Common/IowaRuntime/Source/iowaruntime.c =================================================================== --- Frontier/trunk/Common/IowaRuntime/Source/iowaruntime.c 2006-04-18 17:51:46 UTC (rev 1294) +++ Frontier/trunk/Common/IowaRuntime/Source/iowaruntime.c 2006-04-18 18:34:24 UTC (rev 1295) @@ -28,6 +28,8 @@ #include "frontier.h" #include "standard.h" +#include "byteorder.h" + #include "shelltypes.h" #include <appletdefs.h> #include <iac.h> @@ -2051,6 +2053,8 @@ moveleft (*hpackedcard, &header, longsizeof (header)); + disktomemlong (header.idwindow); /* 2006-04-17 aradke: for Mac Intel */ + switch (header.idwindow) { case 1024: case 1025: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-18 17:51:57
|
Revision: 1294 Author: andreradke Date: 2006-04-18 10:51:46 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1294&view=rev Log Message: ----------- In osaLoad, replace the call to OSARemoveStorageType with a custom hack that doesn't truncate compiled scripts on Intel Macs. Modified Paths: -------------- Frontier/trunk/Common/source/osacomponent.c Modified: Frontier/trunk/Common/source/osacomponent.c =================================================================== --- Frontier/trunk/Common/source/osacomponent.c 2006-04-18 17:49:06 UTC (rev 1293) +++ Frontier/trunk/Common/source/osacomponent.c 2006-04-18 17:51:46 UTC (rev 1294) @@ -66,6 +66,7 @@ #include "osaparseaete.h" #include "osawindows.h" #include <SetUpA5.h> +#include "byteorder.h" #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ #include "aeutils.h" @@ -2558,7 +2559,46 @@ break; } - err = OSARemoveStorageType ((AEDataStorage) hdata); + #ifdef SWAP_BYTE_ORDER + { + /* + 2006-04-17 aradke: This is a MAJOR HACK (FIXME)! + + Compiled osa scripts of the generic storage type have a 12-byte trailer: + + Bytes 0-3 contain the signature of the OSA component that knows + how to execute the script, e.g. 'LAND' for the UserTalk component. + The meaning of bytes 4-5 is unknown. + Bytes 6-7 seem to contain the length of the trailer as a 16bit integer. + Bytes 8-11 contain 0xFADEDEAD as a magic signature for the trailer. + + Example: 4C41 4E44 0001 000C FADE DEAD (see 'scpt' resource #1024 in iowaruntime.r) + + OSARemoveStorageType is supposed to remove this trailer if it is present. + However, it doesn't perform byte-order swapping on the length bytes in the trailer. + The call below ends up removing 3072 bytes instead of 12 bytes from hdata. + + Until we figure out how to properly deal with this bug(?), we use our own + implementation of OSARemoveStorageType on Intel Macs. + */ + + long hlen = gethandlesize (hdata); + char * p = *hdata; + long marker; + + p += (hlen - 4); + + marker = *(long *) p; + + disktomemlong (marker); + + if (marker == 0xFADEDEAD) { + sethandlesize (hdata, hlen - 12); //remove storage type trailer + } + } + #else + err = OSARemoveStorageType ((AEDataStorage) hdata); + #endif if (err == noErr) fl = langunpackvalue (hdata, &vscript); @@ -2571,7 +2611,7 @@ err = errOSABadStorageType; } - #if TARGET_API_MAC_CARBON + #if TARGET_API_MAC_CARBON == 1 if(descData != nil) { disposehandle(descData); /* AE OS X fix */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-18 17:49:17
|
Revision: 1293 Author: andreradke Date: 2006-04-18 10:49:06 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1293&view=rev Log Message: ----------- In binarytodesc, conditionally byte-swap the (big-endian) binary type extracted from the binary UserTalk value before using it as the descriptor type. Modified Paths: -------------- Frontier/trunk/Common/source/langipc.c Modified: Frontier/trunk/Common/source/langipc.c =================================================================== --- Frontier/trunk/Common/source/langipc.c 2006-04-17 17:52:12 UTC (rev 1292) +++ Frontier/trunk/Common/source/langipc.c 2006-04-18 17:49:06 UTC (rev 1293) @@ -51,6 +51,7 @@ #include "meprograms.h" #include "process.h" #include "processinternal.h" +#include "byteorder.h" #ifdef flcomponent #include <uisharing.h> #include <uisinternal.h> @@ -2175,6 +2176,8 @@ 8/11/92 dmb: also special-case character values; they must go out as standard typeChar descriptors. + + 2006-04-17 aradke: Must byte-swap valtype id extracted from binary value on Intel Macs. */ register AEDesc *d = desc; @@ -2182,15 +2185,16 @@ #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ Handle hcopy; + DescType dtype; - newclearhandle (sizeof (DescType), &hcopy); + copyhandle (hbinary, &hcopy); - copyhandlecontents (hbinary, hcopy); + pullfromhandle (hcopy, 0L, sizeof (DescType), &dtype); - pullfromhandle (hcopy, 0L, sizeof (DescType), &(*d).descriptorType); - - newdescwithhandle (d, (*d).descriptorType, hcopy); + disktomemlong (dtype); + newdescwithhandle (d, dtype, hcopy); + disposehandle (hcopy); #else @@ -2198,6 +2202,8 @@ (*d).dataHandle = hbinary; pullfromhandle ((*d).dataHandle, 0L, sizeof (DescType), &(*d).descriptorType); + + disktomemlong ((*d).descriptorType); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-17 17:52:30
|
Revision: 1292 Author: andreradke Date: 2006-04-17 10:52:12 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1292&view=rev Log Message: ----------- Fix breakage in WinProcessActivateAppEvent introduced in revision 1290 when the custom tyjugglermessage struct was replaced with endianness-agnostic code. ViewCVS Links: ------------- http://svn.sourceforge.net/frontierkernel/?rev=1290&view=rev Modified Paths: -------------- Frontier/trunk/Common/headers/macconv.h Frontier/trunk/Common/source/FrontierWinMain.c Frontier/trunk/Common/source/shelljuggler.c Modified: Frontier/trunk/Common/headers/macconv.h =================================================================== --- Frontier/trunk/Common/headers/macconv.h 2006-04-17 15:09:49 UTC (rev 1291) +++ Frontier/trunk/Common/headers/macconv.h 2006-04-17 17:52:12 UTC (rev 1292) @@ -67,7 +67,9 @@ #define wmouseUp 38 //Windows Only #define zoomEvt 39 //Windows Only - +#define suspendResumeMessage 0x0001 +#define resumeFlag 0x01 + #define everyEvent -1 #define activeFlag 256 #define activMask 256 Modified: Frontier/trunk/Common/source/FrontierWinMain.c =================================================================== --- Frontier/trunk/Common/source/FrontierWinMain.c 2006-04-17 15:09:49 UTC (rev 1291) +++ Frontier/trunk/Common/source/FrontierWinMain.c 2006-04-17 17:52:12 UTC (rev 1292) @@ -1820,22 +1820,23 @@ /* 5.0a22 dmb: added + + 2006-04-17 aradke: Removed tyjugglermessage for endianness-agnostic code. + See shellhandlejugglerevent in shelljuggler.c. */ EventRecord ev; - tyjugglermessage jmsg; ev.hwnd = hwnd; ev.winmsg = msg; ev.wparam = wParam; ev.lparam = lParam; + + ev.message = 0; + ev.message |= (suspendResumeMessage << 24); + ev.message |= ((wParam != 0) ? resumeFlag : 0); - *((long *)&jmsg) = 0; - jmsg.eventtype = 1; - jmsg.flresume = (BOOL) wParam; - ev.what = jugglerEvt; - ev.message = *(long *) &jmsg; ev.when = gettickcount (); ev.where.h = 0; ev.where.v = 0; Modified: Frontier/trunk/Common/source/shelljuggler.c =================================================================== --- Frontier/trunk/Common/source/shelljuggler.c 2006-04-17 15:09:49 UTC (rev 1291) +++ Frontier/trunk/Common/source/shelljuggler.c 2006-04-17 17:52:12 UTC (rev 1292) @@ -139,7 +139,7 @@ if (fl) shellactivatewindow (shellwindow, flshellactive); - #if !TARGET_API_MAC_CARBON + #if defined(TARGET_API_MAC_OS8) && (TARGET_API_MAC_OS8 == 1) /* 2006-04-17 aradke: convertClipboardFlag is never set on Carbon */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <has...@us...> - 2006-04-17 15:10:04
|
Revision: 1291 Author: hasseily Date: 2006-04-17 08:09:49 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1291&view=rev Log Message: ----------- Fixed endian issues with Intel Macs. It's not acceptable to check for WIN95VERSION when dealing with endianness any more. Modified Paths: -------------- Frontier/trunk/Common/source/langtree.c Modified: Frontier/trunk/Common/source/langtree.c =================================================================== --- Frontier/trunk/Common/source/langtree.c 2006-04-17 10:53:56 UTC (rev 1290) +++ Frontier/trunk/Common/source/langtree.c 2006-04-17 15:09:49 UTC (rev 1291) @@ -38,12 +38,11 @@ typedef struct tydisktreenode { -#ifdef MACVERSION +#ifdef SWAP_BYTE_ORDER + short nodetype; /*low byte will coincide with MAC enum*/ +#else tytreetype nodetype; /*add, subtract, if, etc.*/ #endif -#ifdef WIN95VERSION - short nodetype; /*low byte will coincide with MAC enum*/ -#endif long nodevalsize; @@ -70,7 +69,15 @@ typedef enum tydisktreenodeparaminfo { -#ifdef MACVERSION +#ifdef SWAP_BYTE_ORDER + ctparams_mask = 0x00f0, + ctparams_1 = 0x0010, + hasparam1_mask = 0x0008, + hasparam2_mask = 0x0004, + hasparam3_mask = 0x0002, + hasparam4_mask = 0x0001, + haslink_mask = 0x8000 +#else ctparams_mask = 0xf000, ctparams_1 = 0x1000, hasparam1_mask = 0x0800, @@ -79,16 +86,6 @@ hasparam4_mask = 0x0100, haslink_mask = 0x0080 #endif - -#ifdef WIN95VERSION - ctparams_mask = 0x00f0, - ctparams_1 = 0x0010, - hasparam1_mask = 0x0008, - hasparam2_mask = 0x0004, - hasparam3_mask = 0x0002, - hasparam4_mask = 0x0001, - haslink_mask = 0x8000 -#endif } tydisktreenodeparaminfo; @@ -108,10 +105,10 @@ typedef struct tyOLD42disktreenode { - #ifdef MACVERSION + #ifdef __BIG_ENDIAN__ tytreetype nodetype; /*add, subtract, if, etc.*/ #endif - #ifdef WIN95VERSION + #ifdef __LITTLE_ENDIAN__ short nodetype; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-17 10:54:09
|
Revision: 1290 Author: andreradke Date: 2006-04-17 03:53:56 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1290&view=rev Log Message: ----------- Fix handling of suspend/resume events for Intel Macs by replacing the custom tyjugglermessage bit-field with endianness-agnostic code. Modified Paths: -------------- Frontier/trunk/Common/headers/shellprivate.h Frontier/trunk/Common/source/osawindows.c Frontier/trunk/Common/source/shelljuggler.c Modified: Frontier/trunk/Common/headers/shellprivate.h =================================================================== --- Frontier/trunk/Common/headers/shellprivate.h 2006-04-17 05:50:15 UTC (rev 1289) +++ Frontier/trunk/Common/headers/shellprivate.h 2006-04-17 10:53:56 UTC (rev 1290) @@ -63,17 +63,6 @@ } tymenustate; -typedef struct tyjugglermessage { - - long eventtype: 8; /*bits 24 -- 31*/ - - long reservedbits: 22; /*bits 2 -- 23*/ - - long flconvertclipboard: 1; /*bit 1*/ - - long flresume: 1; /*bit 0*/ - } tyjugglermessage; - #ifdef version42orgreater #define cteditors 14 #else Modified: Frontier/trunk/Common/source/osawindows.c =================================================================== --- Frontier/trunk/Common/source/osawindows.c 2006-04-17 05:50:15 UTC (rev 1289) +++ Frontier/trunk/Common/source/osawindows.c 2006-04-17 10:53:56 UTC (rev 1290) @@ -97,13 +97,13 @@ static boolean removewindowsharinghandlers (void); -static pascal ComponentResult -handlewindoweventcommand ( - Handle hglobals, - EventRecord *ev, - tyWindowSharingGlobals *pwsGlobals) -{ -#pragma unused (hglobals) +static pascal ComponentResult handlewindoweventcommand (Handle hglobals, EventRecord *ev, tyWindowSharingGlobals *pwsGlobals) { + + /* + 2006-04-17 aradke: update jugglerEvt case for Intel Macs using endianness-agnostic code + */ + + #pragma unused (hglobals) boolean flcloseallwindows = false; WindowPtr w; @@ -130,10 +130,9 @@ break; case jugglerEvt: { - tyjugglermessage *jmsg = (tyjugglermessage *) &(*ev).message; - if ((*jmsg).eventtype == 1) /*suspend or resume subevent*/ - shellactivatewindow (w, (*jmsg).flresume); + if ((((*ev).message >> 24) & 0xff) == suspendResumeMessage) /*suspend or resume subevent*/ + shellactivatewindow (w, ((*ev).message & resumeFlag) != 0); break; } Modified: Frontier/trunk/Common/source/shelljuggler.c =================================================================== --- Frontier/trunk/Common/source/shelljuggler.c 2006-04-17 05:50:15 UTC (rev 1289) +++ Frontier/trunk/Common/source/shelljuggler.c 2006-04-17 10:53:56 UTC (rev 1290) @@ -93,11 +93,7 @@ } /*shellactivate*/ -static boolean -shelljugglervisit ( - WindowPtr w, - ptrvoid refcon) -{ +static boolean shelljugglervisit (WindowPtr w, ptrvoid refcon) { #pragma unused (refcon) shellpushglobals (w); @@ -116,18 +112,18 @@ 7/13/90 DW: deactivate the front window when we're swapped into the background on a juggler event. activate it when we're swapped back into the foreground. + + 2006-04-17 aradke: updated for Intel Macs using endianness-agnostic code */ register boolean flresume; - tyjugglermessage jmsg; + long message = shellevent.message; - moveleft (&shellevent.message, &jmsg, longsizeof (jmsg)); - - if (jmsg.eventtype == 1) { /*suspend or resume subevent*/ + if (((message >> 24) & 0xff) == suspendResumeMessage) { /*suspend or resume subevent*/ boolean fl; - flresume = jmsg.flresume; /*copy into register*/ + flresume = ((message & resumeFlag) != 0); /*copy into register*/ flshellactive = flresume; /*set global*/ @@ -142,14 +138,20 @@ if (fl) shellactivatewindow (shellwindow, flshellactive); - - if (jmsg.flconvertclipboard) { + + #if !TARGET_API_MAC_CARBON + /* + 2006-04-17 aradke: convertClipboardFlag is never set on Carbon + */ - if (flresume) - ; /*shellreadscrap ()*/ /*12/28/90 dmb: see comment in shellreadscrap*/ - else - shellwritescrap (anyscraptype); - } + if ((message & convertClipboardFlag) != 0) { + + if (flresume) + ; /*shellreadscrap ()*/ /*12/28/90 dmb: see comment in shellreadscrap*/ + else + shellwritescrap (anyscraptype); + } + #endif if (fl) shellpopglobals (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |