Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/Cog' into FileAttributesPlugin200
Browse files Browse the repository at this point in the history
  • Loading branch information
akgrant committed Oct 2, 2018
2 parents 0c08668 + 057c592 commit 5aa42b7
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 254 deletions.
11 changes: 0 additions & 11 deletions platforms/Cross/plugins/FilePlugin/FilePlugin.h
Expand Up @@ -74,7 +74,6 @@ sqInt sqFileDescriptorType(int fdNum);
sqInt dir_Create(char *pathString, sqInt pathStringLength);
sqInt dir_Delete(char *pathString, sqInt pathStringLength);
sqInt dir_Delimitor(void);
#if PharoVM
sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
Expand All @@ -83,16 +82,6 @@ sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char *nameString
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissions, sqInt *isSymlink);
#else
sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile);
sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char *nameString, sqInt nameStringLength,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile);
#endif
sqInt dir_PathToWorkingDir(char *pathName, sqInt pathNameMax);
sqInt dir_SetMacFileTypeAndCreator(char *filename, sqInt filenameSize, char *fType, char *fCreator);
sqInt dir_GetMacFileTypeAndCreator(char *filename, sqInt filenameSize, char *fType, char *fCreator);
27 changes: 4 additions & 23 deletions platforms/iOS/vm/Common/Classes/sqSqueakFileDirectoryAPI.m
Expand Up @@ -90,23 +90,11 @@ sqInt dir_Lookup2(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissions, sqInt *isSymlink);
#if !defined(PharoVM)
# define PharoVM 0
#endif

#if PharoVM
sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissionsVar, sqInt *isSymlinkVar)
#else
sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile)
#define posixPermissionsVar nil
#define isSymlinkVar nil
#endif
{
@autoreleasepool {
sqInt status = dir_Lookup2(pathString, pathStringLength, index, name, nameLength, creationDate, modificationDate, isDirectory, sizeIfFile,posixPermissionsVar,isSymlinkVar);
Expand Down Expand Up @@ -147,17 +135,10 @@ sqInt dir_Lookup2(char *pathString, sqInt pathStringLength, sqInt index,
return status;
}

#if PharoVM
sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString, sqInt nameStringLength,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissionsVar, sqInt *isSymlinkVar)
#else
sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString, sqInt nameStringLength,
/* outputs: */
char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile)
#endif
{

/*Implementation notes
Expand All @@ -168,16 +149,16 @@ sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString
[gDelegateApp.squeakApplication.fileDirectoryLogic
dir_EntryLookup: pathString
length: pathStringLength
returnName: nameString
returnNameLength: nameStringLength
returnName: nameString
returnNameLength: nameStringLength
name: name
length: nameLength
creationDate: creationDate
modificationDate: modificationDate
isDirectory: isDirectory
sizeIfFile: sizeIfFile
posixPermissions: (PharoVM ? posixPermissionsVar : nil)
isSymlink: (PharoVM ? isSymlinkVar : nil)];
posixPermissions: posixPermissionsVar
isSymlink: isSymlinkVar];
return status;
}
}
Expand Down
20 changes: 0 additions & 20 deletions platforms/unix/plugins/FilePlugin/sqUnixFile.c
Expand Up @@ -149,15 +149,9 @@ static int maybeOpenDir(char *unixPath)
return true;
}

#if PharoVM
sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs: */ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt * posixPermissions, sqInt *isSymlink)
#else
sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
/* outputs: */ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile)
#endif
{
/* Lookup the index-th entry of the directory with the given path, starting
at the root of the file system. Set the name, name length, creation date,
Expand All @@ -180,10 +174,8 @@ sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
*modificationDate = 0;
*isDirectory = false;
*sizeIfFile = 0;
#if PharoVM
*posixPermissions = 0;
*isSymlink = false;
#endif

if ((pathStringLength == 0))
strcpy(unixPath, ".");
Expand Down Expand Up @@ -253,24 +245,16 @@ sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index,
else
*sizeIfFile= statBuf.st_size;

#if PharoVM
*isSymlink = S_ISLNK(statBuf.st_mode);
*posixPermissions = statBuf.st_mode & 0777;
#endif

return ENTRY_FOUND;
}


#if PharoVM
sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString, sqInt nameStringLength,
/* outputs: */ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile, sqInt *posixPermissions, sqInt *isSymlink)
#else
sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString, sqInt nameStringLength,
/* outputs: */ char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,
sqInt *isDirectory, squeakFileOffsetType *sizeIfFile)
#endif
{
/* Lookup the given name in the given directory,
Set the name, name length, creation date,
Expand All @@ -290,10 +274,8 @@ sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString
*modificationDate = 0;
*isDirectory = false;
*sizeIfFile = 0;
#if PharoVM
*posixPermissions = 0;
*isSymlink = false;
#endif

if ((pathStringLength == 0))
strcpy(unixPath, ".");
Expand Down Expand Up @@ -326,10 +308,8 @@ sqInt dir_EntryLookup(char *pathString, sqInt pathStringLength, char* nameString
else
*sizeIfFile= statBuf.st_size;

#if PharoVM
*isSymlink = S_ISLNK(statBuf.st_mode);
*posixPermissions = statBuf.st_mode & 0777;
#endif

return ENTRY_FOUND;
}
Expand Down

0 comments on commit 5aa42b7

Please sign in to comment.