diff --git a/platforms/Cross/plugins/FileAttributesPlugin/faCommon.c b/platforms/Cross/plugins/FileAttributesPlugin/faCommon.c index ee290b02a5..4471799907 100644 --- a/platforms/Cross/plugins/FileAttributesPlugin/faCommon.c +++ b/platforms/Cross/plugins/FileAttributesPlugin/faCommon.c @@ -1,7 +1,7 @@ /* * faCommon.c * - * Provides a number of platform independent functions. + * Provides a number of platform independent functions for FileAttributesPlugin. */ #include "sq.h" diff --git a/platforms/Cross/plugins/FileAttributesPlugin/faConstants.h b/platforms/Cross/plugins/FileAttributesPlugin/faConstants.h index f62160aea1..9d9c1247fc 100644 --- a/platforms/Cross/plugins/FileAttributesPlugin/faConstants.h +++ b/platforms/Cross/plugins/FileAttributesPlugin/faConstants.h @@ -4,7 +4,7 @@ * File Attributes constants * * Note that these must be kept in sync with their definition in - * FileAttributesPlugin errors protocol. + * FileAttributesPlugin errors / status protocol. * */ #define FA_SUCCESS 0 diff --git a/platforms/unix/plugins/FileAttributesPlugin/faSupport.c b/platforms/unix/plugins/FileAttributesPlugin/faSupport.c index 8cfce07601..4b54b1f1f8 100644 --- a/platforms/unix/plugins/FileAttributesPlugin/faSupport.c +++ b/platforms/unix/plugins/FileAttributesPlugin/faSupport.c @@ -1,7 +1,6 @@ /* * faSupport.c - Unix support routines for the FileAttributesPlugin * - * Author: akgrant@gmail.com */ #include #include diff --git a/platforms/unix/plugins/FileAttributesPlugin/faSupport.h b/platforms/unix/plugins/FileAttributesPlugin/faSupport.h index 2a8423b463..f8217e2a8c 100644 --- a/platforms/unix/plugins/FileAttributesPlugin/faSupport.h +++ b/platforms/unix/plugins/FileAttributesPlugin/faSupport.h @@ -1,3 +1,6 @@ +/* + * faSupport.h - Unix macro and type definitions for FileAttributesPlugin + */ #include #include @@ -7,29 +10,37 @@ #include "sqUnixCharConv.h" +/* + * Set the structure used by stat(). + */ typedef struct stat faStatStruct; /* - * typedef fapath + * fapath * - * This holds the current state for retrieving all the children of a - * directory. + * fapath is used to pass path names between smalltalk and the primitives. + * The structure holds the path name in Smalltalk format (precomposed UTF8) + * and the platform format (Wide Strings for Windows). + * Set and Get functions are used to ensure that the two formats are always + * kept in sync. * + * State information for iterating over directories is also held by fapath. * The directory (path) being enumerated and the current file name are stored * in a single string (path) to simplify stat()ing the file. * - * path_len - length of the name of the path being enumerated. - * path - The directory name being enumerated, with precomposed UTF8 - * encoding. - * platformDir - platform specific data for directory enumeration. - * uxpath - The directory name being enumerated in platform specific encoding - * Linux: precomposed UTF8 - * OSX: HFS decomposed UTF8 - * uxpath_file - points to the file name of the current entry. - * This is set to the byte after the directory name - * and is used to stat() each file. + * path - The path name in precomposed UTF8 encoding (Smalltalk encoding). + * path_len - length of path. + * path_file - When iterating over a directory, this points to the + * character after the trailing path separator. + * The current file will be stored here and is used to + * stat() each file. * max_file_len - The space remaining after the path for the file name. + * + * uxpath, uxpath_len, uxpath_file and uxmax_file_len are the Unix + * encoded equivalents: + * - UTF8 for Linux + * - HFS specific decomposed UTF8 for OSX */ typedef struct fapathstruct { char path[FA_PATH_MAX]; diff --git a/platforms/win32/plugins/FileAttributesPlugin/faSupport.c b/platforms/win32/plugins/FileAttributesPlugin/faSupport.c index e1290f4c5b..26949b8b51 100644 --- a/platforms/win32/plugins/FileAttributesPlugin/faSupport.c +++ b/platforms/win32/plugins/FileAttributesPlugin/faSupport.c @@ -1,7 +1,5 @@ /* * faSupport.c - Windows support routines for the FileAttributesPlugin - * - * Author: akgrant@gmail.com */ #include #include diff --git a/platforms/win32/plugins/FileAttributesPlugin/faSupport.h b/platforms/win32/plugins/FileAttributesPlugin/faSupport.h index 382cc93bad..8001391f9f 100644 --- a/platforms/win32/plugins/FileAttributesPlugin/faSupport.h +++ b/platforms/win32/plugins/FileAttributesPlugin/faSupport.h @@ -1,3 +1,6 @@ +/* + * faSupport.h - Windows macro and type definitions for FileAttributesPlugin + */ #include #include @@ -5,25 +8,40 @@ #define FA_PATH_MAX 4096 #define PATH_SEPARATOR '\\' +/* + * Set the structure used by stat(). + */ typedef struct _stat faStatStruct; /* - * typedef osdir + * fapath * - * This holds the current state for retrieving all the children of a - * directory. + * fapath is used to pass path names between smalltalk and the primitives. + * The structure holds the path name in Smalltalk format (precomposed UTF8) + * and the platform format (Wide Strings for Windows). + * Set and Get functions are used to ensure that the two formats are always + * kept in sync. * + * State information for iterating over directories is also held by fapath. * The directory (path) being enumerated and the current file name are stored * in a single string (path) to simplify stat()ing the file. * - * platformDir - platform specific data for directory enumeration. - * path_len - length of the name of the path being enumerated. - * path_file - points to the file name of the current entry. - * This is set to the byte after the directory name - * and is used to stat() each file. + * path - The path name in precomposed UTF8 encoding (Smalltalk encoding). + * path_len - length of path. + * path_file - When iterating over a directory, this points to the + * character after the trailing path separator. + * The current file will be stored here and is used to + * stat() each file. * max_file_len - The space remaining after the path for the file name. - * path - The directory name being enumerated, with UTF8 encoding. + * + * winpath, winpath_len, winpath_file and winmax_file_len are the Windows + * wide string encoded equivalents. + * + * Some windows functions require the path name be prepended with "\\?\" to + * support long file names, while others support long file names without the + * leading characters. winpath includes the "\\?\" prefix, while winpath2 + * excludes it. */ typedef struct fapathstruct { char path[FA_PATH_MAX];