Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FileAttributesPlugin: restructure platform support files
Restructure FileAttributesPlugin to move platform specific functionality out to separate files. This is required as Windows requires the "wide" versions of posix functions to be used, e.g. access() vs. _waccess(), while other seem to require the Windows native functions, e.g. iterating over directories, and interleaving #ifdef _WIN32 was becoming unwieldy.
- Loading branch information
Showing
7 changed files
with
1,397 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* faCommon.c | ||
* | ||
* Provides a number of platform independent functions. | ||
*/ | ||
|
||
#include "sq.h" | ||
#include "faSupport.h" | ||
|
||
extern struct VirtualMachine * interpreterProxy; | ||
|
||
|
||
sqInt faSetStDirOop(fapath *aFaPath, sqInt pathNameOop) | ||
{ | ||
int len; | ||
char *pathName; | ||
|
||
|
||
len = interpreterProxy->stSizeOf(pathNameOop); | ||
pathName = interpreterProxy->arrayValueOf(pathNameOop); | ||
return faSetStDir(aFaPath, pathName, len); | ||
} | ||
|
||
|
||
|
||
sqInt faSetStPathOop(fapath *aFaPath, sqInt pathNameOop) | ||
{ | ||
int len; | ||
char *pathName; | ||
|
||
|
||
len = interpreterProxy->stSizeOf(pathNameOop); | ||
pathName = interpreterProxy->arrayValueOf(pathNameOop); | ||
return faSetStPath(aFaPath, pathName, len); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* faPlugin.h | ||
* | ||
* Declarations of routines generated by the plugin and used by the platform | ||
* support routines. | ||
*/ | ||
|
||
|
||
sqInt byteArrayFromCStringto(const char *aCString, sqInt *byteArrayOop); | ||
|
Oops, something went wrong.