home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
FORTRAN
/
DISK6
/
BSEDOS.FD$
/
BSEDOS.bin
Wrap
Text File
|
1989-01-27
|
19KB
|
562 lines
C****************************** Module Header *******************************
C*
C* Module Name: BSEDOS.FD
C*
C* OS/2 Base Include File
C*
C* Copyright (c) 1988, 1989 Microsoft Corporation
C*
C****************************************************************************
C
* Subcomponents marked with "+" are partially included by default
*
* $DEFINE: To include:
*
* + INCL_DOSPROCESS Process and thread support
* INCL_DOSINFOSEG InfoSeg support
* + INCL_DOSFILEMGR File Management
* + INCL_DOSMEMMGR Memory Management
* + INCL_DOSSEMAPHORES Semaphore support
* + INCL_DOSDATETIME Date/Time and Timer support
* INCL_DOSMODULEMGR Module manager
* + INCL_DOSRESOURCES Resource support
* INCL_DOSNLS National Language Support
* INCL_DOSSIGNALS Signals
* INCL_DOSMONITORS Monitors
* INCL_DOSQUEUES Queues
* INCL_DOSSESMGR Session Manager Support
* INCL_DOSDEVICES Device specific, ring 2 support
* INCL_DOSNMPIPES Named Pipes Support
* INCL_DOSPROFILE DosProfile API
*
$IF (defined(INCL_DOSPROCESS) .OR. .NOT.defined(INCL_NOCOMMON))
INTEGER*2 DosBeep[EXTERN]
EXTERNAL DosExit
INTEGER*2 EXIT_THREAD, EXIT_PROCESS
PARAMETER (EXIT_THREAD = 0) ! DosExit codes
PARAMETER (EXIT_PROCESS = 1)
$ENDIF ! common INCL_DOSPROCESS consts
$IF DEFINED(INCL_DOSPROCESS) ! INCL_DOSPROCESS types
STRUCTURE/PIDINFO/ ! Used in DosGetPID
INTEGER*2 pid
INTEGER*2 tid
INTEGER*2 pidParent
END STRUCTURE
STRUCTURE/RESULTCODES/
INTEGER*2 codeTerminate
INTEGER*2 codeResult
END STRUCTURE
INTEGER*2 DosCreateThread[EXTERN]
INTEGER*2 DosResumeThread[EXTERN]
INTEGER*2 DosSuspendThread[EXTERN]
INTEGER*2 DosCWait[EXTERN]
INTEGER*2 DosSleep[EXTERN]
EXTERNAL DosEnterCritSec
EXTERNAL DosExitCritSec
INTEGER*2 DosExitList[EXTERN]
INTEGER*2 DosExecPgm[EXTERN]
INTEGER*2 DosGetPID[EXTERN]
C INTEGER*2 DosGetPPID[EXTERN]
INTEGER*2 DosGetPrty[EXTERN]
INTEGER*2 DosSetPrty[EXTERN]
INTEGER*2 DosKillProcess[EXTERN]
INTEGER*2 DCWA_PROCESS, DCWA_PROCESSTREE, DCWW_WAIT, DCWW_NOWAIT,
+ PRTYS_PROCESS, PRTYS_PROCESSTREE, PRTYS_THREAD, PRTYC_NOCHANGE,
+ PRTYC_IDLETIME, PRTYC_REGULAR, PRTYC_TIMECRITICAL, P_PROCESS,
+ P_PROCESSTREE, TC_EXIT, TC_HARDERROR, TC_TRAP, TC_KILLPROCESS,
+ EXLST_ADD, EXLST_REMOVE, EXLST_EXIT, EXEC_SYNC, EXEC_ASYNC,
+ EXEC_ASYNCRESULT, EXEC_TRACE, EXEC_BACKGROUND, EXEC_LOAD
PARAMETER (DCWA_PROCESS = 0) ! Action code values
PARAMETER (DCWA_PROCESSTREE = 1)
PARAMETER (DCWW_WAIT = 0) ! Wait option values
PARAMETER (DCWW_NOWAIT = 1)
PARAMETER (PRTYS_PROCESS = 0) ! Priority scopes
PARAMETER (PRTYS_PROCESSTREE = 1)
PARAMETER (PRTYS_THREAD = 2)
PARAMETER (PRTYC_NOCHANGE = 0) ! Priority classes
PARAMETER (PRTYC_IDLETIME = 1)
PARAMETER (PRTYC_REGULAR = 2)
PARAMETER (PRTYC_TIMECRITICAL = 3)
PARAMETER (P_PROCESS = 0)
PARAMETER (P_PROCESSTREE = 1)
PARAMETER (TC_EXIT = 0) ! codeTerminate values
PARAMETER (TC_HARDERROR = 1)
PARAMETER (TC_TRAP = 2)
PARAMETER (TC_KILLPROCESS = 3)
PARAMETER (EXLST_ADD = 1) ! DosExitList functions
PARAMETER (EXLST_REMOVE = 2)
PARAMETER (EXLST_EXIT = 3)
PARAMETER (EXEC_SYNC = 0) ! DosExecPgm functions
PARAMETER (EXEC_ASYNC = 1)
PARAMETER (EXEC_ASYNCRESULT = 2)
PARAMETER (EXEC_TRACE = 3)
PARAMETER (EXEC_BACKGROUND = 4)
PARAMETER (EXEC_LOAD = 5)
$ENDIF ! INCL_DOSPROCESS constants
$IF DEFINED(INCL_DOSINFOSEG) ! INCL_DOSINFOSEG constants
INTEGER*2 DosGetInfoSeg[EXTERN]
INTEGER*2 PT_FULLSCREEN, PT_REALMODE, PT_WINDOWABLEVIO, PT_PM,
+ PT_DETACHED
PARAMETER (PT_FULLSCREEN = 0) ! Process Type codes
PARAMETER (PT_REALMODE = 1)
PARAMETER (PT_WINDOWABLEVIO = 2)
PARAMETER (PT_PM = 3)
PARAMETER (PT_DETACHED = 4)
C$IF DEFINED(INCL_DOSINFOSEG) ! INCL_DOSINFOSEG types
C
C TYPE
C _GINFOSEG = PACKED RECORD ! Global Info Seg
C time : integer4;
C msecs : integer4;
C hour : byte;
C minutes : byte;
C seconds : byte;
C hundredths : byte;
C timezone : word;
C cusecTimerInterval : word;
C day : byte;
C month : byte;
C year : word;
C weekday : byte;
C uchMajorVersion : byte;
C uchMinorVersion : byte;
C chRevisionLetter : byte;
C sgCurrent : byte;
C sgMax : byte;
C cHugeShift : byte;
C fProtectModeOnly : byte;
C pidForeground : word;
C fDynamicSched : byte;
C csecMaxWait : byte;
C cmsecMinSlice : word;
C cmsecMaxSlice : word;
C bootdrive : word;
C amecRAS : array [1..32] of byte;
C csgWindowableVioMax : byte;
C csgPMMax : byte;
C end;
C
C _LINFOSEG = PACKED RECORD ! Local Info Seg
C pidCurrent : word;
C pidParent : word;
C prtyCurrent : word;
C tidCurrent : word;
C sgCurrent : word;
C sgSub : word;
C fForeground : word;
C typeProcess : byte;
C dummy : byte;
C selEnvironment : word;
C offCmdLine : word;
C cbDataSegment : word;
C cbStack : word;
C cbHeap : word;
C hmod : word;
C selDS : word;
C end;
C
C$ENDIF ! INCL_DOSINFOSEG types
$ENDIF ! INCL_DOSINFOSEG constants
$IF (defined(INCL_DOSFILEMGR) .OR. .NOT.defined(INCL_NOCOMMON))
INTEGER*2 DosOpen[EXTERN]
INTEGER*2 DosClose[EXTERN]
INTEGER*2 DosRead[EXTERN]
INTEGER*2 DosWrite[EXTERN]
INTEGER*2 DosDelete[EXTERN]
INTEGER*2 DosDupHandle[EXTERN]
INTEGER*2 DosQFHandState[EXTERN]
INTEGER*2 DosSetFHandState[EXTERN]
INTEGER*2 DosQHandType[EXTERN]
INTEGER*2 DosReadAsync[EXTERN]
INTEGER*2 DosWriteAsync[EXTERN]
INTEGER*2 DosFindFirst[EXTERN]
INTEGER*2 DosFindNext[EXTERN]
INTEGER*2 DosFindClose[EXTERN]
INTEGER*2 DosNewSize[EXTERN]
INTEGER*2 DosBufReset[EXTERN]
INTEGER*2 DosChgFilePtr[EXTERN]
INTEGER*2 DosFileLocks[EXTERN]
INTEGER*2 DosMove[EXTERN]
INTEGER*2 DosMkDir[EXTERN]
INTEGER*2 DosRmDir[EXTERN]
INTEGER*2 DosSelectDisk[EXTERN]
INTEGER*2 DosQCurDisk[EXTERN]
INTEGER*2 DosChDir[EXTERN]
INTEGER*2 DosQCurDir[EXTERN]
INTEGER*2 DosQFSInfo[EXTERN]
INTEGER*2 DosSetFSInfo[EXTERN]
INTEGER*2 DosQVerify[EXTERN]
INTEGER*2 DosSetVerify[EXTERN]
INTEGER*2 DosSetMaxFH[EXTERN]
INTEGER*2 DosQFileInfo[EXTERN]
INTEGER*2 DosSetFileInfo[EXTERN]
INTEGER*2 DosQFileMode[EXTERN]
INTEGER*2 DosSetFileMode[EXTERN]
STRUCTURE/FILESTATUS/
INTEGER*2 fdateCreation
INTEGER*2 ftimeCreation
INTEGER*2 fdateLastAccess
INTEGER*2 ftimeLastAccess
INTEGER*2 fdateLastWrite
INTEGER*2 ftimeLastWrite
INTEGER*4 cbFile
INTEGER*4 cbFileAlloc
INTEGER*2 attrFile
END STRUCTURE
C used by DOSQFSInfo
STRUCTURE/QFSINFO/
UNION
MAP ! used if FSInfoLevel = 1
INTEGER*4 idFileSystem
INTEGER*4 cSectorUnit
INTEGER*4 cUnit
INTEGER*4 cUnitAvail
INTEGER*2 cbSector
END MAP
MAP ! used if FSInfoLevel = 2
INTEGER*2 fdateCreation
INTEGER*2 ftimeCreation
INTEGER*1 cchName
CHARACTER*14 achname
END MAP
END UNION
END STRUCTURE
$ENDIF ! common INCL_DOSFILEMGR types
$IF (defined(INCL_MEMMGR) .OR. .NOT.defined(INCL_NOCOMMON))
INTEGER*2 DosAllocSeg[EXTERN]
INTEGER*2 DosReallocSeg[EXTERN]
INTEGER*2 DosFreeSeg[EXTERN]
INTEGER*2 DosGiveSeg[EXTERN]
INTEGER*2 DosGetSeg[EXTERN]
C INTEGER*2 DosSizeSeg[EXTERN]
INTEGER*2 SEG_GIVEABLE, SEG_GETTABLE, SEG_DISCARDABLE
PARAMETER (SEG_GIVEABLE = 16#0001) ! Segment attribute flags
PARAMETER (SEG_GETTABLE = 16#0002)
PARAMETER (SEG_DISCARDABLE = 16#0004)
$ENDIF ! common INCL_DOSMEMMGRMGR constants
$IF defined(INCL_DOSMEMMGR) ! INCL_DOSMEMMGR constants
INTEGER*2 DosAllocHuge[EXTERN]
INTEGER*2 DosReallocHuge[EXTERN]
INTEGER*2 DosGetHugeShift[EXTERN]
INTEGER*2 DosAllocShrSeg[EXTERN]
INTEGER*2 DosLockSeg[EXTERN]
INTEGER*2 DosUnlockSeg[EXTERN]
INTEGER*2 DosGetShrSeg[EXTERN]
INTEGER*2 DosMemAvail[EXTERN]
INTEGER*2 DosCreateCSAlias[EXTERN]
INTEGER*2 DosSubAlloc[EXTERN]
INTEGER*2 DosSubFree[EXTERN]
INTEGER*2 DosSubSet[EXTERN]
$ENDIF ! INCL_DOSMEMMGR constants
$IF (defined(INCL_DOSSEMAPHORES) .OR. .NOT. defined(INCL_NOCOMMON))
INTEGER*2 DosSemClear[EXTERN]
INTEGER*2 DosSemSet[EXTERN]
INTEGER*2 DosSemWait[EXTERN]
INTEGER*2 DosSemSetWait[EXTERN]
INTEGER*2 DosSemRequest[EXTERN]
INTEGER*4 SEM_INDEFINITE_WAIT, SEM_IMMEDIATE_RETURN
PARAMETER (SEM_INDEFINITE_WAIT = -1)
PARAMETER (SEM_IMMEDIATE_RETURN= 0)
$ENDIF ! common INCL_DOSSEMAPHORES constants
$IF defined(INCL_DOSSEMAPHORES) ! INCL_DOSSEMAPHORES constants
INTEGER*2 DosCreateSem[EXTERN]
INTEGER*2 DosOpenSem[EXTERN]
INTEGER*2 DosCloseSem[EXTERN]
INTEGER*2 DosMuxSemWait[EXTERN]
C INTEGER*2 DosFSRamSemRequest[EXTERN]
C INTEGER*2 DosFSRamSemClear[EXTERN]
INTEGER*2 CSEM_PRIVATE, CSEM_PUBLIC
PARAMETER (CSEM_PRIVATE = 0)
PARAMETER (CSEM_PUBLIC = 1)
STRUCTURE/MUXSEM/
INTEGER*2 zero
INTEGER*2 hsem
END STRUCTURE
STRUCTURE/MUXSEMLIST/
INTEGER*2 cmxs
RECORD/MUXSEM/ amxs(16)
END STRUCTURE
$ENDIF ! INCL_DOSSEMAPHORES constants
$IF (defined(INCL_DOSDATETIME) .OR. .NOT.defined(INCL_NOCOMMON))
INTEGER*2 DosGetDateTime[EXTERN]
INTEGER*2 DosSetDateTime[EXTERN]
STRUCTURE/DATETIME/
INTEGER*1 hours
INTEGER*1 minutes
INTEGER*1 seconds
INTEGER*1 hundredths
INTEGER*1 day
INTEGER*1 month
INTEGER*2 year
INTEGER*2 timezone
INTEGER*1 weekday
END STRUCTURE
$ENDIF ! common INCL_DOSDATETIME types
$IF defined(INCL_DOSDATETIME)
INTEGER*2 DosTimerAsync[EXTERN]
INTEGER*2 DosTimerStart[EXTERN]
INTEGER*2 DosTimerStop[EXTERN]
$ENDIF ! INCL_DOSDATETIME
$IF defined(INCL_DOSMODULEMGR)
INTEGER*2 DosLoadModule[EXTERN]
INTEGER*2 DosFreeModule[EXTERN]
INTEGER*2 DosGetProcAddr[EXTERN]
INTEGER*2 DosGetModHandle[EXTERN]
INTEGER*2 DosGetModName[EXTERN]
$ENDIF ! INCL_DOSMODULEMGR
$IF (defined(INCL_DOSRESOURCES) .OR. .NOT.defined(INCL_NOCOMMON))
! Predefined resource types
INTEGER*2 RT_POINTER, RT_BITMAP, RT_MENU, RT_DIALOG, RT_STRING,
+ RT_FONTDIR, RT_FONT, RT_ACCELTABLE, RT_RCDATA, RT_MESSAGE,
+ RT_DLGINCLUDE, RT_VKEYTBL, RT_KEYTBL, RT_CHARTBL
PARAMETER (RT_POINTER = 1) ! Mouse pointer shape
PARAMETER (RT_BITMAP = 2) ! Bitmap
PARAMETER (RT_MENU = 3) ! Menu template
PARAMETER (RT_DIALOG = 4) ! Dialog template
PARAMETER (RT_STRING = 5) ! String tables
PARAMETER (RT_FONTDIR = 6) ! Font directory
PARAMETER (RT_FONT = 7) ! Font
PARAMETER (RT_ACCELTABLE = 8) ! Accelerator tables
PARAMETER (RT_RCDATA = 9) ! Binary data
PARAMETER (RT_MESSAGE = 10) ! Error msg tables
PARAMETER (RT_DLGINCLUDE = 11) ! Dialog include file name
PARAMETER (RT_VKEYTBL = 12) ! Key to vkey tables
PARAMETER (RT_KEYTBL = 13) ! Key to UGL tables
PARAMETER (RT_CHARTBL = 14) ! Glyph to character tables
$ENDIF ! common INCL_DOSRESOURCES consts
$IF defined(INCL_DOSRESOURCES)
INTEGER*2 DosGetResource[EXTERN]
$ENDIF ! INCL_DOSRESOURCES
$IF DEFINED(INCL_DOSNLS) ! INCL_DOSNLS types
STRUCTURE/COUNTRYCODE/
INTEGER*2 country
INTEGER*2 codepage
END STRUCTURE
STRUCTURE/COUNTRYINFO/
INTEGER*2 country ! country code
INTEGER*2 codepage ! Reserved value (must =0)
INTEGER*2 fsDateFmt ! Date format
CHARACTER*5 szCurrency
CHARACTER*2 szThousandsSeparator
CHARACTER*2 szDecimal
CHARACTER*2 szDateSeparator
CHARACTER*2 szTimeSeparator
INTEGER*1 fsCurrencyFmt
INTEGER*1 cDecimalPlace
INTEGER*1 fsTimeFmt
INTEGER*2 abReserved(2) ! Reserved (must =0)
CHARACTER*2 szDataSeparator
INTEGER*2 abReserved2(2) ! Reserved (must =0)
END STRUCTURE
INTEGER*2 DosGetCtryInfo[EXTERN]
INTEGER*2 DosGetDBCSEv[EXTERN]
INTEGER*2 DosCaseMap[EXTERN]
INTEGER*2 DosGetCollate[EXTERN]
INTEGER*2 DosGetCp[EXTERN]
INTEGER*2 DosSetCp[EXTERN]
C INTEGER*2 DosSetProcCp[EXTERN]
$ENDIF ! INCL_DOSNLS
$IF DEFINED(INCL_DOSSIGNALS) ! INCL_DOSSIGNALS constants
! Signal Numbers for DosSetSigHandler
INTEGER*2 SIG_CTRLC, SIG_BROKENPIPE, SIG_KILLPROCESS,
+ SIG_CTRLBREAK, SIG_PFLG_A, SIG_PFLG_B, SIG_PFLG_C, SIG_CSIGNALS
PARAMETER (SIG_CTRLC = 1) ! Control C
PARAMETER (SIG_BROKENPIPE = 2) ! Broken Pipe
PARAMETER (SIG_KILLPROCESS = 3) ! Program Termination
PARAMETER (SIG_CTRLBREAK = 4) ! Control Break
PARAMETER (SIG_PFLG_A = 5) ! Process Flag A
PARAMETER (SIG_PFLG_B = 6) ! Process Flag B
PARAMETER (SIG_PFLG_C = 7) ! Process Flag C
PARAMETER (SIG_CSIGNALS = 8) ! number of signals plus one
! Flag Numbers for DosFlagProcess
INTEGER*2 PFLG_A, PFLG_B, PFLG_C
PARAMETER (PFLG_A = 0) ! Process Flag A
PARAMETER (PFLG_B = 1) ! Process Flag B
PARAMETER (PFLG_C = 2) ! Process Flag C
INTEGER*2 SIGA_KILL, SIGA_IGNORE, SIGA_ACCEPT, SIGA_ERROR,
+ SIGA_ACKNOWLEDGE
PARAMETER (SIGA_KILL = 0) ! Signal actions
PARAMETER (SIGA_IGNORE = 1)
PARAMETER (SIGA_ACCEPT = 2)
PARAMETER (SIGA_ERROR = 3)
PARAMETER (SIGA_ACKNOWLEDGE = 4)
INTEGER*2 HLDSIG_ENABLE, HLDSIG_DISABLE
PARAMETER (HLDSIG_ENABLE = 0) ! DosHoldSignal constants
PARAMETER (HLDSIG_DISABLE = 1)
INTEGER*2 FLGP_SUBTREE, FLGP_PID
PARAMETER (FLGP_SUBTREE = 0) ! DosFlagProcess codes
PARAMETER (FLGP_PID = 1)
INTEGER*2 DosSetSigHandler[EXTERN]
INTEGER*2 DosFlagProcess[EXTERN]
INTEGER*2 DosHoldSignal[EXTERN]
INTEGER*2 DosSendSignal[EXTERN]
$ENDIF ! INCL_DOSSIGNALS constants
$IF defined(INCL_DOSMONITORS)
INTEGER*2 DosMonOpen[EXTERN]
INTEGER*2 DosMonClose[EXTERN]
INTEGER*2 DosMonReg[EXTERN]
INTEGER*2 DosMonRead[EXTERN]
INTEGER*2 DosMonWrite[EXTERN]
$ENDIF ! INCL_DOSMONITORS
$IF defined(INCL_DOSQUEUES)
INTEGER*2 DosMakePipe[EXTERN]
INTEGER*2 DosCloseQueue[EXTERN]
INTEGER*2 DosCreateQueue[EXTERN]
INTEGER*2 DosOpenQueue[EXTERN]
INTEGER*2 DosPeekQueue[EXTERN]
INTEGER*2 DosPurgeQueue[EXTERN]
INTEGER*2 DosQueryQueue[EXTERN]
INTEGER*2 DosReadQueue[EXTERN]
INTEGER*2 DosWriteQueue[EXTERN]
INTEGER*2 DosError[EXTERN]
INTEGER*2 DosSetVec[EXTERN]
INTEGER*2 DosGetMessage[EXTERN]
INTEGER*2 DosErrClass[EXTERN]
INTEGER*2 DosInsMessage[EXTERN]
INTEGER*2 DosPutMessage[EXTERN]
C INTEGER*2 DosSysTrace[EXTERN]
C INTEGER*2 DosDynamicTrace[EXTERN]
C INTEGER*2 DosPTrace[EXTERN]
C INTEGER*2 DosQSysInfo[EXTERN]
INTEGER*2 DosGetenv[EXTERN]
INTEGER*2 DosScanEnv[EXTERN]
INTEGER*2 DosSearchPath[EXTERN]
INTEGER*2 DosGetVersion[EXTERN]
INTEGER*2 DosGetMachineMode[EXTERN]
$ENDIF ! INCL_DOSQUEUES
$IF DEFINED(INCL_DOSSESMGR) ! INCL_DOSSESMGR types
STRUCTURE/STARTDATA/
INTEGER*2 Length
INTEGER*2 Related
INTEGER*2 FgBg
INTEGER*2 TraceOpt
INTEGER*4 PgmTitle ! Pointer to string
INTEGER*4 PgmName ! Pointer to string
INTEGER*4 PgmInputs ! Pointer to string
INTEGER*4 TermQ ! Pointer to string
END STRUCTURE
STRUCTURE/STATUSDATA/
INTEGER*2 Length
INTEGER*2 SelectInd
INTEGER*2 BondInd
END STRUCTURE
INTEGER*2 DosStartSession[EXTERN]
INTEGER*2 DosSetSession[EXTERN]
INTEGER*2 DosSelectSession[EXTERN]
INTEGER*2 DosStopSession[EXTERN]
C INTEGER*2 DosQAppType[EXTERN]
$ENDIF ! INCL_DOSSESMGR types
$IF defined(INCL_DOSDEVICES)
INTEGER*2 DosDevConfig[EXTERN]
INTEGER*2 DosDevIOCtl[EXTERN]
INTEGER*2 DosSystemService[EXTERN]
INTEGER*2 DosCLIAccess[EXTERN]
INTEGER*2 DosPortAccess[EXTERN]
INTEGER*2 DosPhysicalDisk[EXTERN]
C INTEGER*2 DosR2StackRealLoc[EXTERN]
C INTEGER*2 DosCallback[EXTERN]
$ENDIF ! INCL_DOSDEVICES