|
From: <kar...@us...> - 2006-05-24 18:06:54
|
Revision: 1392 Author: karstenw Date: 2006-05-24 11:06:41 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1392&view=rev Log Message: ----------- Moved #define OPLANGLISTACCEL from frontierdefs.h to oplist.c; the only place that needs modification for the listcache. Comments added for easier navigation. Started work on files for Sint64 sizes. Modified Paths: -------------- Frontier/branches/Int64/Common/headers/file.h Frontier/branches/Int64/Common/headers/frontierdefs.h Frontier/branches/Int64/Common/source/fileops.c Frontier/branches/Int64/Common/source/oplist.c Modified: Frontier/branches/Int64/Common/headers/file.h =================================================================== --- Frontier/branches/Int64/Common/headers/file.h 2006-05-22 17:05:05 UTC (rev 1391) +++ Frontier/branches/Int64/Common/headers/file.h 2006-05-24 18:06:41 UTC (rev 1392) @@ -159,25 +159,53 @@ boolean fltemp; /*Windows "temp" file attribute*/ OSType filecreator, filetype; /*the creator ID and file type*/ - + +#if LONGINT_LONGDATE == 999 // struct tyfileinfo file dates + + tylongdate + timecreated, + timemodified, + timeaccessed; + +#else long timecreated, timemodified, timeaccessed; /*the creation and modification date for the file*/ +#endif long sizedataforkhigh, sizedatafork, sizeresourcefork; /*the size of the file's two forks*/ - + short ixlabel; /*the file's label, as displayed in the Finder*/ Point iconposition; /*the position of the file's icon, when viewing by icon in Finder*/ - + +#if LONGINT_LONGDATE == 999 // struct tyfileinfo folderitemcount & noOfVolumeFolders + + tylonglongint + ctfiles, + ctfolders; + +#else + unsigned short ctfiles; /*for folders, the number of files in the folder*/ unsigned short ctfolders; /*for volumes, the number of folders on the disk*/ - + +#endif + tyfolderview folderview; /*for folders, view by name, by date, etc.*/ +#if LONGINT_LONGDATE == 999 // struct tyfileinfo volume freeBytes & volume totalBytes + + tylonglongint + ctfreebytes, + cttotalbytes; + +#else + unsigned long ctfreebytes; /*for volumes*/ unsigned long cttotalbytes; /*for volumes*/ - +#endif + unsigned long blocksize; } tyfileinfo; Modified: Frontier/branches/Int64/Common/headers/frontierdefs.h =================================================================== --- Frontier/branches/Int64/Common/headers/frontierdefs.h 2006-05-22 17:05:05 UTC (rev 1391) +++ Frontier/branches/Int64/Common/headers/frontierdefs.h 2006-05-24 18:06:41 UTC (rev 1392) @@ -89,10 +89,6 @@ // kw - 2006-02-13 --- a test for the AE-memory leak #define AEDISPOSAL 1 -// kw - 2006-02-15 --- oplanglist accelerator - set to 1 to turn on -#define OPLANGLISTACCEL 0 - - #ifdef MACVERSION #define macBirdRuntime 1 #undef appRunsCards /*for Applet Toolkit, Iowa Runtime is baked in*/ Modified: Frontier/branches/Int64/Common/source/fileops.c =================================================================== --- Frontier/branches/Int64/Common/source/fileops.c 2006-05-22 17:05:05 UTC (rev 1391) +++ Frontier/branches/Int64/Common/source/fileops.c 2006-05-24 18:06:41 UTC (rev 1392) @@ -260,6 +260,28 @@ } /*getmacfileinfo*/ +#if LONGINT_LONGDATE == 1 // getosxfileinfo() +boolean getosxfileinfo (const tyfilespec *fs, CInfoPBRec *pb) { + + /* + 2.1b2 dmb: new fsspec-based version + */ + + setoserrorparam ((ptrstring) (*fs).name); /*in case error message takes a filename parameter*/ + + clearbytes (pb, sizeof (*pb)); + + (*pb).hFileInfo.ioNamePtr = (StringPtr) (*fs).name; + + (*pb).hFileInfo.ioVRefNum = (*fs).vRefNum; + + (*pb).hFileInfo.ioDirID = (*fs).parID; + + return (!oserror (PBGetCatInfoSync (pb))); +} /*getmacfileinfo*/ +#endif + + static boolean setmacfileinfo (const tyfilespec *fs, CInfoPBRec *pb) { /* Modified: Frontier/branches/Int64/Common/source/oplist.c =================================================================== --- Frontier/branches/Int64/Common/source/oplist.c 2006-05-22 17:05:05 UTC (rev 1391) +++ Frontier/branches/Int64/Common/source/oplist.c 2006-05-24 18:06:41 UTC (rev 1392) @@ -53,13 +53,18 @@ #define oplistversionnumber 1 +// kw - 2006-05-24 --- moved here from frontierdefs.h; +// kw - 2006-02-15 --- oplanglist accelerator - set to 1 to turn on +#define OPLANGLISTACCEL 0 -#if OPLANGLISTACCEL == 1 + + +#if OPLANGLISTACCEL == 1 // struct tylistindex typedef struct tylistindex { hdlheadrecord oplistindex; SInt32 - start, + first, current, ctelements, size; @@ -80,7 +85,7 @@ /*routine that releases one of **your** handles*/ oplistreleaseitemcallback releaseitemcallback; -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in struct tylistrecord tylistindex listindex; #endif @@ -125,7 +130,7 @@ } /%oplistreleaserefcon%/ */ -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // functions // a try at accelerating list access by use of an index. // currently getnthlistitem has time complexity O(n). // I want O(1) @@ -151,10 +156,10 @@ SInt32 *usedsize, SInt32 *nextidx) { - *shiftsize = theIndex->start; + *shiftsize = theIndex->first; *pushsize = theIndex->size - theIndex->current; - *usedsize = theIndex->current - theIndex->start; - *nextidx = theIndex->current - theIndex->start + 1; + *usedsize = theIndex->current - theIndex->first; + *nextidx = theIndex->current - theIndex->first + 1; } static boolean @@ -169,7 +174,7 @@ return (false); // one quarter reserved for unshift ops - plistidx->start = plistidx->current = nsize >> 2; + plistidx->first = plistidx->current = nsize >> 2; plistidx->ctelements = 0; plistidx->size = nsize; @@ -179,7 +184,7 @@ static SInt32 rel2absIndex(tylistindexptr theIndex, SInt32 n) { - return( n + theIndex->start - 1); + return( n + theIndex->first - 1); } @@ -194,9 +199,9 @@ absn = rel2absIndex(theIndex, n); - if (absn == (theIndex->start) && absn == (theIndex->current)) + if (absn == (theIndex->first) && absn == (theIndex->current)) return(firstadd); - else if (absn == (theIndex->start - 1)) + else if (absn == (theIndex->first - 1)) return(addshift); else if(absn == (theIndex->current)) return(addpush); @@ -216,13 +221,13 @@ */ // total push array - long limit = theIndex->size - theIndex->start; + long limit = theIndex->size - theIndex->first; // free handles in pushspace - long remainpush = limit - (theIndex->current - theIndex->start); + long remainpush = limit - (theIndex->current - theIndex->first); // free handles in unshift space - long remainunshift = theIndex->start; + long remainunshift = theIndex->first; SInt32 shiftsize, pushsize, usedsize, nextidx; @@ -251,7 +256,7 @@ UInt32 thesize = (UInt32)(theIndex->size + (theIndex->size >> 2)); SInt32 therate = (SInt32)thesize >> 3; - // ptrs to start & current of used area + // ptrs to first & current of used area // void *s, *e; SInt32 shiftsize, pushsize, usedsize, nextidx; @@ -264,7 +269,7 @@ // disposehandle(theIndex->oplistindex); theIndex->oplistindex = nil; theIndex->size = -1; - theIndex->start = -1; + theIndex->first = -1; theIndex->current = -1; return(false); } @@ -275,12 +280,12 @@ calcIndexVars(theIndex, &shiftsize, &pushsize, &usedsize, &nextidx); // BULLSHIT! - // ToDo: shift start off to make room for unshift + // ToDo: shift first off to make room for unshift /* - s = *(theIndex->oplistindex) + (theIndex->start * sizeof(void *)); - e = *(theIndex->oplistindex) + (theIndex->start * 256 * sizeof(void *)); + s = *(theIndex->oplistindex) + (theIndex->first * sizeof(void *)); + e = *(theIndex->oplistindex) + (theIndex->first * 256 * sizeof(void *)); moveright(s, e, 256 * sizeof(void *)); - theIndex->start += 256; + theIndex->first += 256; theIndex->current += 256; */ return(true); @@ -290,7 +295,7 @@ getindexedadr(tylistindexptr theIndex, long n, hdlheadrecord *h) { hdlheadrecord *dst; - SInt32 relIndex = n + theIndex->start - 1; + SInt32 relIndex = n + theIndex->first - 1; SInt32 shiftsize, pushsize, usedsize, nextidx; calcIndexVars(theIndex, &shiftsize, &pushsize, &usedsize, &nextidx); @@ -325,7 +330,7 @@ getlastindexedadr(tylistindexptr theIndex, long n, hdlheadrecord *h) { SInt32 - s = theIndex->start, + s = theIndex->first, r = n + s - 1, e = theIndex->current - 1, shiftsize, pushsize, usedsize, nextidx; @@ -351,7 +356,7 @@ { hdlheadrecord *dst; SInt32 - s = theIndex->start, + s = theIndex->first, r = n + s - 1, e = theIndex->current, l = theIndex->size; @@ -406,12 +411,12 @@ calcIndexVars(theIndex, &shiftsize, &pushsize, &usedsize, &nextidx); // start address of cache - b = *(theIndex->oplistindex) + (theIndex->start * sizeof(Handle)); + b = *(theIndex->oplistindex) + (theIndex->first * sizeof(Handle)); - // dest of areamove (start + n) + // dest of areamove (first + n) s = b + n * sizeof(Handle); - // start of areamove (start + n + 1) + // start of areamove (first + n + 1) e = b + (n + 1) * sizeof(Handle); // size of area to move (arraysize - 1 - n + 1) @@ -466,7 +471,7 @@ h = *hlist; /*copy into register*/ -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in opnewlist() (**h).listindex.oplistindex = nil; if (!initlistindex(&((**h).listindex))) return(false); @@ -513,7 +518,7 @@ hcurrentlist = nil; -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in opdisposelist() if (!disposelistindex(&((**hlist).listindex))) ; #endif @@ -561,7 +566,7 @@ opsetheadstring (hnew, bs); -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in oppushhandle() // set value at index 1 if (!(**h).isrecord) if (!setindexedadr( &((**h).listindex), 1, (Handle *)&hnew)) @@ -571,7 +576,7 @@ else { -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in oppushhandle() // get last index at n // this one is for debugging only @@ -598,7 +603,7 @@ goto error; } -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in oppushhandle() // set value at index n if (!(**h).isrecord) if (!setindexedadr( &((**h).listindex), ctitems + 1, (Handle *)&hnew)) @@ -673,7 +678,7 @@ hnew = (**ho).hsummit; /*set this guy's refcon handle*/ opsetheadstring (hnew, bs); -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in opunshifthandle() // set value at index 1 if (!setindexedadr( &((**h).listindex), 1, (Handle *)&hnew)) return(false); @@ -690,7 +695,7 @@ goto error; } -#if OPLANGLISTACCEL == 1 +#if OPLANGLISTACCEL == 1 // in opunshifthandle() // set value at index 1 if (!setindexedadr( &((**h).listindex), 0, (Handle *)&hnew)) return(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |