Appendix B    External Functions

This appendix covers the JADE external functions declared in the RootSchema jomos external function library that call Windows library functions as defined in the Microsoft Developer Network (MSDN). These external functions are declared to avoid having to declare ANSI- and Unicode-specific definitions for some commonly called Windows library functions; for example, josShellExecute calls ShellExecuteA in an ANSI environment and ShellExecuteW in a Unicode environment.

The following table maps functions defined in the RootSchema jomos external function library to the corresponding MSDN function.

JADE External Function Windows Function Description
josCreateDirectory CreateDirectory Creates a directory that inherits information from other directories (security attributes default to null)
josDeleteDirectory RemoveDirectory Deletes an existing empty directory
josFileAccess GetFileAttributes Retrieves attributes for a specified file or directory (for details, see the paragraph that follows this table)
josFileCopy CopyFile Copies an existing file to a new file
josFileDelete DeleteFile Deletes an existing file
josGetKeyState GetKeyState Retrieves the status of the specified key; that is, whether the key is up, down, or toggled
josGetLastError GetLastError Retrieves the last error code value of the calling thread
josShellExecute ShellExecute Opens or prints the specified file; for example, to start another program under Microsoft Windows

In addition to these functions, the josValidateDirectory external function is declared, which validates that the specified name is a directory.

The josFileAccess function checks the specified file to determine if it exists and whether it can be read, written, or executed. This pointer is a call for files only; if you call it with a directory name, F_FILE_NOT_FOUND is returned. (Call the josValidateDirectory function to validate a directory.) The josFileAccess parameters are:

The josFileAccess and josValidateDirectory calls return zero (0) if successful or they return a JADE file‑handling error in the range 5000 through 5099.

For details about: