unsigned year : 7; /* binary year for directory entry, offset from 1980 */
} FDATE;
typedef FDATE FAR *PFDATE;
ΓòÉΓòÉΓòÉ 6.2. FTIME ΓòÉΓòÉΓòÉ
typedef struct _FTIME { /* ftime */
unsigned twosecs : 5; /* binary number of two-second increments */
unsigned minutes : 6; /* binary number of minutes */
unsigned hours : 5; /* binary number of hours */
} FTIME;
typedef FTIME FAR *PFTIME;
ΓòÉΓòÉΓòÉ 6.3. FILESTATUS ΓòÉΓòÉΓòÉ
typedef struct _FILESTATUS { /* fsts */
FDATE fdateCreation; /* date of file creation */
FTIME ftimeCreation; /* time of file creation */
FDATE fdateLastAccess; /* date of last access */
FTIME ftimeLastAccess; /* time of last access */
FDATE fdateLastWrite; /* date of last write */
FTIME ftimeLastWrite; /* time of last write */
ULONG cbFile; /* file size (end of data) */
ULONG cbFileAlloc; /* file allocated size */
USHORT attrFile; /* attributes of the file */
ULONG cbList; /* length of EA structure */
} FILESTATUS;
typedef FILESTATUS FAR *PFILESTATUS;
Note: This structure must be byte packed. The ULONG at the end will be out of
place of it is allowed to assume WORD or DWORD alignment.
ΓòÉΓòÉΓòÉ 6.4. STARTDATA ΓòÉΓòÉΓòÉ
/* The following typedef has been plagiarised from the OS/2 Warp Developer's Toolkit 4.0 */
typedef struct _STARTDATA {
USHORT Length; /* The length of the data structure, in bytes, including Length itself. */
USHORT Related; /* An indicator which specifies whether the session created is related to the calling session. */
USHORT FgBg; /* An indicator which specifies whether the new session should be started in the foreground or background. */
USHORT TraceOpt; /* An indicator which specifies whether the program started in the new session should be executed under conditions for tracing. */
PCSZ PgmTitle; /* Address of an ASCIIZ string that contains the program title. */
PCSZ PgmName; /* The address of an ASCIIZ string that contains the file specification of the program to be loaded. */
PCSZ PgmInputs; /* Either 0 or the address of an ASCIIZ string that contains the input arguments to be passed to the program. */
PCSZ TermQ; /* Either 0 or the address of an ASCIIZ string that contains the file specification of a system queue. */
PCSZ Environment; /* The address of an environment string to be passed to the program started in the new session. */
USHORT InheritOpt; /* Specifies whether the program started in the new session should inherit the calling program's environment and open file handles. */
USHORT SessionType; /* The type of session that should be created for this program. */
PCSZ IconFile; /* Either 0 or the address of an ASCIIZ string that contains the file specification of an icon definition. */
ULONG PgmHandle; /* Either 0 or the program handle. */
USHORT PgmControl; /* An indicator which specifies the initial state for a windowed application. */
USHORT InitXPos; /* The initial x-coordinate, in pels, for the initial session window. */
USHORT InitYPos; /* The initial y-coordinate, in pels, for the initial session window. */
USHORT InitXSize; /* The initial x extent, in pels, for the initial session window. */
USHORT InitYSize; /* The initial y extent, in pels, for the initial session window. */
USHORT Reserved; /* Reserved; must be zero. */
PVOID ObjectBuffer; /* Buffer in which the name of the object that contributed to the failure of DosExecPgm is returned. */
ULONG ObjectBuffLen; /* The length, in bytes, of the buffer pointed to by ObjectBuffer. */
} STARTDATA;
typedef STARTDATA FAR *PSTARTDATA;
ΓòÉΓòÉΓòÉ 7. Linkage Convention ΓòÉΓòÉΓòÉ
The linkage convention is handled in C/C++ by a macro called VDM_LINKAGE. In
any other language you will need to deal with this, unless the default linkage
convention is that of Pascal. This means that both Pascal and FORTRAN
programmers should be OK.
ΓòÉΓòÉΓòÉ 7.1. Using Watcom C/C++ ΓòÉΓòÉΓòÉ
The Watcom C/C++ compiler permits #pragma aux to generate machine instructions
from in-line assembler source. This is the approach I have taken for these API
calls using this compiler. As a result, no linkage convention is used: the
object code is in-line, and the VDM_LINKAGE macro is null.
ΓòÉΓòÉΓòÉ 7.2. Using Other Compilers ΓòÉΓòÉΓòÉ
Note: This section applies to compilers of languages other than C/C++, as well
as to C/C++ compilers from other vendors.
For compilers other than Watcom C/C++, I have used the Pascal linkage
convention, since that is the "lowest common denominator" of subroutine
linkage, and it is the one used by the OS/2 native API. Thus, the VDM_LINKAGE