Skip to content

Commit

Permalink
FileAttributesPlugin: restructure platform support files
Browse files Browse the repository at this point in the history
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
akgrant committed Sep 30, 2018
1 parent a229a95 commit 71e9b7e
Show file tree
Hide file tree
Showing 7 changed files with 1,397 additions and 797 deletions.
36 changes: 36 additions & 0 deletions platforms/Cross/plugins/FileAttributesPlugin/faCommon.c
@@ -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);
}

10 changes: 10 additions & 0 deletions platforms/Cross/plugins/FileAttributesPlugin/faPlugin.h
@@ -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);

0 comments on commit 71e9b7e

Please sign in to comment.