summaryrefslogtreecommitdiff
path: root/packages/os2units
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-01-27 11:53:57 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-01-27 11:53:57 +0000
commit59ac585946f82965a2a4fa6b4efd12993e66fcc3 (patch)
treebcca28ff96e1e5a3934fbcf480a3f6185222c9fe /packages/os2units
parente878e3f25ba7f1fa8294b568cfc121e606d50fda (diff)
downloadfpc-59ac585946f82965a2a4fa6b4efd12993e66fcc3.tar.gz
* os2units moved
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@10037 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/os2units')
-rw-r--r--packages/os2units/Makefile2286
-rw-r--r--packages/os2units/Makefile.fpc26
-rw-r--r--packages/os2units/examples/ftptest.pas93
-rw-r--r--packages/os2units/examples/lvmtest.pas67
-rw-r--r--packages/os2units/examples/mciapi1.pas60
-rw-r--r--packages/os2units/examples/mciapi2.pas60
-rw-r--r--packages/os2units/fpmake.pp29
-rw-r--r--packages/os2units/readme.txt91
-rw-r--r--packages/os2units/src/buildall.pas17
-rw-r--r--packages/os2units/src/clkdll.pas169
-rw-r--r--packages/os2units/src/clktest.pas11
-rw-r--r--packages/os2units/src/dive.pas324
-rw-r--r--packages/os2units/src/ftpapi.pas1181
-rw-r--r--packages/os2units/src/hwvideo.pas214
-rw-r--r--packages/os2units/src/lvm.pas5232
-rw-r--r--packages/os2units/src/mci.pas2523
-rw-r--r--packages/os2units/src/mciapi.pas123
-rw-r--r--packages/os2units/src/mcidrv.pas358
-rw-r--r--packages/os2units/src/mmbase.pas3275
-rw-r--r--packages/os2units/src/mmio.pas1648
-rw-r--r--packages/os2units/src/som.pas1523
-rw-r--r--packages/os2units/src/sw.pas519
-rw-r--r--packages/os2units/src/wpstk.pp751
23 files changed, 20580 insertions, 0 deletions
diff --git a/packages/os2units/Makefile b/packages/os2units/Makefile
new file mode 100644
index 0000000000..04792b2140
--- /dev/null
+++ b/packages/os2units/Makefile
@@ -0,0 +1,2286 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26]
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+override PACKAGE_NAME=os2units
+override PACKAGE_VERSION=1.0.0
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_UNITS+=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+endif
+override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=src tests examples
+endif
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+ifeq ($(OS_SOURCE),linux)
+ifndef GCCLIBDIR
+ifeq ($(CPU_TARGET),i386)
+ifneq ($(findstring x86_64,$(shell uname -a)),)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+endif
+endif
+endif
+ifeq ($(CPU_TARGET),powerpc64)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
+endif
+endif
+endif
+ifndef GCCLIBDIR
+CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(CROSSGCC),)
+GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`)
+endif
+endif
+ifndef OTHERLIBDIR
+OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
+endif
+endif
+ifdef inUnix
+ifeq ($(OS_SOURCE),netbsd)
+OTHERLIBDIR+=/usr/pkg/lib
+endif
+export GCCLIBDIR OTHERLIB
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+ $(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(CPU_TARGET)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+endif
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_units
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
+override ALLTARGET+=fpc_units
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+endif
+fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+ @$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+ $(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+ $(MAKE) all DEBUG=1
+fpc_release:
+ $(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+ $(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+ $(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+ $(COMPILER) $<
+ $(EXECPPAS)
+%$(PPUEXT): %.pas
+ $(COMPILER) $<
+ $(EXECPPAS)
+%$(EXEEXT): %.pp
+ $(COMPILER) $<
+ $(EXECPPAS)
+%$(EXEEXT): %.pas
+ $(COMPILER) $<
+ $(EXECPPAS)
+%$(EXEEXT): %.lpr
+ $(COMPILER) $<
+ $(EXECPPAS)
+%$(EXEEXT): %.dpr
+ $(COMPILER) $<
+ $(EXECPPAS)
+%.res: %.rc
+ windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+ $(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+ $(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+ @$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+ $(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+ $(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+ -$(UPXPROG) $(INSTALLEXEFILES)
+endif
+ $(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+ $(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+ $(MKDIR) $(INSTALL_UNITDIR)
+ $(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+ $(MKDIR) $(INSTALL_UNITDIR)
+ $(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+ $(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+ $(MKDIR) $(INSTALL_LIBDIR)
+ $(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+ ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+ $(MKDIR) $(INSTALL_DATADIR)
+ $(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+ $(MKDIR) $(INSTALL_SOURCEDIR)
+ $(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+ $(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+ $(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+ $(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+ $(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+ $(MKDIR) $(DIST_DESTDIR)
+ $(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+ $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+ $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+ $(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+ echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+ echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+ echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+ /bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+ $(RUNBATCH) (ZIPWRAPPER)
+else
+ $(ZIPWRAPPER)
+endif
+endif
+ $(DEL) $(ZIPWRAPPER)
+else
+ $(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+ $(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+ $(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+ $(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+ $(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+ -$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+ -$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+ -$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+ -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+ -$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+ -$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+ -$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+ -$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+ -$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+ -$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+ -$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+ -$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+ -$(DELTREE) units
+ -$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+ -$(DEL) *.o *.ppu *.a
+endif
+ -$(DELTREE) *$(SMARTEXT)
+ -$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+ -$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+ -$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+ -$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+ @$(ECHO)
+ @$(ECHO) == Package info ==
+ @$(ECHO) Package Name..... $(PACKAGE_NAME)
+ @$(ECHO) Package Version.. $(PACKAGE_VERSION)
+ @$(ECHO)
+ @$(ECHO) == Configuration info ==
+ @$(ECHO)
+ @$(ECHO) FPC.......... $(FPC)
+ @$(ECHO) FPC Version.. $(FPC_VERSION)
+ @$(ECHO) Source CPU... $(CPU_SOURCE)
+ @$(ECHO) Target CPU... $(CPU_TARGET)
+ @$(ECHO) Source OS.... $(OS_SOURCE)
+ @$(ECHO) Target OS.... $(OS_TARGET)
+ @$(ECHO) Full Source.. $(FULL_SOURCE)
+ @$(ECHO) Full Target.. $(FULL_TARGET)
+ @$(ECHO) SourceSuffix. $(SOURCESUFFIX)
+ @$(ECHO) TargetSuffix. $(TARGETSUFFIX)
+ @$(ECHO)
+ @$(ECHO) == Directory info ==
+ @$(ECHO)
+ @$(ECHO) Required pkgs... $(REQUIRE_PACKAGES)
+ @$(ECHO)
+ @$(ECHO) Basedir......... $(BASEDIR)
+ @$(ECHO) FPCDir.......... $(FPCDIR)
+ @$(ECHO) CrossBinDir..... $(CROSSBINDIR)
+ @$(ECHO) UnitsDir........ $(UNITSDIR)
+ @$(ECHO) PackagesDir..... $(PACKAGESDIR)
+ @$(ECHO)
+ @$(ECHO) GCC library..... $(GCCLIBDIR)
+ @$(ECHO) Other library... $(OTHERLIBDIR)
+ @$(ECHO)
+ @$(ECHO) == Tools info ==
+ @$(ECHO)
+ @$(ECHO) As........ $(AS)
+ @$(ECHO) Ld........ $(LD)
+ @$(ECHO) Ar........ $(AR)
+ @$(ECHO) Rc........ $(RC)
+ @$(ECHO)
+ @$(ECHO) Mv........ $(MVPROG)
+ @$(ECHO) Cp........ $(CPPROG)
+ @$(ECHO) Rm........ $(RMPROG)
+ @$(ECHO) GInstall.. $(GINSTALL)
+ @$(ECHO) Echo...... $(ECHO)
+ @$(ECHO) Shell..... $(SHELL)
+ @$(ECHO) Date...... $(DATE)
+ @$(ECHO) FPCMake... $(FPCMAKE)
+ @$(ECHO) PPUMove... $(PPUMOVE)
+ @$(ECHO) Upx....... $(UPXPROG)
+ @$(ECHO) Zip....... $(ZIPPROG)
+ @$(ECHO)
+ @$(ECHO) == Object info ==
+ @$(ECHO)
+ @$(ECHO) Target Loaders........ $(TARGET_LOADERS)
+ @$(ECHO) Target Units.......... $(TARGET_UNITS)
+ @$(ECHO) Target Implicit Units. $(TARGET_IMPLICITUNITS)
+ @$(ECHO) Target Programs....... $(TARGET_PROGRAMS)
+ @$(ECHO) Target Dirs........... $(TARGET_DIRS)
+ @$(ECHO) Target Examples....... $(TARGET_EXAMPLES)
+ @$(ECHO) Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+ @$(ECHO)
+ @$(ECHO) Clean Units......... $(CLEAN_UNITS)
+ @$(ECHO) Clean Files......... $(CLEAN_FILES)
+ @$(ECHO)
+ @$(ECHO) Install Units....... $(INSTALL_UNITS)
+ @$(ECHO) Install Files....... $(INSTALL_FILES)
+ @$(ECHO)
+ @$(ECHO) == Install info ==
+ @$(ECHO)
+ @$(ECHO) DateStr.............. $(DATESTR)
+ @$(ECHO) ZipName.............. $(ZIPNAME)
+ @$(ECHO) ZipPrefix............ $(ZIPPREFIX)
+ @$(ECHO) ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+ @$(ECHO) ZipSuffix............ $(ZIPSUFFIX)
+ @$(ECHO) FullZipName.......... $(FULLZIPNAME)
+ @$(ECHO) Install FPC Package.. $(INSTALL_FPCPACKAGE)
+ @$(ECHO)
+ @$(ECHO) Install base dir..... $(INSTALL_BASEDIR)
+ @$(ECHO) Install binary dir... $(INSTALL_BINDIR)
+ @$(ECHO) Install library dir.. $(INSTALL_LIBDIR)
+ @$(ECHO) Install units dir.... $(INSTALL_UNITDIR)
+ @$(ECHO) Install source dir... $(INSTALL_SOURCEDIR)
+ @$(ECHO) Install doc dir...... $(INSTALL_DOCDIR)
+ @$(ECHO) Install example dir.. $(INSTALL_EXAMPLEDIR)
+ @$(ECHO) Install data dir..... $(INSTALL_DATADIR)
+ @$(ECHO)
+ @$(ECHO) Dist destination dir. $(DIST_DESTDIR)
+ @$(ECHO) Dist zip name........ $(DIST_ZIPNAME)
+ @$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+ fpc_makefile_dirs
+fpc_makefile:
+ $(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+ $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+ $(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+all: fpc_all
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall: fpc_distinstall
+zipinstall: fpc_zipinstall
+zipsourceinstall: fpc_zipsourceinstall
+zipexampleinstall: fpc_zipexampleinstall
+zipdistinstall: fpc_zipdistinstall
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+.NOTPARALLEL:
diff --git a/packages/os2units/Makefile.fpc b/packages/os2units/Makefile.fpc
new file mode 100644
index 0000000000..b15e052c16
--- /dev/null
+++ b/packages/os2units/Makefile.fpc
@@ -0,0 +1,26 @@
+#
+# Makefile.fpc for SDL bindings
+#
+
+[package]
+name=os2units
+version=1.0.0
+
+[require]
+libc=y
+
+[target]
+units=buildall clkdll clktest dive ftpapi hwvideo lvm mciapi mcidrv mci mmbase mmio som sw wpstk
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../..
+
+[compiler]
+includedir=src
+sourcedir=src tests examples
+
+[rules]
+.NOTPARALLEL:
diff --git a/packages/os2units/examples/ftptest.pas b/packages/os2units/examples/ftptest.pas
new file mode 100644
index 0000000000..222e857cef
--- /dev/null
+++ b/packages/os2units/examples/ftptest.pas
@@ -0,0 +1,93 @@
+program FTPTest;
+
+uses
+ FTPApi;
+
+const
+ TstName1 = 'FTPTEST1';
+ TstName2 = 'FTPTEST2';
+{$IFDEF USECON}
+ ListName = 'CON';
+ (* Using output file name 'CON' here causes output directly to console. *)
+{$ELSE USECON}
+ ListName = 'FTP.LST';
+{$ENDIF USECON}
+ TstText = 'This is a sample test file for FTPTest'#13#10'check it for yourself.';
+
+var
+ Hst, Usr, Pwd: string;
+ T: text;
+ L: longint;
+ S: string;
+
+begin
+ if ParamCount < 1 then
+ begin
+ WriteLn ('Syntax: FTPTest <host_name> [<user_name> [<password>]] ' + LineEnding + LineEnding +
+ ' User "anonymous" is used if no user name is supplied on command line,' + LineEnding +
+ ' password is being asked for if omitted');
+ Halt (1);
+ end;
+ WriteLn;
+ Hst := ParamStr (1);
+ if ParamCount > 1 then
+ begin
+ Usr := ParamStr (2);
+ if ParamCount > 2 then Pwd := ParamStr (3) else
+ begin
+ Write ('Password for user "' + Usr + '" (it _will_ be displayed on screen!): ');
+ ReadLn (Pwd);
+ end;
+ end else
+ begin
+ Usr := 'anonymous';
+ Pwd := 'nobody@nowhere.com';
+ end;
+ Write ('Preparing test file ' + TstName1 + '... ');
+ Assign (T, TstName1);
+ Rewrite (T);
+ WriteLn (T, TstText);
+ Close (T);
+ WriteLn ('done');
+ FtpVer (S);
+ WriteLn ('FTPAPI.DLL was compiled ', S);
+ FtpSetUser (Hst, Usr, Pwd, '');
+ WriteLn ('Finding out the current directory on "', Hst, '"...');
+ L := FtpPwd (S);
+ if L = 0 then WriteLn (S);
+ WriteLn ('RC = ', L);
+ Write ('The remote system is ');
+ L := FtpSys (S);
+ if L = 0 then WriteLn (S);
+ WriteLn ('RC = ', L);
+ WriteLn ('Switching to binary');
+ FtpSetBinary (T_BINARY);
+ Write ('Uploading "' + TstName1 + '" to "' + Hst + '" as "' + TstName2 + '"... ');
+ WriteLn ('RC = ', FtpPut (TstName1, TstName2));
+ WriteLn ('Getting dir listing from "' + Hst + '" to "' + ListName + '"... ');
+ L := FtpDir (ListName, '');
+{$IFNDEF USECON}
+ if L = 0 then
+ begin
+ Assign (T, ListName);
+ Reset (T);
+ while not (Eof (T)) do
+ begin
+ ReadLn (T, S);
+ WriteLn (S);
+ end;
+ Close (T);
+ end;
+{$ENDIF USECON}
+ WriteLn ('RC = ', L);
+ Write ('Downloading "' + TstName2 + '"... ');
+ WriteLn ('RC = ', FtpGet (TstName2, TstName2, 'w'));
+ Write ('Setting time of the downloaded file to that one on server... ');
+ WriteLn ('Result = ', Keep_File_Date (TstName2, TstName2));
+ Write ('Removing "', TstName2, '" again from "', Hst, '"... ');
+ WriteLn ('RC = ', FtpDelete (TstName2));
+ Write ('Closing all connections... ');
+ FtpLogoff;
+ WriteLn ('done.');
+ WriteLn (LineEnding + 'Finished.');
+end.
diff --git a/packages/os2units/examples/lvmtest.pas b/packages/os2units/examples/lvmtest.pas
new file mode 100644
index 0000000000..75b0ffb807
--- /dev/null
+++ b/packages/os2units/examples/lvmtest.pas
@@ -0,0 +1,67 @@
+(*****************************************************************************
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+* the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*****************************************************************************)
+uses lvm;
+
+// lvmtest.cpp, program to test the LVM library
+//
+// By John Martin Alfredsson, jma@jmast.se
+// Pascal conversion by Yuri Prokushev
+
+var
+ vca: Volume_Control_Array;
+ vir: Volume_Information_Record;
+ iCounter: integer;
+const
+ Error_Code: CARDINAL32 = 99999;
+begin
+ Open_LVM_Engine(True, addr(Error_Code));
+ if Error_Code<>0 then
+ begin
+ writeln('Open_LVM_Engine Error !!');
+ halt(1);
+ end;
+
+ vca:=Get_Volume_Control_Data(addr(Error_Code));
+ if Error_Code<>0 then
+ begin
+ writeln('Get_Volume_Control_Data Error !!');
+ halt(1);
+ end;
+
+ for iCounter:=0 to vca.Count-1 do
+ begin
+ writeln('--------------------------------------');
+ vir:=Get_Volume_Information(vca.Volume_Control_Data[iCounter].Volume_Handle, addr(Error_Code));
+ writeln('Volname : [', vir.Current_Drive_Letter, ':] ', vir.Volume_Name);
+ writeln('FileSystem : ', vir.File_System_Name);
+ case vir.Status of
+ 0: writeln('Status : None');
+ 1: writeln('Status : Bootable');
+ 2: writeln('Status : Startable');
+ 3: writeln('Status : Installable');
+ end;
+
+ if vca.Volume_Control_Data[iCounter].Compatibility_Volume then
+ writeln('Volume type : Compatibility Volume')
+ else
+ writeln('Volume type : LVM Volume');
+ end;
+
+ writeln('--------------------------------------');
+
+ Free_Engine_Memory(vca.Volume_Control_Data);
+ Close_LVM_Engine;
+end.
diff --git a/packages/os2units/examples/mciapi1.pas b/packages/os2units/examples/mciapi1.pas
new file mode 100644
index 0000000000..de20a36543
--- /dev/null
+++ b/packages/os2units/examples/mciapi1.pas
@@ -0,0 +1,60 @@
+program mciapi1;
+
+uses
+ Os2Def, PMWin, mciapi;
+
+function ClientWindowProc (Window, Msg: cardinal; MP1, MP2: pointer): pointer;
+ cdecl; export;
+var
+ Ps: cardinal;
+ R: TRectL;
+begin
+ ClientWindowProc := nil;
+ case Msg of
+ wm_Paint: begin
+ PS := WinBeginPaint (Window, 0, @R);
+ WinFillRect (PS, @R, SYSCLR_WINDOW);
+ WinEndPaint (PS);
+ end;
+ else ClientWindowProc := WinDefWindowProc (Window, Msg, MP1, MP2);
+ end;
+end;
+
+const
+ idClientWindow = 11000;
+ WinFlags: cardinal = fcf_TitleBar + fcf_SysMenu + fcf_SizeBorder +
+ fcf_MinMax + fcf_TaskList + fcf_NoByteAlign;
+ ClassName = 'MYVIEW';
+
+var
+ Anchor, MsgQue: cardinal;
+ Message: TQMsg;
+ Frame, Client: cardinal;
+begin
+ Anchor := WinInitialize(0);
+ { It might be beneficial to set the second parameter of the following }
+ { call to something large, such as 1000. The OS/2 documentation does }
+ { not recommend this, however } MsgQue := WinCreateMsgQueue (Anchor, 0);
+ if MsgQue = 0 then Halt (254);
+
+ WinRegisterClass (Anchor, ClassName, proc (@ClientWindowProc), cs_SizeRedraw,
+ SizeOf (pointer));
+ Frame := WinCreateStdWindow (hwnd_Desktop, 0, WinFlags, ClassName,
+ 'MMPM/2 TEST WAVE', 0, 0, idClientWindow, Client);
+ if (Frame <> 0) then
+ begin
+ WinSetWindowPos (Frame, 0, 0, WinQuerySysValue (hwnd_Desktop,
+ sv_CyScreen) - 200, 200, 200, swp_Move + swp_Size + swp_Activate +
+ swp_Show);
+ (* Play a wave file set to valid window handle *)
+
+ mciPlayFile(Frame, 'test.wav', MCI_ASYNC, nil, 0);
+
+ while WinGetMsg (Anchor, Message, 0, 0, 0) do
+ WinDispatchMsg (Anchor, Message);
+
+ WinDestroyWindow (Frame);
+ end;
+ WinDestroyMsgQueue (MsgQue);
+ WinTerminate (Anchor);
+end.
diff --git a/packages/os2units/examples/mciapi2.pas b/packages/os2units/examples/mciapi2.pas
new file mode 100644
index 0000000000..f7dc795fdf
--- /dev/null
+++ b/packages/os2units/examples/mciapi2.pas
@@ -0,0 +1,60 @@
+program mciapi2;
+
+uses
+ Os2Def, PMWin, mciapi;
+
+function ClientWindowProc (Window, Msg: cardinal; MP1, MP2: pointer): pointer;
+ cdecl; export;
+var
+ Ps: cardinal;
+ R: TRectL;
+begin
+ ClientWindowProc := nil;
+ case Msg of
+ wm_Paint: begin
+ PS := WinBeginPaint (Window, 0, @R);
+ WinFillRect (PS, @R, SYSCLR_WINDOW);
+ WinEndPaint (PS);
+ end;
+ else ClientWindowProc := WinDefWindowProc (Window, Msg, MP1, MP2);
+ end;
+end;
+
+const
+ idClientWindow = 11000;
+ WinFlags: cardinal = fcf_TitleBar + fcf_SysMenu + fcf_SizeBorder +
+ fcf_MinMax + fcf_TaskList + fcf_NoByteAlign;
+ ClassName = 'MYVIEW';
+
+var
+ Anchor, MsgQue: cardinal;
+ Message: TQMsg;
+ Frame, Client: cardinal;
+begin
+ Anchor := WinInitialize(0);
+ { It might be beneficial to set the second parameter of the following }
+ { call to something large, such as 1000. The OS/2 documentation does }
+ { not recommend this, however } MsgQue := WinCreateMsgQueue (Anchor, 0);
+ if MsgQue = 0 then Halt (254);
+
+ WinRegisterClass (Anchor, ClassName, proc (@ClientWindowProc), cs_SizeRedraw,
+ SizeOf (pointer));
+ Frame := WinCreateStdWindow (hwnd_Desktop, 0, WinFlags, ClassName,
+ 'MMPM/2 TEST', 0, 0, idClientWindow, Client);
+ if (Frame <> 0) then
+ begin
+ WinSetWindowPos (Frame, 0, 0, WinQuerySysValue (hwnd_Desktop,
+ sv_CyScreen) - 200, 200, 200, swp_Move + swp_Size + swp_Activate +
+ swp_Show);
+ (* Play a wave file set to valid window handle *)
+
+ mciPlayFile(Frame, 'movie.avi', MCI_ASYNC, 'MMPM/2 TEST MOVIE', 0);
+
+ while WinGetMsg (Anchor, Message, 0, 0, 0) do
+ WinDispatchMsg (Anchor, Message);
+
+ WinDestroyWindow (Frame);
+ end;
+ WinDestroyMsgQueue (MsgQue);
+ WinTerminate (Anchor);
+end.
diff --git a/packages/os2units/fpmake.pp b/packages/os2units/fpmake.pp
new file mode 100644
index 0000000000..d996698b7c
--- /dev/null
+++ b/packages/os2units/fpmake.pp
@@ -0,0 +1,29 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+ P : TPackage;
+ T : TTarget;
+begin
+ With Installer do
+ begin
+{$endif ALLPACKAGES}
+
+ P:=AddPackage('os2units');
+{$ifdef ALLPACKAGES}
+ P.Directory:='os2units';
+{$endif ALLPACKAGES}
+ P.Version:='2.0.0';
+ P.SourcePath.Add('src');
+// P.Dependencies.Add('x11');
+
+ // not compilable defunct for now
+
+{$ifndef ALLPACKAGES}
+ Run;
+ end;
+end.
+{$endif ALLPACKAGES}
diff --git a/packages/os2units/readme.txt b/packages/os2units/readme.txt
new file mode 100644
index 0000000000..05f057c290
--- /dev/null
+++ b/packages/os2units/readme.txt
@@ -0,0 +1,91 @@
+OS/2 Multimedia Toolkit
+=======================
+
+OS/2 Multimedia toolkit is set of units to manage various parts of multimedia
+subsystem of OS/2. Not a part of standard OS/2 Multimedia:
+
+a) WarpOverlay! library interface (hwvideo.pas)
+
+MMPM/2 Documentation
+--------------------
+
+OS/2 Multimedia Subsystem Programming Guide
+Provides guidelines for developing multimedia subsystems. Each subsystem
+component is described in detail in individual chapters. Models are used
+to complement the information provided by component sample program templates.
+
+OS/2 Multimedia Application Programming Guide
+Provides advisory information on application interfaces to help you select
+and implement functions for your OS/2 multimedia applications. Code examples
+from fully documented sample programs accompany the descriptions of the
+functions.
+
+OS/2 Multimedia Programming Reference
+Provides detailed information on multimedia functions, messages, and data
+structures to enable you to write code for your multimedia application
+programs and subsystems.
+
+The MMPM/2 Device Driver Reference for OS/2
+It is for subsystem developers who want to write their own physical
+device drivers (and associated virtual device drivers) to support audio
+and video adapters in the Multimedia Presentation Manager/2 system.
+
+Multimedia REXX
+Describes REXX functions that enable media control interface string commands
+to be sent from an OS/2 command file to control multimedia devices. This
+online book is provided with OS/2 multimedia.
+
+Guide to Multimedia User Interface Design - (41G2922)
+Describes design concepts to be considered when designing a CUA multimedia
+interface that is consistent within a particular multimedia product and
+across other products.
+
+WarpOverlay!
+------------
+
+WarpOverlay! is video acceleration driver. This is original readme.txt
+(BEWARE! Most probably, Valery don't know about this port):
+
+-Begin-
+Short overview:
+hwvideo.h is a main header for use WarpOverlay! video acceleration driver.
+There are no more or less suitable SDK yet, I am to lazy :(
+
+
+DEMO - small stupid example of using WarpOverlay!, currently it does not sup-
+port many features of WarpOverlay!, only basic functionality.
+it just tried to load file demo.mpg and cyclically play it.
+Used mpeg1 decoder pretty unstable and very unoptimal. This is just example.
+Many of MPEG files can crush decoder. I am not very fimilar with different
+MPEG aspects and do not want to mess with it, sorry.
+I just included one small MPEG1 file, which work well.
+
+RGB - example of using RGB (FOURCC_R565) overlay. Attention! RGB overlay
+not supported for NVidia chips and for Matrox G200.
+Known worked RGB overlay: Rage128, Radeon, i740, Savages.
+
+
+Please contact me, if you have questions/troubles with this example or with
+WarpOverlay! usage.
+
+Valery Gaynullin
+
+MPEG decoding engine based on the Berkeley MPEG (mpegplay).
+-End-
+
+Longterm plans
+--------------
+
+a) Fix lot of bugs ;)
+b) Add support for IBM Multimedia Classes and CWMM Classes for WPS (as fast as
+ SOM and WPS toolkits will be presented)
+c) SEAL library interface (seal.pas) www.netlabs.org/hobbes.nmsu.edu
+ SEAL is module player library. At the present time SEAL not developing
+ anymore (for all platforms), but still very usefull for mudule music fans.
+d) DualMode Library (dual.pas) www.netlabs.org
+ DualMode library allows to use common access method as for fullscreen (MGL)
+ as for windowed (DIVE) video modes.
+e) Examples, examples, examples (tests as well)
+
+CU!
+Yuri & Andry
diff --git a/packages/os2units/src/buildall.pas b/packages/os2units/src/buildall.pas
new file mode 100644
index 0000000000..e20f281fa1
--- /dev/null
+++ b/packages/os2units/src/buildall.pas
@@ -0,0 +1,17 @@
+Unit Buildall;
+
+Interface
+
+Uses
+ sw,
+ mmbase,
+ dive,
+ hwvideo,
+ mci,
+ mciapi,
+ mcidrv,
+ mmio;
+
+Implementation
+
+End.
diff --git a/packages/os2units/src/clkdll.pas b/packages/os2units/src/clkdll.pas
new file mode 100644
index 0000000000..2c42d3e2c3
--- /dev/null
+++ b/packages/os2units/src/clkdll.pas
@@ -0,0 +1,169 @@
+{
+ Copyright (c) 2002 by Mark Eckstein
+ Copyright (c) 2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ eCS Clock API (part of standard eCS installation)
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+1 **********************************************************************}
+
+{
+The Clock API is a set of functions, which offer you a variety of
+time-related operations. You can use it like any other DLL provided
+with OS/2 and eComStation. However, the Clock API DLL is not Rexx
+enabled.
+}
+
+Unit clkdll;
+
+Interface
+
+Uses
+ DosCalls;
+
+{
+If you need to know the universal world time call this API. The
+value it returns is updated every 250 ms, so it's rather meant
+for not-too-high precision tasks.
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkQueryUTC(var Value: TDateTime): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryUTC'; {index 00001}
+
+{
+You can obtain the time zone offset using this API.
+Return values: 0 ... ok
+ 128 ... failed
+}
+
+Function ClkQueryUTCOffset(var Value: Longint): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryUTCOffset'; {index 00002}
+
+{
+Get the difference between standard time and summer time in
+seconds by calling this API.
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkQueryDSTAdvance(var Value: Integer): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryDSTAdvance'; {index 00003}
+
+{
+This returns the standard time zone identifier and date and
+time of the next change to standard time.
+Return values: 0 ... ok
+ 30 ... ID only
+ 40 ... Date only
+ 128 ... failed
+}
+Function ClkQuerySTData(ID: PChar; var NextDate: TDateTime): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQuerySTData'; {index 00004}
+
+{
+This returns the summer time zone identifier and date and
+time of the next change to summer time.
+Return values: 0 ... ok
+ 30 ... ID only
+ 40 ... Date only
+ 128 ... failed
+}
+Function ClkQueryDSTData(ID: PChar; var NextDate: TDateTime): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryDSTData'; {index 00005}
+
+{
+This returns the TZ string that is currently in use, independent
+from the actual TZ environment setting.
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkQueryTimeZone(value: PChar): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryTimeZone'; {index 00006}
+
+{
+If you want to know in which hemisphere the computer is located
+call this API.
+Value is either 0 for southern or 1 for northern hemisphere.
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkQueryHemisphere(var Value: Integer): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryHemisphere'; {index 00007}
+
+{
+The system's uptime is returned when calling this API. Opposed
+to the OS/2 API for the same purpose this one's rollover will
+be after approximately 130 years (untested!).
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkQueryUptime(var Days, Hours, Minutes, Seconds, Hundredths: Cardinal): Cardinal; cdecl;
+ external 'clkdll' name 'ClkQueryUptime'; {index 00008}
+
+{
+Returns, whether a synchronization can be done (Value == 1) or
+not (Value == 0). This depends on the chosen connection type and
+the current connection status.
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkCanSynchronize(var Value: Integer): Cardinal; cdecl;
+ external 'clkdll' name 'ClkCanSynchronize'; {index 00015}
+
+{
+Triggers a time synchronization.
+Return values: 0 ... ok
+ 64 ... writing to pipe failed
+ 70 ... can't synchronize
+ 128 ... clkbasic version could not be determined
+ 129 ... clkbasic version unknow
+}
+Function ClkDoSynchronize: Cardinal; cdecl;
+ external 'clkdll' name 'ClkDoSynchronize'; {index 00013}
+
+{
+Queries, whether clkbasic is currently in the process of
+synchronizing (Value == 1: yes, Value == 0: no)
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkIsSynchronizing(var Value: Integer): Cardinal; cdecl;
+ external 'clkdll' name 'ClkIsSynchronizing'; {index 00014}
+
+{
+Returns the synchronization data. Date and time of the last
+attempted synchronization, date and time of the last successful
+synchronization, indicator for success of last attempt and the host
+from where the time could be synched successfully.
+Return values: 0 ... ok
+ 128 ... failed
+}
+Function ClkGetSynchData(var Last, LastSuccess: TDateTime;
+ var LastWasSuccessful: Integer;
+ LastSuccessfulHost: PChar): Cardinal; cdecl;
+ external 'clkdll' name 'ClkGetSynchData'; {index 00016}
+
+{ not documented
+ external 'clkdll' name 'ClkQueryBasePath'; {index 00009}
+ external 'clkdll' name 'ClkQueryLanguagePath'; {index 00010}
+ external 'clkdll' name 'ClkQueryDialupState'; {index 00011}
+ external 'clkdll' name 'ClkQueryVersion'; {index 00012}
+ external 'clkdll' name 'ClkCallSettings'; {index 00017}
+ external 'clkdll' name 'ClkCallSchedulerHelper'; {index 00018}
+}
+
+Implementation
+
+End.
diff --git a/packages/os2units/src/clktest.pas b/packages/os2units/src/clktest.pas
new file mode 100644
index 0000000000..cfc85481e7
--- /dev/null
+++ b/packages/os2units/src/clktest.pas
@@ -0,0 +1,11 @@
+uses doscalls, clkdll;
+
+Var
+ ID: Array[0..255] of Char;
+ NextDate: TDateTime;
+begin
+ WriteLn('RC=',ClkQuerySTData(@ID, NextDate));
+ WriteLn(PChar(@ID));
+ With NextDate do
+ WriteLn(Hours,':',Minutes,':',Seconds);
+end.
diff --git a/packages/os2units/src/dive.pas b/packages/os2units/src/dive.pas
new file mode 100644
index 0000000000..ad96f3011a
--- /dev/null
+++ b/packages/os2units/src/dive.pas
@@ -0,0 +1,324 @@
+{****************************************************************************
+
+
+ DIVE interface unit
+ FPC Pascal Runtime Library for OS/2
+ Copyright (c) 1999-2000 by Karoly Balogh (aka Charlie/INQ)
+
+ The FPC Pascal runtime library is distributed under the Library GNU Public
+ License v2. So is this unit. The Library GNU Public License requires you to
+ distribute the source code of this unit with any product that uses it.
+ Because the EMX library isn't under the LGPL, we grant you an exception to
+ this, and that is, when you compile a program with the Free Pascal Compiler,
+ you do not need to ship source code with that program, AS LONG AS YOU ARE
+ USING UNMODIFIED CODE! If you modify this code, you MUST change the next
+ line:
+
+ <This an official, unmodified Free Pascal source code file.>
+
+ Send us your modified files, we can work together if you want!
+
+ Free Pascal is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ Library GNU General Public License for more details.
+
+ You should have received a copy of the Library GNU General Public License
+ along with Free Pascal; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+****************************************************************************}
+
+Unit DIVE;
+
+{Warning: This code is alfa. Future versions of this unit will propably
+ not be compatible.}
+
+Interface
+
+Uses OS2Def, PMWin, MMBase;
+
+Const Max_Dive_Instances = 64;
+
+ DIVE_Success = $00000000;
+ DIVE_Err_Invalid_Instance = $00001000;
+ DIVE_Err_Source_Format = $00001001;
+ DIVE_Err_Destination_Format = $00001002;
+ DIVE_Err_Blitter_Not_Setup = $00001003;
+ DIVE_Err_Insufficient_Length = $00001004;
+ DIVE_Err_Too_Many_Instances = $00001005;
+ DIVE_Err_No_Direct_Access = $00001006;
+ DIVE_Err_Not_Bank_Switched = $00001007;
+ DIVE_Err_Invalid_Bank_Number = $00001008;
+ DIVE_Err_FB_Not_Acquired = $00001009;
+ DIVE_Err_FB_Already_Acquired = $0000100A;
+ DIVE_Err_Acquire_Failed = $0000100B;
+ DIVE_Err_Bank_Switch_Failed = $0000100C;
+ DIVE_Err_Deacquire_Failed = $0000100D;
+ DIVE_Err_Invalid_Palette = $0000100E;
+ DIVE_Err_Invalid_Destination_RECTL = $0000100F;
+ DIVE_Err_Invalid_Buffer_Number = $00001010;
+ DIVE_Err_SSMDD_Not_Installed = $00001011;
+ DIVE_Err_Buffer_Already_Accessed = $00001012;
+ DIVE_Err_Buffer_Not_Accessed = $00001013;
+ DIVE_Err_Too_Many_Bufffers = $00001014;
+ DIVE_Err_Allocation_Error = $00001015;
+ DIVE_Err_Invalid_Linesize = $00001016;
+ DIVE_Err_Fatal_Exception = $00001017;
+ DIVE_Err_Invalid_Conversion = $00001018;
+ DIVE_Err_VSD_Error = $00001019;
+ DIVE_Err_Color_Support = $0000101A;
+ DIVE_Err_Out_Of_Range = $0000101B;
+ DIVE_Warn_No_Size = $00001100;
+
+ DIVE_Buffer_Screen = $00000000;
+ DIVE_Buffer_Graphics_Plane = $00000001;
+ DIVE_Buffer_Alternate_Plane = $00000002;
+
+ DIVE_Fully_Visible = $FFFFFFFF;
+
+ { * Use either of the two defines as the bRGB2Entries pointer to have DIVE * }
+ { * query and set the physical or default palette as source or destination. * }
+
+ DIVE_Palette_Physical = $00000000;
+ DIVE_Palette_Default = $FFFFFFFF;
+
+Type HDIVE = cardinal;
+
+ { * Blitter setup structures * }
+ TSetup_Blitter = Record
+ ulStructLen : cardinal; { * ulStructLen tells how much of the structure is used. * }
+ { * Comments here show appropriate values, so don't count ;) * }
+
+ fInvert : cardinal; { * Image is inverted on blit * }
+ { * fInvert use: * }
+ { * %0001 = 01 = $01 horizontal flip * }
+ { * %0010 = 02 = $02 vertical flip * }
+
+ { * This is the mark for 8 bytes * }
+
+ fccSrcColorFormat : FourCC; { * Source data format * }
+ ulSrcWidth : cardinal; { * Width in pels * }
+ ulSrcHeight : cardinal; { * Height in pels * }
+ { * The following are for displaying a sub-portion of the image. * }
+ ulSrcPosX : cardinal; { * X Position of source data * }
+ ulSrcPosY : cardinal; { * Y Position of source data * }
+
+ { * This is the mark for 28 bytes * }
+
+ ulDitherType : cardinal; { * Dither type * }
+
+ { * 32 byte mark * }
+
+ fccDstColorFormat : FourCC; { * Destination color format * }
+ ulDstWidth : cardinal; { * Destination width in pels * }
+ ulDstHeight : cardinal; { * Destination height in pels * }
+ lDstPosX : LongInt;
+ lDstPosY : LongInt;
+
+ { * 52 byte mark * }
+
+ lScreenPosX : LongInt;
+ lScreenPosY : LongInt;
+
+ { * 60 byte mark * }
+
+ ulNumDstRects : cardinal;
+ pVisDstRects : PRectl; { * This is a pointer to an array of visible rectangles. * }
+
+ { * 68 bytes = fully used * }
+ End;
+
+ PSetup_Blitter = ^TSetup_Blitter;
+
+ { * Stuff for DiveQueryCaps() * }
+ TDIVE_CAPS = Record
+ ulStructLen : cardinal; { * SizeOf(TDIVE_CAPS) * }
+ ulPlaneCount : cardinal; { * Number of defined planes * }
+
+ { * Following info applies to ulPlaneID * }
+ fScreenDirect : Boolean; { * Direct screen access (was type BOOL in C) * }
+ fBankSwitched : Boolean; { * VRAM bank-switched? (was type BOOL in C) * }
+ ulDepth : cardinal; { * Number of bits per pixel * }
+ ulHorizontalResolution : cardinal;
+ ulVerticalResolution : cardinal;
+ ulScanLineBytes : cardinal;
+ fccColorEncoding : FourCC;
+ ulApertureSize : cardinal;
+
+ ulInputFormats : cardinal; { * Number of input color formats * }
+ ulOutputFormats : cardinal;
+ ulFormatLength : cardinal; { * Length of format buffer * }
+ pFormatData : Pointer; { * Pointer to format buffer of FOURCC's * }
+ End;
+
+ PDIVE_CAPS = ^TDIVE_CAPS;
+
+Function DiveQueryCaps(DiveCaps: PDIVE_CAPS; ulPlaneBufNum : cardinal) : cardinal; cdecl;
+
+Function DiveOpen(Var phDiveInst : cardinal; fNonScreenInstance : cardinal;
+ Var ppFrameBuffer : Pointer) : cardinal; cdecl;
+Function DiveClose(hDiveInst : cardinal) : cardinal; cdecl;
+
+Function DiveSetupBlitter(hDiveInst : cardinal; pSetupBlitter : PSetup_Blitter) : cardinal; cdecl;
+Function DiveBlitImage(hDiveInst : cardinal; ulSrcBufNumber : cardinal; ulDstBufNumber : cardinal) : cardinal; cdecl;
+
+Function DiveAcquireFrameBuffer(hDiveInst : cardinal; prectlDst : PRectl) : cardinal; cdecl;
+Function DiveDeacquireFrameBuffer(hDiveInst : cardinal) : cardinal; cdecl;
+Function DiveCalcFrameBufferAddress(hDiveInst : cardinal;
+ prectlDest : PRectl;
+ Var pDestinationAddress : Pointer;
+ Var ulBankNumber : cardinal;
+ Var ulRemLinesInBank : cardinal) : cardinal; cdecl;
+Function DiveSwitchBank(hDiveInst : cardinal; ulBankNumber : cardinal) : cardinal; cdecl;
+
+{ Notes on DiveAllocImageBuffer:
+ If pbImageBuffer is not NULL, the buffer is associated rather than
+ allocated. If pbImageBuffer is not NULL and the buffer number
+ pointed to by pulBufferNumber is non-zero, a new buffer pointer is
+ associated with the buffer number. Even though no memory is
+ allocated by DiveAllocImageBuffer when user-allocated buffers are
+ associated, DiveFreeImageBuffer should be called to release the
+ buffer association to avoid using up available buffer indexes.
+ The specified line size will be used if a buffer is allocated in
+ system memory, or if a user buffer is associated. If the
+ specified line size is zero, the allocated line size is rounded up
+ to the nearest DWORD boundry. }
+
+Function DiveAllocImageBuffer(hDiveInst : cardinal;
+ Var ulBufferNumber : cardinal;
+ fccColorSpace : FourCC;
+ ulWidth : cardinal;
+ ulHeight : cardinal;
+ ulLineSizeBytes : cardinal;
+ Var bImageBuffer : Pointer) : cardinal; cdecl;
+Function DiveFreeImageBuffer(hDiveInst : cardinal; ulBufferNumber : cardinal) : cardinal; cdecl;
+
+Function DiveBeginImageBufferAccess(hDiveInst : cardinal;
+ ulBufferNumber : cardinal;
+ Var pbImageBuffer : Pointer;
+ Var ulBufferScanLineBytes : cardinal;
+ Var ulBufferScanLines : cardinal) : cardinal; cdecl;
+Function DiveEndImageBufferAccess(hDiveInst : cardinal; ulBufferNumber : cardinal) : cardinal; cdecl;
+
+
+{/* Notes on palettes:
+ Neither DiveSetSourcePalette nor DiveSetDestinationPalette API's will set
+ the physical palette. If your application MUST set the PHYSICAL palette,
+ try using no more than 236 entries (the middle 236: 10-245, thus leaving
+ the top and bottom 10 entries for the Workplace Shell). If your
+ application MUST use ALL 256 entries, it must do so as a full-screen
+ (i.e. maximized) application. Remember, No WM_REALIZEPALETTE message
+ will be sent to other running applications, meaning they will not redraw
+ and their colors will be all wrong. It is not recommended that a
+ developer use these commands:
+
+ To set physical palette, do the following:
+ hps = WinGetPS ( HWND_DESKTOP );
+ hdc = GpiQueryDevice ( hps );
+ GpiCreateLogColorTable ( hps, LCOL_PURECOLOR | LCOL_REALIZABLE,
+ LCOLF_CONSECRGB, 0, 256, (PLONG)plRGB2Entries );
+ Gre32EntrY3 ( hdc, 0L, 0x000060C6L );
+ WinInvalidateRect ( HWND_DESKTOP, (PRECTL)NULL, TRUE );
+ WinReleasePS ( hps );
+
+ To reset physical palette, do the following:
+ hps = WinGetPS ( HWND_DESKTOP );
+ hdc = GpiQueryDevice ( hps );
+ Gre32EntrY3 ( hdc, 0L, 0x000060C7L );
+ WinInvalidateRect ( HWND_DESKTOP, (PRECTL)NULL, TRUE );
+ WinReleasePS ( hps );
+*/}
+
+Function DiveSetDestinationPalette(hDiveInst : cardinal;
+ ulStartIndex : cardinal;
+ ulNumEntries : cardinal;
+ Var bRGB2Entries : Pointer) : cardinal; cdecl;
+
+Function DiveSetSourcePalette(hDiveInst : cardinal;
+ ulStartIndex : cardinal;
+ ulNumEntries : cardinal;
+ Var bRGB2Entries : Pointer) : cardinal; cdecl;
+
+Function DiveSetTransparentBlitMode(hDiveInst : cardinal;
+ ulStartIndex : cardinal;
+ ulValue1 : cardinal;
+ ulValue2 : cardinal) : cardinal; cdecl;
+
+Implementation
+
+Function DiveQueryCaps(DiveCaps : PDIVE_CAPS; ulPlaneBufNum : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 1;
+
+Function DiveOpen(Var phDiveInst : cardinal; fNonScreenInstance : cardinal; Var ppFrameBuffer : Pointer) : cardinal; cdecl;
+External 'DIVE' Index 2;
+
+Function DiveClose(hDiveInst : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 3;
+
+Function DiveSetupBlitter(hDiveInst : cardinal; pSetupBlitter : PSetup_Blitter) : cardinal; cdecl;
+External 'DIVE' Index 4;
+
+Function DiveBlitImage(hDiveInst : cardinal; ulSrcBufNumber : cardinal; ulDstBufNumber : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 5;
+
+Function DiveAcquireFrameBuffer(hDiveInst : cardinal; prectlDst : PRectl) : cardinal; cdecl;
+External 'DIVE' Index 6;
+
+Function DiveDeacquireFrameBuffer(hDiveInst : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 8;
+
+Function DiveCalcFrameBufferAddress(hDiveInst : cardinal;
+ prectlDest : PRectl;
+ Var pDestinationAddress : Pointer;
+ Var ulBankNumber : cardinal;
+ Var ulRemLinesInBank : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 11;
+
+Function DiveSwitchBank(hDiveInst : cardinal; ulBankNumber : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 7;
+
+
+Function DiveAllocImageBuffer(hDiveInst : cardinal;
+ Var ulBufferNumber : cardinal;
+ fccColorSpace : FourCC;
+ ulWidth : cardinal;
+ ulHeight : cardinal;
+ ulLineSizeBytes : cardinal;
+ Var bImageBuffer : Pointer) : cardinal; cdecl;
+External 'DIVE' Index 12;
+
+Function DiveFreeImageBuffer(hDiveInst : cardinal;
+ ulBufferNumber : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 13;
+
+Function DiveBeginImageBufferAccess(hDiveInst : cardinal;
+ ulBufferNumber : cardinal;
+ Var pbImageBuffer : Pointer;
+ Var ulBufferScanLineBytes : cardinal;
+ Var ulBufferScanLines : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 14;
+
+Function DiveEndImageBufferAccess(hDiveInst : cardinal; ulBufferNumber : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 15;
+
+Function DiveSetDestinationPalette(hDiveInst : cardinal;
+ ulStartIndex : cardinal;
+ ulNumEntries : cardinal;
+ Var bRGB2Entries : Pointer) : cardinal; cdecl;
+External 'DIVE' Index 9;
+
+Function DiveSetSourcePalette(hDiveInst : cardinal;
+ ulStartIndex : cardinal;
+ ulNumEntries : cardinal;
+ Var bRGB2Entries : Pointer) : cardinal; cdecl;
+External 'DIVE' Index 10;
+
+Function DiveSetTransparentBlitMode(hDiveInst : cardinal;
+ ulStartIndex : cardinal;
+ ulValue1 : cardinal;
+ ulValue2 : cardinal) : cardinal; cdecl;
+External 'DIVE' Index 18;
+
+End.
diff --git a/packages/os2units/src/ftpapi.pas b/packages/os2units/src/ftpapi.pas
new file mode 100644
index 0000000000..ec789b96e1
--- /dev/null
+++ b/packages/os2units/src/ftpapi.pas
@@ -0,0 +1,1181 @@
+{
+ Copyright (c) 2002 by Yuri Prokushev (prokushev@freemail.ru).
+
+ Functions from FTPAPI.DLL (part of standard OS/2 Warp 4/eCS installation).
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(a unit to handle FTP)
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(22 Jul 2002)
+@lastmod(01 Oct 2002)
+This is functions from FTPAPI.DLL. Goal is ftp manipulation.
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+@todo(Rework some functions to support strings longer then 255 chars)
+@todo(Finish functions description)
+}
+unit FTPAPI;
+
+{****************************************************************************
+
+ RTL configuration
+
+****************************************************************************}
+
+
+interface
+
+uses
+ OS2Def,
+ PMWin,
+ Strings;
+
+Const
+ // window message id for post xfer updates
+ WM_FTPAPI_XFER_UPDATE = WM_USER + 1000;
+
+ // Transfer types is ASCII
+ T_ASCII = 1;
+ // Transfer types is EBCDIC
+ T_EBCDIC = 2;
+ // Transfer types is BINARY
+ T_BINARY = 3;
+
+ // command/reply trace file modes
+ M_OVERLAY = 1;
+ M_APPEND = 2;
+
+ // command/reply tracing error codes
+
+ // invalid trace file open mode
+ TRCMODE = 1;
+ // unable to open trace file
+ TRCOPEN = 2;
+
+ // Common error codes (try Ftp_ErrNo, all other functions returns usually
+ // 0 if all ok, -1 if all bad)
+
+ // No any error
+ FTPNOERROR = 00;
+ // Unknown service.
+ FTPSERVICE = 01;
+ // Unknown host.
+ FTPHOST = 02;
+ // Unable to obtain socket.
+ FTPSOCKET = 03;
+ // Unable to connect to server.
+ FTPCONNECT = 04;
+ // Login failed.
+ FTPLOGIN = 05;
+ // Transfer aborted.
+ FTPABORT = 06;
+ // Problem opening the local file.
+ FTPLOCALFILE = 07;
+ // Problem initializing data connection.
+ FTPDATACONN = 08;
+ // Command failed.
+ FTPCOMMAND = 09;
+ // Proxy server does not support third party transfers.
+ FTPPROXYTHIRD = 10;
+ // No primary connection for proxy transfer.
+ FTPNOPRIMARY = 11;
+ // No code page translation table was loaded
+ FTPNOXLATETBL = 12;
+
+ // ping error codes
+
+ // All ok
+ PINGOK = 0;
+ // Host does not reply
+ PINGREPLY = -1;
+ // Unable to obtain socket
+ PINGSOCKET = -3;
+ // Unknown protocol ICMP
+ PINGPROTO = -4;
+ // Send failed
+ PINGSEND = -5;
+ // Recv() failed
+ PINGRECV = -6;
+ // Unknown host (can't resolve)
+ PINGHOST = -7;
+
+ // Restart Specific
+ REST_GET = 1;
+ REST_PUT = 2;
+
+Const
+ // Short functions vars
+ ShortHost: String='';
+ ShortUserId: String='';
+ ShortPasswd: String='';
+ ShortAcct: String='';
+ ShortTransferType: Integer = T_ASCII;
+
+
+{****************************************************************************
+
+ Opening and Closing Functions
+
+****************************************************************************}
+
+// Defines Host, UserId, Passwd and Acct for short function calls
+Function FtpSetUser(Host, UserId, Passwd, Acct: String): Integer;
+
+// Defines TransferType for short function calls
+Function FtpSetBinary(TransferType: Integer): Integer;
+
+// Stores the string containing the FTP API version
+// Buf is the buffer to store version string
+// BufLen is length of the buffer
+// Version string is null-terminated and truncated to buffer length
+Function FtpVer(var Buf; BufLen: Integer): Integer; cdecl;
+
+Function FtpVer(Var Buf: String): Integer;
+
+// Closes all current connections
+Procedure FtpLogoff; cdecl;
+
+{****************************************************************************
+
+ File Action Functions
+
+****************************************************************************}
+
+// Appends information to a remote file
+// Host is hostname. Use 'hostname portnumber' to specify non-standard port
+// UserID is user ID
+// Passwd is password
+// Acct is account (can be nil)
+// Local is local filename
+// Remote is Remote filename
+// TransferType is type of transfer (T_* constants)
+Function FTPAppend(Host, UserId, Passwd, Acct, Local, Remote: PChar;
+ Transfertype: Integer): Integer; cdecl;
+
+Function FTPAppend(Host, UserId, Passwd, Acct, Local, Remote: String;
+ Transfertype: Integer): Integer;
+
+Function FTPAppend(Local, Remote: PChar; Transfertype: Integer): Integer;
+Function FTPAppend(Local, Remote: String; Transfertype: Integer): Integer;
+
+Function FTPAppend(Local, Remote: PChar): Integer;
+Function FTPAppend(Local, Remote: String): Integer;
+
+// Deletes files on a remote host
+Function FtpDelete(Host, UserId, Passwd, Acct, Name: PChar): Integer; cdecl;
+
+Function FtpDelete(Host, UserId, Passwd, Acct, Name: String): Integer;
+
+Function FtpDelete(Name: PChar): Integer;
+Function FtpDelete(Name: String): Integer;
+
+// Renames a file on a remote host
+Function FtpRename(Host, UserId, Passwd, Acct, NameFrom, NameTo: PChar): Integer; cdecl;
+
+Function FtpRename(Host, UserId, Passwd, Acct, NameFrom, NameTo: String): Integer;
+
+Function FtpRename(NameFrom, NameTo: PChar): Integer;
+Function FtpRename(NameFrom, NameTo: String): Integer;
+
+// Gets a file from an FTP server
+// Mode is either 'w' for re_w_rite, or 'a' for _a_ppend
+Function FtpGet(Host, UserId, Passwd, Acct, Local, Remote, Mode: PChar; TransferType: integer): Integer; cdecl;
+
+Function FtpGet(Host, UserId, Passwd, Acct, Local, Remote, Mode: String; TransferType: integer): Integer;
+
+Function FtpGet(Local, Remote, Mode: PChar; TransferType: integer): Integer;
+Function FtpGet(Local, Remote, Mode: String; TransferType: integer): Integer;
+
+Function FtpGet(Local, Remote, Mode: PChar): Integer;
+Function FtpGet(Local, Remote, Mode: String): Integer;
+
+// Transfers a file to an FTP server
+Function FtpPut(Host, UserId, Passwd, Acct, Local, Remote: PChar; TransferType: Integer): Integer; cdecl;
+
+Function FtpPut(Host, UserId, Passwd, Acct, Local, Remote: String; TransferType: Integer): Integer;
+
+Function FtpPut(Local, Remote: PChar; TransferType: Integer): Integer;
+Function FtpPut(Local, Remote: String; TransferType: Integer): Integer;
+
+Function FtpPut(Local, Remote: PChar): Integer;
+Function FtpPut(Local, Remote: String): Integer;
+
+// Transfers a file to a host and ensures it is created with a unique name
+Function FtpPutUnique(Host, UserId, Passwd, Acct, Local, Remote: PChar; TransferType: Integer): Integer; cdecl;
+
+Function FtpPutUnique(Host, UserId, Passwd, Acct, Local, Remote: String; TransferType: Integer): Integer;
+
+Function FtpPutUnique(Local, Remote: PChar; TransferType: Integer): Integer;
+Function FtpPutUnique(Local, Remote: String; TransferType: Integer): Integer;
+
+Function FtpPutUnique(Local, Remote: PChar): Integer;
+Function FtpPutUnique(Local, Remote: String): Integer;
+
+// Restarts an aborted transaction from the point of interruption
+Function FtpReStart(Host, UserId, Passwd, Acct, Local, Remote, Mode: PChar; TransferType, Rest: Integer): Longint; cdecl;
+
+Function FtpReStart(Host, UserId, Passwd, Acct, Local, Remote, Mode: String; TransferType, Rest: Integer): Longint;
+
+Function FtpReStart(Local, Remote, Mode: String; TransferType, Rest: Integer): Longint;
+Function FtpReStart(Local, Remote, Mode: String; Rest: Integer): Longint;
+
+
+{****************************************************************************
+
+ Directory Listing Functions
+
+****************************************************************************}
+
+// Gets directory information in short format from a remote host and stores it to a local file
+// You can use named pipes here to avoid a need for creating a real file
+Function FtpLs(Host, Userid, Passwd, Acct, Local, Pattern: PChar): Integer; cdecl;
+
+Function FtpLs(Host, Userid, Passwd, Acct, Local, Pattern: String): Integer;
+
+Function FtpLs(Local, Pattern: String): Integer;
+
+// Gets a directory in wide format from a host and stores it in file Local
+// See comment regarding named pipes above
+Function FtpDir(Host, UserId, Passwd, Acct, Local, Pattern: PChar): Integer; cdecl;
+
+Function FtpDir(Host, Userid, Passwd, Acct, Local, Pattern: String): Integer;
+
+Function FtpDir(Local, Pattern: String): Integer;
+
+
+{****************************************************************************
+
+ Directory Action Functions
+
+****************************************************************************}
+
+// Changes the current working directory on a host
+Function FtpCd(Host, Userid, Passwd, Acct, Dir: PChar): Integer; cdecl;
+
+Function FtpCd(Host, Userid, Passwd, Acct, Dir: String): Integer;
+
+Function FtpCd(Dir: String): Integer;
+
+// Creates a new directory on a target machine
+Function FtpMkd(Host, Userid, Passwd, Acct, Dir: PChar): Integer; cdecl;
+
+Function FtpMkd(Host, Userid, Passwd, Acct, Dir: String): Integer;
+
+Function FtpMkd(Dir: String): Integer;
+
+// Removes a directory on a target machine
+Function FtpRmd(Host, UserId, Passwd, Acct, Dir: PChar): Integer; cdecl;
+
+Function FtpRmd(Host, UserId, Passwd, Acct, Dir: String): Integer;
+
+Function FtpRmd(Dir: String): Integer;
+
+// Stores the string containing the FTP server description of the current
+// working directory on the host to the buffer
+Function FtpPwd(Host, UserId, Passwd, Acct, Buf: PChar; BufLen: Integer): Integer; cdecl;
+
+Function FtpPwd(Host, UserId, Passwd, Acct: String; var Buf: String): Integer;
+
+Function FtpPwd(var Buf: String): Integer;
+
+{****************************************************************************
+
+ Remote Server Functions
+
+****************************************************************************}
+
+// Sends a string to the server verbatim
+Function FtpQuote(Host, UserId, Passwd, Acct, QuoteStr: PChar): Integer; cdecl;
+
+Function FtpQuote(Host, UserId, Passwd, Acct, QuoteStr: String): Integer;
+
+Function FtpQuote(QuoteStr: String): Integer;
+
+// Executes the site command
+Function FtpSite(Host, UserId, Passwd, Acct, SiteStr: PChar): Integer; cdecl;
+
+Function FtpSite(Host, UserId, Passwd, Acct, SiteStr: String): Integer;
+
+Function FtpSite(SiteStr: String): Integer;
+
+// Stores the string containing the FTP server description of the operating
+// system running on the host in a buffer
+Function FtpSys(Host, UserId, Passwd, Acct, Buf: PChar; BufLen: Integer): Integer; cdecl;
+
+Function FtpSys(Host, UserId, Passwd, Acct: String; var Buf: String): Integer;
+
+Function FtpSys(var Buf: String): Integer;
+
+
+// Transfers a file between two remote servers without sending the file to
+// the local host
+Function FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2: PChar; TransferType: Integer): Integer; cdecl;
+
+Function FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2: String; TransferType: Integer): Integer;
+
+Function FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2: String): Integer;
+
+// Resolves a host name and sends a ping to the remote host to determine if the host is responding
+Function FtpPing(Host: PChar; Len: Integer; var Addr: Longint): Integer; cdecl;
+
+Function FtpPing(Host: String; Len: Integer; var Addr: Longint): Integer;
+
+// Sends a ping to the remote host to determine if the host is responding
+Function Ping(Addr: Longint; Len: Integer): Integer; cdecl;
+
+// Returns the size of a file on the remote host
+Function FtpRemSize(Host, UserId, Passwd, Acct, Local, Remote, Mode: Pchar; TransferType: Integer): Longint; cdecl;
+
+Function FtpRemSize(Host, UserId, Passwd, Acct, Local, Remote, Mode: String; TransferType: Integer): Longint;
+
+Function FtpRemSize(Local, Remote, Mode: String; TransferType: Integer): Longint;
+
+Function FtpRemSize(Local, Remote, Mode: String): Longint;
+
+// Maintain the original date/time of files received.
+Function Keep_File_Date(LocalFile, RemoteFile: PChar): Boolean; cdecl;
+
+Function Keep_File_Date(LocalFile, RemoteFile: String): Boolean;
+
+{****************************************************************************
+
+ Trace Functions
+
+****************************************************************************}
+
+
+// Opens the trace file specified and starts tracing
+Function FtpTrcOn(FileSpec: PChar; Mode: Integer): Integer; cdecl;
+
+Function FtpTrcOn(FileSpec: String; Mode: Integer): Integer; cdecl;
+
+// Closes the trace file, and stops tracing of the command and reply sequences that
+// were sent over the control connection between the local and remote hosts
+Function FtpTrcOff: Integer; cdecl;
+
+{****************************************************************************
+
+ Other Functions
+
+****************************************************************************}
+
+// FTP error No
+Function Ftp_ErrNo: Integer; cdecl;
+
+
+(* Undocumented / unimplemented functions:
+Function FtpXLate(Dig: Longint; St:PChar): Longint; cdecl;
+Procedure FtpXferWnd(var _hwnd: HWND); cdecl;
+Procedure FtpSetConvertMode(var code: integer); cdecl;
+Procedure FtpSetEncodeMode(var code: integer); cdecl;
+Procedure FtpSetDecodeMode(var code: integer); cdecl;
+Function FtpSetActiveMode(var UseActiveOnly: integer): integer; cdecl;
+*)
+
+implementation
+
+const
+ FTPAPIDLL = 'FTPAPI';
+
+Function FTPAppend(Host, UserId, Passwd, Acct, Local, Remote: PChar;
+ Transfertype: Integer): Integer; cdecl;
+ external FTPAPIDLL index 1;
+
+Function FTPAppend(Host, UserId, Passwd, Acct, Local, Remote: String;
+ Transfertype: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, Host);
+ StrPCopy(@_UserId, UserId);
+ StrPCopy(@_Passwd, Passwd);
+ StrPCopy(@_Acct, Acct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpAppend:=FtpAppend(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, TransferType);
+End;
+
+Function FTPAppend(Local, Remote: PChar; TransferType: Integer): Integer;
+Var
+ Host, UserId, Passwd, Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@Host, ShortHost);
+ StrPCopy(@UserId, ShortUserId);
+ StrPCopy(@Passwd, ShortPasswd);
+ StrPCopy(@Acct, ShortAcct);
+ FtpAppend:=FtpAppend(@Host, @UserId, @Passwd, @Acct, Local, Remote, TransferType);
+End;
+
+Function FTPAppend(Local, Remote: PChar): Integer;
+Begin
+ FtpAppend:=FtpAppend(Local, Remote, ShortTransferType);
+End;
+
+Function FTPAppend(Local, Remote: String; TransferType: Integer): Integer;
+Var
+ _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpAppend:=FtpAppend(@_Local, @_Remote, TransferType);
+End;
+
+Function FTPAppend(Local, Remote: String): Integer;
+Var
+ _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpAppend:=FtpAppend(@_Local, @_Remote);
+End;
+
+Function FtpCd(Host, Userid, Passwd, Acct, Dir: PChar): Integer; cdecl;
+ external FTPAPIDLL index 2;
+
+Function FtpCd(Host, Userid, Passwd, Acct, Dir: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Dir: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_Dir, Length(Dir)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_Dir, Dir);
+ FtpCd:=FtpCd(_Host, _Userid, _Passwd, _Acct, _Dir);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_Dir, Length(Dir)+1);
+End;
+
+Function FtpCd(Dir: String): Integer;
+Begin
+ FtpCd:=FtpCd(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Dir);
+End;
+
+Function FtpDelete(Host, UserId, Passwd, Acct, Name: PChar): Integer; cdecl;
+ external FTPAPIDLL index 3;
+
+Function FtpDelete(Host, UserId, Passwd, Acct, Name: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Name: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, Host);
+ StrPCopy(@_UserId, UserId);
+ StrPCopy(@_Passwd, Passwd);
+ StrPCopy(@_Acct, Acct);
+ StrPCopy(@_Name, Name);
+ FtpDelete:=FtpDelete(@_Host, @_UserId, @_Passwd, @_Acct, @_Name);
+End;
+
+Function FtpDelete(Name: PChar): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpDelete:=FtpDelete(@_Host, @_UserId, @_Passwd, @_Acct, Name);
+End;
+
+Function FtpDelete(Name: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Name: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Name, Name);
+ FtpDelete:=FtpDelete(@_Host, @_UserId, @_Passwd, @_Acct, @_Name);
+End;
+
+Function FtpDir(Host, UserId, Passwd, Acct, Local, Pattern: PChar): Integer; cdecl;
+ external FTPAPIDLL index 4;
+
+Function FtpDir(Host, Userid, Passwd, Acct, Local, Pattern: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Pattern: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_Local, Length(Local)+1);
+ GetMem(_Pattern, Length(Pattern)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_Local, Local);
+ StrPCopy(_Pattern, Pattern);
+ FtpDir:=FtpDir(_Host, _Userid, _Passwd, _Acct, _Local, _Pattern);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_Local, Length(Local)+1);
+ FreeMem(_Pattern, Length(Pattern)+1);
+End;
+
+Function FtpDir(Local, Pattern: String): Integer;
+Begin
+ FtpDir:=FtpDir(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Local, Pattern);
+End;
+
+Function FtpLs(Host, Userid, Passwd, Acct, Local, Pattern: PChar): Integer; cdecl;
+ external FTPAPIDLL index 7;
+
+Function FtpLs(Host, Userid, Passwd, Acct, Local, Pattern: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Pattern: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_Local, Length(Local)+1);
+ GetMem(_Pattern, Length(Pattern)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_Local, Local);
+ StrPCopy(_Pattern, Pattern);
+ FtpLs:=FtpLs(_Host, _Userid, _Passwd, _Acct, _Local, _Pattern);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_Local, Length(Local)+1);
+ FreeMem(_Pattern, Length(Pattern)+1);
+End;
+
+Function FtpLs(Local, Pattern: String): Integer;
+Begin
+ FtpLs:=FtpLs(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Local, Pattern);
+End;
+
+Function FtpGet(Host, UserId, Passwd, Acct, Local, Remote, Mode: PChar; TransferType: integer): Integer; cdecl;
+ external FTPAPIDLL index 5;
+
+Function FtpGet(Host, UserId, Passwd, Acct, Local, Remote, Mode: String; TransferType: integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote, _Mode: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, Host);
+ StrPCopy(@_UserId, UserId);
+ StrPCopy(@_Passwd, Passwd);
+ StrPCopy(@_Acct, Acct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ StrPCopy(@_Mode, Mode);
+ FtpGet:=FtpGet(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, @_Mode, TransferType);
+End;
+
+Function FtpGet(Local, Remote, Mode: PChar; TransferType: integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpGet:=FtpGet(@_Host, @_UserId, @_Passwd, @_Acct, Local, Remote, Mode, TransferType);
+End;
+
+Function FtpGet(Local, Remote, Mode: String; TransferType: integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote, _Mode: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ StrPCopy(@_Mode, Mode);
+ FtpGet:=FtpGet(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, @_Mode, TransferType);
+End;
+
+Function FtpGet(Local, Remote, Mode: PChar): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpGet:=FtpGet(@_Host, @_UserId, @_Passwd, @_Acct, Local, Remote, Mode, ShortTransferType);
+End;
+
+Function FtpGet(Local, Remote, Mode: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote, _Mode: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ StrPCopy(@_Mode, Mode);
+ FtpGet:=FtpGet(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, @_Mode, ShortTransferType);
+End;
+
+Procedure FtpLogoff; cdecl;
+ external FTPAPIDLL index 6;
+
+Function FtpMkd(Host, Userid, Passwd, Acct, Dir: PChar): Integer; cdecl;
+ external FTPAPIDLL index 8;
+
+Function FtpMkD(Host, Userid, Passwd, Acct, Dir: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Dir: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_Dir, Length(Dir)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_Dir, Dir);
+ FtpMkD:=FtpMkD(_Host, _Userid, _Passwd, _Acct, _Dir);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_Dir, Length(Dir)+1);
+End;
+
+Function FtpMkD(Dir: String): Integer;
+Begin
+ FtpMkD:=FtpMkD(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Dir);
+End;
+
+Function FtpPing(Host: PChar; Len: Integer; var Addr: Longint): Integer; cdecl;
+ external FTPAPIDLL index 9;
+
+Function FtpPing(Host: String; Len: Integer; var Addr: Longint): Integer;
+var
+ _Host: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ StrPCopy(_Host, Host);
+ FtpPing:=FtpPing(_Host, Len, Addr);
+ FreeMem(_Host, Length(Host)+1);
+End;
+
+Function FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2: PChar; TransferType: Integer): Integer; cdecl;
+ external FTPAPIDLL index 10;
+
+Function FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2: String; TransferType: Integer): Integer;
+Begin
+ Host1:=Host2+#0;
+ Host2:=Host2+#0;
+ UserId1:=UserId1+#0;
+ UserId2:=UserId2+#0;
+ Passwd1:=Passwd1+#0;
+ Passwd2:=Passwd2+#0;
+ Acct1:=Acct1+#0;
+ Acct2:=Acct2+#0;
+ FN1:=FN1+#0;
+ FN2:=FN2+#0;
+ FtpProxy:=FtpProxy(@Host1[1], @UserId1[1], @Passwd1[1], @Acct1[1],
+ @Host2[1], @UserId2[1], @Passwd2[1], @Acct2[1],
+ @FN1[1], @FN2[1], TransferType);
+End;
+
+Function FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2: String): Integer;
+Begin
+ FtpProxy:=FtpProxy(Host1, UserId1, Passwd1, Acct1,
+ Host2, UserId2, Passwd2, Acct2,
+ FN1, FN2, ShortTransferType);
+End;
+
+Function FtpPut(Host, UserId, Passwd, Acct, Local, Remote: PChar; TransferType: Integer): Integer; cdecl;
+ external FTPAPIDLL index 11;
+
+Function FtpPut(Host, UserId, Passwd, Acct, Local, Remote: String; TransferType: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, Host);
+ StrPCopy(@_UserId, UserId);
+ StrPCopy(@_Passwd, Passwd);
+ StrPCopy(@_Acct, Acct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpPut:=FtpPut(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, TransferType);
+End;
+
+Function FtpPut(Local, Remote: PChar; TransferType: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpPut:=FtpPut(@_Host, @_UserId, @_Passwd, @_Acct, Local, Remote, TransferType);
+End;
+
+Function FtpPut(Local, Remote: String; TransferType: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpPut:=FtpPut(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, TransferType);
+End;
+
+Function FtpPut(Local, Remote: PChar): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpPut:=FtpPut(@_Host, @_UserId, @_Passwd, @_Acct, Local, Remote, ShortTransferType);
+End;
+
+Function FtpPut(Local, Remote: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpPut:=FtpPut(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, ShortTransferType);
+End;
+
+Function FtpPutUnique(Host, UserId, Passwd, Acct, Local, Remote: PChar; TransferType: Integer): Integer; cdecl;
+ external FTPAPIDLL index 12;
+
+Function FtpPutUnique(Host, UserId, Passwd, Acct, Local, Remote: String; TransferType: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, Host);
+ StrPCopy(@_UserId, UserId);
+ StrPCopy(@_Passwd, Passwd);
+ StrPCopy(@_Acct, Acct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpPutUnique:=FtpPutUnique(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, TransferType);
+End;
+
+Function FtpPutUnique(Local, Remote: PChar; TransferType: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpPutUnique:=FtpPutUnique(@_Host, @_UserId, @_Passwd, @_Acct, Local, Remote, TransferType);
+End;
+
+Function FtpPutUnique(Local, Remote: String; TransferType: Integer): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpPutUnique:=FtpPutUnique(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, TransferType);
+End;
+
+Function FtpPutUnique(Local, Remote: PChar): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpPutUnique:=FtpPutUnique(@_Host, @_UserId, @_Passwd, @_Acct, Local, Remote, ShortTransferType);
+End;
+
+Function FtpPutUnique(Local, Remote: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_Local, Local);
+ StrPCopy(@_Remote, Remote);
+ FtpPutUnique:=FtpPutUnique(@_Host, @_UserId, @_Passwd, @_Acct, @_Local, @_Remote, ShortTransferType);
+End;
+
+Function FtpPwd(Host, UserId, Passwd, Acct, Buf: PChar; BufLen: Integer): Integer; cdecl;
+ external FTPAPIDLL index 13;
+
+Function FtpPwd(Host, UserId, Passwd, Acct: String; var Buf: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: PChar;
+ _Buf: Array[0..255] of Char;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ FtpPwd:=FtpPwd(_Host, _UserId, _Passwd, _Acct, @_Buf, SizeOf(_Buf));
+ Buf:=StrPas(@_Buf);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+End;
+
+Function FtpPwd(var Buf: String): Integer;
+Begin
+ FtpPwd:=FtpPwd(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Buf);
+End;
+
+
+Function FtpQuote(Host, UserId, Passwd, Acct, QuoteStr: PChar): Integer; cdecl;
+ external FTPAPIDLL index 14;
+
+Function FtpQuote(Host, UserId, Passwd, Acct, QuoteStr: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _QuoteStr: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_QuoteStr, Length(QuoteStr)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_QuoteStr, QuoteStr);
+ FtpQuote:=FtpQuote(_Host, _UserId, _Passwd, _Acct, _QuoteStr);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_QuoteStr, Length(QuoteStr)+1);
+End;
+
+Function FtpQuote(QuoteStr: String): Integer;
+Begin
+ FtpQuote:=FtpQuote(ShortHost, ShortUserId, ShortPasswd, ShortAcct, QuoteStr);
+End;
+
+Function FtpRename(Host, UserId, Passwd, Acct, NameFrom, NameTo: PChar): Integer; cdecl;
+ external FTPAPIDLL index 15;
+
+Function FtpRename(Host, UserId, Passwd, Acct, NameFrom, NameTo: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _NameFrom, _NameTo: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, Host);
+ StrPCopy(@_UserId, UserId);
+ StrPCopy(@_Passwd, Passwd);
+ StrPCopy(@_Acct, Acct);
+ StrPCopy(@_NameTo, NameTo);
+ StrPCopy(@_NameFrom, NameFrom);
+ FtpRename:=FtpRename(@_Host, @_UserId, @_Passwd, @_Acct, @_NameFrom, @_NameTo);
+End;
+
+Function FtpRename(NameFrom, NameTo: PChar): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ FtpRename:=FtpRename(@_Host, @_UserId, @_Passwd, @_Acct, NameFrom, NameTo);
+End;
+
+Function FtpRename(NameFrom, NameTo: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _NameFrom, _NameTo: Array[0..255] of Char;
+Begin
+ StrPCopy(@_Host, ShortHost);
+ StrPCopy(@_UserId, ShortUserId);
+ StrPCopy(@_Passwd, ShortPasswd);
+ StrPCopy(@_Acct, ShortAcct);
+ StrPCopy(@_NameTo, NameTo);
+ StrPCopy(@_NameFrom, NameFrom);
+ FtpRename:=FtpRename(@_Host, @_UserId, @_Passwd, @_Acct, @_NameFrom, @_NameTo);
+End;
+
+Function FtpRmd(Host, UserId, Passwd, Acct, Dir: PChar): Integer; cdecl;
+ external FTPAPIDLL index 16;
+
+Function FtpRmD(Host, Userid, Passwd, Acct, Dir: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Dir: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_Dir, Length(Dir)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_Dir, Dir);
+ FtpRmD:=FtpRmD(_Host, _Userid, _Passwd, _Acct, _Dir);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_Dir, Length(Dir)+1);
+End;
+
+Function FtpRmD(Dir: String): Integer;
+Begin
+ FtpRmD:=FtpRmD(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Dir);
+End;
+
+Function FtpSite(Host, UserId, Passwd, Acct, SiteStr: PChar): Integer; cdecl;
+ external FTPAPIDLL index 17;
+
+Function FtpSite(Host, UserId, Passwd, Acct, SiteStr: String): Integer;
+Var
+ _Host, _UserId, _Passwd, _Acct, _SiteStr: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_SiteStr, Length(SiteStr)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_SiteStr, SiteStr);
+ FtpSite:=FtpSite(_Host, _Userid, _Passwd, _Acct, _SiteStr);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_SiteStr, Length(SiteStr)+1);
+End;
+
+Function FtpSite(SiteStr: String): Integer;
+Begin
+ FtpSite:=FtpSite(ShortHost, ShortUserid, ShortPasswd, ShortAcct, SiteStr);
+End;
+
+Function FtpSys(Host, UserId, Passwd, Acct, Buf: PChar; BufLen: Integer): Integer; cdecl;
+ external FTPAPIDLL index 18;
+
+Function FtpSys(Host, UserId, Passwd, Acct: String; var Buf: String): Integer;
+var
+ _Buf: Array[0..255] of char;
+Begin
+ Host:=Host+#0;
+ UserId:=UserId+#0;
+ Passwd:=Passwd+#0;
+ Acct:=Acct+#0;
+ FtpSys:=FtpSys(@Host[1], @UserId[1], @Passwd[1], @Acct[1], @_Buf, SizeOf(Buf));
+ Buf:=StrPas(@_Buf);
+End;
+
+Function FtpSys(var Buf: String): Integer;
+Begin
+ FtpSys:=FtpSys(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Buf);
+End;
+
+Function Ping(Addr: Longint; Len: Integer): Integer; cdecl;
+ external FTPAPIDLL index 19;
+
+Function Ftp_ErrNo: Integer; cdecl;
+ external FTPAPIDLL index 21;
+
+Function FtpVer(var Buf; BufLen: Integer): Integer; cdecl;
+ external FTPAPIDLL index 23;
+
+Function FtpVer(var Buf: String): Integer;
+var
+ T:array[0..255] of char;
+begin
+ FtpVer:=FtpVer(T, SizeOf(T));
+ Buf:=StrPas(T);
+end;
+
+Function FtpTrcOn(FileSpec: PChar; Mode: Integer): Integer; cdecl;
+ external FTPAPIDLL index 24;
+
+Function FtpTrcOn(FileSpec: String; Mode: Integer): Integer; cdecl;
+Begin
+ FileSpec:=FileSpec+#0;
+ FtpTrcOn:=FtpTrcOn(@FileSpec[1], Mode);
+End;
+
+Function FtpTrcOff: Integer; cdecl;
+ external FTPAPIDLL index 25;
+
+Function Keep_File_Date(LocalFile, RemoteFile: PChar): Boolean; cdecl;
+ external FTPAPIDLL index 30;
+
+Function Keep_File_Date(LocalFile, RemoteFile: String): Boolean;
+Begin
+ LocalFile:=LocalFile+#0;
+ RemoteFile:=RemoteFile+#0;
+ Keep_File_Date:=Keep_File_Date(@LocalFile[1], @RemoteFile[1]);
+End;
+
+Function FtpReStart(Host, UserId, Passwd, Acct, Local, Remote, Mode: PChar; TransferType, Rest: Integer): Longint; cdecl;
+ external FTPAPIDLL index 31;
+
+Function FtpReStart(Host, UserId, Passwd, Acct, Local, Remote, Mode: String; TransferType, Rest: Integer): Longint;
+Var
+ _Host, _UserId, _Passwd, _Acct, _Local, _Remote, _Mode: PChar;
+Begin
+ GetMem(_Host, Length(Host)+1);
+ GetMem(_UserId, Length(UserId)+1);
+ GetMem(_Passwd, Length(Passwd)+1);
+ GetMem(_Acct, Length(Acct)+1);
+ GetMem(_Local, Length(Local)+1);
+ GetMem(_Remote, Length(Remote)+1);
+ GetMem(_Mode, Length(Mode)+1);
+ StrPCopy(_Host, Host);
+ StrPCopy(_UserId, UserId);
+ StrPCopy(_Passwd, Passwd);
+ StrPCopy(_Acct, Acct);
+ StrPCopy(_Local, Local);
+ StrPCopy(_Remote, Remote);
+ StrPCopy(_Mode, Mode);
+ FtpReStart:=FtpReStart(_Host, _UserId, _Passwd, _Acct, _Local, _Remote, _Mode, TransferType, Rest);
+ FreeMem(_Host, Length(Host)+1);
+ FreeMem(_UserId, Length(UserId)+1);
+ FreeMem(_Passwd, Length(Passwd)+1);
+ FreeMem(_Acct, Length(Acct)+1);
+ FreeMem(_Local, Length(Local)+1);
+ FreeMem(_Remote, Length(Remote)+1);
+ FreeMem(_Mode, Length(Mode)+1);
+End;
+
+Function FtpReStart(Local, Remote, Mode: String; TransferType, Rest: Integer): Longint;
+Begin
+ FtpReStart:=FtpReStart(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Local, Remote, Mode, TransferType, Rest);
+End;
+
+Function FtpReStart(Local, Remote, Mode: String; Rest: Integer): Longint;
+Begin
+ FtpReStart:=FtpReStart(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Local, Remote, Mode, ShortTransferType, Rest);
+End;
+
+Function FtpRemSize(Host, UserId, Passwd, Acct, Local, Remote, Mode: Pchar; TransferType: Integer): Longint; cdecl;
+ external FTPAPIDLL index 32;
+
+Function FtpRemSize(Host, UserId, Passwd, Acct, Local, Remote, Mode: String; TransferType: Integer): Longint;
+Begin
+ Host:=Host+#0;
+ UserId:=UserId+#0;
+ Passwd:=Passwd+#0;
+ Acct:=Acct+#0;
+ Local:=Local+#0;
+ Remote:=Remote+#0;
+ Mode:=Mode+#0;
+ FtpRemSize:=FtpRemSize(@Host[1], @UserId[1], @Passwd[1], @Acct[1], @Local[1], @Remote[1], @Mode[1], TransferType);
+End;
+
+Function FtpRemSize(Local, Remote, Mode: String; TransferType: Integer): Longint;
+Begin
+ FtpRemSize:=FtpRemSize(ShortHost, ShortUserId, ShortPasswd, ShortAcct, Local, Remote, Mode, TransferType);
+End;
+
+Function FtpRemSize(Local, Remote, Mode: String): Longint;
+Begin
+ FtpRemSize:=FtpRemSize(Local, Remote, Mode, ShortTransferType);
+End;
+
+Function FtpSetUser(Host, UserId, Passwd, Acct: String): Integer;
+Begin
+ ShortHost:=Host;
+ ShortUserId:=UserId;
+ ShortPasswd:=Passwd;
+ ShortAcct:=Acct;
+ FtpSetUser:=0;
+ If (Host='') or (UserId='') then FtpSetUser:=-1;
+End;
+
+Function FtpSetBinary(TransferType: Integer): Integer;
+Begin
+ ShortTransferType:=TransferType;
+ FtpSetBinary:=0;
+End;
+
+(* Undocumented functions follow
+Function FtpXLate(Dig: Longint; St:PChar): Longint; cdecl;
+ external FTPAPIDLL index 22;
+Procedure FtpXferWnd(var _hwnd: HWND); cdecl; external FTPAPIDLL index 26;
+Procedure FtpSetConvertMode(var code: integer); cdecl;
+ external FTPAPIDLL index 27;
+Procedure FtpSetEncodeMode(var code: integer); cdecl;
+ external FTPAPIDLL index 28;
+Procedure FtpSetDecodeMode(var code: integer); cdecl;
+ external FTPAPIDLL index 29;
+
+Absolutely no information about following functions:
+
+var FtpErrNo: integer; cdecl; external FTPAPIDLL index 20; // seems to be a copy of ftp_errno
+//³ 00033 ³ FTPQUOTEREPLY // Seems to be direct command send (reply to ftpquote)
+//³ 00034 ³ FtpSetActiveMode
+
+*)
+
+End.
diff --git a/packages/os2units/src/hwvideo.pas b/packages/os2units/src/hwvideo.pas
new file mode 100644
index 0000000000..9c2d1ad501
--- /dev/null
+++ b/packages/os2units/src/hwvideo.pas
@@ -0,0 +1,214 @@
+{
+ Copyright (c) 1991, 1992, 1993 International Business Machines Corporation
+ Copyright (c) 2002 by Valery Gaynullin
+ Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ This is Video Acceleration Interface
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(Video Acceleration Interface)
+@author(Valery Gaynullin)
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(29 Nov 2002)
+@lastmod(19 Jan 2003)
+This is Video Acceleration Interface.
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+
+Unit HWVideo;
+
+Interface
+
+Uses
+ Os2Def,
+ PMWin,
+ PMGpi;
+
+// GRADD function class
+Const
+ VA2_FUNCTION_CLASS='Video Acceleration 2';
+
+Type
+ THWVIDEOCAPS=record
+ ulLength: Cardinal;
+ ulCapsFlags: Cardinal; //flags, describing HW capability
+ szlSrcMax: SIZEL; //maximum source size (pixels)
+ rctlDstMargin: RECTL; //destination rectangle margins
+ fccDstColor: Cardinal; //screen FOURCC
+ ulScanAlign: Cardinal; //requered scanline aligment-1
+ ulNumColors: Cardinal; //count of supported source FOURCC
+ fccColorType: ^Cardinal; //array of supported FOURCC
+ ulAttrCount: Cardinal; //count of viewport attributes
+ end;
+ PHWVIDEOCAPS=^THWVIDEOCAPS;
+
+//ulCapsFlag defines
+Const
+ HWVIDEOCAPS_MINIFY = $00000001; //Chip can perform downscaling
+ HWVIDEOCAPS_FILTER = $00000002; //Image filtering present
+ HWVIDEOCAPS_NONINTEGER_SCALE = $00000004; //allow scale to noninteger ratio
+ HWVIDEOCAPS_COLOR_KEYING = $00000008; //allow color keying
+ HWVIDEOCAPS_OVERLAY = $00000010; //overlay-type HW
+ HWVIDEOCAPS_SEPARATE_OUT = $00000020; //used separate output connector (like TV out)
+ HWVIDEOCAPS_DECODE = $00000040; //support non-RAW data
+ HWVIDEOCAPS_NEEDPROTECT = $00000080; //HW need to lock VRAM
+
+Type
+ THWATTRIBUTE=record
+ ulLength: Cardinal; //size of structure in bytes
+ szAttrDesc: Array[0..64] of Char; //string, describing attribute
+ ulAttrType: Cardinal; //type of attribute, check ATTRTYPE_* const
+ ulValueSize: Cardinal; //size in bytes of each value member
+ ulValueCount: Cardinal; //count of value members
+ pValueList: Pointer; //list of supported values
+ ulCurrentValue: Cardinal; //current value
+ ulDefaultValue: Cardinal; //default value
+ ulAttribFlags: Cardinal; //flags to define some additional properties
+ end;
+ PHWATTRIBUTE=^THWATTRIBUTE;
+
+//types of attributes.
+// if ATTRTYPE_BOOLEAN, ATTRTYPE_STATICTEXT or ATTRTYPE_BYTE,
+// ulValueCount & ulValueSize undefined,
+// pValueList can be NULL,
+// else this must be actual value of allocated chunk of memory.
+
+Const
+ //attribute of ON/OFF type
+ ATTRTYPE_BOOLEAN = 1;
+ //attribute can be member of set string type
+ ATTRTYPE_AGGREGATE_STRING = 2;
+ //attribute have no value - this is static text string
+ ATTRTYPE_STATICTEXT = 3;
+ //attribute can be any value in 0..255 margins
+ ATTRTYPE_BYTE = 4;
+
+
+//defines for ulAttribFlags field
+//changing this attribute affect HW capability, so application
+//must re-read Caps after changing value of this attribute
+//application must not assume preserving any capability when this
+//attribute was changed
+ ATTRIB_CHANGE_CAPS = 1;
+
+//some common attribute names
+Const
+ ATTRIBUTE_BRIGHTNESS = 'Brightness';
+ ATTRIBUTE_CONTRAST = 'Contrast';
+ ATTRIBUTE_SATURATION = 'Saturation';
+ ATTRIBUTE_HUE = 'Hue';
+ ATTRIBUTE_FILTERING = 'Filtering';
+ ATTRIBUTE_TVOUT = 'Output to TV';
+ ATTRIBUTE_COLORKEY = 'Color Keying';
+
+Type
+ THWVIDEOSETUP=record
+ ulLength: Cardinal;
+ rctlDstRect: RECTL; //destination screen rectangle
+ szlSrcSize: SIZEL; //source image size
+ ulSrcPitch: Cardinal; //byte offset between image rows
+ fccColor: Cardinal; //image format
+ ulKeyColor: Cardinal; //color key
+ rctlSrcRect: RECTL;
+ end;
+ PHWVIDEOSETUP=^THWVIDEOSETUP;
+
+//return codes
+Const
+ //no error
+ HWVIDEO_DONE = 0;
+ //unspecified error
+ HWVIDEO_ERROR = 3;
+ //FS session active, accelerator not available
+ HWVIDEO_ERROR_BACKGROUND = 4;
+ //HW not available
+ HWVIDEO_ERROR_NO_HW = 6;
+ //incorrect parameter
+ HWVIDEO_ERROR_PARAMETER = 7;
+ //to low offscreen VRAM to handle setup
+ HWVIDEO_ERROR_LOW_VRAM = 8;
+ //HW already in use
+ HWVIDEO_ERROR_USED = 9;
+
+//Init HWVideo subsystem
+//check for presence and avilability of accelerated HW, if present and
+//available - lock it for this process.
+Function HWVIDEOInit: Cardinal; cdecl;
+
+//Get HW capability
+//return filled structure. When called, ulNumColors must be
+//set to actual allocated size of fccColorType array.
+//if call returned with error, then need to check returned
+//ulNumColors, allocate larger space and call again.
+Function HWVIDEOCaps(pCaps: PHWVIDEOCAPS): Cardinal; cdecl;
+
+//Set HWVideo viewport
+//Check HW capability to handle this setup, allocate buffers.
+//one special case: pSetup==NULL - disable video and free all
+//buffers
+Function HWVIDEOSetup(pSetup: PHWVIDEOSETUP): Cardinal; cdecl;
+
+//Get HWVideo buffer pointer
+//return linear pointer to overlay buffer and it's physical address
+Function HWVIDEOBeginUpdate(var ppBuffer: Pointer; var pulPhysBuffer: Cardinal): Cardinal; cdecl;
+
+//Display HWVideo buffer
+//set pending state for last accessed videobuffer, switch
+//buffers on next VSYNC
+Function HWVIDEOEndUpdate: Cardinal; cdecl;
+
+//Get current HW attributes
+//0<=ulAttribNum<pCaps->ulAttrCount, else error returned.
+Function HWVIDEOGetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
+
+//Set new attribute value
+//0<=ulAttribNum<pCaps.ulAttrCount, else error returned.
+//pAttrib->ulCurrentValue filled with new value
+Function HWVIDEOSetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
+
+//Close HWVideo
+Function HWVIDEOClose: Cardinal; cdecl;
+
+Implementation
+
+Function HWVIDEOInit: Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOInit';
+
+Function HWVIDEOCaps(pCaps: PHWVIDEOCAPS): Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOCaps';
+
+Function HWVIDEOSetup(pSetup: PHWVIDEOSETUP): Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOSetup';
+
+Function HWVIDEOBeginUpdate(var ppBuffer: Pointer; var pulPhysBuffer: Cardinal): Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOBeginUpdate';
+
+Function HWVIDEOEndUpdate: Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOEndUpdate';
+
+Function HWVIDEOGetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOGetAttrib';
+
+Function HWVIDEOSetAttrib(ulAttribNum: Cardinal; pAttrib: PHWATTRIBUTE): Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOSetAttrib';
+
+Function HWVIDEOClose: Cardinal; cdecl;
+ external 'hwvideo' name 'HWVIDEOClose';
+
+End.
diff --git a/packages/os2units/src/lvm.pas b/packages/os2units/src/lvm.pas
new file mode 100644
index 0000000000..7f284494f3
--- /dev/null
+++ b/packages/os2units/src/lvm.pas
@@ -0,0 +1,5232 @@
+{
+ Copyright (c) International Business Machines Corp., 2000
+ Copyright (c) 2003 Yuri Prokushev
+
+ This module defines the interface to LVM.DLL, which is the
+ engine that performs all of the disk partitioning/volume
+ creation work.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+}
+Unit LVM;
+
+{$PACKRECORDS C}
+
+Interface
+
+{$ifdef os2}
+ {$define lvm1}
+{$endif}
+
+{$ifdef linux}
+ {$define lvm2}
+{$endif}
+
+// The number of bytes in a sector on the disk.
+const
+ BYTES_PER_SECTOR=512;
+
+//The maximum number of cylinders, heads, and sectors that a partition table entry can accomodate.
+//Cylinders are numbered 0 - 1023, for a maximum of 1024 cylinders.
+//eads are numbered 0 - 255, for a maximum of 256 heads.
+//Sectors are numbered 1 - 63, for a maximum of 63 sectors per track.
+const
+ MAX_CYLINDERS= 1024;
+ MAX_HEADS = 256;
+ MAX_SECTORS = 63;
+
+// The following define the values used to indicate that a partition table entry is for an EBR, not a partition.
+const
+ EBR_BOOT_INDICATOR = 0;
+ EBR_FORMAT_INDICATOR = 5;
+
+// The following define is used as the default Format_Indicator for new non-primary partitions.
+const
+ NEW_LOGICAL_DRIVE_FORMAT_INDICATOR = $6;
+
+// The following define is used as the default Format_Indicator for a new non-active primary partitions.
+const
+ NEW_PRIMARY_PARTITION_FORMAT_INDICATOR = $16;
+
+// The following define is used as the default Format_Indicator for a new active primary partition.
+const
+ NEW_ACTIVE_PRIMARY_PARTITION_FORMAT_INDICATOR = $06;
+
+// The following define is used to hold the value of the Boot_Indicator for active partitions.
+const
+ ACTIVE_PARTITION = $80;
+
+// Define the size of a Partition Name. Partition Names are user defined names given to a partition.
+const
+ PARTITION_NAME_SIZE = 20;
+
+// Define the size of a volume name. Volume Names are user defined names given to a volume.
+const
+ VOLUME_NAME_SIZE = 20;
+
+// Define the size of a disk name. Disk Names are user defined names given to physical disk drives in the system.
+const
+ DISK_NAME_SIZE = 20;
+
+// The name of the filesystem in use on a partition. This name may be up to 12 ( + NULL terminator) characters long.
+const
+ FILESYSTEM_NAME_SIZE = 20;
+
+// The comment field is reserved but is not currently used. This is for future expansion and use.
+const
+ COMMENT_SIZE = 81;
+
+// Define the minimum number of sectors to reserve on the disk for Boot Manager.
+const
+ BOOT_MANAGER_SIZE = 2048;
+
+// An INTEGER number is a whole number, either + or -.
+//The number appended to the INTEGER key word indicates the number of bits
+//used to represent an INTEGER of that type.
+type
+ INTEGER16=SmallInt;
+ INTEGER32=LongInt;
+ INTEGER=LongInt;
+
+// A CARDINAL number is a positive integer >= 0.
+//The number appended to the CARDINAL key word indicates the number of bits
+//used to represent a CARDINAL of that type.
+type
+ CARDINAL16=Word;
+ CARDINAL32 = Cardinal;
+
+(*
+/* A REAL number is a floating point number. */
+typedef float REAL32;
+typedef double REAL64;
+*)
+ REAL32 = double;
+ REAL64 = double;
+
+
+// An ADDRESS variable is one which holds an address. The address can contain
+//anything, or even be invalid. It is just an address which is presumed to
+//hold some kind of data.
+Type
+ ADDRESS=Pointer;
+
+Type
+ pSTRING=PChar;
+
+// 4 bytes
+Type
+ DoubleWord=Cardinal;
+
+//* The following types are used in the declaration of disk structures. Disk structures
+//have a defined size and internal structure which must be matched exactly. */
+
+//* 8 bytes. */
+type
+ QuadWord=QWord;
+
+// The following types are used internally by LVM. */
+
+// Define a Partition Sector Number. A Partition Sector Number is relative to the start of a partition.
+//The first sector in a partition is PSN 0.
+type
+ PSN=Cardinal;
+
+// Define a Logical Sector Number. A Logical Sector Number is relative to the start of a volume.
+//The first sector in a volume is LSN 0.
+type
+ LSN=Cardinal;
+
+// Define a Logical Block Address. A Logical Block Address is relative to the start of a
+//physical device - a disk drive. The first sector on a disk drive is LBA 0.
+type
+ LBA=Cardinal;
+
+// The following define sets the maximum number of LVM classes for which structures and storage will be reserved.
+const
+ MAXIMUM_LVM_CLASSES = 3;
+
+// The following enum defines the various LVM classes to which a "feature" may belong.
+// An LVM Plugin is used to implement a "feature", so "plugin" and "feature" are really synonyms.
+
+type
+ _LVM_Classes = (
+ Partition_Class, // For "features" which must operate on a partition level - i.e. Bad Block Relocation.
+ Aggregate_Class, // For "features" which combine partitions into a single logical entity - i.e. Drive Linking.
+ Volume_Class // For "features" which operate best on a volume level - i.e. encryption, mirroring etc.
+ );
+ LVM_Classes = _LVM_Classes;
+
+
+// An LVM plugin may belong to one or more classes. For each class to which it belongs, certain attributes must be defined.
+//This structure tracks those attributes for a class.
+type
+ _LVM_Class_Attributes=record
+ ClassMember: BOOLEAN; // TRUE if a member of this class, FALSE otherwise.
+ GlobalExclusive: BOOLEAN; // TRUE if this plugin can not work with any other plugin - i.e. it
+//must be the only "feature" on the volume, besides the built in feature of BBR.
+ TopExclusive: BOOLEAN; // TRUE if this plugin must be the topmost plugin in this class.
+ BottomExclusive: BOOLEAN; // TRUE if this plugin must be the bottommost plugin in this class.
+ ClassExclusive: BOOLEAN; // TRUE if this plugin will not work with any other plugin in this class.
+ Weight_Factor: CARDINAL32; // A value between 1 and 100 which is used to guide the LVM interfaces when attempting to
+//establish a default ordering for plugins within this class. A value of 1
+//indicates that this plugin wants to be as close to the bottom of the plugins
+//in this class as possible. A value of 100 means that this plugin wants to
+//be as close to being the topmost plugin in this class as possible. This value
+//is only used if none of the "exclusive" flags are set.
+ end;
+ LVM_Class_Attributes=_LVM_Class_Attributes;
+
+// The following enum specifies the interface types that LVM supports, and hence any plugin must support.
+ _LVM_Interface_Types= (
+ PM_Interface,
+ VIO_Interface, // LVM.EXE is a VIO app. since it is used during install, and during recovery scenarios where PM/Java may not be available.
+ Java_Interface // The LVM GUI is written in Java.
+ );
+ LVM_Interface_Types=_LVM_Interface_Types;
+
+const
+ MAXIMUM_LVM_INTERFACE_TYPES = 3;
+
+
+//* The following structures define what functions must be supported for each interface type.
+type
+ PADDRESS=^ADDRESS;
+ PCARDINAL32=^CARDINAL32;
+
+ _LVM_OS2_Native_Support=record
+//void (* _System Create_and_Configure) ( CARDINAL32 ID, ADDRESS InputBuffer, CARDINAL32 InputBufferSize, ADDRESS * OutputBuffer, CARDINAL32 * OutputBufferSize, CARDINAL32 * Error_Code);
+ Create_and_Configure: procedure(ID: CARDINAL32; InputBuffer: ADDRESS; InputBufferSize: CARDINAL32; OutputBuffer: PADDRESS; OutputBufferSize: PCARDINAL32; Error_Code: PCARDINAL32);
+//void (* _System Display_Status) ( ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
+ Display_Status: procedure(Volume_Handle: ADDRESS; Error_Code: PCARDINAL32 );
+//void (* _System Control_Panel) (ADDRESS Volume_Handle, CARDINAL32 * Error_Code );
+ Control_Panel: procedure(Volume_Handle: ADDRESS; Error_Code: PCARDINAL32 );
+//void (* _System Help_Panel) (CARDINAL32 Help_Index, CARDINAL32 * Error_Code);
+ Help_Panel: procedure(Help_Index: CARDINAL32; Error_Code: PCARDINAL32);
+ end;
+ LVM_OS2_Native_Support=_LVM_OS2_Native_Support;
+
+
+type
+ _LVM_Interface_Support=record
+ Interface_Supported: BOOLEAN;
+ case longint of
+ 0 : ( Java_Interface_Class : ^char );
+ 1 : ( VIO_PM_Calls : LVM_OS2_Native_Support );
+ end;
+ LVM_Interface_Support=_LVM_Interface_Support;
+
+//* The following define the default help indicies which must be supported by the Help_Panel function. NOTE: Index
+//values from 0 to 100 are reserved by LVM. The Plugin may, for its own use, use any values above 100.
+const
+ HELP_PLUGIN_DESCRIPTION = 0;
+
+// The following define the maximum length of the names which can be used to represent a feature in LVM. The
+//maximum name length for a feature is 30 characters plus the trailing NULL character. For command line parsing,
+//though, a shorter name is preferable! Thus, the "short" name for a feature will be limited to 10 characters
+//plus the trailing NULL character. The "short" name will be used for command line purposes, while the regular
+//name will be used by all other interfaces.
+const
+ MAX_FEATURE_NAME_LENGTH = 31;
+ MAX_FEATURE_SHORT_NAME_LENGTH = 11;
+ MAX_OEM_INFO_LENGTH =255;
+
+// The following definitions are used to control and access the various "features" available through the LVM Engine, such as Drive Linking and BBR.
+type
+ _Feature_ID_Data=record
+ Name: Array[0..MAX_FEATURE_NAME_LENGTH-1] of char; // Feature Name, for use in menus and command line parsing.
+ Short_Name: Array[0..MAX_FEATURE_SHORT_NAME_LENGTH-1] of char; // The name/code used to represent this feature during command line parsing.
+ OEM_Info: Array[0..MAX_OEM_INFO_LENGTH-1] of char; // Name and copyright info. of the manufacturer, i.e. IBM, Vinca, etc.
+ ID: CARDINAL32; // Numeric Feature ID.
+ Major_Version_Number: CARDINAL32; // The version number of this feature.
+ Minor_Version_Number: CARDINAL32; // The version number of this feature.
+ LVM_Major_Version_Number: CARDINAL32; // The version of LVM that this feature was designed to work with.
+ LVM_Minor_Version_Number: CARDINAL32; // The version of LVM that this feature was designed to work with.
+ Preferred_Class: LVM_Classes; // The class from which this "feature" prefers to be chosen. Encryption can be performed
+//at the partition level or the volume level, and may therefore belong to both the
+//Partition_Class and the Volume_Class. However, it is preferrable for it to be used
+//on the volume level instead of at the partition level. Thus, its perferred class would
+//be the Volume_Class, but it would still be a member of both the Volume_Class and the
+//Partition_Class.
+ ClassData: Array[0..MAXIMUM_LVM_CLASSES-1] of LVM_Class_Attributes; // The attributes for each of the LVM classes that this "feature" is in.
+ Interface_Support: Array[0..MAXIMUM_LVM_INTERFACE_TYPES-1] of LVM_Interface_Support; // The functions and classes for each of the video modes that LVM can run it.
+ end;
+ Feature_ID_Data=_Feature_ID_Data;
+
+// The following defines the TAG value used to identify an item of type Feature_ID_Data in a DLIST.
+const
+ FEATURE_ID_DATA_TAG = 354385972;
+
+// The following are invariant for a disk drive.
+Type
+ Drive_Control_Record = record
+ Drive_Number: CARDINAL32; // OS/2 Drive Number for this drive.
+ Drive_Size: CARDINAL32; // The total number of sectors on the drive.
+ Drive_Serial_Number: DoubleWord; // The serial number assigned to this drive. For info. purposes only.
+ Drive_Handle: ADDRESS; // Handle used for operations on the disk that this record corresponds to.
+ Cylinder_Count: CARDINAL32; // The number of cylinders on the drive.
+ Heads_Per_Cylinder: CARDINAL32; // The number of heads per cylinder for this drive.
+ Sectors_Per_Track: CARDINAL32; // The number of sectors per track for this drive.
+ Drive_Is_PRM: BOOLEAN; // Set to TRUE if this drive is a PRM.
+ Reserved: Array[0..3-1] of BYTE; // Alignment.
+ end;
+
+// The following structure is returned by the Get_Drive_Control_Data function.
+ Drive_Control_Array=record
+ Drive_Control_Data: ^Drive_Control_Record; // An array of drive control records.
+ Count: CARDINAL32; // The number of entries in the array of drive control records.
+ end;
+
+// The following structure defines the information that can be changed for a specific disk drive.
+ Drive_Information_Record=record
+ Total_Available_Sectors: CARDINAL32; // The number of sectors on the disk which are not currently assigned to a partition.
+ Largest_Free_Block_Of_Sectors: CARDINAL32; // The number of sectors in the largest contiguous block of available sectors.
+ Corrupt_Partition_Table: BOOLEAN; // If TRUE, then the partitioning information found on the drive is incorrect!
+ Unusable: BOOLEAN; // If TRUE, the drive's MBR is not accessible and the drive can not be partitioned.
+ IO_Error: BOOLEAN; // If TRUE, then the last I/O operation on this drive failed!
+ Is_Big_Floppy: BOOLEAN; // If TRUE, then the drive is a PRM formatted as a big floppy (i.e. the old style removable media support).
+ Drive_Name: Array[0..DISK_NAME_SIZE-1] of Char; // User assigned name for this disk drive.
+ end;
+
+ Partition_Information_Record=record
+ Partition_Handle: ADDRESS; // The handle used to perform operations on this partition.
+ Volume_Handle: ADDRESS; // If this partition is part of a volume, this will be the handle of
+ //the volume. If this partition is NOT part of a volume, then this
+ //handle will be 0.
+ Drive_Handle: ADDRESS; // The handle for the drive this partition resides on.
+ Partition_Serial_Number: DoubleWord; // The serial number assigned to this partition.
+ Partition_Start: CARDINAL32; // The LBA of the first sector of the partition.
+ True_Partition_Size: CARDINAL32; // The total number of sectors comprising the partition.
+ Usable_Partition_Size: CARDINAL32; // The size of the partition as reported to the IFSM. This is the
+ //size of the partition less any LVM overhead.
+ Boot_Limit: CARDINAL32; // The maximum number of sectors from this block of free space that can be used to
+ //create a bootable partition if you allocate from the beginning of the block of
+ //free space.
+ Spanned_Volume: BOOLEAN; // TRUE if this partition is part of a multi-partition volume.
+ Primary_Partition: BOOLEAN; // True or False. Any non-zero value here indicates that
+ //this partition is a primary partition. Zero here indicates
+ //that this partition is a "logical drive" - i.e. it resides
+ //inside of an extended partition.
+ Active_Flag: BYTE; // 80 = Partition is marked as being active.
+ // 0 = Partition is not active.
+ OS_Flag: BYTE; // This field is from the partition table. It is known as the
+ //OS flag, the Partition Type Field, Filesystem Type, and
+ //various other names.
+
+ //Values of interest
+
+ //If this field is: (values are in hex)
+
+ //07 = The partition is a compatibility partition formatted for use
+ //with an installable filesystem, such as HPFS or JFS.
+ //00 = Unformatted partition
+ //01 = FAT12 filesystem is in use on this partition.
+ //04 = FAT16 filesystem is in use on this partition.
+ //0A = OS/2 Boot Manager Partition
+ //35 = LVM partition
+ //84 = OS/2 FAT16 partition which has been relabeled by Boot Manager to "Hide" it.
+ Partition_Type: BYTE; // 0 = Free Space
+ //1 = LVM Partition (Part of an LVM Volume.)
+ //2 = Compatibility Partition
+ //All other values are reserved for future use.
+ Partition_Status: BYTE; // 0 = Free Space
+ //1 = In Use - i.e. already assigned to a volume.
+ //2 = Available - i.e. not currently assigned to a volume.
+ On_Boot_Manager_Menu: BOOLEAN; // Set to TRUE if this partition is not part of a Volume yet is on the Boot Manager Menu.
+ Reserved: BYTE; // Alignment.
+ Volume_Drive_Letter: char; // The drive letter assigned to the volume that this partition is a part of.
+ Drive_Name: Array[0..DISK_NAME_SIZE-1] of char; // User assigned name for this disk drive.
+ File_System_Name: Array[0..FILESYSTEM_NAME_SIZE-1] of char;// The name of the filesystem in use on this partition, if it is known.
+ Partition_Name: Array[0..PARTITION_NAME_SIZE-1] of char; // The user assigned name for this partition.
+ Volume_Name: Array[0..VOLUME_NAME_SIZE-1] of char; // If this partition is part of a volume, then this will be the
+ //name of the volume that this partition is a part of. If this
+ //record represents free space, then the Volume_Name will be
+ //"FREE SPACE xx", where xx is a unique numeric ID generated by
+ //LVM.DLL. Otherwise it will be an empty string.
+ end;
+
+// The following defines are for use with the Partition_Type field in the Partition_Information_Record.
+const
+ pt_FREE_SPACE_PARTITION = 0;
+ pt_LVM_PARTITION = 1;
+ pt_COMPATIBILITY_PARTITION = 2;
+
+// The following defines are for use with the Partition_Status field in the Partition_Information_Record.
+const
+ PARTITION_IS_IN_USE = 1;
+ PARTITION_IS_AVAILABLE = 2;
+ PARTITION_IS_FREE_SPACE = 0;
+
+// The following structure is returned by various functions in the LVM Engine.
+type
+ Partition_Information_Array=record
+ Partition_Array: ^Partition_Information_Record; // An array of Partition_Information_Records.
+ Count: CARDINAL32; // The number of entries in the Partition_Array.
+ end;
+
+// The following items are invariant for a volume.
+type
+ Volume_Control_Record=record
+ Volume_Serial_Number: DoubleWord; // The serial number assigned to this volume.
+ Volume_Handle: ADDRESS; // The handle used to perform operations on this volume.
+ Compatibility_Volume: BOOLEAN; // TRUE indicates that this volume is compatible with older versions of OS/2.
+//FALSE indicates that this is an LVM specific volume and can not be used without OS2LVM.DMD.
+ Device_Type: BYTE; // Indicates what type of device the Volume resides on:
+//0 = Hard Drive under LVM Control
+//1 = PRM under LVM Control
+//2 = CD-ROM
+//3 = Network drive
+//4 = Unknown device NOT under LVM Control
+ Reserved: Array[0..2-1] of BYTE; // Alignment.
+ end;
+
+// The following define the device types used in the Device_Type field of the Volume_Control_Record.
+const
+ LVM_HARD_DRIVE = 0;
+ LVM_PRM = 1;
+ NON_LVM_CDROM = 2;
+ NETWORK_DRIVE = 3;
+ NON_LVM_DEVICE = 4;
+
+// The following structure is returned by the Get_Volume_Control_Data function.
+type
+ Volume_Control_Array=record
+ Volume_Control_Data: ^Volume_Control_Record; // An array of volume control records.
+ Count: CARDINAL32; // The number of entries in the array of volume control records.
+ end;
+
+// The following information about a volume can (and often does) vary.
+type
+ Volume_Information_Record=record
+ Volume_Size: CARDINAL32; // The number of sectors comprising the volume.
+ Partition_Count: CARDINAL32; // The number of partitions which comprise this volume.
+ Drive_Letter_Conflict: CARDINAL32; // 0 indicates that the drive letter preference for this volume is unique.
+//1 indicates that the drive letter preference for this volume
+//is not unique, but this volume got its preferred drive letter anyway.
+//2 indicates that the drive letter preference for this volume
+//is not unique, and this volume did NOT get its preferred drive letter.
+//4 indicates that this volume is currently "hidden" - i.e. it has
+//no drive letter preference at the current time.
+ Compatibility_Volume: BOOLEAN; // TRUE if this is for a compatibility volume, FALSE otherwise.
+ Bootable: BOOLEAN; // Set to TRUE if this volume appears on the Boot Manager menu, or if it is
+//a compatibility volume and its corresponding partition is the first active
+//primary partition on the first drive.
+ Drive_Letter_Preference: char; // The drive letter that this volume desires to be.
+ Current_Drive_Letter: char; // The drive letter currently used to access this volume. May be different than
+//Drive_Letter_Preference if there was a conflict ( i.e. Drive_Letter_Preference
+//is already in use by another volume ).
+ Initial_Drive_Letter: char; // The drive letter assigned to this volume by the operating system when LVM was started.
+//This may be different from the Drive_Letter_Preference if there were conflicts, and
+//may be different from the Current_Drive_Letter. This will be 0x0 if the Volume did
+//not exist when the LVM Engine was opened (i.e. it was created during this LVM session).
+ New_Volume: BOOLEAN; // Set to FALSE if this volume existed before the LVM Engine was opened. Set to
+//TRUE if this volume was created after the LVM Engine was opened.
+ Status: BYTE; // 0 = None.
+//1 = Bootable
+//2 = Startable
+//3 = Installable.
+ Reserved_1: BYTE;
+ Volume_Name: Array[0..VOLUME_NAME_SIZE-1] of char; // The user assigned name for this volume.
+ File_System_Name: Array[0..FILESYSTEM_NAME_SIZE-1] of char;// The name of the filesystem in use on this partition, if it is known.
+ end;
+
+// The following structure is used to return the feature information for the installed features, or the features on a volume.
+type
+ Feature_Information_Array=record
+ Count: CARDINAL32;
+ Feature_Data: ^Feature_ID_Data;
+ end;
+
+// The following structure defines an item on the Boot Manager Menu.
+type
+ Boot_Manager_Menu_Item=record
+ Handle: ADDRESS; // A Volume or Partition handle.
+ Volume: BOOLEAN; // If TRUE, then Handle is the handle of a Volume. Otherwise, Handle is the handle of a partition.
+ end;
+
+// The following structure is used to get a list of the items on the partition manager menu.
+type
+ Boot_Manager_Menu=record
+ Menu_Items: ^Boot_Manager_Menu_Item;
+ Count: CARDINAL32;
+ end;
+
+// The following structure is used to specify an LVM Feature when creating a volume. Since LVM Features may be part of
+//more than one LVM Class, the specific class to be used with the feature must also be specified.
+type
+ LVM_Feature_Specification_Record=record
+ Feature_ID: CARDINAL32; // The feature ID of the feature to use.
+ Actual_Class: LVM_Classes; // The LVM Class (supported by the specified feature) to use.
+ Init_Data: ADDRESS; // The address of a buffer containing initialization data for this feature.
+ //NULL if there is no initialization data being provided for this feature.
+ end;
+
+// The following structure is used with the Get_Child_Handles function.
+Type
+ LVM_Handle_Array_Record=record
+ Count: CARDINAL32;
+ Handles: ^ADDRESS;
+ end;
+
+// The following preprocessor directives define the operations that can be performed on a partition, volume, or a block of free space.
+// These definitions represent bits in a 32 bit value returned by the Get_Valid_Options function.
+const
+ CREATE_PRIMARY_PARTITION = 1;
+ CREATE_LOGICAL_DRIVE = 2;
+ DELETEPARTITION = 4;
+ SET_ACTIVE_PRIMARY = 8;
+ SET_PARTITION_ACTIVE = $10;
+ SET_PARTITION_INACTIVE = $20;
+ SETSTARTABLE = $40;
+ INSTALLBOOTMANAGER = $80;
+ REMOVEBOOTMANAGER = $100;
+ SET_BOOT_MANAGER_DEFAULTS = $200;
+ ADD_TO_BOOT_MANAGER_MENU = $400;
+ REMOVE_FROM_BOOT_MANAGER_MENU = $800;
+ DELETEVOLUME = $1000;
+ HIDEVOLUME = $2000;
+ EXPANDVOLUME = $4000;
+ SET_VOLUME_INSTALLABLE = $8000;
+ ASSIGNDRIVELETTER = $10000;
+ CAN_BOOT_PRIMARY = $20000; // If a primary is created from this block of free space, then it can be made bootable.
+ CAN_BOOT_LOGICAL = $40000; // If a logical drive is created from this block of free space, then OS/2 can boot from it by adding it to the boot manager menu.
+ CAN_SET_NAME = $80000;
+ SET_BOOT_MANAGER_STARTABLE = $100000;
+
+// The following enumeration defines the allocation strategies used by the Create_Partition function.
+type
+ _Allocation_Algorithm =(
+Automatic, // Let LVM decide which block of free space to use to create the partition.
+Best_Fit, // Use the block of free space which is closest in size to the partition being created.
+First_Fit, // Use the first block of free space on the disk which is large enough to hold a partition of the specified size.
+Last_Fit, // Use the last block of free space on the disk which is large enough to hold a partition of the specified size.
+From_Largest, // Find the largest block of free space and allocate the partition from that block of free space.
+From_Smallest, // Find the smallest block of free space that can accommodate a partition of the size specified.
+All // Turn the specified drive or block of free space into a single partition.
+);
+ Allocation_Algorithm=_Allocation_Algorithm;
+
+// Error codes returned by the LVM Engine.
+const
+ LVM_ENGINE_NO_ERROR = 0;
+ LVM_ENGINE_OUT_OF_MEMORY = 1;
+ LVM_ENGINE_IO_ERROR = 2;
+ LVM_ENGINE_BAD_HANDLE = 3;
+ LVM_ENGINE_INTERNAL_ERROR = 4;
+ LVM_ENGINE_ALREADY_OPEN = 5;
+ LVM_ENGINE_NOT_OPEN = 6;
+ LVM_ENGINE_NAME_TOO_BIG = 7;
+ LVM_ENGINE_OPERATION_NOT_ALLOWED = 8;
+ LVM_ENGINE_DRIVE_OPEN_FAILURE = 9;
+ LVM_ENGINE_BAD_PARTITION = 10;
+ LVM_ENGINE_CAN_NOT_MAKE_PRIMARY_PARTITION = 11;
+ LVM_ENGINE_TOO_MANY_PRIMARY_PARTITIONS = 12;
+ LVM_ENGINE_CAN_NOT_MAKE_LOGICAL_DRIVE = 13;
+ LVM_ENGINE_REQUESTED_SIZE_TOO_BIG = 14;
+ LVM_ENGINE_1024_CYLINDER_LIMIT = 15;
+ LVM_ENGINE_PARTITION_ALIGNMENT_ERROR = 16;
+ LVM_ENGINE_REQUESTED_SIZE_TOO_SMALL = 17;
+ LVM_ENGINE_NOT_ENOUGH_FREE_SPACE = 18;
+ LVM_ENGINE_BAD_ALLOCATION_ALGORITHM = 19;
+ LVM_ENGINE_DUPLICATE_NAME = 20;
+ LVM_ENGINE_BAD_NAME = 21;
+ LVM_ENGINE_BAD_DRIVE_LETTER_PREFERENCE = 22;
+ LVM_ENGINE_NO_DRIVES_FOUND = 23;
+ LVM_ENGINE_WRONG_VOLUME_TYPE = 24;
+ LVM_ENGINE_VOLUME_TOO_SMALL = 25;
+ LVM_ENGINE_BOOT_MANAGER_ALREADY_INSTALLED = 26;
+ LVM_ENGINE_BOOT_MANAGER_NOT_FOUND = 27;
+ LVM_ENGINE_INVALID_PARAMETER = 28;
+ LVM_ENGINE_BAD_FEATURE_SET = 29;
+ LVM_ENGINE_TOO_MANY_PARTITIONS_SPECIFIED = 30;
+ LVM_ENGINE_LVM_PARTITIONS_NOT_BOOTABLE = 31;
+ LVM_ENGINE_PARTITION_ALREADY_IN_USE = 32;
+ LVM_ENGINE_SELECTED_PARTITION_NOT_BOOTABLE = 33;
+ LVM_ENGINE_VOLUME_NOT_FOUND = 34;
+ LVM_ENGINE_DRIVE_NOT_FOUND = 35;
+ LVM_ENGINE_PARTITION_NOT_FOUND = 36;
+ LVM_ENGINE_TOO_MANY_FEATURES_ACTIVE = 37;
+ LVM_ENGINE_PARTITION_TOO_SMALL = 38;
+ LVM_ENGINE_MAX_PARTITIONS_ALREADY_IN_USE = 39;
+ LVM_ENGINE_IO_REQUEST_OUT_OF_RANGE = 40;
+ LVM_ENGINE_SPECIFIED_PARTITION_NOT_STARTABLE = 41;
+ LVM_ENGINE_SELECTED_VOLUME_NOT_STARTABLE = 42;
+ LVM_ENGINE_EXTENDFS_FAILED = 43;
+ LVM_ENGINE_REBOOT_REQUIRED = 44;
+ LVM_ENGINE_CAN_NOT_OPEN_LOG_FILE = 45;
+ LVM_ENGINE_CAN_NOT_WRITE_TO_LOG_FILE = 46;
+ LVM_ENGINE_REDISCOVER_FAILED = 47;
+ LVM_ENGINE_INTERNAL_VERSION_FAILURE = 48;
+ LVM_ENGINE_PLUGIN_OPERATION_INCOMPLETE = 49;
+ LVM_ENGINE_BAD_FEATURE_ID = 50;
+ LVM_ENGINE_NO_INIT_DATA = 51;
+ LVM_ENGINE_NO_CONTEXT_DATA = 52;
+ LVM_ENGINE_WRONG_CLASS_FOR_FEATURE = 53;
+ LVM_ENGINE_INCOMPATIBLE_FEATURES_SELECTED = 54;
+ LVM_ENGINE_NO_CHILDREN = 55;
+ LVM_ENGINE_FEATURE_NOT_SUPPORTED_BY_INTERFACE= 56;
+ LVM_ENGINE_NO_PARENT = 57;
+ LVM_ENGINE_VOLUME_HAS_NOT_BEEN_COMMITTED_YET = 58;
+ LVM_ENGINE_UNABLE_TO_REFERENCE_VOLUME = 59;
+ LVM_ENGINE_PARSING_ERROR = 60;
+ LVM_ENGINE_INTERNAL_FEATURE_ERROR = 61;
+ LVM_ENGINE_VOLUME_NOT_CONVERTED = 62;
+
+
+// The following definitions are used for command line processing. As the command line is processed,
+//the command line is first broken up into tokens. Each token has a "characterization", which indicates
+//what the token is thought to be.
+
+type
+ Token_Characterizations=(
+LVM_AcceptableCharsStr,
+LVM_All,
+LVM_BestFit,
+LVM_BootDOS,
+LVM_BootOS2,
+LVM_Bootable,
+LVM_CR,
+LVM_CRI,
+LVM_Compatibility,
+LVM_Drive,
+LVM_Existing,
+LVM_Expand,
+LVM_FS,
+LVM_FirstFit,
+LVM_Freespace,
+LVM_FromEnd,
+LVM_FromLargest,
+LVM_FromSmallest,
+LVM_FromStart,
+LVM_LVM,
+LVM_LastFit,
+LVM_Logical,
+LVM_New,
+LVM_NoBoot,
+LVM_NonBootable,
+LVM_NotBootable,
+LVM_Partition,
+LVM_Primary,
+LVM_RB,
+LVM_Size,
+LVM_Unusable,
+LVM_Unused,
+LVM_Volume,
+LVM_Volumes,
+LVM_Comma,
+LVM_Number,
+LVM_Colon,
+LVM_Space,
+LVM_Tab,
+LVM_MultiSpace,
+LVM_MultiTab,
+LVM_String,
+LVM_FileNameStr,
+LVM_SemiColon,
+LVM_Eof,
+LVM_Separator,
+LVM_Open_Paren, //* ( */
+LVM_Close_Paren, //* ) */
+LVM_Open_Bracket, //* [ */
+LVM_Close_Bracket, //* ] */
+LVM_Open_Brace, //* { */
+LVM_Close_Brace, //* } */
+LVM_EQ_Sign, //* = */
+LVM_Bootmgr,
+LVM_Create,
+LVM_Delete,
+LVM_DriveLetter,
+LVM_File,
+LVM_Hide,
+LVM_Install,
+LVM_NewMBR,
+LVM_Query,
+LVM_RediscoverPRM,
+LVM_SetName,
+LVM_SetStartable,
+LVM_SI,
+LVM_SlashSize,
+LVM_StartLog
+);
+
+type
+ _LVM_Token=record
+ TokenText: PChar; // The actual text of the token.
+ TokenType: Token_Characterizations; // What the token is thought to be.
+ Position: CARDINAL32; // The position of the first character of the token on the command line.
+ end;
+ LVM_Token=_LVM_Token;
+
+const
+ LVM_TOKEN_TAG = 28387473;
+
+// Function Prototypes
+
+//***************************************************************************
+//
+// Functions relating to the LVM Engine itself
+//
+//***************************************************************************
+
+//****************************************************************************************************/
+//* */
+//* Function Name: Open_LVM_Engine */
+//* */
+//* Descriptive Name: Opens the LVM Engine and readies it for use. */
+//* */
+//* Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the */
+//* MBR/EBR partition tables for validity. This is useful if there */
+//* are drive geometry problems, such as the drive was partitioned and */
+//* formatted with one geometry and then moved to a different machine */
+//* which uses a different geometry for the drive. This would cause */
+//* the starting and ending CHS values in the partition tables to */
+//* be inconsistent with the size and partition offset entries in the */
+//* partition tables. Setting Ignore_CHS to TRUE will disable the */
+//* LVM Engine's CHS consistency checks, thereby allowing the drive */
+//* to be partitioned. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if this function completes successfully. If an error occurs, */
+//* *Error_Code will contain a non-zero error code. */
+//* */
+//* Error Handling: If this function aborts with an error, all memory allocated during the course */
+//* of this function will be released. Disk read errors will be reported to the */
+//* user via pop-up error messages. Disk read errors will only cause this */
+//* function to abort if none of the disk drives in the system could be */
+//* successfully read. */
+//* */
+//* Side Effects: The LVM Engine will be initialized. The partition tables for all OS2DASD */
+//* controlled disk drives will be read into memory. Memory will be allocated for */
+//* the data structures used by the LVM Engine. */
+//* */
+//* Notes: This is provided for programs that used LVM Version 1. This function assumes an */
+//* LVM_Interface_Type of VIO_Interface. */
+//* */
+//****************************************************************************************************/
+procedure Open_LVM_Engine(Ignore_CHS: BOOLEAN; Error_Code: PCARDINAL32); external 'lvm' name 'Open_LVM_Engine';
+
+//****************************************************************************************************/
+//* */
+//* Function Name: Open_LVM_Engine2 */
+//* */
+//* Descriptive Name: Opens the LVM Engine and readies it for use. */
+//* */
+//* Input: BOOLEAN Ignore_CHS : If TRUE, then the LVM engine will not check the CHS values in the */
+//* MBR/EBR partition tables for validity. This is useful if there */
+//* are drive geometry problems, such as the drive was partitioned and */
+//* formatted with one geometry and then moved to a different machine */
+//* which uses a different geometry for the drive. This would cause */
+//* the starting and ending CHS values in the partition tables to */
+//* be inconsistent with the size and partition offset entries in the */
+//* partition tables. Setting Ignore_CHS to TRUE will disable the */
+//* LVM Engine's CHS consistency checks, thereby allowing the drive */
+//* to be partitioned. */
+//* LVM_Interface_Types Interface_Type - Indicate the type of user interface being used: */
+//* PM_Interface, VIO_Interface, or Java_Interface. This lets the */
+//* LVM Engine know which interface support routines to call in any */
+//* plugin modules which may be loaded. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if this function completes successfully. If an error occurs, */
+//* *Error_Code will contain a non-zero error code. */
+//* */
+//* Error Handling: If this function aborts with an error, all memory allocated during the course */
+//* of this function will be released. Disk read errors will be reported to the */
+//* user via pop-up error messages. Disk read errors will only cause this */
+//* function to abort if none of the disk drives in the system could be */
+//* successfully read. */
+//* */
+//* Side Effects: The LVM Engine will be initialized. The partition tables for all OS2DASD */
+//* controlled disk drives will be read into memory. Memory will be allocated for */
+//* the data structures used by the LVM Engine. */
+//* */
+//* Notes: New in LVM Version 2 */
+//* */
+//****************************************************************************************************/
+{$ifdef lvm2}
+procedure Open_LVM_Engine2(Ignore_CHS: BOOLEAN; Interface_Type: LVM_Interface_Types; Error_Code: PCARDINAL32); external 'lvm' name 'Open_LVM_Engine2';
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Commit_Changes */
+//* */
+//* Descriptive Name: Saves any changes made to the partitioning */
+//* information of the OS2DASD controlled disk */
+//* drives in the system. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: The function return value will be TRUE if all of the */
+//* partitioning/volume changes made were successfully */
+//* written to disk. Also, *Error_Code will be 0 if no */
+//* errors occur. */
+//* */
+//* If an error occurs, then the furnction return value */
+//* will be FALSE and *Error_Code will contain a non-zero */
+//* error code. */
+//* */
+//* Error Handling: If an error occurs, the function return value */
+//* will be false and *Error_Code will be > 0. */
+//* */
+//* Disk read and write errors will be indicated by*/
+//* setting the IO_Error field of the */
+//* Drive_Information_Record to TRUE. Thus, if */
+//* the function return value is FALSE, and */
+//* *Error_Code indicates an I/O error, the caller */
+//* of this function should call the */
+//* Get_Drive_Status function on each drive to */
+//* determine which drives had I/O errors. */
+//* */
+//* If a read or write error occurs, then the */
+//* engine may not have been able to create a */
+//* partition or volume. Thus, the caller */
+//* may want to refresh all partition and volume */
+//* data to see what the engine was and was not */
+//* able to create. */
+//* */
+//* Side Effects: The partitioning information of the disk drives */
+//* in the system may be altered. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Commit_Changes(Error_Code: PCARDINAL32): BOOLEAN; external 'lvm' name 'Commit_Changes';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Java_Call_Back */
+//* */
+//* Descriptive Name: This function allows the calling Java program */
+//* to set the call back address. The call back */
+//* address is used when the LVM Engine or one of */
+//* its plug-ins, needs to run a Java class to */
+//* gather information from the user. */
+//* */
+//* Input: void ( * Execute_Java_Class) ... - The address of a */
+//* function that the LVM */
+//* engine may call when */
+//* it needs a Java class */
+//* to be executed. This */
+//* is only required if the*/
+//* user interface being */
+//* used is written in Java*/
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: If the function completes successfully, then *Error_Code*/
+//* will be set to LVM_ENGINE_NO_ERROR. Otherwise, */
+//* *Error_Code will be set to a non-zero error code. */
+//* */
+//* Error Handling: If an error occurs, the function will abort and*/
+//* *Error_Code will be set to a non-zero error */
+//* code. */
+//* */
+//* Side Effects: The Java call back address is set to point to the*/
+//* specified function. Once the Java call back */
+//* address is set, LVM plug-ins which require the */
+//* Java call back will be enabled and can be used */
+//* during the creation of LVM Volumes. */
+//* */
+//* Notes: If a Java interface is in use (as specified on the */
+//* Open_LVM_Engine call), then this function must be called*/
+//* in order to enable those LVM plug-ins which require */
+//* initialization information during the creation of an */
+//* LVM Volume. If these plug-ins are not enabled, then */
+//* they will not be reported by the Get_Available_Features */
+//* API, nor can they be used or accessed by any other LVM */
+//* Engine APIs. Thus, this function should be called */
+//* immediately after the Open_LVM_Engine API is called. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+type
+ TJavaExecProc=procedure(
+ Class_Name: PChar;
+ InputBuffer: ADDRESS;
+ InputBufferSize: CARDINAL32;
+ OutputBuffer: PADDRESS;
+ OutputBufferSize,
+ Error_Code: PCARDINAL32);
+
+procedure Set_Java_Call_Back(
+ Execute_Java_Class: TJAvaExecProc;
+ Error_Code: PCARDINAL32); external 'lvm' name 'Set_Java_Call_Back';
+
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Close_LVM_Engine */
+//* */
+//* Descriptive Name: Closes the LVM Engine and frees any memory */
+//* held by the LVM Engine. */
+//* */
+//* Input: None. */
+//* */
+//* Output: None. */
+//* */
+//* Error Handling: N/A */
+//* */
+//* Side Effects: Any memory held by the LVM Engine is released. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Close_LVM_Engine; external 'lvm' name 'Close_LVM_Engine';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Available_Features */
+//* */
+//* Descriptive Name: Returns the feature ID information for each of*/
+//* the features that the LVM Engine knows about. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: If successful, a Feature_Information_Array structure is */
+//* returned with a non-zero Count. Also, *Error_Code will */
+//* be set to LVM_ENGINE_NO_ERROR. If an error occurs, */
+//* then the Count field in the structure will be 0 and */
+//* ( *Error_Code) will contain a non-zero error code. */
+//* */
+//* Error Handling: The only expected error is if this function is */
+//* called while the LVM Engine is not open. This */
+//* should be the only error condition. */
+//* */
+//* Side Effects: Memory is allocated using the LVM Engine's memory*/
+//* manager for the array of Feature_ID_Data items */
+//* being returned. */
+//* */
+//* Notes: This function seems to be presented since LVM Version 2 */
+//* */
+//*********************************************************************/
+{$ifdef LVM2}
+function Get_Available_Features(Error_Code: PCARDINAL32): Feature_Information_Array; external 'lvm' name 'Get_Available_Features';
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Issue_Feature_Command */
+//* */
+//* Descriptive Name: Issues a feature specific command to either */
+//* the Ring 0 or Ring 3 portion of the feature. */
+//* */
+//* Input: CARDINAL32 Feature_ID - The numeric ID assigned to the */
+//* feature which is to receive the */
+//* command being issued. */
+//* ADDRESS Handle - The handle of the volume, partition, or */
+//* aggregate to which the feature command */
+//* is to be directed. */
+//* BOOLEAN Ring0 - If TRUE, then the command will be sent */
+//* to the Ring 0 portion of the feature. */
+//* If FALSE, then the command will be sent */
+//* to the Ring 3 portion of the feature. */
+//* ADDRESS InputBuffer - A buffer containing the command and*/
+//* any necessary information for the */
+//* feature to process the command. */
+//* CARDINAL32 InputSize - The number of bytes in the */
+//* InputBuffer. */
+//* ADDRESS * OutputBuffer - The address of a variable used */
+//* to hold the location of the */
+//* output buffer created by the */
+//* feature in response to the */
+//* command in InputBuffer. */
+//* CARDINAL32 * OutputSize - The address of a variable used */
+//* to hold the number of bytes in */
+//* *OutputBuffer. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: If successful, then *Error_Code will be set to */
+//* LVM_ENGINE_NO_ERROR. If unsuccessful, then *Error_Code */
+//* will be set to a non-zero error code. *OutputBuffer and*/
+//* *OutputSize are set by the feature. If the feature */
+//* specified does not exist, then *OutputBuffer will be */
+//* NULL and *Outputsize will be 0. If the feature does */
+//* exist, then the value of *OutputBuffer and *OutputSize */
+//* depend upon the feature. */
+//* */
+//* Error Handling: If the specified feature does not exist, then */
+//* *Error_Code will contain a non-zero error code, */
+//* *OutputBuffer will be NULL, and *OutputSize will*/
+//* be set to 0. All other error conditions are */
+//* feature dependent. */
+//* */
+//* Side Effects: Side effects are feature dependent. */
+//* */
+//* Notes: New in LVM Version 2 */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+void _System Issue_Feature_Command( CARDINAL32 Feature_ID,
+ADDRESS Handle,
+BOOLEAN Ring0,
+ADDRESS InputBuffer,
+CARDINAL32 InputSize,
+ADDRESS * OutputBuffer,
+CARDINAL32 * OutputSize,
+CARDINAL32 * Error_Code );
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Parse_Feature_Parameters */
+//* */
+//* Descriptive Name: This function allows access to the parsing */
+//* function of an LVM Plug-in Feature. The */
+//* specified feature will be passed a list of */
+//* tokens to parse, and, if it parses the tokens */
+//* successfully, will produce a buffer containing*/
+//* initialization data that can be used with the */
+//* Create_Volume API. If it encounters an error,*/
+//* the current item in the Tokens list will be */
+//* the offending item, and a pointer to an error */
+//* message will be returned. */
+//* */
+//* Input: DLIST Tokens - A DLIST of tokens to parse. Parsing will*/
+//* begin with the current entry in the list */
+//* and proceed until there is an error or */
+//* until the specified feature has found a */
+//* complete command. Each feature defines */
+//* what commands it will accept. */
+//* LVM_Feature_Specification_Record * Feature_Data - A */
+//* pointer to a record which contains the */
+//* ID of the feature which is to parse the */
+//* DLIST of Tokens. The other fields in */
+//* this record will be filled in by the */
+//* feature if it successfully parses the */
+//* tokens. */
+//* char ** Error_Message - The address of a pointer to char.*/
+//* This will be set to NULL if the feature */
+//* successfully parses the list of tokens, */
+//* or it will be set to point to an error */
+//* message if an error occurs. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 */
+//* variable into which an error code may */
+//* be placed. The error code will be */
+//* LVM_ENGINE_NO_ERROR if this function */
+//* completes successfully, or a non-zero */
+//* error code if an error occurs. */
+//* */
+//* Output: If there are no errors, the Actual_Class and Init_Data */
+//* fields of *Feature_Data will be set, *Error_Message will*/
+//* be set to NULL, and Error_Code will be set to */
+//* LVM_ENGINE_NO_ERROR. The current item in the Tokens */
+//* list will be the first token that was not parsed by the */
+//* feature (i.e. the first token after the command accepted*/
+//* by the plug-in). */
+//* */
+//* If an error occurs, the values of Actual_Class and */
+//* Init_Data in *Feature_Data are undefined. *Error_Code */
+//* will be set to LVM_ENGINE_PARSING_ERROR if the error is */
+//* parsing related, or some other non-zero value if the */
+//* error is not parsing related. If the error is parsing */
+//* related, then *Error_Message will point to an error */
+//* message which can be displayed for the user. The */
+//* current item in the Tokens list will be the token which */
+//* failed. */
+//* */
+//* Error Handling: If an parsing related error occurs, i.e. the */
+//* tokens in the Tokens list do not form a valid */
+//* command accepted by the specified feature, then */
+//* the current item in the Tokens list will be the */
+//* offending token, *Error_Message will be set to */
+//* point to an error message, and *Error_Code will */
+//* be set to LVM_ENGINE_PARSING_ERROR. */
+//* If any other error occurs, the current item in */
+//* the Tokens list will be the token that was being*/
+//* processed when the error occurs, and *Error_Code*/
+//* will be set to a non-zero value. */
+//* */
+//* Side Effects: The current item in the Tokens list may change. */
+//* */
+//* Notes: Each feature defines which commands it will accept, and */
+//* therefore which commands it will successfully parse. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+void _System Parse_Feature_Parameters( DLIST Tokens,
+LVM_Feature_Specification_Record * Feature_Data,
+char ** Error_Message,
+CARDINAL32 * Error_Code);
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Refresh_LVM_Engine */
+//* */
+//* Descriptive Name: This function causes the LVM Engine to look */
+//* for changes in the current system */
+//* configuration and update its internal tables */
+//* accordingly. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: None. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be set to */
+//* a non-zero value. */
+//* */
+//* Side Effects: Volumes which represent non-LVM devices may have */
+//* their handles changed! */
+//* */
+//* Notes: After calling this function, Get_Volume_Control_Data */
+//* should be called to get the updated list of volumes. */
+//* This is necessary as the handles of some volumes may */
+//* have changed. */
+//* */
+//*********************************************************************/
+procedure Refresh_LVM_Engine(Error_Code: PCARDINAL32); external 'lvm' name 'Refresh_LVM_Engine';
+
+//****************************************************************************
+//
+// Functions relating to Drives
+//
+//***************************************************************************
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Drive_Control_Data */
+//* */
+//* Descriptive Name: This function returns an array of */
+//* Drive_Control_Records. These records provide*/
+//* important information about the drives in the*/
+//* system and provide the handles required to */
+//* access them. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: A Drive_Control_Array structure is returned. If no */
+//* errors occur, Drive_Control_Data will be non-NULL, */
+//* Count will be greater than zero, and *Error_Code will */
+//* be 0. */
+//* */
+//* Error Handling: If an error occurs, the Drive_Control_Array */
+//* returned by this function will have NULL for */
+//* Drive_Control_Data, and 0 for Count. */
+//* *Error_Code will be greater than 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The caller becomes responsible for the memory allocated */
+//* for the array of Drive_Control_Records pointed to by */
+//* Drive_Control_Data pointer in the Drive_Control_Array */
+//* structure returned by this function. The caller should */
+//* free this memory when they are done using it. */
+//* */
+//*********************************************************************/
+function Get_Drive_Control_Data(Error_Code: PCARDINAL32): Drive_Control_Array; external 'lvm' name 'Get_Drive_Control_Data';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Drive_Status */
+//* */
+//* Descriptive Name: Returns the Drive_Information_Record for the */
+//* drive specified by Drive_Handle. */
+//* */
+//* Input: ADDRESS Drive_Handle - The handle of the drive to use. */
+//* Drive handles are obtained through the*/
+//* Get_Drive_Control_Data function. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: This function returns the Drive_Information_Record for */
+//* the drive associated with the specified Drive_Handle. */
+//* If no errors occur, *Error_Code will be set to 0. If an*/
+//* error does occur, then *Error_Code will be non-zero. */
+//* */
+//* Error Handling: If an error occurs, then *Error_Code will be */
+//* non-zero. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Drive_Status(Drive_Handle: ADDRESS; Error_Code: PCARDINAL32): Drive_Information_Record; external 'lvm' name 'Get_Drive_Status';
+
+//****************************************************************************
+//
+// Functions relating to Partitions
+//
+//***************************************************************************
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Partitions */
+//* */
+//* Descriptive Name: Returns an array of partitions associated */
+//* with the object specified by Handle. */
+//* */
+//* Input:ADDRESS Handle - This is the handle of a drive or volume. */
+//* Drive handles are obtained through the */
+//* Get_Drive_Control_Data function. Volume */
+//* handles are obtained through the */
+//* Get_Volume_Control_Data function. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: This function returns a structure. The structure has */
+//* two components: an array of partition information */
+//* records and the number of entries in the array. If */
+//* Handle is the handle of a disk drive, then the returned */
+//* array will contain a partition information record for */
+//* each partition and block of free space on that drive. */
+//* If Handle is the handle of a volume, then the returned */
+//* array will contain a partition information record for */
+//* each partition which is part of the specified volume. */
+//* If no errors occur, then *Error_Code will be 0. If an */
+//* error does occur, then *Error_Code will be non-zero. */
+//* */
+//* Error Handling: Any memory allocated for the return value will */
+//* be freed. The Partition_Information_Array */
+//* returned by this function will contain a NULL */
+//* pointer for Partition_Array, and have a Count of*/
+//* 0. *Error_Code will be non-zero. */
+//* */
+//* If Handle is non-NULL and is invalid, a trap */
+//* is likely. */
+//* */
+//* Side Effects: Memory will be allocated to hold the array */
+//* returned by this function. */
+//* */
+//* Notes: The caller becomes responsible for the memory allocated */
+//* for the array of Partition_Information_Records pointed */
+//* to by Partition_Array pointer in the */
+//* Partition_Information_Array structure returned by this */
+//* function. The caller should free this memory when they */
+//* are done using it. */
+//* */
+//*********************************************************************/
+function Get_Partitions(Handle: ADDRESS; Error_Code: PCARDINAL32): Partition_Information_Array; external 'lvm' name 'Get_Partitions';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Partition_Handle */
+//* */
+//* Descriptive Name: Returns the handle of the partition whose */
+//* serial number matches the one provided. */
+//* */
+//* Input: CARDINAL32 Serial_Number - This is the serial number to */
+//* look for. If a partition with*/
+//* a matching serial number is */
+//* found, its handle will be */
+//* returned. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If a partition with a matching serial number is found, */
+//* then the function return value will be the handle */
+//* of the partition found. If no matching partition is */
+//* found, then the function return value will be NULL. */
+//* */
+//* Error Handling: If no errors occur, *Error_Code will be */
+//* LVM_ENGINE_NO_ERROR. If an error occurs, then */
+//* *Error_Code will be a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Partition_Handle(Serial_Number: CARDINAL32; Error_Code: PCARDINAL32): ADDRESS; external 'lvm' name 'Get_Partition_Handle';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Partition_Information */
+//* */
+//* Descriptive Name: Returns the Partition_Information_Record for */
+//* the partition specified by Partition_Handle. */
+//* */
+//* Input: ADDRESS Partition_Handle - The handle associated with the*/
+//* partition for which the */
+//* Partition_Information_Record */
+//* is desired. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: A Partition_Information_Record is returned. If there */
+//* is no error, then *Error_Code will be 0. If an error */
+//* occurs, *Error_Code will be non-zero. */
+//* */
+//* Error Handling: If the Partition_Handle is not a valid handle, */
+//* a trap could result. If it is a handle for */
+//* something other than a partition, an error code*/
+//* will be returned in *Error_Code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Partition_Information(Partition_Handle: ADDRESS; Error_Code: PCARDINAL32): Partition_Information_Record; external 'lvm' name 'Get_Partition_Information';
+
+//*********************************************************************/
+//* */
+//* Function Name: Create_Partition */
+//* */
+//* Descriptive Name: Creates a partition on a disk drive. */
+//* */
+//* Input: ADDRESS Handle - The handle of a disk drive or */
+//* a block of free space. */
+//* CARDINAL32 Size - The size, in sectors, of the */
+//* partition to create. */
+//* char Name[] - The name to give to the newly */
+//* created partition. */
+//* Allocation_Algorithm algorithm - If Handle is a drive, */
+//* then the engine will */
+//* find a block of free */
+//* space to use to create */
+//* the partition. This */
+//* tells the engine which */
+//* memory management */
+//* algorithm to use. */
+//* BOOLEAN Bootable - If TRUE, then the engine will */
+//* only create the partition if */
+//* it can be booted from. If */
+//* Primary_Partition is FALSE, */
+//* then it is assumed that OS/2 */
+//* is the operating system that */
+//* will be booted. */
+//* BOOLEAN Primary_Partition - If TRUE, then the */
+//* engine will create */
+//* a primary partition. */
+//* If FALSE, then the */
+//* engine will create a */
+//* logical drive. */
+//* BOOLEAN Allocate_From_Start - If TRUE, then the */
+//* engine will */
+//* allocate the new */
+//* partition from the */
+//* beginning of the */
+//* selected block of */
+//* free space. If */
+//* FALSE, then the */
+//* partition will be */
+//* allocated from the */
+//* end of the selected*/
+//* block of free */
+//* space. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: The function return value will be the handle of the */
+//* partition created. If the partition could not be */
+//* created, then NULL will be returned. */
+//* *Error_Code will be 0 if the partition was created. */
+//* *Error_Code will be > 0 if the partition could not be */
+//* created. */
+//* */
+//* Error Handling: If the partition can not be created, then any */
+//* memory allocated by this function will be */
+//* freed and the partitioning of the disk in */
+//* question will be unchanged. */
+//* */
+//* If Handle is not a valid handle, then a trap */
+//* may result. */
+//* */
+//* If Handle represents a partition or volume, */
+//* then the function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* Side Effects: A partition may be created on a disk drive. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+type
+ TPartitionName=Array[0..PARTITION_NAME_SIZE-1] of char;
+
+function Create_Partition(Handle: ADDRESS;
+Size: CARDINAL32;
+Name: TPartitionName;
+algorithm: Allocation_Algorithm;
+Bootable: BOOLEAN;
+Primary_Partition: BOOLEAN;
+Allocate_From_Start: BOOLEAN;
+Error_Code: PCARDINAL32
+): ADDRESS; external 'lvm' name 'Create_Partition';
+
+//*********************************************************************/
+//* */
+//* Function Name: Delete_Partition */
+//* */
+//* Descriptive Name: Deletes the partition specified by */
+//* Partition_Handle. */
+//* */
+//* Input: ADDRESS Partition_Handle - The handle associated with the*/
+//* partition to be deleted. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the partition was deleted */
+//* successfully. *Error_Code will be > 0 if the partition */
+//* could not be deleted. */
+//* */
+//* Error Handling: If the partition can not be deleted, then */
+//* *Error_Code will be > 0. */
+//* */
+//* If Partition_Handle is not a valid handle, a */
+//* trap may result. */
+//* */
+//* If Partition_Handle is a volume or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* Side Effects: A partition on a disk drive may be deleted. */
+//* */
+//* Notes: A partition can not be deleted if it is part of a */
+//* volume! */
+//* */
+//*********************************************************************/
+procedure Delete_Partition(Partition_Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'Delete_Partition';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Active_Flag */
+//* */
+//* Descriptive Name: Sets the Active Flag field for a partition. */
+//* */
+//* Input: ADDRESS Partition_Handle - The handle of the partition */
+//* whose Active Flag is to be set*/
+//* BYTE Active_Flag - The new value for the Active Flag. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the Active Flag was */
+//* successfully set, otherwise *Error_Code will contain a */
+//* non-zero error code indicating what went wrong. */
+//* */
+//* Error Handling: If the Active Flag can not be set, this function*/
+//* will abort without changing any disk structures.*/
+//* */
+//* If Partition_Handle is not a valid handle, a */
+//* trap may result. */
+//* */
+//* If Partition_Handle is a volume or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* */
+//* Side Effects: The Active Flag for a partition may be modified. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Active_Flag(Partition_Handle: ADDRESS;
+Active_Flag: BYTE;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Set_Active_Flag';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_OS_Flag */
+//* */
+//* Descriptive Name: Sets the OS Flag field for a partition. This */
+//* field is typically used to indicate the */
+//* filesystem used on the partition, which */
+//* generally gives an indication of which OS is */
+//* using that partition. */
+//* */
+//* Input: ADDRESS Partition_Handle - The handle of the partition */
+//* whose Active Flag is to be set*/
+//* BYTE OS_Flag - The new value for the OS Flag. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the OS Flag was successfully */
+//* set, otherwise *Error_Code will contain a non-zero error*/
+//* code indicating what went wrong. */
+//* */
+//* Error Handling: If the OS Flag can not be set, this function */
+//* will abort without changing any disk structures.*/
+//* */
+//* If Partition_Handle is not a valid handle, a */
+//* trap may result. */
+//* */
+//* If Partition_Handle is a volume or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* */
+//* Side Effects: The OS Flag for a partition may be modified. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_OS_Flag(Partition_Handle: ADDRESS;
+OS_Flag: BYTE;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Set_OS_Flag';
+
+//****************************************************************************
+//
+// Functions relating to Volumes
+//
+//***************************************************************************
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Volume_Control_Data */
+//* */
+//* Descriptive Name: This function returns a structure containing */
+//* an array of Volume_Control_Records. These */
+//* records contain information about volumes */
+//* which is invariant - i.e. will not change for */
+//* as long as the volume exists. One of the */
+//* items in the Volume_Control_Record is the */
+//* handle for the volume. This handle must be */
+//* used on all accesses to the volume. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: A Volume_Control_Array structure is returned. */
+//* */
+//* If there are no errors, then the Volume_Control_Data */
+//* pointer in the Volume_Control_Array will be non-NULL, */
+//* the Count field of the Volume_Control_Array will be */
+//* >= 0, and *Error_Code will be 0. */
+//* */
+//* If an error does occur, then the Volume_Control_Data */
+//* pointer in the the Volume_Control_Array will be NULL, */
+//* the Count field of the Volume_Control_Array will be 0, */
+//* and *Error_Code will be > 0. */
+//* */
+//* Error Handling: If an error occurs, then any memory allocated by*/
+//* this function will be freed. */
+//* */
+//* Side Effects: Memory for the returned array is allocated. */
+//* */
+//* Notes: The caller becomes responsible for the memory allocated */
+//* for the array of Volume_Control_Records pointed to by */
+//* Volume_Control_Data pointer in the Volume_Control_Array */
+//* structure returned by this function. The caller should */
+//* free this memory when they are done using it. */
+//* */
+//*********************************************************************/
+function Get_Volume_Control_Data(Error_Code: PCARDINAL32): Volume_Control_Array; external 'lvm' name 'Get_Volume_Control_Data';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Volume_Information */
+//* */
+//* Descriptive Name: This function returns the */
+//* Volume_Information_Record for the volume */
+//* associated with Volume_Handle. */
+//* */
+//* Input: ADDRESS Volume_Handle - The handle of the volume about */
+//* which information is desired. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: This function returns a Volume_Information_Record. */
+//* */
+//* If this function is successful, then *Error_Code will be*/
+//* 0. */
+//* */
+//* If this function fails, then *Error_Code will be > 0. */
+//* */
+//* Error Handling: If Volume_Handle is not a valid handle, a trap */
+//* will be likely. If Volume_Handle is a drive or*/
+//* partition handle, *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Volume_Information(Volume_Handle: ADDRESS; Error_Code: PCARDINAL32): Volume_Information_Record; external 'lvm' name 'Get_Volume_Information';
+
+//*********************************************************************/
+//* */
+//* Function Name: Create_Volume */
+//* */
+//* Descriptive Name: This function creates a volume from a list of*/
+//* partitions. The partitions are specified by */
+//* their corresponding handles. */
+//* */
+//* Input: char Name[] - The name to assign to the newly */
+//* created volume. */
+//* BOOLEAN Create_LVM_Volume - If TRUE, then an LVM */
+//* volume is created, */
+//* otherwise a */
+//* compatibility volume is */
+//* created. */
+//* BOOLEAN Bootable - If TRUE, the volume will not be */
+//* created unless OS/2 can be booted*/
+//* from it. */
+//* char Drive_Letter_Preference - This is the drive */
+//* letter to use for */
+//* accessing the */
+//* newly created */
+//* volume. */
+//* CARDINAL32 FeaturesToUse - This is currently reserved */
+//* for future use and should */
+//* always be set to 0. */
+//* CARDINAL32 Partition_Count - The number of partitions */
+//* to link together to form */
+//* the volume being created. */
+//* ADDRESS Partition_Handles[] - An array of partition */
+//* handles with one entry*/
+//* for each partition */
+//* that is to become part*/
+//* of the volume being */
+//* created. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the volume was created. */
+//* *Error_Code will be > 0 if the volume could not be */
+//* created. */
+//* */
+//* Error Handling: If any of the handles in the partition handles */
+//* array is not valid, then a trap is likely. If */
+//* Partition_Count is greater than the number of */
+//* entries in the partition handles array, then a */
+//* trap is likely. If any of the handles in the */
+//* partition array are not partition handles, then */
+//* *Error_Code will be > 0. If the volume can NOT */
+//* be created, then *Error_Code will be > 0 and any*/
+//* memory allocated by this function will be freed.*/
+//* If the volume can NOT be created, then the */
+//* existing partition/volume structure of the disk */
+//* will be unchanged. */
+//* */
+//* Side Effects: A volume may be created. */
+//* */
+//* Notes: This function provides limited compatibility for */
+//* programs written to use the LVM Version 1 interface. */
+//* Specifically, this function will only allow the */
+//* creation of compatibility volumes. Any attempt to */
+//* create an LVM volume will result in an error code being */
+//* returned. */
+//* */
+//*********************************************************************/
+type
+ TVolumeName=Array[0..VOLUME_NAME_SIZE-1] of char;
+
+procedure Create_Volume(Name: TVolumeName;
+Create_LVM_Volume: BOOLEAN;
+Bootable: BOOLEAN;
+Drive_Letter_Preference: char;
+FeaturesToUse: CARDINAL32;
+Partition_Count: CARDINAL32;
+Partition_Handles: Array of ADDRESS;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Create_Volume';
+
+//*********************************************************************/
+//* */
+//* Function Name: Create_Volume2 */
+//* */
+//* Descriptive Name: This function creates a volume from a list of*/
+//* partitions. The partitions are specified by */
+//* their corresponding handles. */
+//* */
+//* Input: char Name[] - The name to assign to the newly */
+//* created volume. */
+//* BOOLEAN Create_LVM_Volume - If TRUE, then an LVM */
+//* volume is created, */
+//* otherwise a */
+//* compatibility volume is */
+//* created. */
+//* BOOLEAN Bootable - If TRUE, the volume will not be */
+//* created unless OS/2 can be booted*/
+//* from it. */
+//* char Drive_Letter_Preference - This is the drive */
+//* letter to use for */
+//* accessing the */
+//* newly created */
+//* volume. */
+//* CARDINAL32 Feature_Count - The number of features to */
+//* install on the volume being */
+//* created. This field is */
+//* ignored if Create_LVM_Volume*/
+//* is FALSE. */
+//* LVM_Feature_Specification_Record FeaturesToUse[] - An */
+//* array of feature IDs and */
+//* their associated LVM */
+//* classes used to designate */
+//* which features to install */
+//* on the volume being */
+//* created and the order in */
+//* which to install them. */
+//* This field is ignored if */
+//* Create_LVM_Volume is */
+//* FALSE. */
+//* CARDINAL32 Partition_Count - The number of partitions */
+//* to link together to form */
+//* the volume being created. */
+//* ADDRESS Partition_Handles[] - An array of partition */
+//* handles with one entry*/
+//* for each partition */
+//* that is to become part*/
+//* of the volume being */
+//* created. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the volume was created. */
+//* *Error_Code will be > 0 if the volume could not be */
+//* created. */
+//* */
+//* Error Handling: If any of the handles in the partition handles */
+//* array is not valid, then a trap is likely. If */
+//* Partition_Count is greater than the number of */
+//* entries in the partition handles array, then a */
+//* trap is likely. If any of the handles in the */
+//* partition array are not partition handles, then */
+//* *Error_Code will be > 0. If the volume can NOT */
+//* be created, then *Error_Code will be > 0 and any*/
+//* memory allocated by this function will be freed.*/
+//* If the volume can NOT be created, then the */
+//* existing partition/volume structure of the disk */
+//* will be unchanged. */
+//* */
+//* Side Effects: A volume may be created. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+void _System Create_Volume2( char Name[VOLUME_NAME_SIZE],
+BOOLEAN Create_LVM_Volume,
+BOOLEAN Bootable,
+char Drive_Letter_Preference,
+CARDINAL32 Feature_Count,
+LVM_Feature_Specification_Record FeaturesToUse[],
+CARDINAL32 Partition_Count,
+ADDRESS Partition_Handles[],
+CARDINAL32 * Error_Code
+);
+{$endif}
+
+//*********************************************************************/
+//* */
+//* Function Name: Delete_Volume */
+//* */
+//* Descriptive Name: Deletes the volume specified by Volume_Handle.*/
+//* */
+//* Input: ADDRESS Volume_Handle - The handle of the volume to */
+//* delete. All partitions which are*/
+//* part of the specified volume will*/
+//* be deleted also. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the volume and its partitions */
+//* are successfully deleted. Otherwise, *Error_Code will */
+//* be > 0. */
+//* */
+//* Error Handling: *Error_Code will be > 0 if an error occurs. If */
+//* the volume or any of its partitions can not be */
+//* deleted, then any changes made by this function */
+//* will be undone. */
+//* */
+//* If Volume_Handle is not a valid handle, a trap */
+//* may result. */
+//* */
+//* If Volume_Handle is a partition or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* Side Effects: A volume and its partitions may be deleted. */
+//* System memory may be freed as the internal */
+//* structures used to track the deleted volume */
+//* are no longer required. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Delete_Volume(Volume_Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'Delete_Volume';
+
+//*********************************************************************/
+//* */
+//* Function Name: Hide_Volume */
+//* */
+//* Descriptive Name: Hide volume "hides" a volume from OS/2 by */
+//* removing its drive letter assignment. Without*/
+//* a drive letter assignment, OS/2 can not access*/
+//* (or "see") the volume. */
+//* */
+//* Input: ADDRESS Volume_Handle - The handle of the volume to hide.*/
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the volume was successfully */
+//* hidden. If the volume could not be hidden, then */
+//* *Error_Code will be > 0. */
+//* */
+//* Error Handling: *Error_Code will be > 0 if the volume can not be*/
+//* hidden. If the volume can not be hidden, then */
+//* nothing will be altered. */
+//* */
+//* If Volume_Handle is not a valid handle, a trap */
+//* may result. */
+//* */
+//* If Volume_Handle is a partition or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Hide_Volume(Volume_Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'Hide_Volume';
+
+//*********************************************************************/
+//* */
+//* Function Name: Expand_Volume */
+//* */
+//* Descriptive Name: This function expands an existing volume by */
+//* linking additional partitions to it. */
+//* */
+//* Input: ADDRESS Volume_Handle - The handle of the volume to be */
+//* expanded. */
+//* CARDINAL32 Partition_Count - The number of partitions or */
+//* volumes to be added to the */
+//* volume being expanded. */
+//* ADDRESS Partition_Handles[] - An array of handles. Each */
+//* handle in the array is the */
+//* handle of a partition */
+//* which is to be added to */
+//* the volume being expanded. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the volume is successfully */
+//* expanded. If the volume can not be expanded, */
+//* *Error_Code will be > 0. */
+//* */
+//* Error Handling: If the volume can not be expanded, the state of */
+//* the volume is unchanged and any memory allocated*/
+//* by this function is freed. */
+//* */
+//* If Volume_Handle is not a valid handle, a trap */
+//* may result. */
+//* */
+//* If Volume_Handle is a partition or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* If any of the partition handles in the */
+//* Partition_handles array are not valid handles, */
+//* then a trap may result. */
+//* */
+//* If any of the partition handles in the */
+//* Partition_Handles array are actually drive */
+//* handles, then this function will abort and */
+//* set *Error_Code to a non-zero value. */
+//* */
+//* If Partition_Count is greater than the number of*/
+//* entries in the Partition_Handles array, a trap */
+//* may result. */
+//* */
+//* Side Effects: A volume may be expanded. If the volume is */
+//* expanded using another volume, the partitions */
+//* on the second volume will be linked to those of */
+//* the first volume and all data on the second */
+//* volume will be lost. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Expand_Volume(Volume_Handle: ADDRESS;
+Partition_Count: CARDINAL32;
+Partition_Handles: Array of ADDRESS;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Expand_Volume';
+
+//*********************************************************************/
+//* */
+//* Function Name: Assign_Drive_Letter */
+//* */
+//* Descriptive Name: Assigns a drive letter to a volume. */
+//* */
+//* Input: ADDRESS Volume_Handle - The handle of the volume which */
+//* is to have its assigned drive */
+//* letter changed. */
+//* char New_Drive_Preference - The new drive letter to */
+//* assign to the volume. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the drive letter was assigned */
+//* successfully; otherwise *Error_Code will be > 0. */
+//* */
+//* Error Handling: If the drive letter assignment can not be made, */
+//* the volume will not be altered. */
+//* */
+//* If Volume_Handle is not a valid handle, a trap */
+//* may result. */
+//* */
+//* If Volume_Handle is a partition or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* Side Effects: A volume may have its drive letter assignment */
+//* changed. */
+//* */
+//* Notes: If the drive letter being assigned is already in use by */
+//* volume which does not lie on removable media, then the */
+//* drive assignment will NOT be made. */
+//* */
+//*********************************************************************/
+procedure Assign_Drive_Letter(Volume_Handle: ADDRESS;
+New_Drive_Preference: char;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Assign_Drive_Letter';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Installable */
+//* */
+//* Descriptive Name: Marks a volume as being the volume to install */
+//* OS/2 on. */
+//* */
+//* Input: ADDRESS Volume_Handle - The handle of the volume to which*/
+//* OS/2 should be installed. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If the volume is successfully marked as installable, */
+//* *Error_Code will be 0; otherwise *Error_Code will */
+//* be > 0. */
+//* */
+//* Error Handling: If Volume_Handle is not a valid handle, a trap */
+//* may result. */
+//* */
+//* If Volume_Handle is a partition or drive handle,*/
+//* then this function will abort and set */
+//* *Error_Code to a non-zero value. */
+//* */
+//* Side Effects: The specified volume may be marked as */
+//* installable. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Installable(Volume_Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'Set_Installable';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Installable_Volume */
+//* */
+//* Descriptive Name: Marks a volume as being the volume to install */
+//* OS/2 on. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If a volume is mared installable, its information will */
+//* be returned and *Error_Code will be LVM_ENGINE_NO_ERROR.*/
+//* If there is no volume marked installable, then */
+//* *Error_Code will be > 0. */
+//* */
+//* Error Handling: An error code is returned if there is an error. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Installable_Volume(Error_Code: PCARDINAL32): Volume_Information_Record; external 'lvm' name 'Get_Installable_Volume';
+
+//*********************************************************************/
+//* */
+//* Function Name: Convert_Volumes_To_V1 */
+//* */
+//* Descriptive Name: This function attempts to convert all LVM */
+//* volumes in the system into a format that can */
+//* be used by LVM Version 1, which was shipped */
+//* with Warp Server for e-business. This */
+//* function returns a bitmap of the drive letters*/
+//* corresponding to Volumes that can not be */
+//* converted. */
+//* */
+//* Input: BOOLEAN * Hidden_Volume_Conversion_Failure - The address */
+//* of a BOOLEAN variable in which */
+//* to store a flag indicating if */
+//* there were hidden volumes that */
+//* could not be converted. If */
+//* *Hidden_Volume_Conversion_Failure */
+//* is TRUE, then there were hidden */
+//* volumes that could not be */
+//* converted. If FALSE, then there */
+//* were no hidden volumes, or the */
+//* hidden volumes that existed were */
+//* converted successfully. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: This function returns a bitmap of the drive letters */
+//* corresponding to volumes that could not be converted to */
+//* LVM Version 1 format. If this function is successful */
+//* and all volumes were converted, then *Error_Code will be*/
+//* set to LVM_ENGINE_NO_ERROR and the bitmap returned will */
+//* have no bits set. If this function failes, *Error_Code */
+//* will contain a non-zero error code and the bitmap */
+//* returned by this function may be non-zero. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: All LVM volumes that can be converted to LVM */
+//* Version 1 format will be. */
+//* */
+//* Notes: Bit 0 in the bitmap returned by this function represents*/
+//* drive letter 'A'. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+CARDINAL32 _System Convert_Volumes_To_V1 ( BOOLEAN * Hidden_Volume_Conversion_Failure,
+CARDINAL32 * Error_Code ) ;
+{$endif}
+
+//***************************************************************************
+//
+// Functions relating to Partitions, Drives, and Volumes.
+//
+//***************************************************************************
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Name */
+//* */
+//* Descriptive Name: Sets the name of a volume, drive, or partition*/
+//* */
+//* Input: ADDRESS Handle - The handle of the drive, partition, or */
+//* volume which is to have its name set. */
+//* char New_Name[] - The new name for the drive/partition/ */
+//* volume. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the name is set as specified. */
+//* If the name can not be set, *Error_Code will be > 0. */
+//* */
+//* Error Handling: If the name can not be set, then drive/volume/ */
+//* partition is not modified. */
+//* */
+//* If Handle is not a valid handle, a trap may */
+//* result. */
+//* */
+//* Side Effects: A drive/volume/partition may have its name set. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Name(Handle: ADDRESS;
+New_Name: Array of char;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Set_Name';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Startable */
+//* */
+//* Descriptive Name: Sets the specified volume or partition */
+//* startable. If a volume is specified, it must */
+//* be a compatibility volume whose partition is */
+//* a primary partition on the first drive. If a */
+//* partition is specified, it must be a primary */
+//* partition on the first drive in the system. */
+//* */
+//* Input: ADDRESS Handle - The handle of the partition or volume */
+//* which is to be set startable. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the specified volume or */
+//* partition was set startable. */
+//* If the name can not be set, *Error_Code will be > 0. */
+//* */
+//* Error Handling: If the volume or partition could not be set */
+//* startable, then nothing in the system is */
+//* changed. */
+//* */
+//* If Handle is not a valid handle, a trap may */
+//* result. */
+//* */
+//* Side Effects: Any other partition or volume which is marked */
+//* startable will have its startable flag cleared. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Startable(Handle: ADDRESS;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Set_Startable';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Valid_Options */
+//* */
+//* Descriptive Name: Returns a bitmap where each bit in the bitmap */
+//* corresponds to a possible operation that the */
+//* LVM Engine can perform. Those bits which are */
+//* 1 represent operations which can be performed */
+//* on the item specified by Handle. Those bits */
+//* which are 0 are not allowed on the item */
+//* specified by Handle. */
+//* */
+//* Input: ADDRESS Handle - This is any valid drive, volume, or */
+//* partition handle. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: A bitmap indicating which operations are valid on the */
+//* item specified by Handle. */
+//* */
+//* If no errors occur, *Error_Code will be 0, otherwise */
+//* *Error_Code will be > 0. */
+//* */
+//* Error Handling: If Handle is not valid, a trap will be likely. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The values of the various bits in the bitmap returned */
+//* by this function are defined near the beginning of this */
+//* file, immediately after all of the structure */
+//* definitions. */
+//* */
+//*********************************************************************/
+function Get_Valid_Options(Handle: ADDRESS; Error_Code: PCARDINAL32): CARDINAL32; external 'lvm' name 'Get_Valid_Options';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Child_Handles */
+//* */
+//* Descriptive Name: Given the handle of a volume or aggregate, */
+//* this function will return the handles of the */
+//* children of the volume or aggregate. This */
+//* allows the entire tree representation of a */
+//* volume to be traversed, a level at a time. */
+//* */
+//* Input: ADDRESS Handle - The handle of the volume or aggregate */
+//* whose children are required. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: If successful, an LVM_Handle_Array_Record is returned */
+//* with a non-zero Count. Also, *Error_Code will be set */
+//* to LVM_ENGINE_NO_ERROR. If an error occurs, then */
+//* the Count field will be 0 and *Error_Code will contain */
+//* a non-zero error code. */
+//* */
+//* Error Handling: If Handle is not a valid handle, then a trap is */
+//* likely. If Handle is the handle of partition, */
+//* then *Error_Code will be set to */
+//* LVM_ENGINE_NO_CHILDREN. If Handle is not a */
+//* volume or aggregate handle, then *Error_Code */
+//* will be set to LVM_ENGINE_BAD_HANDLE. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+LVM_Handle_Array_Record _System Get_Child_Handles( ADDRESS Handle, CARDINAL32 * Error_Code);
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Get_Parent_Handle */
+//* */
+//* Descriptive Name: Given the handle of a partition or aggregate, */
+//* this function will return the handle of the */
+//* parent of the partition or aggregate. */
+//* */
+//* Input: ADDRESS Handle - The handle of the partition or aggregate*/
+//* whose parent is required. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: If successful, the handle of the parent is returned */
+//* as the function result and *Error_Code will be set to */
+//* LVM_ENGINE_NO_ERROR. */
+//* If an error occurs, then NULL will be the function */
+//* result and *Error_Code will contain a non-zero error */
+//* code. */
+//* */
+//* Error Handling: If Handle is not a valid handle, then a trap is */
+//* likely. If Handle is the handle of volume, */
+//* then *Error_Code will be set to */
+//* LVM_ENGINE_NO_PARENT. If Handle is not the */
+//* handle of a volume, partition, or aggregate */
+//* then *Error_Code will be set to */
+//* LVM_ENGINE_BAD_HANDLE. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+ADDRESS _System Get_Parent_Handle( ADDRESS Handle, CARDINAL32 * Error_Code);
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Get_Features */
+//* */
+//* Descriptive Name: Returns the feature ID information for each of*/
+//* the features that are installed on the */
+//* item specified by Handle. */
+//* */
+//* Input: ADDRESS Handle - The handle of the object to use. */
+//* */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code */
+//* should an error occur. */
+//* */
+//* Output: If successful, a Feature_Information_Array structure is */
+//* returned with a non-zero Count. Also, *Error_Code will */
+//* be set to LVM_ENGINE_NO_ERROR. If an error occurs, */
+//* then the Count field in the structure will be 0 and */
+//* ( *Error_Code) will contain a non-zero error code. */
+//* */
+//* Error Handling: If Handle is not a valid handle, a trap */
+//* will be likely. */
+//* */
+//* Side Effects: Memory is allocated using the LVM Engine's memory*/
+//* manager for the array of Feature_ID_Data items */
+//* being returned. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+Feature_Information_Array _System Get_Features( ADDRESS Handle, CARDINAL32 * Error_Code );
+{$endif}
+//***************************************************************************
+//
+// Functions relating to Boot Manager
+//
+//***************************************************************************
+
+//*********************************************************************/
+//* */
+//* Function Name: Boot_Manager_Is_Installed */
+//* */
+//* Descriptive Name: Indicates whether or not Boot Manager is */
+//* installed on the first or second hard drives */
+//* in the system. */
+//* */
+//* Input: BOOLEAN * Active - *Active is set to TRUE if LVM found an*/
+//* active copy of Boot Manager on the */
+//* system. If LVM could not find an */
+//* active copy of Boot Manager on the */
+//* system, but did find an inactive copy */
+//* of Boot Manager, then *Active will be */
+//* set to FALSE. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: TRUE is returned if Boot Manager is found. If this */
+//* copy of Boot Manager is Active, then *Active will be set*/
+//* to TRUE. If the copy of Boot Manager is not currently */
+//* active, then *Active will be set to FALSE. */
+//* */
+//* FALSE is returned if Boot Manager is not found or if an */
+//* error occurs. In this case, *Active is undefined. */
+//* */
+//* *Error_Code will be 0 if no errors occur; otherwise it */
+//* will be > 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+type
+ PBOOLEAN=^BOOLEAN;
+
+function Boot_Manager_Is_Installed(Active: PBOOLEAN; Error_Code: PCARDINAL32): BOOLEAN; external 'lvm' name 'Boot_Manager_Is_Installed';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Boot_Manager_Handle */
+//* */
+//* Descriptive Name: Returns the handle of the partition containing*/
+//* Boot Manager. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If Boot Manager is NOT installed, NULL is returned. */
+//* If Boot Manager is installed, whether it is active or */
+//* not, the handle of the partition it resides in is */
+//* returned. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: */
+//* */
+//*********************************************************************/
+function Get_Boot_Manager_Handle(Error_Code: PCARDINAL32): ADDRESS; external 'lvm' name 'Get_Boot_Manager_Handle';
+
+//*********************************************************************/
+//* */
+//* Function Name: Add_To_Boot_Manager */
+//* */
+//* Descriptive Name: Adds the volume/partition to the Boot Manager */
+//* menu. */
+//* */
+//* Input: ADDRESS Handle - The handle of a partition or volume that*/
+//* is to be added to the Boot Manager menu.*/
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the partition or volume was */
+//* successfully added to the Boot Manager menu; otherwise */
+//* *Error_Code will be > 0. */
+//* */
+//* Error Handling: If the partition/volume can not be added to the */
+//* Boot Manager menu, no action is taken and */
+//* *Error_Code will contain a non-zero error code. */
+//* */
+//* If Handle is not a valid handle, a trap may */
+//* result. */
+//* */
+//* If Handle represents a drive, then this function*/
+//* will abort and set *Error_Code to a non-zero */
+//* value. */
+//* */
+//* Side Effects: The Boot Manager menu may be altered. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Add_To_Boot_Manager(Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'Add_To_Boot_Manager';
+
+//*********************************************************************/
+//* */
+//* Function Name: Remove_From_Boot_Manager */
+//* */
+//* Descriptive Name: Removes the specified partition or volume */
+//* from the Boot Manager menu. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* */
+//* Output: *Error_Code will be 0 if the partition or volume was */
+//* successfully removed to the Boot Manager menu; */
+//* otherwise *Error_Code will be > 0. */
+//* */
+//* Error Handling: If Handle is not a valid handle, a trap may */
+//* result. */
+//* */
+//* If Handle represents a drive, or if Handle */
+//* represents a volume or partition which is NOT on*/
+//* the boot manager menu, then this function */
+//* will abort and set *Error_Code to a non-zero */
+//* value. */
+//* */
+//* Side Effects: The Boot Manager menu may be altered. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Remove_From_Boot_Manager(Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'Remove_From_Boot_Manager';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Boot_Manager_Menu */
+//* */
+//* Descriptive Name: Returns an array containing the handles of the*/
+//* partitions and volumes appearing on the */
+//* Boot Manager menu. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: The function returns a Boot_Manager_Menu structure. */
+//* This structure contains two items: a pointer to an array*/
+//* of Boot_Manager_Menu_Items and a count of how many items*/
+//* are in the array. Each Boot_Manager_Menu_Item contains */
+//* a handle and a BOOLEAN variable to indicate whether the */
+//* handle is for a partition or a volume. */
+//* */
+//* If this function is successful, then *Error_Code will */
+//* be 0. */
+//* */
+//* If an error occurs, the Count field in the */
+//* Boot_Manager_Menu will be 0 and the corresponding */
+//* pointer will be NULL. *Error_Code will be > 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* any memory allocated by this function will be */
+//* freed. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Boot_Manager_Menu(Error_Code: PCARDINAL32): Boot_Manager_Menu; external 'lvm' name 'Get_Boot_Manager_Menu';
+
+//*********************************************************************/
+//* */
+//* Function Name: Install_Boot_Manager */
+//* */
+//* Descriptive Name: This function installs Boot Manager. It can */
+//* be used to replace an existing Boot Manager */
+//* as well. */
+//* */
+//* Input: CARDINAL32 Drive_Number - The number of the drive to */
+//* install Boot Manager on. Must*/
+//* be 1 or 2. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If this function is successful, then *Error_Code will be*/
+//* 0; otherwise it will be > 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be set to a*/
+//* non-zero value. Depending upon the error, it */
+//* is possible that the Boot Manager partition can */
+//* be left in an unusuable state (such as for a */
+//* write error). */
+//* */
+//* Side Effects: Boot Manager may be installed on drive 1 or 2. */
+//* The MBR for drive 1 may be altered. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+// Only drives 0 and 1 are acceptable.
+procedure Install_Boot_Manager(Drive_Number: CARDINAL32; Error_Code: PCARDINAL32); external 'lvm' name 'Install_Boot_Manager';
+
+//*********************************************************************/
+//* */
+//* Function Name: Remove_Boot_Manager */
+//* */
+//* Descriptive Name: Removes Boot Manager from the system. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if Boot Manager was successfully */
+//* removed from the system; otherwise *Error_Code will */
+//* be 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: Boot Manager will be removed from the system. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Remove_Boot_Manager(Error_Code: PCARDINAL32); external 'lvm' name 'Remove_Boot_Manager';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Boot_Manager_Options */
+//* */
+//* Descriptive Name: Sets the Boot Managers Options. The options */
+//* that can be set are: whether or not the time- */
+//* out timer is active, how long the timer-out */
+//* is, the partition to boot by default, and */
+//* whether or not Boot Manager should display its*/
+//* menu using default mode or advanced mode. */
+//* */
+//* Input: ADDRESS Handle - The handle of the partition or volume */
+//* to boot if the time-out timer is active */
+//* and the time-out value is reached. */
+//* BOOLEAN Timer_Active - If TRUE, then the time-out timer */
+//* is active. */
+//* CARDINAL32 Time_Out_Value - If the time-out timer is */
+//* active, this is the time-out */
+//* value, in seconds. */
+//* BOOLEAN Advanced_Mode - If TRUE, then Boot Manager will */
+//* operate in advanced mode. If */
+//* FALSE, then normal mode will be */
+//* in effect. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if no errors occur. If an error */
+//* does occur, then *Error_Code will be > 0. */
+//* */
+//* Error Handling: If an error occurs, no changes will be made to */
+//* Boot Manager and *Error_Code will be set a */
+//* non-zero error code. */
+//* */
+//* Side Effects: Boot Manager may be modified. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Boot_Manager_Options(Handle: ADDRESS;
+Timer_Active: BOOLEAN;
+Time_Out_Value: CARDINAL32;
+Advanced_Mode: BOOLEAN;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Set_Boot_Manager_Options';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Boot_Manager_Options */
+//* */
+//* Descriptive Name: This function returns the current Boot Manager*/
+//* settings for the various Boot Manager options.*/
+//* */
+//* Input: ADDRESS * Handle - The handle for the default boot volume*/
+//* or partition. */
+//* BOOLEAN * Handle_Is_Volume - If TRUE, then Handle */
+//* represents a volume. If */
+//* FALSE, then Handle */
+//* represents a partition. */
+//* BOOLEAN * Timer_Active - If TRUE, then the time-out timer*/
+//* is active. If FALSE, then the */
+//* time-out timer is not active. */
+//* CARDINAL32 * Time_Out_Value - If the time-out timer is */
+//* active, then this is the */
+//* number of seconds that Boot*/
+//* Manager will wait for user */
+//* input before booting the */
+//* default volume/partition. */
+//* BOOLEAN * Advanced_Mode - If TRUE, the Boot Manager is */
+//* operating in advanced mode. If*/
+//* FALSE, then Boot Manager is */
+//* operating in normal mode. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Handle, *Handle_Is_Volume, *Timer_Active, */
+//* *Time_out_value, *Advanced_Mode, and *Error_Code are all*/
+//* set by this function. If there are no errors, then */
+//* *Error_Code will be set to 0. If any errors occur, then*/
+//* *Error_Code will be > 0. */
+//* */
+//* Error Handling: If any of the parameters are invalid, then a */
+//* trap is likely. If Boot Manager is not */
+//* installed, then *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Get_Boot_Manager_Options(Handle: PADDRESS;
+Handle_Is_Volume: PBOOLEAN;
+Timer_Active: PBOOLEAN;
+Time_Out_Value: PCARDINAL32;
+Advanced_Mode: PBOOLEAN;
+Error_Code: PCARDINAL32
+); external 'lvm' name 'Get_Boot_Manager_Options';
+
+//****************************************************************************
+//
+// Other Functions
+//
+//***************************************************************************
+
+//*********************************************************************/
+//* */
+//* Function Name: Allocate_Engine_Memory */
+//* */
+//* Descriptive Name: Allocates a block of memory using LVM.DLL's */
+//* memory management functions. */
+//* */
+//* Input: CARDINAL32 Size - The number of bytes of memory to */
+//* allocate. */
+//* */
+//* Output: The address of the block of memory which was allocated, */
+//* or NULL if the requested amount of memory could not be */
+//* allocated. */
+//* */
+//* Error Handling: None. */
+//* */
+//* Side Effects: The specified number of bytes is allocated from */
+//* the memory manager imbedded in LVM.DLL. Memory */
+//* allocated by this function must be freed using */
+//* Free_Engine_Memory function. The use of any */
+//* memory manager to free the memory could result in*/
+//* Bad Things Happening! */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+{$ifdef lvm2}
+ADDRESS _System Allocate_Engine_Memory( CARDINAL32 Size );
+{$endif}
+//*********************************************************************/
+//* */
+//* Function Name: Free_Engine_Memory */
+//* */
+//* Descriptive Name: Frees a memory object created by LVM.DLL and */
+//* returned to a user of LVM.DLL. */
+//* */
+//* Input: ADDRESS Object : The address of the memory object to */
+//* free. This could be the */
+//* Drive_Control_Data field of a */
+//* Drive_Control_Record, the */
+//* Partition_Array field of a */
+//* Partition_Information_Array structure, */
+//* or any other dynamically allocated */
+//* memory object created by LVM.DLL and */
+//* returned by a function in LVM.DLL. */
+//* */
+//* Output: None. */
+//* */
+//* Error Handling: None. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: A trap or exception could occur if a bad address is */
+//* passed into this function. */
+//* */
+//*********************************************************************/
+procedure Free_Engine_Memory(Object_: ADDRESS); external 'lvm' name 'Free_Engine_Memory';
+
+//*********************************************************************/
+//* */
+//* Function Name: New_MBR */
+//* */
+//* Descriptive Name: This function lays down a new MBR on the */
+//* specified drive. */
+//* */
+//* Input: ADDRESS Drive_Handle - The handle of the drive on which */
+//* the new MBR is to be placed. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if the new MBR was successfully */
+//* placed on the specified drive. If the operation failed */
+//* for any reason, then *Error_Code will contain a non-zero*/
+//* error code. */
+//* */
+//* Error Handling: If an error occurs, then the existing MBR is not*/
+//* altered and *Error_Code will be > 0. */
+//* */
+//* Side Effects: A new MBR may be placed on the specified drive. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure New_MBR(Drive_Handle: ADDRESS; Error_Code: PCARDINAL32); external 'lvm' name 'New_MBR';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Available_Drive_Letters */
+//* */
+//* Descriptive Name: This function returns a bitmap indicating */
+//* which drive letters are available for use. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: This function returns a bitmap of the available drive */
+//* letters. If this function is successful, then */
+//* *Error_Code will be set to 0. Otherwise, *Error_Code */
+//* will be > 0 and the bitmap returned will have all bits */
+//* set to 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: A drive letter is available if it is not associated */
+//* with a volume located on a disk drive controlled */
+//* by OS2DASD. */
+//* */
+//*********************************************************************/
+function Get_Available_Drive_Letters(Error_Code: PCARDINAL32): CARDINAL32; external 'lcm' name 'Get_Available_Drive_Letters';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Reserved_Drive_Letters */
+//* */
+//* Descriptive Name: This function returns a bitmap indicating */
+//* which drive letters are reserved for use by */
+//* devices NOT under the control of LVM. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: This function returns a bitmap of the drive letters */
+//* which are being used by devices which are NOT controlled*/
+//* by LVM. While a Volume CAN be assigned a drive letter */
+//* from this list, a reboot will almost always be required */
+//* in order for the assignment to take place. */
+//* If this function is successful, then *Error_Code will be*/
+//* set to 0. Otherwise, *Error_Code will be > 0 and the */
+//* bitmap returned will have all bits set to 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: Devices which are assigned drive letters but which are */
+//* NOT under LVM control include: CD-ROM, Network drives, */
+//* parallel port attached devices, and any DASD devices */
+//* not controlled by OS2DASD. */
+//* */
+//*********************************************************************/
+function Get_Reserved_Drive_Letters(Error_Code: CARDINAL32): CARDINAL32; external 'lvm' name 'Get_Reserved_Drive_Letters';
+
+//*********************************************************************/
+//* */
+//* Function Name: Reboot_Required */
+//* */
+//* Descriptive Name: This function indicates whether or not any */
+//* changes were made to the partitioning of the */
+//* disks in the system which would require a */
+//* reboot to make functional. */
+//* */
+//* Input: None. */
+//* */
+//* Output: The function return value will be TRUE if the system */
+//* must be rebooted as a result of disk partitioning */
+//* changes. */
+//* */
+//* Error Handling: None required. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Reboot_Required: BOOLEAN; external 'lvm' name 'Reboot_Required';
+
+//*********************************************************************/
+//* */
+//* Function Name: Changes_Pending */
+//* */
+//* Descriptive Name: This function indicates whether or not any */
+//* changes were made to the partitioning of the */
+//* disks in the system which have not yet been */
+//* comitted to disk. */
+//* */
+//* Input: None. */
+//* */
+//* Output: The function return value will be TRUE if there are */
+//* uncomitted changes to the partitioning of one or more of*/
+//* the drives in the system. */
+//* */
+//* Error Handling: None required. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Changes_Pending: BOOLEAN; external 'lvm' name 'Changes_Pending';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Reboot_Flag */
+//* */
+//* Descriptive Name: This function sets the Reboot Flag. The */
+//* Reboot Flag is a special flag on the boot */
+//* disk used by the install program to keep */
+//* track of whether or not the system was just */
+//* rebooted. It is used by the various phases */
+//* of install. */
+//* */
+//* Input: BOOLEAN Reboot - The new value for the Reboot Flag. If */
+//* TRUE, then the reboot flag will be set. */
+//* If FALSE, then the reboot flag will be */
+//* cleared. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be set to 0 if there are no errors. */
+//* *Error_Code will be > 0 if an error occurs. */
+//* */
+//* Error Handling: If an error occurs, then the value of the Reboot*/
+//* Flag will be unchanged. */
+//* */
+//* Side Effects: The value of the Reboot Flag may be changed. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Reboot_Flag(Reboot: BOOLEAN; Error_Code: PCARDINAL32); external 'lvm' name 'Set_Reboot_Flag';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Reboot_Flag */
+//* */
+//* Descriptive Name: This function returns the value of the Reboot */
+//* Flag. The Reboot Flag is a special flag on */
+//* the boot disk used by the install program to */
+//* keep track of whether or not the system was */
+//* just rebooted. It is used by the various */
+//* phases of install. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: The function return value will be TRUE if no errors */
+//* occur and the Reboot Flag is set. *Error_Code will be */
+//* 0 under these conditions. If an error occurs, the */
+//* function return value will be FALSE and *Error_Code */
+//* will be > 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* The value of the reboot flag will be unchanged. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Reboot_Flag(Error_Code: PCARDINAL32): BOOLEAN; external 'lvm' name 'Get_Reboot_Flag';
+
+//*********************************************************************/
+//* */
+//* */
+//* Function Name: Set_Install_Flags */
+//* */
+//* Descriptive Name: This function sets the value of the Install */
+//* Flags. The Install Flags reside in a 32 bit */
+//* field in the LVM dataspace. These flags are */
+//* not used by LVM, thereby leaving Install free */
+//* to use them for whatever it wants. */
+//* */
+//* Input: CARDINAL32 Install_Flags - The new value for the Install */
+//* Flags. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be set to 0 if there are no errors. */
+//* *Error_Code will be > 0 if an error occurs. */
+//* */
+//* Error Handling: If an error occurs, then the value of the */
+//* Install Flags will be unchanged. */
+//* */
+//* Side Effects: The value of the Install Flags may be changed. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Install_Flags(Install_Flags: CARDINAL32; Error_Code: PCARDINAL32); external 'lvm' name 'Set_Install_Flags';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_Install_Flags */
+//* */
+//* Descriptive Name: This function returns the value of the Install*/
+//* Flags. The Install Flags reside in a 32 bit */
+//* field in the LVM dataspace. These flags are */
+//* not used by LVM, thereby leaving Install free */
+//* to use them for whatever it wants. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: The function returns the current value of the Install */
+//* Flags stored in the LVM Dataspace. */
+//* *Error_Code will be LVM_ENGINE_NO_ERROR if the function */
+//* is successful. If an error occurs, the function will */
+//* return 0 and *Error_Code will be > 0. */
+//* */
+//* Error Handling: If an error occurs, *Error_Code will be > 0. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+function Get_Install_Flags(Error_Code: PCARDINAL32): CARDINAL32; external 'lvm' name 'Get_Install_Flags';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Min_Install_Size */
+//* */
+//* Descriptive Name: This function tells the LVM Engine how big a */
+//* partition/volume must be in order for it to */
+//* marked installable. If this function is not */
+//* used to set the minimum size for an */
+//* installable partition/volume, the LVM Engine */
+//* will use a default value of 300 MB. */
+//* */
+//* Input: CARDINAL32 Min_Sectors - The minimum size, in sectors, */
+//* that a partition must be in */
+//* order for it to be marked as */
+//* installable. */
+//* */
+//* Output: None. */
+//* */
+//* Error Handling: None required. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Min_Install_Size(Min_Sectors: CARDINAL32); external 'lvm' name 'Set_Min_Install_Size';
+
+//*********************************************************************/
+//* */
+//* Function Name: Set_Free_Space_Threshold */
+//* */
+//* Descriptive Name: This function tells the LVM Engine not to */
+//* report blocks of free space which are less */
+//* than the size specified. The engine defaults */
+//* to not reporting blocks of free space which */
+//* are smaller than 2048 sectors (1 MB). */
+//* */
+//* Input: CARDINAL32 Min_Sectors - The minimum size, in sectors, */
+//* that a block of free space must */
+//* be in order for the LVM engine */
+//* to report it. */
+//* */
+//* Output: None. */
+//* */
+//* Error Handling: None required. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Set_Free_Space_Threshold(Min_Sectors: CARDINAL32); external 'lvm' name 'Set_Free_Space_Threshold';
+
+//*********************************************************************/
+//* */
+//* Function Name: Read_Sectors */
+//* */
+//* Descriptive Name: This function reads one or more sectors from */
+//* the specified drive and places the data read */
+//* in Buffer. */
+//* */
+//* Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
+//* read from. The drives in the */
+//* system are numbered from 1 to */
+//* n, where n is the total number */
+//* of hard drives in the system. */
+//* LBA Starting_Sector : The first sector to read from. */
+//* CARDINAL32 Sectors_To_Read : The number of sectors to */
+//* read into memory. */
+//* ADDRESS Buffer : The location to put the data read into. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful, then the data read will be placed in */
+//* memory starting at Buffer, and *Error will be */
+//* LVM_ENGINE_NO_ERROR. */
+//* If Unsuccessful, then *Error will be > 0 and the */
+//* contents of memory starting at Buffer is undefined. */
+//* */
+//* Error Handling: *Error will be > 0 if an error occurs. */
+//* */
+//* Side Effects: Data may be read into memory starting at Buffer. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Read_Sectors(Drive_Number: CARDINAL32;
+Starting_Sector: LBA;
+Sectors_To_Read: CARDINAL32;
+Buffer: ADDRESS;
+Error: PCARDINAL32); external 'lvm' name 'Read_Sectors';
+
+//*********************************************************************/
+//* */
+//* Function Name: Write_Sectors */
+//* */
+//* Descriptive Name: This function writes data from memory to one */
+//* or more sectors on the specified drive. */
+//* */
+//* Input: CARDINAL32 Drive_Number : The number of the hard drive to*/
+//* write to. The drives in the */
+//* system are numbered from 1 to */
+//* n, where n is the total number */
+//* of hard drives in the system. */
+//* LBA Starting_Sector : The first sector to write to. */
+//* CARDINAL32 Sectors_To_Read : The number of sectors to */
+//* be written. */
+//* ADDRESS Buffer : The location of the data to be written */
+//* to disk. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful, then the data at Buffer will be placed */
+//* on the disk starting at the sector specified, and */
+//* *Error will be LVM_ENGINE_NO_ERROR. */
+//* If Unsuccessful, then *Error will be > 0 and the */
+//* contents of the disk starting at sector */
+//* Starting_Sector is undefined. */
+//* */
+//* Error Handling: *Error will be > 0 if an error occurs. */
+//* */
+//* Side Effects: Data may be written to disk. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Write_Sectors(Drive_Number: CARDINAL32;
+Starting_Sector: LBA;
+Sectors_To_Write: CARDINAL32;
+Buffer: ADDRESS;
+Error: PCARDINAL32); external 'lvm' name 'Write_Sectors';
+
+//*********************************************************************/
+//* */
+//* Function Name: Rediscover_PRMs */
+//* */
+//* Descriptive Name: Causes OS2LVM and OS2DASD to check PRMs for */
+//* new or changed media. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If the Rediscover PRM operation was successful, then */
+//* *Error_Code will be LVM_ENGINE_NO_ERROR. If there */
+//* was an error, then *Error_Code will be > 0. */
+//* */
+//* Error Handling: None. */
+//* */
+//* Side Effects: New volumes may be discovered and assigned drive */
+//* letters by OS2LVM and OS2DASD. */
+//* */
+//* Notes: The LVM Engine must be CLOSED when this function is */
+//* called as this function is disabled while it is open! */
+//* */
+//*********************************************************************/
+procedure Rediscover_PRMs(Error_Code: PCARDINAL32); external 'lvm' name 'Rediscover_PRMs';
+
+//*********************************************************************/
+//* */
+//* Function Name: Get_LVM_View */
+//* */
+//* Descriptive Name: This function gets the OS2LVM data for the */
+//* specified drive letter. The intent is to */
+//* allow the determination of what drive letter */
+//* a volume really has given the possibilities */
+//* of conflict or a drive preference of '*'. */
+//* */
+//* Input: char IFSM_Drive_Letter : The drive letter for which the*/
+//* OS2LVM data is requested. */
+//* CARDINAL32 * Drive_Number : The address of a variable */
+//* to hold the OS/2 drive */
+//* number of the drive */
+//* containing the first */
+//* partition of the volume */
+//* currently assigned to the */
+//* requested drive letter. */
+//* CARDINAL32 * Partition_LBA : The address of a variable */
+//* to hold the LBA of the */
+//* first partition of the */
+//* volume currently assigned */
+//* to the requested drive */
+//* letter. */
+//* char * LVM_Drive_Letter : The address of a variable to */
+//* hold the drive letter that */
+//* OS2LVM thinks the volume */
+//* assigned to the requested */
+//* drive letter should have. */
+//* BYTE * UnitID : The address of a variable to hold the */
+//* OS2LVM unit ID for the volume associated*/
+//* with the requested drive letter. */
+//* */
+//* Output: The function return value will be TRUE if the function */
+//* completed successfully. */
+//* */
+//* Error Handling: If this function fails, the specified drive */
+//* letter is either not in use, or is in use by a */
+//* device not controlled by OS2LVM. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: This function can be used with the LVM Engine open or */
+//* closed. */
+//* */
+//*********************************************************************/
+function Get_LVM_View(IFSM_Drive_Letter: char;
+Drive_Number: PCARDINAL32;
+Partition_LBA: PCARDINAL32;
+LVM_Drive_Letter: Pchar;
+UnitID: PBYTE): BOOLEAN; external 'lvm' name 'Get_LVM_View';
+
+//*********************************************************************/
+//* */
+//* Function Name: Start_Logging */
+//* */
+//* Descriptive Name: Enables the LVM Engine logging. Once enabled,*/
+//* the LVM Engine logging function will log all */
+//* LVM Engine activity to the specified log file.*/
+//* The data is logged in a binary format for */
+//* compactness and speed. */
+//* */
+//* Input: char * Filename - The filename of the file to use as the */
+//* log file. */
+//* CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: If the logging file was successfully created, then */
+//* *Error_Code will be 0. If the log file could not be */
+//* created, then *Error_Code will be > 0. */
+//* */
+//* Error Handling: If the log file can not be created, then */
+//* *Error_Code will be > 0. */
+//* */
+//* Side Effects: A file may be created/opened for logging of */
+//* LVM Engine actions. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Start_Logging(Filename: Pchar; Error_Code: PCARDINAL32); external 'lvm' name 'Start_Logging';
+
+//*********************************************************************/
+//* */
+//* Function Name: Stop_Logging */
+//* */
+//* Descriptive Name: This function ends LVM Engine logging and */
+//* closes the log file. */
+//* */
+//* Input: CARDINAL32 * Error_Code - The address of a CARDINAL32 in */
+//* in which to store an error code*/
+//* should an error occur. */
+//* */
+//* Output: *Error_Code will be 0 if this function completes */
+//* successfully; otherwise it will be > 0. */
+//* */
+//* Error Handling: If the log file is not currently opened, or if */
+//* the close operation fails on the log file, then */
+//* *Error_Code will be > 0. */
+//* */
+//* Side Effects: The log file may be closed. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+procedure Stop_Logging(Error_Code: PCARDINAL32); external 'lvm' name 'Stop_Logging';
+
+
+{$ifdef lists}
+(*
+* Description: This module implements a simple, generic, doubly linked list.
+* Data objects of any type can be placed into a linked list
+* created by this module. Futhermore, data objects of different
+* types may be placed into the same linked list.
+*
+* Notes: This linked list implementation makes use of the concept of the
+* current item. In any non-empty list, one item in the list will
+* be designated as the current item. When any of the following
+* functions are called, they will operate upon the current item
+* only: GetItem, ReplaceItem, DeleteItem, GetTag, NextItem,
+* PreviousItem, GetObject, ExtractItem, and ExtractObject. The
+* user of this module may set the current item through the use of
+* the GoToStartOfList, GoToEndOfList, NextItem, PreviousItem,
+* and GoToSpecifiedItem functions.
+*
+* Since a linked list created by this module may contain items
+* of different types, the user will need a way to identify items
+* of different types which may be in the same list. To allow users
+* to do this, the concept of an item tag is used. When an item is
+* added to the list, the user must enter an item tag. The item
+* tag is merely some identifier that the user wishes to associate
+* with the item being placed into the list. When used as intended,
+* each type of data item will have a unique tag associated with it.
+* This way, all data items of the same type will have the same tag
+* while data items of different types will have different tags.
+* Thus, by using the GetTag function, the user can get the item
+* tag for the current item without having to get the item from the
+* list. This allows the user to differentiate between items of
+* different types which reside in the same list.
+*
+* This module is single threaded. If used in a multi-threaded
+* environment, the user must implement appropriate access controls.
+*
+* When an item is inserted or appended to a list, this module
+* allocates memory on the heap to hold the item and then copies
+* the item to the memory that it allocated. This allows local
+* variables to be safely inserted or appended to a list. However,
+* it should be noted that under certain circumstances a copy of the
+* entire data item will NOT be made. Specifically, if the data item
+* is a structure or array containing pointers, then the data pointed
+* to by the pointers will NOT be copied even though the structure or
+* array is! This results from the fact that, when an item is being
+* inserted or appended to a list, the user provides just an address
+* and size. This module assumes that the item to inserted or append
+* lies in a contiguous block of memory at the address provided by the
+* user. This module has no way of knowing the structure of the data
+* at the specified address, and therefore can not know about any
+* embedded pointers which may lie within that block of memory.
+*
+* This module now employs the concept of a handle. A handle is a
+* reference to a specific item in a list which allows that item to
+* be made the current item in the list quickly. Example: If you
+* use the GetHandle function to get a handle for the current item
+* (lets call the item B1), then, regardless of where you are in the
+* list (or any reodering of the items in the list), you can make item
+* B1 the current item by passing its handle to the GoToSpecifiedItem
+* function. Alternatively, you could operate directly on B1 using
+* the other handle based functions, such as GetItem_By_Handle, for
+* example. GetItem_By_Handle gets the item associated with the
+* specified handle without changing which item in the list is the
+* current item in the list.
+*
+* The functions of this module refer to user data as either items or
+* objects. The difference between the two is simple, yet subtle. It
+* deals with who is responsible for the memory used to hold the data.
+* In the case of an item, this module is responsible for the memory
+* used to hold the user data. In the case of an object, the user
+* is responsible for the memory used to hold the data.
+*
+* What this means is that, for functions adding ITEMS to a list,
+* this module will be responsible for allocating memory to hold
+* the user data and then copying the user data into the memory
+* that was allocated. For functions which return items, this
+* module will COPY the user data from the LIST into a buffer
+* specified by the user. For functions which add objects to a
+* list, the user provides a pointer to a block of memory holding
+* user data. This block of memory was allocated by the user, and
+* becomes the "property" of this module once it has been added to
+* a LIST. For functions which return objects, a pointer to the
+* memory where the data is stored is returned. As long as an item/object
+* is in a LIST, this module will be responsible for the memory that
+* is used to store the data associated with that item. This means that
+* users of this module should not call free on an object returned by this
+* module as long as that object is still within a list.
+*
+*
+*)
+
+typedef unsigned long TAG;
+
+typedef ADDRESS DLIST;
+
+//*--------------------------------------------------
+//* Type definitions
+//--------------------------------------------------*/
+
+typedef enum _Insertion_Modes {
+InsertAtStart,
+InsertBefore,
+InsertAfter,
+AppendToList
+} Insertion_Modes;
+
+//************************************************
+//* Functions Available *
+//************************************************/
+
+//*
+//* The parameter *Error is set by every function in this module. It
+//* will be set to 0 to indicate success, and will be > 0 if an
+//* error occurs. The following table lists the possible error codes:
+//* 0 : No error.
+//* 1 : Out of memory
+//* 2 : Memory has been corrupted!
+//* 3 : Bad List Record!
+//* 4 : List Record not initialized yet!
+//* 5 : List is empty!
+//* 6 : Item size mismatch!
+//* 7 : Bad item pointer!
+//* 8 : Item has zero size!
+//* 9 : Item tag mismatch!
+//* 10 : Already at end of list!
+//* 11 : Already at start of list!
+//* 12 : Bad Handle!
+//* 13 : Invalid Insertion Mode!
+//*/
+const
+ DLIST_SUCCESS = 0;
+ DLIST_OUT_OF_MEMORY = 1;
+ DLIST_CORRUPTED = 2;
+ DLIST_BAD = 3;
+ DLIST_NOT_INITIALIZED = 4;
+ DLIST_EMPTY = 5;
+ DLIST_ITEM_SIZE_WRONG = 6;
+ DLIST_BAD_ITEM_POINTER = 7;
+ DLIST_ITEM_SIZE_ZERO = 8;
+ DLIST_ITEM_TAG_WRONG = 9;
+ DLIST_END_OF_LIST =10;
+ DLIST_ALREADY_AT_START =11;
+ DLIST_BAD_HANDLE =12;
+ DLIST_INVALID_INSERTION_MODE =13;
+
+///* The following code is special. It is for use with the PruneList and ForEachItem functions. Basically, these functions
+//can be thought of as "searching" a list. They present each item in the list to a user supplied function which can then
+//operate on the items. If the user supplied function returns a non-zero error code, ForEachItem and PruneList abort and
+//return an error to the caller. This may be undesirable. If the user supplied function used with PruneList and ForEachItem
+//returns the code below, PruneList/ForEachItem will abort and return DLIST_SUCCESS. This allows PruneList and ForEachItem
+//to be used to search a list and terminate the search when the desired item is found without having to traverse the
+//remaining items in the list. */
+#define DLIST_SEARCH_COMPLETE 0xFF
+
+#ifdef USE_POOLMAN
+
+//*********************************************************************/
+//* */
+//* Function Name: CreateList */
+//* */
+//* Descriptive Name: This function allocates and initializes the */
+//* data structures associated with a list and */
+//* then returns a pointer to these structures. */
+//* */
+//* Input: CARDINAL32 InitialPoolSize - Each List gets a pool of */
+//* link nodes. When items are */
+//* added to the List, a link node*/
+//* is removed from the pool. */
+//* When an item is removed from */
+//* the List, the link node used */
+//* for that item is returned to */
+//* the pool. InitialPoolSize is */
+//* the number of link nodes to */
+//* place in the pool when the */
+//* pool is created. */
+//* CARDINAL32 MaximumPoolSize - When the pool runs out of */
+//* link nodes, new nodes are */
+//* allocated by the pool. When */
+//* these links start being */
+//* returned to the pool, the pool*/
+//* will grow. This parameter */
+//* puts a limit on how big the */
+//* pool may grow to. Once the */
+//* pool reaches this size, any */
+//* link nodes being returned to */
+//* the pool will be deallocated. */
+//* CARDINAL32 PoolIncrement - When the pool runs out of link*/
+//* nodes and more are required, */
+//* the pool will allocate one or */
+//* more link nodes. This tells the*/
+//* pool how many link nodes to */
+//* allocate at one time. */
+//* */
+//* Output: If Success : The function return value will be non-NULL */
+//* */
+//* If Failure : The function return value will be NULL. */
+//* */
+//* Error Handling: The function will only fail if it can not */
+//* allocate enough memory to create the new list */
+//* and its associated pool of link nodes. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+DLIST _System CreateList(CARDINAL32 InitialPoolSize,
+CARDINAL32 MaximumPoolSize,
+CARDINAL32 PoolIncrement);
+
+#else
+
+//*********************************************************************/
+//* */
+//* Function Name: CreateList */
+//* */
+//* Descriptive Name: This function allocates and initializes the */
+//* data structures associated with a list and */
+//* then returns a pointer to these structures. */
+//* */
+//* Input: None. */
+//* */
+//* Output: If Success : The function return value will be non-NULL */
+//* */
+//* If Failure : The function return value will be NULL. */
+//* */
+//* Error Handling: The function will only fail if it can not */
+//* allocate enough memory to create the new list. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+DLIST _System CreateList( void );
+
+#endif
+
+//*********************************************************************/
+//* */
+//* Function Name: InsertItem */
+//* */
+//* Descriptive Name: This function inserts an item into a DLIST. */
+//* The item can be placed either before or */
+//* after the current item in the DLIST. */
+//* */
+//* Input: DLIST ListToAddTo : The list to which the */
+//* data item is to be */
+//* added. */
+//* CARDINAL32 ItemSize : The size of the data item, in */
+//* bytes. */
+//* ADDRESS ItemLocation : The address of the data */
+//* to append to the list */
+//* TAG ItemTag : The item tag to associate with */
+//* item being appended to the list */
+//* ADDRESS TargetHandle : The item in ListToAddTo which */
+//* is used to determine where */
+//* the item being transferred will */
+//* be placed. If this is NULL, */
+//* then the current item in */
+//* ListToAddTo will be used. */
+//* Insertion_Modes InsertMode : This indicates where, */
+//* relative to the item in */
+//* ListToAddTo specified by */
+//* Target_Handle, the item being */
+//* inserted can be placed. */
+//* BOOLEAN MakeCurrent : If TRUE, the item being inserted */
+//* into ListToAddTo becomes the */
+//* current item in ListToAddTo. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If the operation is successful, then *Error will be */
+//* set to 0 and the function return value will be the */
+//* handle for the item that was appended to the list. */
+//* If the operation fails, then *Error will contain an */
+//* error code and the function return value will be NULL. */
+//* */
+//* Error Handling: This function will fail under the following */
+//* conditions: */
+//* ListToAddTo does not point to a valid */
+//* list */
+//* ItemSize is 0 */
+//* ItemLocation is NULL */
+//* The memory required to hold a copy of the */
+//* item can not be allocated. */
+//* The memory required to create a LINK NODE */
+//* can not be allocated. */
+//* TargetHandle is invalid or is for an item */
+//* in another list. */
+//* If this routine fails, an error code is returned*/
+//* and any memory allocated by this function is */
+//* freed. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The item to add is copied to the heap to */
+//* avoid possible conflicts with the usage of */
+//* local variables in functions which process */
+//* DLISTs. However, a pointer to a local variable */
+//* should not be appended to the DLIST. */
+//* */
+//* It is assumed that TargetHandle is valid, or is at least*/
+//* the address of an accessible block of storage. If */
+//* TargetHandle is invalid, or is not the address of an */
+//* accessible block of storage, then a trap or exception */
+//* may occur. */
+//* */
+//* It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//* */
+//*********************************************************************/
+ADDRESS _System InsertItem ( DLIST ListToAddTo,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+ADDRESS TargetHandle,
+Insertion_Modes Insert_Mode,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: InsertObject */
+//* */
+//* Descriptive Name: This function inserts an object into a DLIST.*/
+//* The object can be inserted before or after */
+//* the current item in the list. */
+//* */
+//* Input: DLIST ListToAddTo : The list to which the */
+//* data object is to be */
+//* inserted. */
+//* CARDINAL32 ItemSize : The size of the data item, in */
+//* bytes. */
+//* ADDRESS ItemLocation : The address of the data */
+//* to append to the list */
+//* TAG ItemTag : The item tag to associate with */
+//* the item being appended to the */
+//* list */
+//* ADDRESS TargetHandle : The item in ListToAddTo which */
+//* is used to determine where */
+//* the item being transferred will */
+//* be placed. If this is NULL, */
+//* then the current item in */
+//* ListToAddTo will be used. */
+//* Insertion_Modes InsertMode : This indicates where, */
+//* relative to the item in */
+//* ListToAddTo specified by */
+//* Target_Handle, the item being */
+//* inserted can be placed. */
+//* BOOLEAN MakeCurrent : If TRUE, the item being inserted */
+//* into ListToAddTo becomes the */
+//* current item in ListToAddTo. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If the operation is successful, then *Error will be */
+//* set to 0 and the function return value will be the */
+//* handle for the item that was appended to the list. */
+//* If the operation fails, then *Error will contain an */
+//* error code and the function return value will be NULL. */
+//* */
+//* Error Handling: This function will fail under the following */
+//* conditions: */
+//* ListToAddTo does not point to a valid */
+//* list */
+//* ItemSize is 0 */
+//* ItemLocation is NULL */
+//* The memory required for a LINK NODE can not */
+//* be allocated. */
+//* TargetHandle is invalid or is for an item */
+//* in another list. */
+//* If this routine fails, an error code is returned*/
+//* and any memory allocated by this function is */
+//* freed. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The item to insert is NOT copied to the heap. Instead, */
+//* the location of the item is stored in the list. This */
+//* is the major difference between InsertObject and */
+//* InsertItem. InsertItem allocates memory on the heap, */
+//* copies the item to the memory it allocated, and stores */
+//* the address of the memory it allocated in the list. */
+//* InsertObject stores the address provided by the user. */
+//* */
+//* It is assumed that TargetHandle is valid, or is at least*/
+//* the address of an accessible block of storage. If */
+//* TargetHandle is invalid, or is not the address of an */
+//* accessible block of storage, then a trap or exception */
+//* may occur. */
+//* */
+//* It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//* */
+//*********************************************************************/
+ADDRESS _System InsertObject ( DLIST ListToAddTo,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+ADDRESS TargetHandle,
+Insertion_Modes Insert_Mode,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: DeleteItem */
+//* */
+//* Descriptive Name: This function removes the specified item from*/
+//* the list and optionally frees the memory */
+//* associated with it. */
+//* */
+//* Input: DLIST ListToDeleteFrom : The list whose current */
+//* item is to be deleted. */
+//* BOOLEAN FreeMemory : If TRUE, then the memory */
+//* associated with the current */
+//* item will be freed. If FALSE */
+//* then the current item will be */
+//* removed from the list but its */
+//* memory will not be freed. */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides*/
+//* in ListToDeleteFrom, or NULL. If */
+//* NULL is used, then the current item */
+//* in ListToDeleteFrom will be deleted. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If the operation is successful, then *Error will be */
+//* set to 0. If the operation fails, then *Error will */
+//* contain an error code. */
+//* */
+//* Error Handling: This function will fail if ListToDeleteFrom is */
+//* not a valid list, or if ListToDeleteFrom is */
+//* empty, or if Handle is invalid. */
+//* If this routine fails, an error code is returned*/
+//* in *Error. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: Items in a list can be accessed in two ways: A copy of */
+//* the item can be obtained using GetItem and its related */
+//* calls, or a pointer to the item can be obtained using */
+//* GetObject and its related calls. If you have a copy of */
+//* the data and wish to remove the item from the list, set */
+//* FreeMemory to TRUE. This will remove the item from the */
+//* list and deallocate the memory used to hold it. If you */
+//* have a pointer to the item in the list (from one of the */
+//* GetObject style functions) and wish to remove the item */
+//* from the list, set FreeMemory to FALSE. This removes */
+//* the item from the list without freeing its memory, so */
+//* that the pointer obtained with the GetObject style */
+//* functions is still useable. */
+//* */
+//* It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is considered a valid */
+//* handle which refers to the current item in */
+//* ListToDeleteFrom. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list, unless the handle specified belongs */
+//* to the current item in the list, in which case the */
+//* item following the current item becomes the current */
+//* item in the list. If there is no item following the */
+//* current item in the list, then the item preceeding the */
+//* current item will become the current item in the list. */
+//* */
+//*********************************************************************/
+void _System DeleteItem (DLIST ListToDeleteFrom,
+BOOLEAN FreeMemory,
+ADDRESS Handle,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: DeleteAllItems */
+//* */
+//* Descriptive Name: This function deletes all of the items in the*/
+//* specified list and optionally frees the */
+//* memory associated with each item deleted. */
+//* */
+//* Input: DLIST ListToDeleteFrom : The list whose items */
+//* are to be deleted. */
+//* BOOLEAN FreeMemory : If TRUE, then the memory */
+//* associated with each item in the*/
+//* list will be freed. If FALSE */
+//* then the each item will be */
+//* removed from the list but its */
+//* memory will not be freed. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If the operation is successful, then *Error will be */
+//* set to 0. If the operation fails, then *Error will */
+//* contain an error code. */
+//* */
+//* Error Handling: This function will fail if ListToDeleteFrom is */
+//* not a valid list, or if ListToDeleteFrom is */
+//* empty. */
+//* If this routine fails, an error code is returned*/
+//* in *Error. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: Items in a list can be accessed in two ways: A copy of */
+//* the item can be obtained using GetItem and its related */
+//* calls, or a pointer to the item can be obtained using */
+//* GetObject and its related calls. If you have a copy of */
+//* the data and wish to remove the item from the list, set */
+//* FreeMemory to TRUE. This will remove the item from the */
+//* list and deallocate the memory used to hold it. If you */
+//* have a pointer to the item in the list (from one of the */
+//* GetObject style functions) and wish to remove the item */
+//* from the list, set FreeMemory to FALSE. This removes */
+//* the item from the list without freeing its memory, so */
+//* that the pointer obtained with the GetObject style */
+//* functions is still useable. */
+//* */
+//* It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System DeleteAllItems (DLIST ListToDeleteFrom,
+BOOLEAN FreeMemory,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetItem */
+//* */
+//* Descriptive Name: This function copies the specified item in */
+//* the list to a buffer provided by the caller. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* ADDRESS ItemLocation : This is the location of the */
+//* buffer into which the current*/
+//* item is to be copied. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides*/
+//* in ListToGetItemFrom, or NULL. If */
+//* NULL, then the current item in the list*/
+//* will be used. */
+//* BOOLEAN MakeCurrent : If TRUE, the item to get will */
+//* become the current item in the */
+//* list. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The buffer at ItemLocation will contain a copy of */
+//* the current item from ListToGetItemFrom. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemLocation is NULL */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* Handle is invalid, or is for an item */
+//* which is not in ListToGetItemFrom */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is considered a valid */
+//* handle corresponding to the current item in the */
+//* list. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list. */
+//* */
+//*********************************************************************/
+void _System GetItem( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+ADDRESS Handle,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetNextItem */
+//* */
+//* Descriptive Name: This function advances the current item */
+//* pointer and then copies the current item in */
+//* the list to a buffer provided by the caller. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* ADDRESS ItemLocation : This is the location of the */
+//* buffer into which the current*/
+//* item is to be copied. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The buffer at ItemLocation will contain a copy of */
+//* the current item from ListToGetItemFrom. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* The current item pointer will NOT be advanced. */
+//* The current item in the list will be the same */
+//* as before the call to this function. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemLocation is NULL */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* The current item in the list before this */
+//* function is called is the last item */
+//* item in the list. */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System GetNextItem( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetPreviousItem */
+//* */
+//* Descriptive Name: This function makes the previous item in the */
+//* list the current item in the list and then */
+//* copies that item to a buffer provided by the */
+//* user. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* ADDRESS ItemLocation : This is the location of the */
+//* buffer into which the current*/
+//* item is to be copied. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The buffer at ItemLocation will contain a copy of */
+//* the current item from ListToGetItemFrom. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* The current item pointer will NOT be advanced. */
+//* The current item in the list will be the same */
+//* as before the call to this function. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemLocation is NULL */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* The current item in the list before this */
+//* function is called is the last item */
+//* item in the list. */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System GetPreviousItem( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetObject */
+//* */
+//* Descriptive Name: This function returns the address of the data*/
+//* associated with the specified item in the */
+//* list. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to have its address */
+//* returned to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides*/
+//* in ListToGetItemFrom, or NULL. If */
+//* NULL, then the current item in the list*/
+//* BOOLEAN MakeCurrent : If TRUE, the item to get will */
+//* become the current item in the */
+//* list. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The function return value will be the address of */
+//* the data associated with the current item in the */
+//* list. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* The function return value will be NULL. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* Handle is invalid, or is for an item */
+//* which is not in ListToGetItemFrom */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The user should not free the memory associated with */
+//* the address returned by this function as the object is */
+//* still in the list. */
+//* */
+//* It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap may */
+//* occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is considered a valid */
+//* handle designating the current item in the list. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list. */
+//* */
+//*********************************************************************/
+ADDRESS _System GetObject( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+TAG ItemTag,
+ADDRESS Handle,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetNextObject */
+//* */
+//* Descriptive Name: This function advances the current item */
+//* pointer and then returns the address of the */
+//* data associated with the current item in the */
+//* list. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The function return value will be the address of */
+//* the data associated with the current item in the */
+//* list. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* The function return value will be NULL. */
+//* The current item pointer will NOT be advanced. */
+//* The current item in the list will be the same */
+//* as before the call to this function. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* The current item in the list before this */
+//* function is called is the last item */
+//* item in the list. */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The user should not free the memory associated with */
+//* the address returned by this function as the object is */
+//* still in the list. */
+//* */
+//* It is assumed that Error contains a valid address. If */
+//* this assumption are violated, an exception or trap may */
+//* occur. */
+//* */
+//*********************************************************************/
+ADDRESS _System GetNextObject( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+TAG ItemTag,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetPreviousObject */
+//* */
+//* Descriptive Name: This function makes the previous item in the */
+//* list the current item and then returns the */
+//* address of the data associated with the */
+//* current item in the list. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The function return value will be the address of */
+//* the data associated with the current item in the */
+//* list. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* The function return value will be NULL. */
+//* The current item pointer will NOT be advanced. */
+//* The current item in the list will be the same */
+//* as before the call to this function. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* The current item in the list before this */
+//* function is called is the last item */
+//* item in the list. */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The user should not free the memory associated with */
+//* the address returned by this function as the object is */
+//* still in the list. */
+//* */
+//* It is assumed that Error contains a valid address. If */
+//* this assumption are violated, an exception or trap may */
+//* occur. */
+//* */
+//*********************************************************************/
+ADDRESS _System GetPreviousObject( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+TAG ItemTag,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: ExtractItem */
+//* */
+//* Descriptive Name: This function copies the specified item in */
+//* the list to a buffer provided by the caller */
+//* and removes the item from the list. */
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* ADDRESS ItemLocation : This is the location of the */
+//* buffer into which the current*/
+//* item is to be copied. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides*/
+//* in ListToGetItemFrom, or NULL. If */
+//* NULL, then the current item in the list*/
+//* will be used. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The buffer at ItemLocation will contain a copy of */
+//* the current item from ListToGetItemFrom. */
+//* The item will have been removed from the list and */
+//* its memory deallocated. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemLocation is NULL */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* Handle is invalid, or is for an item */
+//* which is not in ListToGetItemFrom */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is considered a valid */
+//* handle which refers to the current item in the */
+//* list. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list, unless the handle specified belongs */
+//* to the current item in the list, in which case the */
+//* item following the current item becomes the current */
+//* item in the list. If there is no item following the */
+//* current item in the list, then the item preceeding the */
+//* current item will become the current item in the list. */
+//* */
+//*********************************************************************/
+void _System ExtractItem( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+ADDRESS Handle,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: ExtractObject */
+//* */
+//* Descriptive Name: This function returns the address of the data*/
+//* associated with the specified item in the */
+//* list and then removes that item from the list*/
+//* */
+//* Input: DLIST ListToGetItemFrom : The list whose current item */
+//* is to be copied and returned */
+//* to the caller. */
+//* CARDINAL32 ItemSize : What the caller thinks the size of*/
+//* the current item is. */
+//* TAG ItemTag : What the caller thinks the item tag */
+//* of the current item is. */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides*/
+//* in ListToGetItemFrom, or NULL. If */
+//* NULL, then the current item in the */
+//* list will be used. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code. */
+//* */
+//* Output: If Successful : */
+//* *Error will be set to 0. */
+//* The function return value will be the address of */
+//* the data associated with the current item in the */
+//* list. */
+//* The current item is removed from the list. */
+//* If Failure : */
+//* *Error will contain an error code. */
+//* The function return value will be NULL. */
+//* */
+//* Error Handling: This function will fail under any of the */
+//* following conditions: */
+//* ListToGetItemFrom is not a valid list */
+//* ItemSize does not match the size of the */
+//* current item in the list */
+//* ItemTag does not match the item tag */
+//* of the current item in the list */
+//* Handle is invalid, or is for an item */
+//* which is not in ListToGetItemFrom */
+//* If any of these conditions occur, *Error will */
+//* contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The user is responsible for the memory associated with */
+//* the address returned by this function since this */
+//* function removes that object from the list. This means */
+//* that, when the user is through with the object, they */
+//* should free it. */
+//* */
+//* It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap may */
+//* occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is considered a valid */
+//* handle which refers to the current item in the */
+//* list. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list, unless the handle specified belongs */
+//* to the current item in the list, in which case the */
+//* item following the current item becomes the current */
+//* item in the list. If there is no item following the */
+//* current item in the list, then the item preceeding the */
+//* current item will become the current item in the list. */
+//* */
+//*********************************************************************/
+ADDRESS _System ExtractObject( DLIST ListToGetItemFrom,
+CARDINAL32 ItemSize,
+TAG ItemTag,
+ADDRESS Handle,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: ReplaceItem */
+//* */
+//* Descriptive Name: This function replaces the specified item in */
+//* the list with the one provided as its */
+//* argument. */
+//* */
+//* Input: DLIST ListToReplaceItemIn : The list whose current item*/
+//* is to be replaced */
+//* CARDINAL32 ItemSize : The size, in bytes, of the */
+//* replacement item */
+//* ADDRESS ItemLocation : The address of the replacement*/
+//* item */
+//* TAG ItemTag : The item tag that the user wishes to */
+//* associate with the replacement item */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides */
+//* in ListToGetItemFrom, or NULL. If NULL */
+//* then the current item in the list will */
+//* used. */
+//* BOOLEAN MakeCurrent : If TRUE, the item to get will */
+//* become the current item in the */
+//* list. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If Successful then *Error will be set to 0. */
+//* If Unsuccessful, then *Error will be set to a non-zero */
+//* error code. */
+//* */
+//* Error Handling: This function will fail under the following */
+//* conditions: */
+//* ListToReplaceItemIn is empty */
+//* ItemSize is 0 */
+//* ItemLocation is NULL */
+//* The memory required can not be allocated. */
+//* Handle is invalid, or is for an item */
+//* which is not in ListToGetItemFrom */
+//* If any of these conditions occurs, *Error */
+//* will contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is a valid handle which */
+//* refers to the current item in the list. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list. */
+//* */
+//*********************************************************************/
+void _System ReplaceItem( DLIST ListToReplaceItemIn,
+CARDINAL32 ItemSize,
+ADDRESS ItemLocation,
+TAG ItemTag,
+ADDRESS Handle,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: ReplaceObject */
+//* */
+//* Descriptive Name: This function replaces the specified object */
+//* in the list with the one provided as its */
+//* argument. */
+//* */
+//* Input: DLIST ListToReplaceItemIn : The list whose current */
+//* object is to be replaced */
+//* CARDINAL32 ItemSize : The size, in bytes, of the */
+//* replacement object */
+//* ADDRESS ItemLocation : The address of the replacement*/
+//* item */
+//* TAG ItemTag : The item tag that the user wishes to */
+//* associate with the replacement item */
+//* ADDRESS Handle : The handle of the item to get. This */
+//* handle must be of an item which resides */
+//* in ListToGetItemFrom, or NULL. If NULL */
+//* then the current item in the list will */
+//* be used. */
+//* BOOLEAN MakeCurrent : If TRUE, the item to get will */
+//* become the current item in the */
+//* list. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If Successful then *Error will be set to 0 and the */
+//* return value of the function will be the address */
+//* of the object that was replaced. */
+//* If Unsuccessful, then *Error will be set to a non-zero */
+//* error code and the function return value will be */
+//* NULL. */
+//* */
+//* Error Handling: This function will fail under the following */
+//* conditions: */
+//* ListToReplaceItemIn is empty */
+//* ItemSize is 0 */
+//* ItemLocation is NULL */
+//* The memory required can not be allocated. */
+//* Handle is invalid, or is for an item */
+//* which is not in ListToGetItemFrom */
+//* If any of these conditions occurs, *Error */
+//* will contain a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: The user is responsible for the memory associated with */
+//* the object returned by this function as that object is */
+//* removed from the list. This means that, when the user */
+//* is through with the object returned by this function, */
+//* they should free it. */
+//* */
+//* It is assumed that Error contains a valid address. It */
+//* is also assumed that if ItemLocation is not NULL, then */
+//* it is a valid address that can be dereferenced. If */
+//* these assumptions are violated, an exception or trap */
+//* may occur. */
+//* */
+//* It is assumed that Handle is valid, or is at least the */
+//* address of an accessible block of storage. If Handle */
+//* is invalid, or is not the address of an accessible block*/
+//* of storage, then a trap or exception may occur. */
+//* NOTE: For this function, NULL is a valid handle for the */
+//* current item in the list. */
+//* */
+//* This function does not alter which item is the current */
+//* item in the list. */
+//* */
+//*********************************************************************/
+ADDRESS _System ReplaceObject( DLIST ListToReplaceItemIn,
+CARDINAL32 * ItemSize, /* On input - size of new object. On return = size of old object. */
+ADDRESS ItemLocation,
+TAG * ItemTag, /* On input - TAG of new object. On return = TAG of old object. */
+ADDRESS Handle,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetTag */
+//* */
+//* Descriptive Name: This function returns the item tag associated*/
+//* with the current item in the list. */
+//* */
+//* Input: DLIST ListToGetTagFrom : The list from which the item */
+//* tag of the current item is to */
+//* be returned */
+//* ADDRESS Handle : The handle of the item whose TAG and */
+//* size we are to get. This handle must */
+//* be of an item which resides in */
+//* in ListToGetTagFrom, or NULL. If NULL */
+//* then the current item in the list will */
+//* be used. */
+//* CARDINAL32 * ItemSize : The size, in bytes, of the */
+//* current item in the list. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, the function returns the item tag & size*/
+//* associated with the current item in ListToGetTagFrom*/
+//* and *Error is set to 0. */
+//* If unsuccessful, the function returns 0 and *Error is */
+//* set to a non-zero error code. */
+//* */
+//* Error Handling: This function will fail if ListToGetTagFrom is */
+//* not a valid list or is an empty list. In either*/
+//* of these cases, *Error is set to a non-zero */
+//* error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//* */
+//*********************************************************************/
+TAG _System GetTag( DLIST ListToGetTagFrom,
+ADDRESS Handle,
+CARDINAL32 * ItemSize,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetHandle */
+//* */
+//* Descriptive Name: This function returns a handle for the */
+//* current item in the list. This handle is */
+//* then associated with that item regardless of */
+//* its position in the list. This handle can be*/
+//* used to make its associated item the current */
+//* item in the list. */
+//* */
+//* Input: DLIST ListToGetHandleFrom : The list from which a */
+//* handle is needed. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, the function returns a handle for the */
+//* the current item in ListToGetHandleFrom, and *Error */
+//* is set to 0. */
+//* If unsuccessful, the function returns 0 and *Error is */
+//* set to a non-zero error code. */
+//* */
+//* Error Handling: This function will fail if ListToGetHandleFrom */
+//* is not a valid list or is an empty list. In */
+//* either of these cases, *Error is set to a */
+//* non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//* The handle returned is a pointer to an internal */
+//* structure within the list. If the item associated */
+//* with this handle is removed from the list, the handle */
+//* will be invalid and should not be used as the internal */
+//* structure it points to will nolonger exist! */
+//* */
+//*********************************************************************/
+ADDRESS _System GetHandle ( DLIST ListToGetHandleFrom, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GetListSize */
+//* */
+//* Descriptive Name: This function returns the number of items in */
+//* a list. */
+//* */
+//* Input: DLIST ListToGetSizeOf : The list whose size we wish to*/
+//* know */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, the function returns the a count of the */
+//* number of items in the list, and *Error is set to 0.*/
+//* If unsuccessful, the function returns 0 and *Error is */
+//* set to a non-zero error code. */
+//* */
+//* Error Handling: This function will fail if ListToGetSizeOf is */
+//* not a valid list. If this happens, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+CARDINAL32 _System GetListSize( DLIST ListToGetSizeOf, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: ListEmpty */
+//* */
+//* Descriptive Name: This function returns TRUE if the */
+//* specified list is empty, otherwise it returns*/
+//* FALSE. */
+//* */
+//* Input: DLIST ListToCheck : The list to check to see if it*/
+//* is empty */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, the function returns TRUE if the */
+//* number of items in the list is 0, otherwise it */
+//* returns FALSE. Also, *Error is set to 0. */
+//* If unsuccessful, the function returns TRUE and */
+//* *Error is set to a non-zero error code. */
+//* */
+//* Error Handling: This function will fail if ListToCheck is not */
+//* a valid list. If this happens, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+BOOLEAN _System ListEmpty( DLIST ListToCheck, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: AtEndOfList */
+//* */
+//* Descriptive Name: This function returns TRUE if the */
+//* current item in the list is the last item */
+//* in the list. Returns FALSE otherwise. */
+//* */
+//* Input: DLIST ListToCheck : The list to check. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, the function returns TRUE if the */
+//* current item in the list is the last item in the */
+//* list. If it is not the last item in the list, */
+//* FALSE is returned. *Error_Code is set to */
+//* DLIST_SUCCESS. */
+//* If unsuccessful, the function returns FALSE and */
+//* *Error is set to a non-zero error code. */
+//* */
+//* Error Handling: This function will fail if ListToCheck is not */
+//* a valid list. If this happens, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+BOOLEAN _System AtEndOfList( DLIST ListToCheck, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: AtStartOfList */
+//* */
+//* Descriptive Name: This function returns TRUE if the */
+//* current item in the list is the first item */
+//* in the list. Returns FALSE otherwise. */
+//* */
+//* Input: DLIST ListToCheck : The list to check. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, the function returns TRUE if the */
+//* current item in the list is the first item in the */
+//* list. If it is not the first item in the list, */
+//* FALSE is returned. *Error_Code is set to */
+//* DLIST_SUCCESS. */
+//* If unsuccessful, the function returns FALSE and */
+//* *Error is set to a non-zero error code. */
+//* */
+//* Error Handling: This function will fail if ListToCheck is not */
+//* a valid list. If this happens, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+BOOLEAN _System AtStartOfList( DLIST ListToCheck, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: DestroyList */
+//* */
+//* Descriptive Name: This function releases the memory associated */
+//* with the internal data structures of a DLIST.*/
+//* Once a DLIST has been eliminated by this */
+//* function, it must be reinitialized before it */
+//* can be used again. */
+//* */
+//* Input: DLIST ListToDestroy : The list to be eliminated */
+//* from memory. */
+//* BOOLEAN FreeItemMemory : If TRUE, all items in the list */
+//* will be freed. If FALSE, all */
+//* items in the list are not */
+//* freed, only the list structures*/
+//* associated with them are. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, *Error will be set to 0. */
+//* If unsuccessful, *Error will be set to a non-zero error*/
+//* code. */
+//* */
+//* Error Handling: This function will fail if ListToDestroy is not */
+//* a valid list. If this happens, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//* If FreeItemMemory is TRUE, then this function will try */
+//* to delete any items which may be in the list. However, */
+//* since this function has no way of knowing the internal */
+//* structure of an item, items which contain embedded */
+//* pointers will not be entirely freed. This can lead to */
+//* memory leaks. The programmer should ensure that any */
+//* list passed to this function when the FreeItemMemory */
+//* parameter is TRUE is empty or does not contain any */
+//* items with embedded pointers. */
+//* */
+//*********************************************************************/
+void _System DestroyList( DLIST * ListToDestroy, BOOLEAN FreeItemMemory, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: NextItem */
+//* */
+//* Descriptive Name: This function makes the next item in the list*/
+//* the current item in the list (i.e. it */
+//* advances the current item pointer). */
+//* */
+//* Input: DLIST ListToAdvance : The list whose current item */
+//* pointer is to be advanced */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, *Error will be set to 0. */
+//* If unsuccessful, *Error will be set to a non-zero error*/
+//* code. */
+//* */
+//* Error Handling: This function will fail under the following */
+//* conditions: */
+//* ListToAdvance is not a valid list */
+//* ListToAdvance is empty */
+//* The current item is the last item in the */
+//* list */
+//* If any of these conditions occurs, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System NextItem( DLIST ListToAdvance, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: PreviousItem */
+//* */
+//* Descriptive Name: This function makes the previous item in the */
+//* list the current item in the list. */
+//* */
+//* Input: DLIST ListToChange : The list whose current item */
+//* pointer is to be changed */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, *Error will be set to 0. */
+//* If unsuccessful, *Error will be set to a non-zero error*/
+//* code. */
+//* */
+//* Error Handling: This function will fail under the following */
+//* conditions: */
+//* ListToChange is not a valid list */
+//* ListToChange is empty */
+//* The current item is the first item in the */
+//* list */
+//* If any of these conditions occurs, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System PreviousItem( DLIST ListToChange, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GoToStartOfList */
+//* */
+//* Descriptive Name: This function makes the first item in the */
+//* list the current item in the list. */
+//* */
+//* Input: DLIST ListToReset : The list whose current item */
+//* is to be set to the first item */
+//* in the list */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, *Error will be set to 0. */
+//* If unsuccessful, *Error will be set to a non-zero error*/
+//* code. */
+//* */
+//* Error Handling: This function will fail if ListToReset is not */
+//* a valid list. If this occurs, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System GoToStartOfList( DLIST ListToReset, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GoToEndOfList */
+//* */
+//* Descriptive Name: This function makes the last item in the */
+//* list the current item in the list. */
+//* */
+//* Input: DLIST ListToSet : The list whose current item */
+//* is to be set to the last item */
+//* in the list */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, *Error will be set to 0. */
+//* If unsuccessful, *Error will be set to a non-zero error*/
+//* code. */
+//* */
+//* Error Handling: This function will fail if ListToSet is not */
+//* a valid list. If this occurs, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System GoToEndOfList( DLIST ListToSet, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: GoToSpecifiedItem */
+//* */
+//* Descriptive Name: This function makes the item associated with */
+//* Handle the current item in the list. */
+//* */
+//* Input: DLIST ListToReposition: The list whose current item */
+//* is to be set to the item */
+//* associated with Handle. */
+//* ADDRESS Handle : A handle obtained by using the */
+//* GetHandle function. This handle */
+//* identifies a unique item in the list. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return code */
+//* */
+//* Output: If successful, *Error will be set to 0. */
+//* If unsuccessful, *Error will be set to a non-zero error*/
+//* code. */
+//* */
+//* Error Handling: This function will fail if ListToReposition is */
+//* not a valid list. If this occurs, then *Error */
+//* is set to a non-zero error code. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//* */
+//* It is assumed that Handle is a valid handle and that */
+//* the item associated with Handle is still in the list. */
+//* If these conditions are not met, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System GoToSpecifiedItem( DLIST ListToReposition, ADDRESS Handle, CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: SortList */
+//* */
+//* Descriptive Name: This function sorts the contents of a list. */
+//* The sorting algorithm used is a stable sort */
+//* whose performance is not dependent upon the */
+//* initial order of the items in the list. */
+//* */
+//* Input: DLIST ListToSort : The DLIST that is to be sorted. */
+//* */
+//* INTEGER32 ( *Compare) ( ... ) */
+//* */
+//* This is a pointer to a function that can compare any */
+//* two items in the list. It should return -1 if */
+//* Object1 is less than Object2, 0 if Object1 is equal */
+//* to Object2, and 1 if Object1 is greater than Object2.*/
+//* This function will be called during the sort whenever*/
+//* the sorting algorithm needs to compare two objects. */
+//* */
+//* The Compare function takes the following parameters: */
+//* */
+//* ADDRESS Object1 : The address of the data for the */
+//* first object to be compared. */
+//* TAG Object1Tag : The user assigned TAG value for the */
+//* first object to be compared. */
+//* ADDRESS Object2 : The address of the data for the */
+//* second object to be compared. */
+//* TAG Object2Tag : The user assigned TAG value for the */
+//* second object to be compared. */
+//* CARDINAL32 * Error : The address of a variable to */
+//* hold the error return value. */
+//* */
+//* If this function ever sets *Error to a non-zero value*/
+//* the sort will terminate and the error code will be */
+//* returned to the caller of the SortList function. */
+//* */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return value. */
+//* */
+//* Output: If successful, this function will set *Error to */
+//* DLIST_SUCCESS and ListToSort will have been sorted. */
+//* If unsuccessful, *Error will contain an error code. */
+//* The order of the items in ListToSort is undefined */
+//* and may have changed. */
+//* */
+//* Error Handling: This function will terminate if *Compare sets */
+//* *Error to a non-zero value, or if ListToSort */
+//* is invalid. If this function does terminate in */
+//* the middle of a sort, the order of the items in */
+//* ListToSort may be different than it was before */
+//* the function was called. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: It is assumed that Error contains a valid address. If */
+//* this assumption is violated, an exception or trap */
+//* may occur. */
+//* */
+//*********************************************************************/
+void _System SortList(DLIST ListToSort,
+INTEGER32 ( * _System Compare) (ADDRESS Object1, TAG Object1Tag, ADDRESS Object2, TAG Object2Tag,CARDINAL32 * Error),
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: ForEachItem */
+//* */
+//* Descriptive Name: This function passes a pointer to each item */
+//* in a list to a user provided function for */
+//* processing by the user provided function. */
+//* */
+//* Input: DLIST ListToProcess : The DLIST whose items are to be */
+//* processed by the user provided */
+//* function. */
+//* */
+//* void ( * ProcessItem) (...) */
+//* */
+//* This is a pointer to the user provided function. */
+//* This user provided function takes the following */
+//* parameters: */
+//* */
+//* ADDRESS Object : A pointer to an item in */
+//* ListToProcess. */
+//* TAG Object1Tag : The user assigned TAG value for */
+//* the item pointed to by Object. */
+//* ADDRESS Parameter : The address of a block of */
+//* memory containing any */
+//* parameters that the user */
+//* wishes to have passed to this*/
+//* function. */
+//* CARDINAL32 * Error : The address of a variable to*/
+//* hold the error return value.*/
+//* */
+//* ADDRESS Parameters : This field is passed through to */
+//* *ProcessItem. This function does */
+//* not even look at the contents of */
+//* this field. This field is here to */
+//* provide the user a way to pass */
+//* additional data to *ProcessItem */
+//* that *ProcessItem may need to */
+//* function correctly. */
+//* */
+//* BOOLEAN Forward : If TRUE, then the list is traversed */
+//* from the start of the list to the end */
+//* of the list. If FALSE, then the list */
+//* is traversed from the end of the list */
+//* to the beginning. */
+//* */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return value. */
+//* */
+//* Output: If successful, this function will set *Error to */
+//* DLIST_SUCCESS. */
+//* If unsuccessful, then this function will set *Error to */
+//* a non-zero error code. */
+//* */
+//* Error Handling: This function aborts immediately when an error */
+//* is detected, and any remaining items in the list*/
+//* will not be processed. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: This function allows the user to access all of the items */
+//* in a list and perform an operation on them. The */
+//* operation performed must not free any items in the list, */
+//* or perform any list operations on the list being */
+//* processed. */
+//* */
+//* As an example of when this would be useful, consider a */
+//* a list of graphic objects (rectangles, triangles, circles*/
+//* etc.) which comprise a drawing. To draw the picture */
+//* that these graphic objects represent, one could build a */
+//* loop which gets and draws each item. Another way to */
+//* do this would be to build a drawing function which can */
+//* draw any of the graphic objects, and then use that */
+//* function as the ProcessItem function in a call to */
+//* ForEachItem. */
+//* */
+//* If the ProcessItem function sets *Error to something */
+//* other than DLIST_SUCCESS, then ForEachItem will terminate*/
+//* and return an error to whoever called it. The single */
+//* exception to this is if ProcessItem sets *Error to */
+//* DLIST_SEARCH_COMPLETE, in which case ForEachItem */
+//* terminates and sets *Error to DLIST_SUCCESS. This is */
+//* usefull for using ForEachItem to search a list and then */
+//* terminating the search once the desired item is found. */
+//* */
+//* A word about the Parameters parameter. This parameter */
+//* is passed through to *ProcessItem and is never looked at */
+//* by this function. This means that the user can put any */
+//* value they desire into Parameters as long as it is the */
+//* same size (in bytes) as Parameters. The intended use of */
+//* Parameters is to allow the user to pass information to */
+//* *ProcessItem that *ProcessItem may need. Either way, */
+//* how Parameters is used is literally up to the user. */
+//* */
+//*********************************************************************/
+void _System ForEachItem(DLIST ListToProcess,
+void ( * _System ProcessItem) (ADDRESS Object, TAG ObjectTag, CARDINAL32 ObjectSize, ADDRESS ObjectHandle, ADDRESS Parameters, CARDINAL32 * Error),
+ADDRESS Parameters,
+BOOLEAN Forward,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: PruneList */
+//* */
+//* Descriptive Name: This function allows the caller to examine */
+//* each item in a list and optionally delete */
+//* it from the list. */
+//* */
+//* Input: DLIST ListToProcess : The DLIST to be pruned. */
+//* */
+//* BOOLEAN ( * KillItem) (...) */
+//* */
+//* This is a pointer to a user provided function. */
+//* This user provided function takes the following */
+//* parameters: */
+//* */
+//* ADDRESS Object : A pointer to an item in */
+//* ListToProcess. */
+//* TAG Object1Tag : The user assigned TAG value for */
+//* the item pointed to by Object. */
+//* ADDRESS Parameter : The address of a block of */
+//* memory containing any */
+//* parameters that the user */
+//* wishes to have passed to this*/
+//* function. */
+//* BOOLEAN * FreeMemory : The address of a BOOLEAN */
+//* variable which this */
+//* function will set to */
+//* either TRUE or FALSE. */
+//* If the function return */
+//* value is TRUE, then the */
+//* value in *FreeMemory will */
+//* be examined. If it is */
+//* TRUE, then PruneList will */
+//* free the memory associated*/
+//* with the item being */
+//* deleted. If *FreeMemory */
+//* is FALSE, then the item */
+//* being removed from the */
+//* DLIST will not be freed, */
+//* and it is up to the user */
+//* to ensure that this memory*/
+//* is handled properly. */
+//* CARDINAL32 * Error : The address of a variable to*/
+//* hold the error return value.*/
+//* */
+//* ADDRESS Parameters : This field is passed through to */
+//* *ProcessItem. This function does */
+//* not even look at the contents of */
+//* this field. This field is here to */
+//* provide the user a way to pass */
+//* additional data to *ProcessItem */
+//* that *ProcessItem may need to */
+//* function correctly. */
+//* */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return value. */
+//* */
+//* Output: If successful, this function will set *Error to */
+//* DLIST_SUCCESS. */
+//* If unsuccessful, then this function will set *Error to */
+//* a non-zero error code. */
+//* */
+//* Error Handling: This function aborts immediately when an error */
+//* is detected, and any remaining items in the list*/
+//* will not be processed. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: This function allows the user to access all of the items */
+//* in a list, perform an operation on them, and then */
+//* optionally delete ("remove") them from the DLIST. The */
+//* operation performed must not free any items in the list, */
+//* or perform any list operations on the list being */
+//* processed. */
+//* */
+//* If the KillItem function sets *Error to something other */
+//* than DLIST_SUCCESS, then PruneList will terminate and */
+//* return an error to whoever called it. The single */
+//* exception to this is if KillItem sets *Error to */
+//* DLIST_SEARCH_COMPLETE, in which case KillItem */
+//* terminates and sets *Error to DLIST_SUCCESS. This is */
+//* usefull for using KillItem to search a list and then */
+//* terminating the search once the desired item is found. */
+//* */
+//* A word about the Parameters parameter. This parameter */
+//* is passed through to *ProcessItem and is never looked at */
+//* by this function. This means that the user can put any */
+//* value they desire into Parameters as long as it is the */
+//* same size (in bytes) as Parameters. The intended use of */
+//* Parameters is to allow the user to pass information to */
+//* *ProcessItem that *ProcessItem may need. Either way, */
+//* how Parameters is used is literally up to the user. */
+//* */
+//*********************************************************************/
+void _System PruneList(DLIST ListToProcess,
+BOOLEAN ( * _System KillItem) (ADDRESS Object, TAG ObjectTag, CARDINAL32 ObjectSize, ADDRESS ObjectHandle, ADDRESS Parameters, BOOLEAN * FreeMemory, CARDINAL32 * Error),
+ADDRESS Parameters,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: AppendList */
+//* */
+//* Descriptive Name: Removes the items in SourceList and appends */
+//* them to TargetList. */
+//* */
+//* Input: DLIST TargetList : The DLIST which is to have the items */
+//* from SourceList appended to it. */
+//* DLIST SourceList : The DLIST whose items are to be */
+//* removed and appended to TargetList. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return value. */
+//* */
+//* Output: If successful, *Error will be set to DLIST_SUCCESS, */
+//* SourceList will be empty, and TargetList will contain*/
+//* all of its original items and all of the items that */
+//* were in SourceList. */
+//* If unsuccessful, *Error will be set to a non-zero value */
+//* and SourceList and TargetList will be unmodified. */
+//* */
+//* Error Handling: This function will abort immediately upon */
+//* detection of an error. All errors that can be */
+//* detected are detected before the contents of */
+//* SourceList are appended to TargetList, so if an*/
+//* error is detected and the function aborts, */
+//* SourceList and TargetList are unaltered. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+void _System AppendList(DLIST TargetList,
+DLIST SourceList,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: TransferItem */
+//* */
+//* Descriptive Name: Removes an item in SourceList and places in */
+//* TargetList. */
+//* */
+//* Input: DLIST SourceList : The DLIST containing the item which */
+//* is to be transferred. */
+//* ADDRESS SourceHandle : The handle of the item in */
+//* SourceList which is to be */
+//* transferred to another DLIST. */
+//* If this is NULL, then the */
+//* current item in SourceList will */
+//* be used. */
+//* DLIST TargetList : The DLIST which is to receive the */
+//* item being transferred. */
+//* ADDRESS TargetHandle : The item in TargetList which */
+//* is used to determine where */
+//* the item being transferred will */
+//* be placed. If this is NULL, */
+//* then the current item in */
+//* TargetList will be used. */
+//* Insertion_Modes TransferMode : This indicates where, */
+//* relative to the item in */
+//* TargetList specified by */
+//* Target_Handle, the item being */
+//* transferred can be placed. */
+//* BOOLEAN MakeCurrent : If TRUE, the item transferred to */
+//* TargetList becomes the current */
+//* item in TargetList. */
+//* CARDINAL32 * Error : The address of a variable to hold */
+//* the error return value. */
+//* */
+//* Output: If successful, *Error will be set to DLIST_SUCCESS, */
+//* SourceList will be empty, and TargetList will contain*/
+//* all of its original items and all of the items that */
+//* were in SourceList. */
+//* If unsuccessful, *Error will be set to a non-zero value */
+//* and SourceList and TargetList will be unmodified. */
+//* */
+//* Error Handling: This function will abort immediately upon */
+//* detection of an error. All errors that can be */
+//* detected are detected before the contents of */
+//* SourceList are appended to TargetList, so if an*/
+//* error is detected and the function aborts, */
+//* SourceList and TargetList are unaltered. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+void _System TransferItem(DLIST SourceList,
+ADDRESS SourceHandle,
+DLIST TargetList,
+ADDRESS TargetHandle,
+Insertion_Modes TransferMode,
+BOOLEAN MakeCurrent,
+CARDINAL32 * Error);
+
+//*********************************************************************/
+//* */
+//* Function Name: CheckListIntegrity */
+//* */
+//* Descriptive Name: Checks the integrity of a DLIST. All link */
+//* nodes in the list are checked, as are all */
+//* fields in the list control block. */
+//* */
+//* Input: DLIST ListToCheck - The list whose integrity is to be */
+//* checked. */
+//* */
+//* Output: The function return value will be TRUE if all of the */
+//* elements in the DLIST are correct. If this function */
+//* returns FALSE, then the DLIST being checked has been */
+//* corrupted! */
+//* */
+//* Error Handling: If this function encounters an error in a DLIST,*/
+//* it will return FALSE. */
+//* */
+//* Side Effects: None. */
+//* */
+//* Notes: None. */
+//* */
+//*********************************************************************/
+BOOLEAN _System CheckListIntegrity(DLIST ListToCheck);
+
+{$endif}
+
+Implementation
+
+End.
diff --git a/packages/os2units/src/mci.pas b/packages/os2units/src/mci.pas
new file mode 100644
index 0000000000..e3d9747d19
--- /dev/null
+++ b/packages/os2units/src/mci.pas
@@ -0,0 +1,2523 @@
+{
+ Copyright (c) 1991, 1992, 1993 International Business Machines Corporation
+ Copyright (c) 2002 by Andry Svirgunov (cool2@ngs.ru)
+ Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ This is Media Control Interface of MMPM/2
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(Media Control Interface of MMPM/2)
+@author(Andry Svirgunov (cool2@ngs.ru))
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(29 Nov 2002)
+@lastmod(05 Dec 2002)
+This is Media Control Interface of MMPM/2.
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+Unit mci;
+
+Interface
+
+Uses
+ mmbase,
+ os2def,
+ pmgpi;
+
+Const
+ MCI_TRUE = 1;
+ MCI_FALSE = 0;
+
+ // MCI command message identifiers
+ MCI_OPEN = 1;
+ MCI_CLOSE = 2;
+ MCI_ESCAPE = 3;
+ MCI_PLAY = 4;
+ MCI_SEEK = 5;
+ MCI_STOP = 6;
+ MCI_PAUSE = 7;
+ MCI_INFO = 8;
+ MCI_GETDEVCAPS = 9;
+ MCI_STATUS = 10;
+ MCI_SPIN = 11;
+ MCI_SET = 12;
+ MCI_STEP = 13;
+ MCI_RECORD = 14;
+ MCI_SYSINFO = 15;
+ MCI_SAVE = 16;
+ MCI_CUE = 17;
+ MCI_UPDATE = 18;
+ MCI_SET_CUEPOINT = 19;
+ MCI_SET_POSITION_ADVISE = 20;
+ MCI_SET_SYNC_OFFSET = 21;
+ MCI_LOAD = 22;
+ MCI_ACQUIREDEVICE = 23;
+ MCI_RELEASEDEVICE = 24;
+ MCI_MASTERAUDIO = 25;
+ MCI_GETTOC = 26;
+ MCI_DEVICESETTINGS = 27;
+ MCI_CONNECTOR = 28;
+ MCI_RESUME = 29;
+ MCI_CONNECTORINFO = 31;
+ MCI_DEFAULT_CONNECTION = 32;
+ MCI_CONNECTION = 33;
+ MCI_GROUP = 34;
+ MCI_NETWORD_DEFAULT_CONNECTION= 35;
+
+ // MCI command message identifiers reserved for Digital Video and Video Overlay
+ MCI_CAPTURE = 40;
+ MCI_FREEZE = 41;
+ MCI_GETIMAGEBUFFER = 42;
+ MCI_GETIMAGEPALETTE = 43;
+ MCI_PUT = 44;
+ MCI_REALIZE = 45;
+ MCI_REWIND = 46;
+ MCI_RESTORE = 47;
+ MCI_SETIMAGEBUFFER = 48;
+ MCI_SETIMAGEPALETTE = 49;
+ MCI_UNFREEZE = 50;
+ MCI_WHERE = 51;
+ MCI_WINDOW = 52;
+
+ MCI_DELETE = 53;
+ MCI_CUT = 54;
+ MCI_PASTE = 55;
+ MCI_COPY = 56;
+ MCI_REDO = 57;
+ MCI_UNDO = 58;
+ MCI_MIXNOTIFY = 59;
+ MCI_SETTUNER = 60;
+ MCI_FILTER = 61;
+ MCI_BUFFER = 62;
+ MCI_MIXSETUP = 63;
+
+ MCI_MAX_COMMAND = 64;
+
+Type
+ RECT = LongInt;
+ HDCT = LongInt;
+
+Const
+ // this and all subsequent message ID's are reserved for the user
+ MCI_USER_MESSAGES = 2000;
+
+ // Special Device ID for "all"
+ MCI_ALL_DEVICE_ID = $FFFF;
+
+ // MCI implementation limits
+ MAX_DEVICE_NAME = 20;
+ MAX_ALIAS_NAME = 20;
+ MAX_PRODINFO = 40;
+ MAX_EXTENSION_NAME = 4;
+ MAX_DEV_PARAMS = 128;
+ MAX_VERSION_NUMBER = 6;
+ MAX_PDD_NAME = 9;
+ MAX_DLL_NAME = 260;
+ MAX_CLASSES = 10;
+ MAX_CONNECTORS = 10;
+ MAX_EXTENSIONS = 25;
+ MAX_TYPEBUFFER = 256;
+
+ // MCI Device Type Constants
+ MCI_DEVTYPE_VIDEOTAPE = 1;
+ MCI_DEVTYPE_VIDEODISC = 2;
+ MCI_DEVTYPE_CD_AUDIO = 3;
+ MCI_DEVTYPE_DAT = 4;
+ MCI_DEVTYPE_AUDIO_TAPE = 5;
+ MCI_DEVTYPE_OTHER = 6;
+ MCI_DEVTYPE_WAVEFORM_AUDIO = 7;
+ MCI_DEVTYPE_SEQUENCER = 8;
+ MCI_DEVTYPE_AUDIO_AMPMIX = 9;
+ MCI_DEVTYPE_OVERLAY = 10;
+ MCI_DEVTYPE_ANIMATION = 11;
+ MCI_DEVTYPE_DIGITAL_VIDEO = 12;
+ MCI_DEVTYPE_SPEAKER = 13;
+ MCI_DEVTYPE_HEADPHONE = 14;
+ MCI_DEVTYPE_MICROPHONE = 15;
+ MCI_DEVTYPE_MONITOR = 16;
+ MCI_DEVTYPE_CDXA = 17;
+ MCI_DEVTYPE_FILTER = 18;
+ MCI_DEVTYPE_TTS = 19;
+
+ // MCI Device Type Names
+ MCI_DEVTYPE_VIDEOTAPE_NAME = 'Videotape';
+ MCI_DEVTYPE_VIDEODISC_NAME = 'Videodisc';
+ MCI_DEVTYPE_CD_AUDIO_NAME = 'CDaudio';
+ MCI_DEVTYPE_DAT_NAME = 'DAT';
+ MCI_DEVTYPE_AUDIO_TAPE_NAME = 'Audiotape';
+ MCI_DEVTYPE_OTHER_NAME = 'Other';
+ MCI_DEVTYPE_WAVEFORM_AUDIO_NAME = 'Waveaudio';
+ MCI_DEVTYPE_SEQUENCER_NAME = 'Sequencer';
+ MCI_DEVTYPE_AUDIO_AMPMIX_NAME = 'Ampmix';
+ MCI_DEVTYPE_OVERLAY_NAME = 'Overlay';
+ MCI_DEVTYPE_ANIMATION_NAME = 'Animation';
+ MCI_DEVTYPE_DIGITAL_VIDEO_NAME= 'Digitalvideo';
+ MCI_DEVTYPE_SPEAKER_NAME = 'Speaker';
+ MCI_DEVTYPE_HEADPHONE_NAME = 'Headphone';
+ MCI_DEVTYPE_MICROPHONE_NAME = 'Microphone';
+ MCI_DEVTYPE_MONITOR_NAME = 'Monitor';
+ MCI_DEVTYPE_CDXA_NAME = 'CDXA';
+ MCI_DEVTYPE_FILTER_NAME = 'Filter';
+ MCI_DEVTYPE_TTS_NAME = 'Texttospeech';
+ MCI_MAX_SYSTEM_DEVICE_NAMES = 19;
+
+
+ // Getdevcaps, set, and status item base values
+ MCI_AMP_ITEM_BASE = $1000;
+ MCI_CD_ITEM_BASE = $2000;
+ MCI_CDXA_ITEM_BASE = $3000;
+ MCI_VD_ITEM_BASE = $4000;
+ MCI_SEQ_ITEM_BASE = $5000;
+ MCI_WAVE_ITEM_BASE = $6000;
+ MCI_VID_ITEM_BASE = $7000;
+ MCI_DGV_ITEM_BASE = $8000;
+ MCI_OVLY_ITEM_BASE = $9000;
+
+ // Flags for mciDriverNotify
+ MCI_NOTIFY_SUCCESSFUL = $0000;
+ MCI_NOTIFY_SUPERSEDED = $0001;
+ MCI_NOTIFY_ABORTED = $0002;
+ MCI_NOTIFY_ERROR = $0003;
+ // mciDriverNotify Message Types
+ MM_MCINOTIFY = $0500;
+ MM_MCIPASSDEVICE = $0501;
+ MM_MCIPOSITIONCHANGE = $0502;
+ MM_MCICUEPOINT = $0503;
+ MM_MCIPLAYLISTMESSAGE = $0504;
+ MM_MCIEVENT = $0505;
+ MM_MCISYNCH = $0506;
+
+ MCI_LOSING_USE = $00000001;
+ MCI_GAINING_USE = $00000002;
+
+ // Common message flags 0x000000XX are reserved for common flags */
+ MCI_NOTIFY = $00000001;
+ MCI_WAIT = $00000002;
+ MCI_FROM = $00000004;
+ MCI_TO = $00000008;
+ MCI_MILLISECONDS = $00000010;
+ MCI_TRACK = $00000020;
+ MCI_OVER = $00000040;
+ MCI_TEST = $00000080;
+ MCI_TO_BUFFER = $00000100;
+ MCI_FROM_BUFFER = $00000200;
+ MCI_CONVERT_FORMAT = $00000400;
+
+ // Time formats
+ MCI_FORMAT_MILLISECONDS = $00000001;
+ MCI_FORMAT_mmTime = $00000002;
+ MCI_FORMAT_MSF = $00000005;
+ MCI_FORMAT_TMSF = $00000006;
+ MCI_FORMAT_CHAPTERS = $00000007;
+ MCI_FORMAT_FRAMES = $00000008;
+ MCI_FORMAT_HMS = $00000009;
+ MCI_FORMAT_TRACKS = $0000000A;
+ MCI_FORMAT_BYTES = $0000000B;
+ MCI_FORMAT_SAMPLES = $0000000C;
+ MCI_FORMAT_HMSF = $0000000D;
+ MCI_FORMAT_SET_SMPTE_24 = $0000000E;
+ MCI_FORMAT_SET_SMPTE_25 = $0000000F;
+ MCI_FORMAT_SET_SMPTE_30 = $00000010;
+ MCI_FORMAT_SET_SMPTE_30DROP = $00000011;
+ MCI_FORMAT_SET_SONGPTR = $00000012;
+ MCI_FORMAT_uSec = $00000013;
+
+ // Speed formats
+ MCI_FORMAT_PERCENTAGE = $00000003;
+ MCI_FORMAT_FPS = $00000004;
+
+// Time format conversions functions
+
+function mSecFromMM(Value: mmTime): LongInt;
+
+function mSecToMM(Value: Cardinal): mmTime;
+
+function RedBookToMM(Value: Cardinal): mmTime;
+
+function fps24ToMM(Value: Cardinal): mmTime;
+
+function fps25ToMM(Value: Cardinal): mmTime;
+
+function fps30ToMM(Value: Cardinal): mmTime;
+
+function HMSToMM(Value: Cardinal): mmTime;
+
+// The +20 is used for rounding purposes. It is derived by:
+// 1/2 * ((300 MMTIME/SEC / (75 FRAMES/SEC)) = 20 MMTIME/HALF-FRAME
+function RedBookFromMM(Value: mmTime): Cardinal;
+
+function FPS24FromMM(Value: mmTime): Cardinal;
+
+function FPS25FromMM(value: mmTime): Cardinal;
+
+function FPS30FromMM(value: mmTime): Cardinal;
+
+function HMSFromMM(value: mmTime): Cardinal;
+
+function tmsf_track(time: mmTime): Byte;
+
+function tmsf_minute(time: mmTime): Byte;
+
+function tmsf_second(time: mmTime): Byte;
+
+function tmsf_frame(time: mmTime): Byte;
+
+function msf_minute(time: mmTime): Byte;
+
+function msf_second(time: mmTime): Byte;
+
+function msf_frame(time: mmTime): Byte;
+
+// BYTE ACCESS WITH A DWORD MACROS
+function uLong_lwlb(var ul): Byte; // Low word low byte
+
+function uLong_lwhb(var ul): Byte; // Low word high byte
+
+function uLong_hwlb(var ul): Byte; // High word low byte
+
+function uLong_hwhb(var ul): Byte; // High word high byte
+
+function uLong_lowd(var ul): Word; // Low word
+
+function uLong_hiwd(var ul): Word; // High word
+
+// parameters for default command messages with empty parameter lists
+type
+ mci_Generic_Parms = record
+ hwndCallback : hwnd;
+ end;
+ pmci_Generic_Parms = ^mci_Generic_Parms;
+
+// flags for the MCI_ACQUIREDEVICE message
+// 0x00000X00 are reserved for MCI_ACQUIREDEVICE flags
+Const
+ MCI_EXCLUSIVE = $00000100;
+ MCI_EXCLUSIVE_INSTANCE = $00000200;
+ MCI_ACQUIRE_QUEUE = $00000400;
+
+ // flags for the MCI_CAPTURE message */
+ // 0x0000XX00 are reserved for MCI_CAPTURE flags */
+ // MCI_CONVERT is used by MCI_GETIMAGEBUFFER, MCI_SETIMAGEBUFFER */
+ // MCI_CAPTURE, and MCI_RESTORE */
+ MCI_CAPTURE_RECT = $00000100;
+ MCI_CONVERT = $00001000;
+type
+ // parameter structure for the MCI_CAPTURE message */
+ mci_Capture_Parms = record
+ hwndCallback : hwnd;
+ Rect : RectL;
+ end;
+ pmci_Capture_Parms = ^mci_Capture_Parms;
+
+ // flags for MCI_CONNECTOR and MCI_CONNECTION messages */
+Const
+ MCI_ENABLE_CONNECTOR = $00000100;
+ MCI_DISABLE_CONNECTOR = $00000200;
+ MCI_QUERY_CONNECTOR_STATUS = $00000400;
+ MCI_CONNECTOR_TYPE = $00000800;
+ MCI_CONNECTOR_INDEX = $00001000;
+ MCI_TO_CONNECTOR_INDEX = $00002000;
+ MCI_TO_CONNECTOR_TYPE = $00004000;
+ MCI_QUERY_CONNECTION = $00008000;
+ MCI_MAKE_CONNECTION = $00010000;
+ MCI_BREAK_CONNECTION = $00020000;
+ MCI_ENUMERATE_CONNECTORS = $00040000;
+ MCI_QUERY_CONNECTOR_TYPE = $00080000;
+ MCI_QUERY_VALID_CONNECTION = $00100000;
+ MCI_CONNECTOR_ALIAS = $00200000;
+ MCI_EXTERNAL_CONNECTION = $00400000;
+
+ // Connector types
+ MCI_MIDI_STREAM_CONNECTOR = $00000001;
+ MCI_CD_STREAM_CONNECTOR = $00000002;
+ MCI_WAVE_STREAM_CONNECTOR = $00000003;
+ MCI_AMP_STREAM_CONNECTOR = $00000004;
+ MCI_XA_STREAM_CONNECTOR = $00000005;
+ MCI_HEADPHONES_CONNECTOR = $00000006;
+ MCI_SPEAKERS_CONNECTOR = $00000007;
+ MCI_MICROPHONE_CONNECTOR = $00000008;
+ MCI_LINE_IN_CONNECTOR = $00000009;
+ MCI_LINE_OUT_CONNECTOR = $0000000a;
+ MCI_VIDEO_IN_CONNECTOR = $0000000b;
+ MCI_VIDEO_OUT_CONNECTOR = $0000000c;
+ MCI_PHONE_SET_CONNECTOR = $0000000d;
+ MCI_PHONE_LINE_CONNECTOR = $0000000e;
+ MCI_AUDIO_IN_CONNECTOR = $0000000f;
+ MCI_AUDIO_OUT_CONNECTOR = $00000010;
+ MCI_UNIVERSAL_CONNECTOR = $00000011;
+ MCI_INTERNAL_AUDIO_CONNECTOR = $00000012;
+ MCI_MIDI_IN_CONNECTOR = $00000013;
+ MCI_MIDI_OUT_CONNECTOR = $00000014;
+ MCI_NULL_CONNECTOR = $00000015;
+
+Type
+ // parameter structure for the MCI_CONNECTION message
+ mci_Connection_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulConnectorType : LongInt; // Connector type
+ ulConnectorIndex : LongInt; // Connector index
+ pszAlias : pChar; // Connection device alias
+ usToDeviceID : Integer; // Connected to device ID
+ usReserved0 : Integer; // Reserved field
+ ulReserved1 : LongInt; // Reserved field
+ ulReserved2 : LongInt; // Reserved field
+ end;
+ pmci_Connection_Parms = ^mci_Connection_Parms;
+
+ //********************************************************************/
+ // parameter structure for the MCI_CONNECTOR message */
+ //********************************************************************/
+ mci_Connector_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulReturn : LongInt; // Return information
+ ulConnectorType : LongInt; // If specified, ulConnectorIndex is relative
+ // to the specified connector type
+ ulConnectorIndex : LongInt; // Connector number
+ end;
+ pmci_Connector_Parms = ^mci_Connector_Parms;
+
+
+ //********************************************************************/
+ // Flags for use with ulParam1 */
+ //********************************************************************/
+
+CONST
+ MCI_MIXSETUP_INIT =$00010000;
+ MCI_MIXSETUP_DEINIT =$00020000;
+ MCI_MIXSETUP_QUERYMODE =$00040000;
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_BUFFER message */
+ //********************************************************************/
+Type
+ mci_mix_buffer = record
+ ulStructLength:LongInt; // Length of the structure */
+ pBuffer:Pointer; // Pointer to a buffer */
+ ulBufferLength:LongInt; // Length of the buffer */
+ ulFlags:LongInt; // Flags */
+ ulUserParm:LongInt; // Caller parameter */
+ ulTime:LongInt; // OUT--Current time in MS */
+ ulReserved1:LongInt; // Unused. */
+ ulReserved2:LongInt; // Unused. */
+ end;
+
+ PMCI_MIX_BUFFER=^mci_mix_buffer;
+
+
+ //********************************************************************/
+ // valid options for the ulFlags field of MCI_MIX_BUFFER */
+ //********************************************************************/
+
+CONST
+ MIX_BUFFER_EOS =$00000001;
+
+type
+ MixerProc=Function(ulHandle:LongInt;pBuffer:PMCI_MIX_BUFFER;ulFlags:LongInt):Longint; cdecl;
+ MixerEvent=Function(ulStatus:LongInt;pBuffer:PMCI_MIX_BUFFER;ulFlags:LongInt):LongInt; cdecl;
+
+ //********************************************************************/
+ // valid returns for the ulFlags param of the MIXEREVENT entry */
+ //********************************************************************/
+
+CONST
+ MIX_STREAM_ERROR =$00000080;
+ MIX_READ_COMPLETE =$00000001;
+ MIX_WRITE_COMPLETE =$00000002;
+
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_MIXSETUP_PARMS message */
+ //********************************************************************/
+
+TYPE MCI_MIXSETUP_PARMS = record
+ hwndCallback:HWND; // PM window handle for MCI notify message */
+ ulBitsPerSample:LongInt; // IN Number of Bits per Sample */
+ ulFormatTag:LongInt; // IN Format Tag */
+ ulSamplesPerSec:LongInt; // IN Sampling Rate */
+ ulChannels:LongInt; // IN Number of channels */
+ ulFormatMode:LongInt; // IN Either MCI_RECORD or MCI_PLAY */
+ ulDeviceType:LongInt; // IN MCI_DEVTYPE (i.e. DEVTYPE_WAVEFORM etc.) */
+ ulMixHandle:LongInt; // OUT--mixer returns handle for write/read */
+ pmixWrite:MixerProc; // OUT-Mixer Write Routine entry point */
+ pmixRead:MixerProc; // OUT-Mixer Read Routine entry point */
+ pmixEvent:MixerEvent; // IN--Mixer Read Routine entry point */
+ pExtendedInfo:Pointer; // Ptr to extended wave information */
+ ulBufferSize:longInt; // OUT--suggested buffer size for current mode */
+ ulNumBuffers:LongInt; // OUT--suggested # of buffers for current mode */
+ end;
+
+pmci_mixsetup_parms=^mci_mixsetup_parms;
+
+ //********************************************************************/
+ // Flags for use with ulParam1 */
+ //********************************************************************/
+
+CONST
+
+ MCI_BUFFER_QUERY =$00010000;
+ MCI_BUFFER_SET =$00020000;
+ MCI_ALLOCATE_MEMORY =$00040000;
+ MCI_DEALLOCATE_MEMORY =$00080000;
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_BUFFER message */
+ //********************************************************************/
+type mci_buffer_parms=record
+ hwndCallback:hwnd; // PM window handle for MCI notify message */
+ ulStructLength:longint; // Length of the MCI Buffer command */
+ ulNumBuffers:longInt; // Number of buffers MCI driver should use */
+ ulBufferSize:longint; // Size of buffers MCI driver should use */
+ ulMinToStart:longint; // Min number of buffers to create a stream. */
+ ulSrcStart:longint; // # of EMPTY buffers required to start Source*/
+ ulTgtStart:longint; // # of FULL buffers required to start Target */
+
+ pBufList:pointer; // Pointer to a list of buffers */
+
+ end;
+ pmci_buffer_parms=^mci_buffer_parms;
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_CONNECTORINFO message */
+ //********************************************************************/
+ mci_ConnectorInfo_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulReturn : Longint; // Return information
+ ulDeviceTypeID : Longint; // MCI device type
+ ulConnectorType : Longint; // If specified, ulConnectorIndex is relative
+ // to the specified connector type
+ ulConnectorIndex : Longint; // Connector number
+ ulToConnectorType: Longint; // Connector type to test if
+ // MCI_QUERY_VALID_CONNECTION is specified
+ end;
+ pmci_ConnectorInfo_Parms = ^mci_ConnectorInfo_Parms;
+
+ //********************************************************************/
+ // flags for the MCI_CUE message */
+ // 0x00000x00 are reserved for MCI_CUE flags */
+ //********************************************************************/
+CONST
+ MCI_CUE_INPUT = $00000100;
+ MCI_CUE_OUTPUT = $00000200;
+ MCI_SHOW = $00000400;
+ MCI_NOSHOW = $00000800;
+
+ //************************************************/
+ // Additional flags for Wave Audio for MCI_CUE */
+ //************************************************/
+ MCI_WAVE_INPUT = $00001000;
+ MCI_WAVE_OUTPUT = $00002000;
+
+ //****************************************************************************/
+ // the MCI_CONNLIST structure used in the NETWORK_DEFAULT_CONNECTION message */
+ //****************************************************************************/
+type mci_connlist=record
+ ulFromDevice: LongInt; // Ordinal position of device within pDevices array */
+ ulSrcConnType: LongInt; // Type of source connector */
+ ulSrcConnNum: LongInt; // Source Connector Number */
+ ulToDevice: LongInt; // Ordinal position of device within pDevices array */
+ ulTgtConnType: LongInt; // Type of target connector */
+ ulTgtConnNum: Longint; // Target Connector Number */
+ end;
+ pmci_connlist=^mci_connlist;
+
+
+ //****************************************************************************/
+ // parameter structure for the MCI_NETWORK_DEFAULT_CONNECTION message */
+ //****************************************************************************/
+type mci_network_default_connection_parms=record
+ hwndCallback:HWND; // PM window handle for MCI notify message */
+ szInstallName:ARRAY [0..MAX_DEVICE_NAME] of Char; // Name of section containing default conn. */
+ ulNumDevices:LongInt; // Number of additional devices in connection */
+ ulNumPlayConnections:LongInt; // Number of Play connections */
+ ulNumRecordConnections:LongInt; // Number of Record connections */
+ pDevices:ARRAY [0..MAX_DEVICE_NAME] of ^Char; // Pointer to array of device names to open */
+ pPlayConnections:PMCI_CONNLIST; // Pointer to array of connections to "make" */
+ pRecordConnections:PMCI_CONNLIST; // Pointer to array of connections to "make" */
+ end;
+type pmci_network_default_connection_parms=^mci_network_default_connection_parms;
+
+
+ //******************************************************/
+ // Additional flags for MCI_NETWORK_DEFAULT_CONNECTION */
+ //******************************************************/
+CONST
+ MCI_RECORD_DEFAULTS =$00000004;
+ MCI_PLAY_DEFAULTS =$00000008;
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_DEFAULT_CONNECTION message */
+ //********************************************************************/
+type mci_Default_Connection_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ pszDevice : pChar; // Device name
+ ulConnectorType : LongInt; // If specified, ulConnectorIndex is relative
+ // to the specified connector type
+ ulConnectorIndex : LongInt; // Connector number
+ pszToDevice : pChar; // Return device name to which the connection exists
+ ulToConnectorType: LongInt; // Connector type
+ ulToConnectorIndex:LongInt; // Connector number
+ end;
+ pmci_Default_Connection_Parms = ^mci_Default_Connection_Parms;
+
+ //********************************************************************/
+ // parameter structure for the MCI_DEVICESETTINGS message */
+ //********************************************************************/
+ mci_DeviceSettings_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ hwndNotebook : hwnd; // Hwhd to notebook window
+ usDeviceType : Integer; // Device type
+ pszDeviceName : pChar; // Device name
+ end;
+ pmci_DeviceSettings_Parms = ^mci_DeviceSettings_Parms;
+
+ //*********************************************************************/
+ // parameter structure for the MCI_CUT / COPY / DELETE / UNDO / etc...*/
+ //*********************************************************************/
+ mci_Edit_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulStructLen : Longint; // Length of the Structure
+ ulFrom : Longint; // Beginning Point of Range
+ ulTo : Longint; // ending point of range
+ pBuff : Pointer; // user buffer
+ ulBufLen : Longint; // length of user buffer
+ pHeader : Pointer; // header which describes the buffer
+ end;
+ pmci_Edit_Parms = ^mci_Edit_Parms;
+
+ //********************************************************************/
+ // flags and parameter structure for the MCI_ESCAPE message */
+ // 0x00000X00 are reserved for MCI_ESCAPE flags */
+ //********************************************************************/
+const
+ mci_Escape_String = $00000100;
+
+type
+ mci_Escape_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ pszCommand : pChar; // Command to send to the device
+ end;
+ pmci_Escape_Parms = ^mci_Escape_Parms;
+
+ //********************************************************************/
+ // flags for the MCI_FREEZE message */
+ // 0x0000XX00 are reserved for MCI_FREEZE flags */
+ //********************************************************************/
+CONST
+ MCI_OVLY_FREEZE_RECT = $00000100;
+ MCI_OVLY_FREEZE_RECT_OUTSIDE = $00000200;
+
+ //********************************************************************/
+ // flags for the MCI_GETDEVCAPS message */
+ // 0x00XXXX00 are reserved for MCI_GETDEVCAPS flags */
+ //********************************************************************/
+ MCI_GETDEVCAPS_MESSAGE = $00000100;
+ MCI_GETDEVCAPS_ITEM = $00000200;
+ MCI_GETDEVCAPS_EXTENDED = $00000400;
+ //************************************************/
+ // General MCI_GETDEVCAPS item values */
+ //************************************************/
+ MCI_GETDEVCAPS_CAN_EJECT = $00000001;
+ MCI_GETDEVCAPS_CAN_LOCKEJECT = $00000002;
+ MCI_GETDEVCAPS_CAN_PLAY = $00000003;
+ MCI_GETDEVCAPS_CAN_PROCESS_INTERNAL = $00000004;
+ MCI_GETDEVCAPS_CAN_RECORD = $00000005;
+ MCI_GETDEVCAPS_CAN_RECORD_INSERT = $00000006;
+ MCI_GETDEVCAPS_CAN_SAVE = $00000007;
+ MCI_GETDEVCAPS_CAN_SETVOLUME = $00000008;
+ MCI_GETDEVCAPS_CAN_STREAM = $00000009;
+ MCI_GETDEVCAPS_DEVICE_TYPE = $0000000A;
+ MCI_GETDEVCAPS_HAS_AUDIO = $0000000B;
+ MCI_GETDEVCAPS_HAS_VIDEO = $0000000C;
+ MCI_GETDEVCAPS_PREROLL_TIME = $0000000D;
+ MCI_GETDEVCAPS_PREROLL_TYPE = $0000000E;
+ MCI_GETDEVCAPS_USES_FILES = $0000000F;
+ MCI_GETDEVCAPS_HAS_IMAGE = $00000010;
+ MCI_GETDEVCAPS_WAVE_FORMAT = $00000011;
+ MCI_GETDEVCAPS_CAN_CLOSE_DOOR = $00000012;
+
+ //**********************************************/
+ // return ID's for videodisc MCI_GETDEVCAPS */
+ //**********************************************/
+ MCI_VD_MEDIA_CLV=$00000001;
+ MCI_VD_MEDIA_CAV=$00000002;
+ MCI_VD_MEDIA_OTHER=$00000003;
+
+ //************************************************/
+ // MCI_GETDEVCAPS item values for video devices */
+ //************************************************/
+ MCI_VID_GETDEVCAPS_CAN_STRETCH = MCI_VID_ITEM_BASE;
+ MCI_VID_GETDEVCAPS_CAN_DISTORT = MCI_VID_ITEM_BASE+1;
+ MCI_VID_GETDEVCAPS_VIDEO_X_EXTENT = MCI_VID_ITEM_BASE+2;
+ MCI_VID_GETDEVCAPS_VIDEO_Y_EXTENT = MCI_VID_ITEM_BASE+3;
+ MCI_VID_GETDEVCAPS_IMAGE_X_EXTENT = MCI_VID_ITEM_BASE+4;
+ MCI_VID_GETDEVCAPS_IMAGE_Y_EXTENT = MCI_VID_ITEM_BASE+5;
+ MCI_VID_GETDEVCAPS_MAX_WINDOWS = MCI_VID_ITEM_BASE+6;
+ MCI_VID_GETDEVCAPS_CAN_FREEZE = MCI_VID_ITEM_BASE+7;
+ MCI_VID_GETDEVCAPS_OVERLAY_GRAPHICS = MCI_VID_ITEM_BASE+8;
+ MCI_VID_GETDEVCAPS_CAN_REVERSE = MCI_VID_ITEM_BASE+9;
+ MCI_VID_GETDEVCAPS_FAST_RATE = MCI_VID_ITEM_BASE+10;
+ MCI_VID_GETDEVCAPS_SLOW_RATE = MCI_VID_ITEM_BASE+11;
+ MCI_VID_GETDEVCAPS_NORMAL_RATE = MCI_VID_ITEM_BASE+12;
+ MCI_VID_GETDEVCAPS_MINIMUM_RATE = MCI_VID_ITEM_BASE+13;
+ MCI_VID_GETDEVCAPS_MAXIMUM_RATE = MCI_VID_ITEM_BASE+14;
+
+
+ //************************************************/
+ // MCI_GETDEVCAPS flag values for Videodisc */
+ //************************************************/
+ MCI_VD_GETDEVCAPS_CLV = $00000400;
+ MCI_VD_GETDEVCAPS_CAV = $00000800;
+
+ //************************************************/
+ // MCI_GETDEVCAPS item values for Videodisc */
+ //************************************************/
+
+ MCI_VD_GETDEVCAPS_CAN_REVERSE = MCI_VID_GETDEVCAPS_CAN_REVERSE;
+ MCI_VD_GETDEVCAPS_FAST_RATE = MCI_VID_GETDEVCAPS_FAST_RATE;
+ MCI_VD_GETDEVCAPS_SLOW_RATE = MCI_VID_GETDEVCAPS_SLOW_RATE;
+ MCI_VD_GETDEVCAPS_NORMAL_RATE = MCI_VID_GETDEVCAPS_NORMAL_RATE;
+ MCI_VD_GETDEVCAPS_MINIMUM_RATE = MCI_VID_GETDEVCAPS_MINIMUM_RATE;
+ MCI_VD_GETDEVCAPS_MAXIMUM_RATE = MCI_VID_GETDEVCAPS_MAXIMUM_RATE;
+ //***********************************************/
+ // MCI_GETDEVCAPS item values for Digital Video */
+ //***********************************************/
+ MCI_DGV_GETDEVCAPS_CAN_REVERSE = MCI_VID_GETDEVCAPS_CAN_REVERSE;
+ MCI_DGV_GETDEVCAPS_CAN_STRETCH = MCI_VID_GETDEVCAPS_CAN_STRETCH;
+ MCI_DGV_GETDEVCAPS_CAN_DISTORT = MCI_VID_GETDEVCAPS_CAN_DISTORT;
+ MCI_DGV_GETDEVCAPS_FAST_RATE = MCI_VID_GETDEVCAPS_FAST_RATE;
+ MCI_DGV_GETDEVCAPS_SLOW_RATE = MCI_VID_GETDEVCAPS_SLOW_RATE;
+ MCI_DGV_GETDEVCAPS_NORMAL_RATE = MCI_VID_GETDEVCAPS_NORMAL_RATE;
+ MCI_DGV_GETDEVCAPS_MINIMUM_RATE = MCI_VID_GETDEVCAPS_MINIMUM_RATE;
+ MCI_DGV_GETDEVCAPS_MAXIMUM_RATE = MCI_VID_GETDEVCAPS_MAXIMUM_RATE;
+ MCI_DGV_GETDEVCAPS_VIDEO_X_EXTENT = MCI_VID_GETDEVCAPS_VIDEO_X_EXTENT;
+ MCI_DGV_GETDEVCAPS_VIDEO_Y_EXTENT = MCI_VID_GETDEVCAPS_VIDEO_Y_EXTENT;
+ MCI_DGV_GETDEVCAPS_IMAGE_X_EXTENT = MCI_VID_GETDEVCAPS_IMAGE_X_EXTENT;
+ MCI_DGV_GETDEVCAPS_IMAGE_Y_EXTENT = MCI_VID_GETDEVCAPS_IMAGE_Y_EXTENT;
+ MCI_DGV_GETDEVCAPS_MAX_WINDOWS = MCI_VID_GETDEVCAPS_MAX_WINDOWS;
+ MCI_DGV_GETDEVCAPS_OVERLAY_GRAPHICS = MCI_VID_GETDEVCAPS_OVERLAY_GRAPHICS;
+ MCI_DGV_GETDEVCAPS_HAS_TUNER = MCI_DGV_ITEM_BASE;
+ MCI_DGV_GETDEVCAPS_HAS_TELETEX = MCI_DGV_ITEM_BASE+1;
+ MCI_DGV_GETDEVCAPS_HAS_AFC = MCI_DGV_ITEM_BASE+2;
+
+ //************************************************/
+ // MCI_GETDEVCAPS item values for Video Overlay */
+ //************************************************/
+ MCI_OVLY_GETDEVCAPS_CAN_STRETCH = MCI_VID_GETDEVCAPS_CAN_STRETCH;
+ MCI_OVLY_GETDEVCAPS_CAN_DISTORT = MCI_VID_GETDEVCAPS_CAN_DISTORT;
+ MCI_OVLY_GETDEVCAPS_VIDEO_X_EXTENT = MCI_VID_GETDEVCAPS_VIDEO_X_EXTENT;
+ MCI_OVLY_GETDEVCAPS_VIDEO_Y_EXTENT = MCI_VID_GETDEVCAPS_VIDEO_Y_EXTENT;
+ MCI_OVLY_GETDEVCAPS_IMAGE_X_EXTENT = MCI_VID_GETDEVCAPS_IMAGE_X_EXTENT;
+ MCI_OVLY_GETDEVCAPS_IMAGE_Y_EXTENT = MCI_VID_GETDEVCAPS_IMAGE_Y_EXTENT;
+ MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = MCI_VID_GETDEVCAPS_MAX_WINDOWS;
+ MCI_OVLY_GETDEVCAPS_CAN_FREEZE = MCI_VID_GETDEVCAPS_CAN_FREEZE;
+ MCI_OVLY_GETDEVCAPS_OVERLAY_GRAPHICS = MCI_VID_GETDEVCAPS_OVERLAY_GRAPHICS;
+
+ MCI_PREROLL_NOTIFIED = $00000001;
+ MCI_PREROLL_DETERMINISTIC = $00000002;
+ MCI_PREROLL_NONE = $00000003;
+
+ //********************************************************************/
+ // parameter structure for the MCI_GETDEVCAPS message */
+ //********************************************************************/
+TYPE
+ mci_GetDevCaps_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulReturn : Longint; // Return field
+ ulItem : Longint; // Item field for GETDEVCAPS item to query
+ usMessage : integer; // Field to hold MCI message to query
+ usReserved0 : integer; // Reserved field
+ end;
+ pmci_GetDevCaps_Parms = ^mci_GetDevCaps_Parms;
+
+ //********************************************************************/
+ // parameter structure for the MCI_WAVE_GETDEVCAPS */
+ //********************************************************************/
+ mci_Wave_GetDevCaps_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulReturn : Longint; // Return field
+ ulItem : Longint; // Item field for GETDEVCAPS item to query
+ usMessage : Integer; // Field to hold MCI message to query
+ usReserved0 : Integer; // Reserved field
+ ulLength : Longint; // Length of structure in ULONGS
+ ulBitsPerSample : Longint; // Number of Bits per Sample
+ ulFormatTag : Longint; // Format Tag
+ ulSamplesPerSec : Longint; // Sampling Rate
+ ulChannels : Longint; // Number of channels
+ ulFormatMode : Longint; // Either MCI_RECORD or MCI_PLAY
+ end;
+ pmci_Wave_GetDevCaps_Parms = ^mci_Wave_GetDevCaps_Parms;
+
+ //********************************************************************/
+ // potential values for the ulValue field of MCI_AMP_GETDEVCAPS */
+ //********************************************************************/
+CONST
+ MCI_SET_MONITOR = $00000001;
+ MCI_SET_MONITOR_AUDIO = $00000002;
+ MCI_SET_MONITOR_VIDEO = $00000003;
+ MCI_SET_RECORD = $00000004;
+
+ // MCI_SET flags for amp/mixer;
+ MCI_AMP_SET_BALANCE = $00100000;
+ MCI_AMP_SET_PITCH = $00200000;
+ MCI_AMP_SET_TREBLE = $00400000;
+ MCI_AMP_SET_BASS = $00800000;
+ MCI_AMP_SET_GAIN = $01000000;
+ MCI_AMP_SET_ALC = $00000004;
+ MCI_AMP_SET_AUDIO = $00000008;
+ MCI_AMP_SET_CROSSOVER = $00000010;
+ MCI_AMP_SET_LOUDNESS = $00000020;
+ MCI_AMP_SET_MUTE = $00000040;
+ MCI_AMP_SET_REVERB = $00000080;
+ MCI_AMP_SET_STEREOENHANCE = $00000100;
+ MCI_AMP_SET_CUSTOM1 = $00000200;
+ MCI_AMP_SET_CUSTOM2 = $00000400;
+ MCI_AMP_SET_CUSTOM3 = $00000800;
+ MCI_AMP_SET_LRVOLUME = $00001000;
+ MCI_AMP_SET_MID = $00020000;
+ MCI_AMP_SET_CHORUS = $00004000; // typo? 40000?
+ MCI_AMP_SET_VOLUME = $00080000; // MCI_SET_VOLUME;
+ MCI_AMP_SET_MONITOR = MCI_SET_MONITOR_AUDIO;
+
+ // Potential values for the ulValue field of MCI_AMP_GETDEVCAPS
+ MCI_AMP_CAN_SET_MONITOR = MCI_AMP_SET_MONITOR;
+ MCI_AMP_CAN_SET_BALANCE = MCI_AMP_SET_BALANCE;
+ MCI_AMP_CAN_SET_ALC = MCI_AMP_SET_ALC;
+ MCI_AMP_CAN_SET_CROSSOVER = MCI_AMP_SET_CROSSOVER;
+ MCI_AMP_CAN_SET_LOUDNESS = MCI_AMP_SET_LOUDNESS;
+ MCI_AMP_CAN_SET_MUTE = MCI_AMP_SET_MUTE;
+ MCI_AMP_CAN_SET_REVERB = MCI_AMP_SET_REVERB;
+ MCI_AMP_CAN_SET_STEREOENHANCE = MCI_AMP_SET_STEREOENHANCE;
+ MCI_AMP_CAN_SET_CUSTOM1 = MCI_AMP_SET_CUSTOM1;
+ MCI_AMP_CAN_SET_CUSTOM2 = MCI_AMP_SET_CUSTOM2;
+ MCI_AMP_CAN_SET_CUSTOM3 = MCI_AMP_SET_CUSTOM3;
+ MCI_AMP_CAN_SET_LRVOLUME = MCI_AMP_SET_LRVOLUME;
+ MCI_AMP_CAN_SET_BASS = MCI_AMP_SET_BASS;
+ MCI_AMP_CAN_SET_MID = MCI_AMP_SET_MID;
+ MCI_AMP_CAN_SET_TREBLE = MCI_AMP_SET_TREBLE;
+ MCI_AMP_CAN_SET_PITCH = MCI_AMP_SET_PITCH;
+ MCI_AMP_CAN_SET_GAIN = MCI_AMP_SET_GAIN;
+ MCI_AMP_CAN_SET_CHORUS = MCI_AMP_SET_CHORUS;
+ MCI_AMP_CAN_SET_VOLUME = MCI_AMP_SET_VOLUME;
+
+ //************************************************************************/
+ // potential values for the ulExtended field of MCI_AMP_GETDEVCAPS_PARMS */
+ //************************************************************************/
+ MCI_MIXER_LINE = $00000001;
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_AMP_GETDEVCAPS */
+ //********************************************************************/
+type
+ mci_Amp_GetDevCaps_Parms = record
+ hwndCallback : Longint; // PM window handle for MCI notify message
+ ulReturn : Longint; // Return field
+ ulItem : Longint; // Item field for GETDEVCAPS item to query
+ usMessage : Integer; // Field to hold MCI message to query
+ usReserved0 : Integer; // Reserved field
+ ulLength : LongInt; // Length of structure in uLongS
+ ulValue : LongInt; // Value to determine caps
+ ulAttribute : LongInt; // Flags to modified the extended parms
+ ulExtended : LongInt; // Extended flags field
+ end;
+ pmci_Amp_GetDevCaps_Parms = ^mci_Amp_GetDevCaps_Parms;
+
+
+ //********************************************************************/
+ // values for the ulFlags field of MCI_MIXEVENT_PARMS */
+ //********************************************************************/
+CONST
+ MCI_MIX_ATTRIBUTE = $00000001;
+ MCI_MIX_CONNECTOR = $00000002;
+ //********************************************************************/
+ // values for the lParam field for mix_notify */
+ //********************************************************************/
+
+ MCI_MIXNOTIFY_ON = $00000004;
+ MCI_MIXNOTIFY_OFF = $00000008;
+
+ //********************************************************************/
+ // value to indicate type of MM_MCIEVENT */
+ //********************************************************************/
+
+ MCI_MIXEVENT = $00000001;
+
+
+ //********************************************************************/
+ // parameter structure for the MCI_MIXEVENT_PARMS */
+ //********************************************************************/
+type
+ mci_MixEvent_Parms = record
+ ulLength : Longint; // Length of struct
+ hwndMixer : hwnd; // window to inform of mixer changes
+ ulFlags : Longint; // Either MCI_MIX_ATTRIBUTE
+ // or MCI_MIX_CONNECTOR
+ usDeviceID : Integer; // device id to notify of the change
+ ulDeviceType : LongInt; // Device Type which generated the change
+ ulDeviceOrdinal : LongInt; // Ordinal of device Type
+ ulAttribute : LongInt; // Attribute that changed(volume, bass etc.)
+ ulValue : LongInt; // new value of the attribute which changed
+ ulConnectorType : LongInt; // Connector Type
+ ulConnectorIndex : LongInt; // Connector Index
+ ulConnStatus : LongInt; // Is connector enabled/disabled.
+ end;
+ pmci_MixEvent_Parms = ^mci_MixEvent_Parms;
+
+
+ //********************************************************************/
+ // flag values for the MCI_GETIMAGEBUFFER and MCI_SETIMAGEBUFFER msg */
+ // 0x0000XX00 are reserved for MCI_GETIMAGEBUFFER and */
+ // MCI_SETIMAGEBUFFER Flags */
+ // MCI_CONVERT is defined by MCI_CAPTURE message as 0x00001000L */
+ //********************************************************************/
+CONST
+ MCI_USE_HW_BUFFER = $00000400;
+ MCI_GET_HW_BUFFER_PTR = $00000800;
+
+ //**************************************************/
+ // parm structure for MCI_GETIMAGEBUFFER and */
+ // MCI_SETIMAGEBUFFER messages */
+ //**************************************************/
+type
+ mci_Image_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulPelFormat : Longint; // Format of the image data returned
+ usBitCount : Integer; // Number of bitsimage data returned
+ usReserved0 : Integer; // Reserved field
+ ulImageCompression : LongInt; //
+ rect : RectL; // Image area to get/set
+ pPelBuffer : Pointer; // Pel data buffer
+ ulPelBufferHeight : LongInt; // Number of rows in buffer
+ ulPelBufferWidth : LongInt; // Pels per row in buffer
+ ulBufLen : LongInt; // Pel data buffer length in bytes
+ end;
+ pmci_Image_Parms = ^mci_Image_Parms;
+
+ //********************************************************************/
+ // flags for the MCI_GETIMAGEPALETTE message */
+ // 0x0000XX00 are reserved for MCI_GETIMAGEPALETTE flags */
+ //********************************************************************/
+CONST
+ MCI_FIND_BEST_REGISTERED = $00000100;
+ MCI_QUERY_REGISTERED_MAP = $00000200;
+ MCI_QUERY_REGISTERED_MAP_SIZE = $00000400;
+
+
+ //**************************************************/
+ // parameter structure for MCI_GETIMAGEPALETTE and */
+ // MCI_SETIMAGEPALETTE messages */
+ //**************************************************/
+type
+ mci_Palette_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ usRegisteredMap : Integer; // Id of the palette from the registed color map
+ usReserved0 : Integer; // Reserved field
+ ulPalEntries : LongInt; // size of the palette returned
+ pPalette : Pointer; // pointer to the palette
+ end;
+ pmci_Palette_Parms = ^mci_Palette_Parms;
+
+
+ //********************************************************************/
+ // Parameter structure for the MCI_GETTOC message */
+ //********************************************************************/
+ mci_Toc_Rec = record
+ TrackNum : BYTE; // Returned Track Number
+ ulStartAddr : LongInt; // Starting address of the track in MMTIME format
+ ulEndAddr : LongInt; // Ending address of the track in MMTIME format
+ Control : BYTE; // Track Control information
+ usCountry : Integer; // Country
+ ulOwner : LongInt; // Owner
+ ulSerialNum : LongInt; // Serial Number
+ end;
+ pTocRec = ^mci_Toc_Rec;
+
+ mci_Toc_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ pBuf : pTocRec; // Pointer to array MCI_TOC_REC structures to
+ // be filled in by the mci device
+ ulBufSize : LongInt; // Size of the array
+ end;
+ pmci_Toc_Parms = ^mci_Toc_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_GROUP message */
+ // 0x00XXXX00 are reserved for MCI_GROUP flags */
+ //********************************************************************/
+const
+ MCI_SYNCHRONIZE = $00000100;
+ MCI_NOPIECEMEAL = $00000200;
+ MCI_GROUP_MAKE = $00000400;
+ MCI_GROUP_DELETE = $00000800;
+ MCI_GROUP_ALIAS = $00001000;
+ MCI_GROUP_MASTER = $00002000;
+ MCI_GROUP_NONE = $00004000; // No group!
+
+type
+ mci_Group_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message.
+ usGroupID : Integer; // GroupID
+ usReserved0 : Integer; // RESERVED
+ ulStructLength : LongInt; // Length of Structure in ULONGS.
+ usMasterID : Integer; // ID of Master device in Synchrounous groups.
+ usReserved1 : Integer; // RESERVED
+ pszGroupAlias : pChar; // Pointer to Alias Name.
+ ulNumDevices : LongInt; // Number of Devices in group.
+ paulDeviceID : PLongInt; // Array of Device ids in the group.
+ end;
+ pmci_Group_Parms = ^mci_Group_Parms;
+
+
+ //********************************************************************/
+ // flags for the MCI_INFO message */
+ // 0x00000X00 are reserved for MCI_INFO flags */
+ //********************************************************************/
+CONST
+ MCI_INFO_PRODUCT = $00000100;
+ MCI_INFO_FILE = $00000200;
+ //***********************************************/
+ // CD Audio MCI_INFO */
+ //***********************************************/
+ MCI_CD_INFO_ID = $00010000;
+ MCI_CD_INFO_UPC = $00020000;
+
+ //***********************************************/
+ // Videodisc MCI_INFO */
+ //***********************************************/
+ MCI_VD_INFO_LABEL = $00001000;
+
+ //***********************************************/
+ // Digital Video MCI_INFO */
+ //***********************************************/
+ MCI_DGV_INFO_VIDEO_FILE = $00001000;
+ MCI_DGV_INFO_IMAGE_FILE = $00002000;
+ MCI_DGV_INFO_REGION = $00004000;
+ MCI_DGV_INFO_REGION_TEXT = $00008000;
+ MCI_DGV_INFO_TEXT = $00010000;
+
+ //***********************************************/
+ // Video Overlay MCI_INFO */
+ //***********************************************/
+ MCI_OVLY_INFO_TEXT = $00010000;
+
+
+type
+ mci_Info_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ pszReturn : pChar; // Pointer to return buffer
+ ulRetSize : LongInt; // Return buffer size
+ end;
+ pmci_Info_Parms = ^mci_Info_Parms;
+
+
+ //********************************************************************/
+ // parameters and flags for the MCI_LOAD message */
+ // 0x00000X00 are reserved for MCI_LOAD flags */
+ //********************************************************************/
+ mci_Load_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ pszElementName : pChar; // File name to loads
+ end;
+ pmci_Load_Parms = ^mci_Load_Parms;
+
+ //********************************************************************/
+ // parameters and flags for the MCI_MASTERAUDIO */
+ // 0x000XXX00 are reserved for MCI_MASTERAUDIO flags */
+ //********************************************************************/
+CONST
+ MCI_ON = $00000100;
+ MCI_OFF = $00000200;
+ MCI_HEADPHONES = $00000400;
+ MCI_SPEAKERS = $00000800;
+ MCI_MASTERVOL = $00001000;
+ MCI_SAVESETTING = $00002000;
+ MCI_QUERYSAVEDSETTING = $00004000;
+ MCI_QUERYCURRENTSETTING = $00008000;
+
+type
+ mci_MasterAudio_Parms = record
+ hwndDummyCallback : hwnd; // Notify not allowed for this message
+ ulReturn : LongInt; // Return field for query information
+ ulMasterVolume : LongInt; // Master volume field
+ end;
+ pmci_MasterAudio_Parms = ^mci_MasterAudio_Parms;
+
+ //********************************************************************/
+ // parameters and flags for the MCI_OPEN message */
+ // 0x0000XX00 are reserved for MCI_OPEN flags */
+ //********************************************************************/
+CONST
+ MCI_OPEN_ELEMENT = $00000100;
+ MCI_OPEN_ALIAS = $00000200;
+ MCI_OPEN_ELEMENT_ID = $00000400;
+ MCI_OPEN_PLAYLIST = $00000800;
+ MCI_OPEN_TYPE_ID = $00001000;
+ MCI_OPEN_SHAREABLE = $00002000;
+ MCI_OPEN_MMIO = $00004000;
+ MCI_READONLY = $00008000;
+
+ //**************************************************/
+ // parameters and flags for the MCI_OPEN message */
+ // Digital Video, Video Overlay specific */
+ //**************************************************/
+ MCI_VID_OPEN_PARENT = $01000000;
+ MCI_DGV_OPEN_PARENT = MCI_VID_OPEN_PARENT;
+ MCI_OVLY_OPEN_PARENT = MCI_VID_OPEN_PARENT;
+
+type
+ mci_Open_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ usDeviceID : Integer; // Device ID returned to user
+ usReserved0 : Integer; // Reserved
+ pszDeviceType : pChar; // Device name from SYSTEM.INI
+ pszElementName : pChar; // Typically a file name or NULL
+ pszAlias : pChar; // Optional device alias
+ end;
+ pmci_Open_Parms = ^mci_Open_Parms;
+
+ //*********************************************************/
+ // parameters for the AMP MCI_OPEN message */
+ //*********************************************************/
+ mci_Amp_Open_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ usDeviceID : Integer; // Device ID returned to user
+ usReserved0 : Integer; // Reserved field
+ pszDeviceType : pChar; // Device name from SYSTEM.INI
+ pszElementName : pChar; // Typically a file name or NULL
+ pszAlias : pChar; // Optional device alias
+ pDevDataPtr : Pointer; // Pointer to device data
+ end;
+ pmci_Amp_Open_Parms = ^mci_Amp_Open_Parms;
+
+ //*********************************************************/
+ // parameters for MCI_OPEN message for video devices */
+ //*********************************************************/
+
+ mci_Vid_Open_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ usDeviceID : Integer; // Device ID returned to user
+ usReserved0 : Integer; // Reserved field
+ pszDeviceType : pChar; // Device name from SYSTEM.INI
+ pszElementName : pChar; // Typically a file name or NULL
+ pszAlias : pChar; // Optional device alias
+ hwndParent : hwnd; // Parent window handle
+ end;
+ pmci_Vid_Open_Parms = ^mci_Vid_Open_Parms;
+
+ mci_dgv_Open_Parms = mci_Vid_Open_Parms;
+ pmci_dgv_Open_Parms = ^mci_dgv_Open_Parms;
+
+ mci_Ovly_Open_Parms = mci_Vid_Open_Parms;
+ pmci_Ovly_Open_Parms = ^mci_Ovly_Open_Parms;
+
+ //**************************************************/
+ // MCI_PLAY flag values for videodisc */
+ //**************************************************/
+CONST
+ MCI_VD_PLAY_REVERSE = $00001000;
+ MCI_VD_PLAY_FAST = $00002000;
+ MCI_VD_PLAY_SPEED = $00004000;
+ MCI_VD_PLAY_SCAN = $00008000;
+ MCI_VD_PLAY_SLOW = $00010000;
+
+ //**************************************************/
+ // MCI_PLAY flag values for digital video */
+ //**************************************************/
+ MCI_DGV_PLAY_REVERSE = $00001000;
+ MCI_DGV_PLAY_FAST = $00002000;
+ MCI_DGV_PLAY_SPEED = $00004000;
+ MCI_DGV_PLAY_SCAN = $00008000;
+ MCI_DGV_PLAY_SLOW = $00010000;
+ MCI_DGV_PLAY_REPEAT = $00020000;
+
+type
+ mci_Play_Parms = record
+ hwndCallback : hwnd;
+ ulFrom : LongInt;
+ ulTo : LongInt;
+ end;
+ pmci_Play_Parms = ^mci_Play_Parms;
+
+ mci_VD_Play_Parms = record
+ hwndCallback : hwnd;
+ ulFrom : LongInt;
+ ulTo : LongInt;
+ ulFactor : LongInt;
+ end;
+ pmci_VD_Play_Parms = ^mci_VD_Play_Parms;
+
+ mci_DGV_play_Parms = record
+ hwndCallback : hwnd;
+ ulFrom : LongInt;
+ ulTo : LongInt;
+ ulSpeed : LongInt;
+ end;
+ pmci_DGV_play_Parms = ^mci_DGV_play_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_PUT message */
+ // 0x00000X00 are reserved for MCI_PUT flags */
+ //********************************************************************/
+CONST
+ MCI_VID_PUT_RECT = $00000100;
+ MCI_VID_PUT_DESTINATION = $00000200;
+ MCI_VID_PUT_SOURCE = $00000400;
+ MCI_VID_PUT_WINDOW_MOVE = $00000800;
+ MCI_VID_PUT_WINDOW_SIZE = $00001000;
+
+ MCI_DGV_PUT_RECT = MCI_VID_PUT_RECT;
+ MCI_DGV_PUT_DESTINATION = MCI_VID_PUT_DESTINATION;
+ MCI_DGV_PUT_SOURCE = MCI_VID_PUT_SOURCE;
+ MCI_DGV_PUT_WINDOW_MOVE = MCI_VID_PUT_WINDOW_MOVE;
+ MCI_DGV_PUT_WINDOW_SIZE = MCI_VID_PUT_WINDOW_SIZE;
+ MCI_DGV_MONITOR = $00010000;
+ MCI_DGV_RECORD = $00020000;
+
+ MCI_OVLY_PUT_RECT = MCI_VID_PUT_RECT;
+ MCI_OVLY_PUT_DESTINATION = MCI_VID_PUT_DESTINATION;
+ MCI_OVLY_PUT_SOURCE = MCI_VID_PUT_SOURCE;
+ MCI_OVLY_PUT_WINDOW_MOVE = MCI_VID_PUT_WINDOW_MOVE;
+ MCI_OVLY_PUT_WINDOW_SIZE = MCI_VID_PUT_WINDOW_SIZE;
+
+ //**************************************************/
+ // Rectangle parameters for MCI_PUT, MCI_WHERE, */
+ // MCI_FREEZE, and MCI_UNFREEZE */
+ //**************************************************/
+
+type
+ mci_Vid_Rect_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ rc : RectL; // rectangle array specifying the offset
+ // and size of a rectangle
+ end;
+
+ mci_Dgv_Rect_Parms = mci_Vid_Rect_Parms;
+ pmci_Dgv_Rect_Parms = ^mci_Dgv_Rect_Parms;
+
+ mci_Ovly_Rect_Parms = mci_Vid_Rect_Parms;
+ pmci_Ovly_Rect_Parms = ^mci_Ovly_Rect_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_RECORD message */
+ // 0x00000X00 are reserved for MCI_RECORD flags */
+ //********************************************************************/
+CONST
+ MCI_RECORD_INSERT = $00000100;
+ MCI_RECORD_OVERWRITE = $00000200;
+
+ MCI_DGV_RECORD_RECT = $00000400;
+
+type
+ mci_Record_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulFrom : LongInt; // Record from position
+ ulTo : LongInt; // Record to position
+ end;
+ pmci_Record_Parms = ^mci_Record_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_RELEASEDEVICE message */
+ // 0xXXXXXX00 are reserved for MCI_RELEASEDEVICE message */
+ //********************************************************************/
+CONST
+ MCI_RETURN_RESOURCE = $00000100;
+
+ //********************************************************************/
+ // parameters for the MCI_RESTORE message */
+ // 0x0000XX00 are reserved for MCI_RESTORE flags */
+ // MCI_CONVERT is defined by MCI_CAPTURE message as 0x00001000L */
+ //********************************************************************/
+ MCI_RESTORE_SRC_RECT = $00000100;
+ MCI_RESTORE_DEST_RECT = $00000200;
+
+type mci_Restore_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ SrcRect : RectL; // Rectangle array specifying the source
+ // area to be restored
+ RestRect : RectL; // Rectangle array specifying the destination
+ // area to be restored
+ end;
+ pmci_Restore_Parms = ^mci_Restore_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_SAVE message */
+ // 0x00000X00 are reserved for MCI_SAVE flags */
+ //********************************************************************/
+const
+ MCI_SAVE_FILE = $00000100;
+
+ //************************************************/
+ // Digital Video MCI_SAVE */
+ //************************************************/
+
+ MCI_DGV_SAVE_VIDEO_FILE = $00001000;
+ MCI_DGV_SAVE_IMAGE_FILE = $00002000;
+
+type
+ mci_Save_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ pszFileName : pChar; // Filename to save data to
+ end;
+ pmci_Save_Parms = ^mci_Save_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_SEEK message */
+ // 0x00000X00 are reserved for MCI_SEEK flags */
+ //********************************************************************/
+const
+ MCI_TO_START = $00000100;
+ MCI_TO_END = $00000200;
+
+ //************************************************/
+ // Digital Video MCI_SEEK */
+ //************************************************/
+
+ MCI_DGV_SEEK_TO_NEAREST_IFRAME = $00100000;
+
+ //************************************************/
+ // Videodisc MCI_SEEK */
+ //************************************************/
+ MCI_VD_SEEK_REVERSE = $00001000;
+
+type
+ mci_Seek_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulTo : LongInt; // Seek to this position
+ end;
+ pmci_Seek_Parms = ^mci_Seek_Parms;
+
+ //********************************************************************/
+ // Flags for the MCI_SET message */
+ // 0x00XXXX00 are reserved for MCI_SET flags */
+ //********************************************************************/
+const
+ MCI_SET_ITEM = $00000100;
+ MCI_SET_ON = $00000200;
+ MCI_SET_OFF = $00000400;
+ MCI_SET_VIDEO = $00000800;
+ MCI_SET_AUDIO = $00001000;
+ MCI_SET_DOOR_OPEN = $00002000;
+ MCI_SET_DOOR_CLOSED = $00004000;
+ MCI_SET_SPEED_FORMAT = $00008000;
+ MCI_SET_TIME_FORMAT = $00010000;
+ MCI_SET_DOOR_LOCK = $00020000;
+ MCI_SET_DOOR_UNLOCK = $00040000;
+ MCI_SET_VOLUME = $00080000;
+ MCI_SET_ITEM_FOURCC = $00100000;
+ MCI_SET_REVERSE = $00200000;
+
+ //******************************************************/
+ // Values for the ulAudio field */
+ //******************************************************/
+ MCI_SET_AUDIO_ALL = $00000000;
+ MCI_SET_AUDIO_LEFT = $00000001;
+ MCI_SET_AUDIO_RIGHT = $00000002;
+
+
+
+
+ //******************************************************/
+ // MCI_SET flags for CDXA */
+ //******************************************************/
+ MCI_CDXA_SET_CHANNEL = $01000000;
+ MCI_CDXA_AUDIO_DEVICE = $10000000;
+ MCI_CDXA_AUDIO_BUFFER = $02000000;
+ MCI_CDXA_VIDEO_BUFFER = $04000000;
+ MCI_CDXA_DATA_BUFFER = $08000000;
+
+ //******************************************************/
+ // MCI_SET flags for videodisc */
+ //******************************************************/
+ MCI_VD_SET_ON = MCI_SET_ON;
+ MCI_VD_SET_OFF = MCI_SET_OFF;
+ MCI_VD_SET_VIDEO = MCI_SET_VIDEO;
+ MCI_VD_SET_CHANNEL = $00100000;
+ MCI_VD_SET_DISPLAY = $00200000;
+ MCI_VD_SET_DONTCARE = $00400000; // Dont care!
+
+ //******************************************************/
+ // Generic MCI_SET item values for video devices */
+ //******************************************************/
+ MCI_VID_SET_VIDEO_COMPRESSION = MCI_VID_ITEM_BASE;
+ MCI_VID_SET_IMAGE_COMPRESSION = MCI_VID_ITEM_BASE+1;
+ MCI_VID_SET_IMAGE_BITSPERPEL = MCI_VID_ITEM_BASE+2;
+ MCI_VID_SET_IMAGE_PELFORMAT = MCI_VID_ITEM_BASE+3;
+ MCI_VID_SET_BRIGHTNESS = MCI_VID_ITEM_BASE+4;
+ MCI_VID_SET_CONTRAST = MCI_VID_ITEM_BASE+5;
+ MCI_VID_SET_HUE = MCI_VID_ITEM_BASE+6;
+ MCI_VID_SET_SATURATION = MCI_VID_ITEM_BASE+7;
+ MCI_VID_SET_SHARPNESS = MCI_VID_ITEM_BASE+8;
+ MCI_VID_SET_GREYSCALE = MCI_VID_ITEM_BASE+9;
+ MCI_VID_SET_IMAGE_QUALITY = MCI_VID_ITEM_BASE+10;
+ MCI_VID_SET_VIDEO_QUALITY = MCI_VID_ITEM_BASE+11;
+ MCI_VID_SET_IMAGE_COMPRESSION_METHOD = MCI_VID_ITEM_BASE+12;
+ MCI_VID_SET_MINIMUM_VIDEO_REFRESH_RATE = MCI_VID_ITEM_BASE+13;
+ MCI_VID_SET_IMAGE_FILE_FORMAT = MCI_VID_ITEM_BASE+14;
+ MCI_VID_SET_REF_INTERVAL = MCI_VID_ITEM_BASE+15;
+ MCI_VID_SET_MAXDATARATE = MCI_VID_ITEM_BASE+16;
+ MCI_VID_SET_VIDEO_FILE_FORMAT = MCI_VID_ITEM_BASE+17;
+
+ //******************************************************/
+ // MCI_SET item values for video overlay */
+ //******************************************************/
+ MCI_OVLY_SET_IMAGE_COMPRESSION = MCI_VID_SET_IMAGE_COMPRESSION;
+ MCI_OVLY_SET_IMAGE_BITSPERPEL = MCI_VID_SET_IMAGE_BITSPERPEL;
+ MCI_OVLY_SET_IMAGE_PELFORMAT = MCI_VID_SET_IMAGE_PELFORMAT;
+ MCI_OVLY_SET_BRIGHTNESS = MCI_VID_SET_BRIGHTNESS;
+ MCI_OVLY_SET_CONTRAST = MCI_VID_SET_CONTRAST;
+ MCI_OVLY_SET_HUE = MCI_VID_SET_HUE;
+ MCI_OVLY_SET_SATURATION = MCI_VID_SET_SATURATION;
+ MCI_OVLY_SET_SHARPNESS = MCI_VID_SET_SHARPNESS;
+ MCI_OVLY_SET_GREYSCALE = MCI_VID_SET_GREYSCALE;
+ MCI_OVLY_SET_IMAGE_QUALITY = MCI_VID_SET_IMAGE_QUALITY;
+ MCI_OVLY_SET_IMAGE_COMPRESSION_METHOD = MCI_VID_SET_IMAGE_COMPRESSION_METHOD;
+ MCI_OVLY_SET_MINIMUM_VIDEO_REFRESH_RATE = MCI_VID_SET_MINIMUM_VIDEO_REFRESH_RATE;
+ MCI_OVLY_SET_IMAGE_FILE_FORMAT = MCI_VID_SET_IMAGE_FILE_FORMAT;
+
+ //******************************************************/
+ // MCI_SET item values for digital video */
+ //******************************************************/
+ MCI_DGV_SET_VIDEO_COMPRESSION = MCI_VID_SET_VIDEO_COMPRESSION;
+ MCI_DGV_SET_IMAGE_COMPRESSION = MCI_VID_SET_IMAGE_COMPRESSION;
+ MCI_DGV_SET_IMAGE_BITSPERPEL = MCI_VID_SET_IMAGE_BITSPERPEL;
+ MCI_DGV_SET_IMAGE_PELFORMAT = MCI_VID_SET_IMAGE_PELFORMAT;
+ MCI_DGV_SET_BRIGHTNESS = MCI_VID_SET_BRIGHTNESS;
+ MCI_DGV_SET_CONTRAST = MCI_VID_SET_CONTRAST;
+ MCI_DGV_SET_HUE = MCI_VID_SET_HUE;
+ MCI_DGV_SET_SATURATION = MCI_VID_SET_SATURATION;
+ MCI_DGV_SET_SHARPNESS = MCI_VID_SET_SHARPNESS;
+ MCI_DGV_SET_GREYSCALE = MCI_VID_SET_GREYSCALE;
+ MCI_DGV_SET_IMAGE_QUALITY = MCI_VID_SET_IMAGE_QUALITY;
+ MCI_DGV_SET_VIDEO_QUALITY = MCI_VID_SET_VIDEO_QUALITY;
+ MCI_DGV_SET_IMAGE_COMPRESSION_METHOD = MCI_VID_SET_IMAGE_COMPRESSION_METHOD;
+ MCI_DGV_SET_MONITOR = MCI_SET_MONITOR;
+ MCI_DGV_SET_MINIMUM_VIDEO_REFRESH_RATE = MCI_VID_SET_MINIMUM_VIDEO_REFRESH_RATE;
+ MCI_DGV_SET_IMAGE_FILE_FORMAT = MCI_VID_SET_IMAGE_FILE_FORMAT;
+ MCI_DGV_SET_REF_INTERVAL = MCI_VID_SET_REF_INTERVAL;
+ MCI_DGV_SET_MAXDATARATE = MCI_VID_SET_MAXDATARATE;
+ MCI_DGV_SET_VIDEO_FILE_FORMAT = MCI_VID_SET_VIDEO_FILE_FORMAT;
+
+ MCI_DGV_SET_AUDIO_COMPRESSION = MCI_DGV_ITEM_BASE;
+ MCI_DGV_SET_AUDIO_QUALITY = MCI_DGV_ITEM_BASE+1;
+ MCI_DGV_SET_CHANNELS = MCI_DGV_ITEM_BASE+2;
+ MCI_DGV_SET_BITSPERSAMPLE = MCI_DGV_ITEM_BASE+3;
+ MCI_DGV_SET_SAMPLESPERSEC = MCI_DGV_ITEM_BASE+4;
+ MCI_DGV_SET_FORMATTAG = MCI_DGV_ITEM_BASE+5;
+ MCI_DGV_SET_BLOCKALIGN = MCI_DGV_ITEM_BASE+6;
+ MCI_DGV_SET_AVGBYTESPERSEC = MCI_DGV_ITEM_BASE+7;
+
+ MCI_DGV_SET_VIDEO_COMPRESSION_SUBTYPE = MCI_DGV_ITEM_BASE+8;
+ MCI_DGV_SET_VIDEO_RECORD_RATE = MCI_DGV_ITEM_BASE+9;
+ MCI_DGV_SET_VIDEO_RECORD_FRAME_DURATION = MCI_DGV_ITEM_BASE+10;
+ MCI_DGV_SET_RECORD_AUDIO = MCI_DGV_ITEM_BASE+11;
+ MCI_DGV_SET_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+12;
+ MCI_DGV_SET_GRAPHIC_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+12;
+ MCI_DGV_SET_AUDIOSYNC = MCI_DGV_ITEM_BASE+13;
+ MCI_DGV_SET_VIDEO_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+14;
+
+ //******************************************************/
+ // Video file format */
+ //******************************************************/
+ MCI_VID_FILE_FORMAT_AVI = $20495641;
+
+ //******************************************************/
+ // Audio/video/image compression types */
+ //******************************************************/
+ MCI_AUD_COMP_ADPCM4 = $00000001;
+ MCI_AUD_COMP_PCM8 = $00000002;
+
+ MCI_VID_COMP_RTV_2_0 = $00000101;
+ MCI_VID_COMP_RTV_2_1 = $00000102;
+ MCI_VID_COMP_ULTI = $49544C55;
+ MCI_VID_COMP_RT21 = $31325452;
+ MCI_VID_COMP_NONE = $20424944; // This is 'DIB ' now.
+
+ MCI_IMG_COMP_NONE = $00000201;
+ MCI_IMG_COMP_PIC9_1_0 = $00000202;
+ MCI_IMG_COMP_PIC16_1_0 = $00000203;
+ MCI_IMG_COMP_JPEG9 = $00000204;
+ MCI_IMG_COMP_JPEG9_1_0 = MCI_IMG_COMP_JPEG9;
+ MCI_IMG_COMP_BMP_RLE4 = $00000205;
+ MCI_IMG_COMP_BMP_RLE8 = $00000206;
+ MCI_IMG_COMP_JPEGN = $00000207;
+
+ //******************************************************/
+ // PEL Formats (video/image) */
+ //******************************************************/
+ MCI_VID_PALETTE = $00000001;
+ MCI_VID_RGB = $00000002;
+ MCI_VID_YUV = $00000003;
+
+ MCI_IMG_PALETTE = MCI_VID_PALETTE;
+ MCI_IMG_RGB = MCI_VID_RGB;
+ MCI_IMG_YUV = MCI_VID_YUV;
+
+
+ //******************************************************/
+ // Audio/video/image quality levels */
+ //******************************************************/
+ MCI_AUD_QUALITY_HIGH = $00000001;
+ MCI_AUD_QUALITY_MED = $00000002;
+ MCI_AUD_QUALITY_LOW = $00000003;
+
+ MCI_VID_QUALITY_HIGH = $00000101;
+ MCI_VID_QUALITY_MED = $00000102;
+ MCI_VID_QUALITY_LOW = $00000103;
+ MCI_VID_QUALITY_BEST = MCI_VID_QUALITY_HIGH;
+ MCI_VID_QUALITY_CDROM = MCI_VID_QUALITY_MED;
+ MCI_VID_QUALITY_COMPACT = MCI_VID_QUALITY_LOW;
+ MCI_VID_QUALITY_BETTER = MCI_VID_QUALITY_MED;
+ MCI_VID_QUALITY_GOOD = MCI_VID_QUALITY_LOW;
+
+ MCI_IMG_QUALITY_HIGH = $00000201;
+ MCI_IMG_QUALITY_MED = $00000202;
+ MCI_IMG_QUALITY_LOW = $00000203;
+
+ //******************************************************/
+ // MCI_SET flags for wave audio */
+ //******************************************************/
+ MCI_WAVE_SET_SAMPLESPERSEC = $01000000;
+ MCI_WAVE_SET_AVGBYTESPERSEC = $02000000;
+ MCI_WAVE_SET_BLOCKALIGN = $04000000;
+ MCI_WAVE_SET_FORMATTAG = $08000000;
+ MCI_WAVE_SET_CHANNELS = $10000000;
+ MCI_WAVE_SET_BITSPERSAMPLE = $80000000;
+
+ //******************************************************/
+ // Wave format tag defines */
+ //******************************************************/
+ MCI_WAVE_FORMAT_PCM = DATATYPE_WAVEFORM;
+ MCI_WAVE_FORMAT_ADPCM = $0002;
+ MCI_WAVE_FORMAT_IBM_CVSD = $0005;
+ MCI_WAVE_FORMAT_ALAW = DATATYPE_RIFF_ALAW;
+ MCI_WAVE_FORMAT_MULAW = DATATYPE_RIFF_MULAW;
+ MCI_WAVE_FORMAT_OKI_ADPCM = $0010;
+ MCI_WAVE_FORMAT_DVI_ADPCM = $0011;
+ MCI_WAVE_FORMAT_DIGISTD = $0015;
+ MCI_WAVE_FORMAT_DIGIFIX = $0016;
+ MCI_WAVE_FORMAT_AVC_ADPCM = DATATYPE_ADPCM_AVC;
+ MCI_WAVE_FORMAT_IBM_ADPCM = DATATYPE_ADPCM_AVC;
+ MCI_WAVE_FORMAT_IBM_MULAW = DATATYPE_MULAW;
+ MCI_WAVE_FORMAT_IBM_ALAW = DATATYPE_ALAW;
+ MCI_WAVE_FORMAT_CT_ADPCM = DATATYPE_CT_ADPCM;
+ MCI_WAVE_FORMAT_MPEG1 = DATATYPE_MPEG1AUDIO;
+
+ //******************************************************/
+ // MCI_SET flags for sequencer */
+ //******************************************************/
+ MCI_SEQ_SET_TEMPO = $00100000;
+ MCI_SEQ_SET_PORT = $00200000;
+ MCI_SEQ_ENABLE_PORT_MAPPER = $00400000;
+ MCI_SEQ_DISABLE_PORT_MAPPER = $00800000;
+ MCI_SEQ_SET_OFFSET = $01000000;
+ MCI_SEQ_SET_MASTER = $02000000;
+ MCI_SEQ_SET_SLAVE = $04000000;
+
+ //*********************************************/
+ // SEQ time formats */
+ //*********************************************/
+ MCI_SEQ_SET_SMPTE_24 = $00000100;
+ MCI_SEQ_SET_SMPTE_25 = $00000200;
+ MCI_SEQ_SET_SMPTE_30 = $00000300;
+ MCI_SEQ_SET_SMPTE_30DROP = $00000400;
+ MCI_SEQ_SET_SONGPTR = $00000500;
+
+ //*********************************************/
+ // SEQ synchronization types */
+ //*********************************************/
+ MCI_SEQ_MIDI = $00000001;
+ MCI_SEQ_SMPTE = $00000002;
+ MCI_SEQ_FILE = $00000003;
+ MCI_SEQ_NONE = $00000004;
+
+ //*********************************************/
+ // SEQ PORT TYPES */
+ //*********************************************/
+ MCI_SET_NONE = $10000000;
+ MIDI_MAPPER = $20000000;
+ MCI_MIDI_MAPPER = MIDI_MAPPER;
+
+type
+ mci_Set_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulTimeFormat : Longint; // Time format to be used by the device
+ ulSpeedFormat : Longint; // Speed format used by this device
+ ulAudio : Longint; // Channel number for this operation
+ // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
+ // MCI_SET_AUDIO_ALL)
+ ulLevel : Longint; // Volume, treble or bass level as % of max.
+ ulOver : Longint; // Delay time for vectored change in millisecond
+ ulItem : Longint; // Item field for set item flags
+ ulValue : Longint; // Value associated with item flag
+ end;
+ pmci_Set_Parms = ^mci_Set_Parms;
+
+ mci_Amp_Set_Parms = mci_Set_Parms;
+ pmci_Amp_Set_Parms = ^mci_Amp_Set_Parms;
+
+ mci_DGV_Set_Parms = mci_Set_Parms;
+ pmci_DGV_Set_Parms = ^mci_DGV_Set_Parms;
+
+ mci_Ovly_Set_Parms = mci_Set_Parms;
+ pmci_Ovly_Set_Parms = ^mci_Ovly_Set_Parms;
+
+
+ mci_CDXA_Set_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulTimeFormat : Longint; // Time format to be used by the device
+ ulSpeedFormat : Longint; // Speed format used by this device
+ ulAudio : Longint; // Channel number for this operation
+ // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
+ // MCI_SET_AUDIO_ALL)
+ ulLevel : Longint; // Volume, treble or bass level as % of max.
+ ulOver : Longint; // Delay time for vectored change in milliseconds
+ ulItem : Longint; // Item field for set item flags
+ ulValue : Longint; // Value associated with item flag
+ ulChannel : Longint; // Channel number
+ pPlayList : Pointer; // Pointer to play list
+ ulPlayListSize : Longint; // Play list size
+ end;
+ pmci_CDXA_Set_Parms = ^mci_CDXA_Set_Parms;
+
+ mci_VD_Set_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulTimeFormat : LongInt; // Time format to be used by the device
+ ulSpeedFormat : LongInt; // Speed format used by this device
+ ulAudio : LongInt; // Channel number for this operation
+ // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
+ // MCI_SET_AUDIO_ALL)
+ ulLevel : LongInt; // Volume, treble or bass level as % of max.
+ ulOver : LongInt; // Delay time for vectored change in milliseconds
+ ulItem : LongInt; // Item field for set item flags
+ ulValue : LongInt; // Value associated with item flag
+ ulChannel : LongInt; // Videodisc channel
+ end;
+ pmci_VD_Set_Parms = ^mci_VD_Set_Parms;
+
+ mci_Wave_Set_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulTimeFormat : Longint; // Time format to be used by the device
+ ulSpeedFormat : Longint; // Speed format used by this device
+ ulAudio : Longint; // Channel number for this operation
+ // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
+ // MCI_SET_AUDIO_ALL)
+ ulLevel : Longint; // Volume, trebble or bass level as % of max.
+ ulOver : Longint; // Delay time for vectored change in milliseconds
+ ulItem : Longint; // Item field for set item flags
+ ulValue : Longint; // Value associated with item flag
+ usInput : Integer; // Channel for input
+ usReserved0 : Integer; // Reserved field
+ usOutput : Integer; // Channel for output
+ usReserved1 : Integer; // Reserved field
+ usFormatTag : Integer; // Format tag
+ usReserved2 : Integer; // Reserved field
+ usChannels : Integer; // mono(1) or stereo(2)
+ usReserved3 : Integer; // Reserved field
+ ulSamplesPerSec : Longint; // Samples per seconds
+ ulAvgBytesPerSec : LongInt; // Bytes per seconds
+ usBlockAlign : Integer; // Block alignment of data
+ usReserved4 : Integer; // Reserved field
+ usBitsPerSample : Integer; // Bits per seconds
+ usReserved5 : Integer; // Reserved field
+ end;
+ pmci_Wave_Set_Parms = ^mci_Wave_Set_Parms;
+
+ mci_Seq_Set_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulTimeFormat : Longint; // Time format to be used by the device
+ ulSpeedFormat : Longint; // Speed format used by this device
+ ulAudio : Longint; // Channel number for this operation
+ // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
+ // MCI_SET_AUDIO_ALL)
+ ulLevel : Longint; // Volume, trebble or bass level as % of max.
+ ulOver : Longint; // Delay time for vectored change in millisecond
+ ulItem : Longint; // Item field for set item flags
+ ulValue : Longint; // Value associated with item flag
+ ulTempo : Longint; // Specified the tempo
+ ulPort : Longint; // Output port
+ ulSlave : Longint; // Unused field
+ ulMaster : Longint; // Unused field
+ ulOffset : Longint; // Specified the data offset
+ end;
+ pmci_Seq_Set_Parms = ^mci_Seq_Set_Parms;
+
+
+ //********************************************************************/
+ // parameters for the MCI_SET_CUEPOINT message */
+ // 0x00000x00 are reserved for MCI_SET_CUEPOINT flags */
+ //********************************************************************/
+CONST
+ MCI_SET_CUEPOINT_ON = $00000100;
+ MCI_SET_CUEPOINT_OFF = $00000200;
+
+type
+ mci_CuePoint_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulCuepoint : Longint; // Specifies the cuepoint location
+ usUserParm : Integer; // User parmameter returned on cuepoint
+ // notify message
+ usReserved0 : Integer; // Reserved field
+ end;
+ pmci_CuePoint_Parms = ^mci_CuePoint_Parms;
+
+ //********************************************************************/
+ // parameters for the MCI_SETIMAGEPALETTE message */
+ // 0x000XXX00 are reserved for MCI_SETIMAGEPALETTE flags */
+ //********************************************************************/
+CONST
+ MCI_SET_REGISTERED = $00000100;
+
+ //********************************************************************/
+ // flags and parameter structure for the MCI_SET_POSITION_ADVISE msg */
+ // 0x00000X00 are reserved for MCI_SET_POSITION_ADVISE flags */
+ //********************************************************************/
+ MCI_SET_POSITION_ADVISE_ON = $00000100;
+ MCI_SET_POSITION_ADVISE_OFF = $00000200;
+
+type
+ mci_Position_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulUnits : Longint; // Specifies position change notifiication
+ // granularity
+ usUserParm : Integer; // User parameter returned on position change
+ // notification message.
+ Reserved0 : Integer; // Reserved field
+ Reserved1 : LongInt; // Reserved field
+ end;
+ pmci_Position_Parms = ^mci_Position_Parms;
+
+ //********************************************************************/
+ // parameter structure for the MCI_SET_SYNC_OFFSET message */
+ //********************************************************************/
+ mci_Sync_Offset_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulOffset : LongInt; // Specifies the device media position offset
+ // in the currently specified device units.
+ end;
+ pmci_Sync_Offset_Parms = ^mci_Sync_Offset_Parms;
+
+ //********************************************************************/
+ // flags for the MCI_SPIN message */
+ // 0x00000X00 are reserved for MCI_SPIN flags */
+ //********************************************************************/
+CONST
+ MCI_SPIN_UP = $00000100;
+ MCI_SPIN_DOWN = $00000200;
+
+ //********************************************************************/
+ // MCI_STATUS message flags */
+ // 0x000XXX00 are reserved for MCI_STATUS flags */
+ // MCI_VOLUME and MCI_VOLUME_DELAY are 0x00000100 and 0x00000200 */
+ //********************************************************************/
+ MCI_STATUS_ITEM = $00000100;
+ MCI_STATUS_START = $00000200;
+ MCI_STATUS_CONNECTOR = $00000400;
+
+ //************************************************/
+ // General MCI_STATUS item values */
+ //************************************************/
+ MCI_STATUS_CURRENT_TRACK = $00000001;
+ MCI_STATUS_LENGTH = $00000002;
+ MCI_STATUS_MODE = $00000003;
+ MCI_STATUS_NUMBER_OF_TRACKS = $00000004;
+ MCI_STATUS_POSITION = $00000005;
+ MCI_STATUS_POSITION_IN_TRACK = $00000006;
+ MCI_STATUS_MEDIA_PRESENT = $00000007;
+ MCI_STATUS_VOLUME = $00000008;
+ MCI_STATUS_READY = $00000009;
+ MCI_STATUS_TIME_FORMAT = $0000000A;
+ MCI_STATUS_SPEED_FORMAT = $0000000B;
+ MCI_STATUS_MONITOR = $0000000C;
+ MCI_STATUS_AUDIO = $0000000D;
+ MCI_STATUS_VIDEO = $0000000E;
+ MCI_STATUS_CLIPBOARD = $0000000F;
+ MCI_STATUS_CAN_PASTE = $00000010;
+ MCI_STATUS_CAN_REDO = $00000020;
+ MCI_STATUS_CAN_UNDO = $00000030;
+
+ //************************************************/
+ // ulValue field values for MCI_STATUS_AUDIO */
+ //************************************************/
+ MCI_STATUS_AUDIO_ALL = $00000000;
+ MCI_STATUS_AUDIO_LEFT = $00000001;
+ MCI_STATUS_AUDIO_RIGHT = $00000002;
+
+ //************************************************/
+ // MCI_STATUS item values for amp/mixer */
+ //************************************************/
+ MCI_AMP_STATUS_PITCH = MCI_AMP_ITEM_BASE;
+ MCI_AMP_STATUS_TREBLE = MCI_AMP_ITEM_BASE+1;
+ MCI_AMP_STATUS_BASS = MCI_AMP_ITEM_BASE+2;
+ MCI_AMP_STATUS_BALANCE = MCI_AMP_ITEM_BASE+3;
+ MCI_AMP_STATUS_GAIN = MCI_AMP_ITEM_BASE+4;
+ MCI_AMP_STATUS_MONITOR = MCI_AMP_ITEM_BASE+5;
+ MCI_AMP_STATUS_MID = MCI_AMP_ITEM_BASE+6;
+ MCI_AMP_STATUS_VOLUME = MCI_STATUS_VOLUME;
+ MCI_AMP_STATUS_LOUDNESS = MCI_AMP_ITEM_BASE+7;
+ MCI_AMP_STATUS_CROSSOVER = MCI_AMP_ITEM_BASE+8;
+ MCI_AMP_STATUS_REVERB = MCI_AMP_ITEM_BASE+9;
+ MCI_AMP_STATUS_ALC = MCI_AMP_ITEM_BASE+10;
+ MCI_AMP_STATUS_CHORUS = MCI_AMP_ITEM_BASE+11;
+ MCI_AMP_STATUS_CUSTOM1 = MCI_AMP_ITEM_BASE+12;
+ MCI_AMP_STATUS_CUSTOM2 = MCI_AMP_ITEM_BASE+13;
+ MCI_AMP_STATUS_CUSTOM3 = MCI_AMP_ITEM_BASE+14;
+ MCI_AMP_STATUS_MUTE = MCI_AMP_ITEM_BASE+15;
+ MCI_AMP_STATUS_STEREOENHANCE = MCI_AMP_ITEM_BASE+16;
+
+
+ //************************************************/
+ // MCI_STATUS item values for cd audio */
+ //************************************************/
+ MCI_CD_STATUS_TRACK_TYPE = MCI_CD_ITEM_BASE;
+ MCI_CD_STATUS_TRACK_COPYPERMITTED = MCI_CD_ITEM_BASE+1;
+ MCI_CD_STATUS_TRACK_CHANNELS = MCI_CD_ITEM_BASE+2;
+ MCI_CD_STATUS_TRACK_PREEMPHASIS = MCI_CD_ITEM_BASE+3;
+
+ //***********************************************/
+ // return values for CD MCI_STATUS message with */
+ // MCI_CD_STATUS_TRACK_TYPE set */
+ //***********************************************/
+ MCI_CD_TRACK_AUDIO = $00000001;
+ MCI_CD_TRACK_DATA = $00000002;
+ MCI_CD_TRACK_OTHER = $00000003;
+
+ //************************************************/
+ // MCI_STATUS item values for CDXA */
+ //************************************************/
+ MCI_CDXA_STATUS_CHANNEL = MCI_CDXA_ITEM_BASE;
+
+ //***********************************************/
+ //returned from call for MCI_CDXA_STATUS_CHANNEL*/
+ //***********************************************/
+ MCI_CDXA_NONE = $00000000;
+
+
+ //************************************************/
+ // MCI_STATUS item values for sequencer */
+ //************************************************/
+ MCI_SEQ_STATUS_TEMPO = MCI_SEQ_ITEM_BASE;
+ MCI_SEQ_STATUS_OFFSET = MCI_SEQ_ITEM_BASE+1;
+ MCI_SEQ_STATUS_DIVTYPE = MCI_SEQ_ITEM_BASE+2;
+ MCI_SEQ_STATUS_MASTER = MCI_SEQ_ITEM_BASE+3;
+ MCI_SEQ_STATUS_PORT = MCI_SEQ_ITEM_BASE+4;
+ MCI_SEQ_STATUS_SLAVE = MCI_SEQ_ITEM_BASE+5;
+
+ //*********************************************/
+ // Return value for current division type */
+ //*********************************************/
+ MCI_SEQ_DIV_PPQN = $00000001;
+ MCI_SEQ_DIV_SMPTE_24 = $00000002;
+ MCI_SEQ_DIV_SMPTE_25 = $00000003;
+ MCI_SEQ_DIV_SMPTE_30DROP = $00000004;
+ MCI_SEQ_DIV_SMPTE_30 = $00000005;
+
+ //************************************************/
+ // MCI_STATUS items for videodisc */
+ //************************************************/
+ MCI_VD_STATUS_SPEED = MCI_VD_ITEM_BASE;
+ MCI_VD_STATUS_FORWARD = MCI_VD_ITEM_BASE+1;
+ MCI_VD_MEDIA_TYPE = MCI_VD_ITEM_BASE+2;
+ MCI_VD_STATUS_SIDE = MCI_VD_ITEM_BASE+3;
+ MCI_VD_STATUS_DISC_SIZE = MCI_VD_ITEM_BASE+4;
+
+ //**********************************************/
+ // return values for videodisc status command */
+ //**********************************************/
+ MCI_VD_SPEED_NORMAL = $00000000;
+ MCI_VD_SPEED_FAST = $00000001;
+ MCI_VD_SPEED_SLOW = $00000002;
+
+ //************************************************/
+ // MCI_STATUS items for wave audio */
+ //************************************************/
+ MCI_WAVE_STATUS_LEVEL = MCI_WAVE_ITEM_BASE;
+ MCI_WAVE_STATUS_SAMPLESPERSEC = MCI_WAVE_ITEM_BASE+1;
+ MCI_WAVE_STATUS_AVGBYTESPERSEC = MCI_WAVE_ITEM_BASE+2;
+ MCI_WAVE_STATUS_BLOCKALIGN = MCI_WAVE_ITEM_BASE+3;
+ MCI_WAVE_STATUS_FORMATTAG = MCI_WAVE_ITEM_BASE+4;
+ MCI_WAVE_STATUS_CHANNELS = MCI_WAVE_ITEM_BASE+5;
+ MCI_WAVE_STATUS_BITSPERSAMPLE = MCI_WAVE_ITEM_BASE+6;
+
+ //************************************************/
+ // Common video MCI_STATUS items */
+ //************************************************/
+ MCI_VID_STATUS_hwnd = MCI_VID_ITEM_BASE;
+ MCI_VID_STATUS_AUDIO_COMPRESSION = MCI_VID_ITEM_BASE+1;
+ MCI_VID_STATUS_VIDEO_COMPRESSION = MCI_VID_ITEM_BASE+2;
+ MCI_VID_STATUS_IMAGE_COMPRESSION = MCI_VID_ITEM_BASE+3;
+ MCI_VID_STATUS_AUDIO_QUALITY = MCI_VID_ITEM_BASE+4;
+ MCI_VID_STATUS_VIDEO_QUALITY = MCI_VID_ITEM_BASE+5;
+ MCI_VID_STATUS_IMAGE_QUALITY = MCI_VID_ITEM_BASE+6;
+ MCI_VID_STATUS_IMAGE_BITSPERPEL = MCI_VID_ITEM_BASE+7;
+ MCI_VID_STATUS_IMAGE_PELFORMAT = MCI_VID_ITEM_BASE+8;
+ MCI_VID_STATUS_FORWARD = MCI_VID_ITEM_BASE+9;
+ MCI_VID_STATUS_NORMAL_RATE = MCI_VID_ITEM_BASE+10;
+ MCI_VID_STATUS_VIDEO_X_EXTENT = MCI_VID_ITEM_BASE+11;
+ MCI_VID_STATUS_VIDEO_Y_EXTENT = MCI_VID_ITEM_BASE+12;
+ MCI_VID_STATUS_IMAGE_X_EXTENT = MCI_VID_ITEM_BASE+13;
+ MCI_VID_STATUS_IMAGE_Y_EXTENT = MCI_VID_ITEM_BASE+14;
+ MCI_VID_STATUS_BRIGHTNESS = MCI_VID_ITEM_BASE+15;
+ MCI_VID_STATUS_CONTRAST = MCI_VID_ITEM_BASE+16;
+ MCI_VID_STATUS_HUE = MCI_VID_ITEM_BASE+17;
+ MCI_VID_STATUS_SATURATION = MCI_VID_ITEM_BASE+18;
+ MCI_VID_STATUS_GREYSCALE = MCI_VID_ITEM_BASE+19;
+ MCI_VID_STATUS_SHARPNESS = MCI_VID_ITEM_BASE+20;
+ MCI_VID_STATUS_SPEED = MCI_VID_ITEM_BASE+21;
+ MCI_VID_STATUS_IMAGE_FILE_FORMAT = MCI_VID_ITEM_BASE+22;
+ MCI_VID_STATUS_TRANSPARENT_TYPE = MCI_VID_ITEM_BASE+23;
+ MCI_VID_STATUS_REF_INTERVAL = MCI_VID_ITEM_BASE+24;
+ MCI_VID_STATUS_MAXDATARATE = MCI_VID_ITEM_BASE+25;
+ MCI_VID_STATUS_VIDEO_FILE_FORMAT = MCI_VID_ITEM_BASE+26;
+
+ //************************************************/
+ // Status Transparent Type returns */
+ // MCI_VID_PALETTE */
+ // MCI_VID_RGB */
+ // MCI_VID_YUV */
+ //************************************************/
+ MCI_VID_STATUS_TRANSPARENT_COLOR = MCI_VID_ITEM_BASE+24;
+
+ //************************************************/
+ // MCI_STATUS items for digital video */
+ //************************************************/
+ MCI_DGV_STATUS_hwnd = MCI_VID_STATUS_hwnd;
+ MCI_DGV_STATUS_AUDIO_COMPRESSION = MCI_VID_STATUS_AUDIO_COMPRESSION;
+ MCI_DGV_STATUS_VIDEO_COMPRESSION = MCI_VID_STATUS_VIDEO_COMPRESSION;
+ MCI_DGV_STATUS_IMAGE_COMPRESSION = MCI_VID_STATUS_IMAGE_COMPRESSION;
+ MCI_DGV_STATUS_AUDIO_QUALITY = MCI_VID_STATUS_AUDIO_QUALITY;
+ MCI_DGV_STATUS_VIDEO_QUALITY = MCI_VID_STATUS_VIDEO_QUALITY;
+ MCI_DGV_STATUS_IMAGE_QUALITY = MCI_VID_STATUS_IMAGE_QUALITY;
+ MCI_DGV_STATUS_IMAGE_BITSPERPEL = MCI_VID_STATUS_IMAGE_BITSPERPEL;
+ MCI_DGV_STATUS_IMAGE_PELFORMAT = MCI_VID_STATUS_IMAGE_PELFORMAT;
+ MCI_DGV_STATUS_FORWARD = MCI_VID_STATUS_FORWARD;
+ MCI_DGV_STATUS_NORMAL_RATE = MCI_VID_STATUS_NORMAL_RATE;
+ MCI_DGV_STATUS_VIDEO_X_EXTENT = MCI_VID_STATUS_VIDEO_X_EXTENT;
+ MCI_DGV_STATUS_VIDEO_Y_EXTENT = MCI_VID_STATUS_VIDEO_Y_EXTENT;
+ MCI_DGV_STATUS_IMAGE_X_EXTENT = MCI_VID_STATUS_IMAGE_X_EXTENT;
+ MCI_DGV_STATUS_IMAGE_Y_EXTENT = MCI_VID_STATUS_IMAGE_Y_EXTENT;
+ MCI_DGV_STATUS_BRIGHTNESS = MCI_VID_STATUS_BRIGHTNESS;
+ MCI_DGV_STATUS_CONTRAST = MCI_VID_STATUS_CONTRAST;
+ MCI_DGV_STATUS_HUE = MCI_VID_STATUS_HUE;
+ MCI_DGV_STATUS_SATURATION = MCI_VID_STATUS_SATURATION;
+ MCI_DGV_STATUS_SPEED = MCI_VID_STATUS_SPEED;
+ MCI_DGV_STATUS_SHARPNESS = MCI_VID_STATUS_SHARPNESS;
+ MCI_DGV_STATUS_REF_INTERVAL = MCI_VID_STATUS_REF_INTERVAL;
+ MCI_DGV_STATUS_MAXDATARATE = MCI_VID_STATUS_MAXDATARATE;
+ MCI_DGV_STATUS_VIDEO_FILE_FORMAT = MCI_VID_STATUS_VIDEO_FILE_FORMAT;
+
+ MCI_DGV_STATUS_CHANNELS = MCI_DGV_ITEM_BASE+13;
+ MCI_DGV_STATUS_BITSPERSAMPLE = MCI_DGV_ITEM_BASE+14;
+ MCI_DGV_STATUS_SAMPLESPERSEC = MCI_DGV_ITEM_BASE+15;
+ MCI_DGV_STATUS_FORMATTAG = MCI_DGV_ITEM_BASE+16;
+ MCI_DGV_STATUS_BLOCKALIGN = MCI_DGV_ITEM_BASE+17;
+ MCI_DGV_STATUS_AVGBYTESPERSEC = MCI_DGV_ITEM_BASE+18;
+ MCI_DGV_STATUS_VIDEO_COMPRESSION_SUBTYPE = MCI_DGV_ITEM_BASE+19;
+ MCI_DGV_STATUS_VIDEO_RECORD_RATE = MCI_DGV_ITEM_BASE+20;
+ MCI_DGV_STATUS_VIDEO_RECORD_FRAME_DURATION = MCI_DGV_ITEM_BASE+21;
+ MCI_DGV_STATUS_RECORD_AUDIO = MCI_DGV_ITEM_BASE+22;
+ MCI_DGV_STATUS_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+23;
+ MCI_DGV_STATUS_GRAPHIC_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+23; // MUST BE SAME AS TRANSPARENT COLOR
+ MCI_DGV_STATUS_hwnd_MONITOR = MCI_DGV_ITEM_BASE+24;
+ MCI_DGV_STATUS_DROPPED_FRAME_PCT = MCI_DGV_ITEM_BASE+25;
+ MCI_DGV_STATUS_AUDIOSYNC = MCI_DGV_ITEM_BASE+26;
+ MCI_DGV_STATUS_AUDIOSYNC_DIRECTION = MCI_DGV_ITEM_BASE+27;
+ MCI_DGV_STATUS_VIDEO_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+28; // MUST BE SAME AS TRANSPARENT COLOR
+ MCI_DGV_STATUS_TUNER_TV_CHANNEL = MCI_DGV_ITEM_BASE+29;
+ MCI_DGV_STATUS_TUNER_LOW_TV_CHANNEL = MCI_DGV_ITEM_BASE+29;
+ MCI_DGV_STATUS_TUNER_HIGH_TV_CHANNEL = MCI_DGV_ITEM_BASE+29;
+ MCI_DGV_STATUS_TUNER_REGION = MCI_DGV_ITEM_BASE+30;
+ MCI_DGV_STATUS_TUNER_FINETUNE = MCI_DGV_ITEM_BASE+31;
+ MCI_DGV_STATUS_TUNER_FREQUENCY = MCI_DGV_ITEM_BASE+32;
+ MCI_DGV_STATUS_TUNER_AUDIO_CHANNEL = MCI_DGV_ITEM_BASE+33;
+ MCI_DGV_STATUS_TUNER_AFC = MCI_DGV_ITEM_BASE+34;
+ MCI_DGV_STATUS_VALID_SIGNAL = MCI_DGV_ITEM_BASE+35;
+
+ //************************************************/
+ // MCI_STATUS item values for video overlay */
+ //************************************************/
+ MCI_OVLY_STATUS_hwnd = MCI_VID_STATUS_hwnd;
+ MCI_OVLY_STATUS_IMAGE_COMPRESSION = MCI_VID_STATUS_IMAGE_COMPRESSION;
+ MCI_OVLY_STATUS_IMAGE_BITSPERPEL = MCI_VID_STATUS_IMAGE_BITSPERPEL;
+ MCI_OVLY_STATUS_IMAGE_PELFORMAT = MCI_VID_STATUS_IMAGE_PELFORMAT;
+ MCI_OVLY_STATUS_IMAGE_X_EXTENT = MCI_VID_STATUS_IMAGE_X_EXTENT;
+ MCI_OVLY_STATUS_IMAGE_Y_EXTENT = MCI_VID_STATUS_IMAGE_Y_EXTENT;
+ MCI_OVLY_STATUS_BRIGHTNESS = MCI_VID_STATUS_BRIGHTNESS;
+ MCI_OVLY_STATUS_CONTRAST = MCI_VID_STATUS_CONTRAST;
+ MCI_OVLY_STATUS_HUE = MCI_VID_STATUS_HUE;
+ MCI_OVLY_STATUS_SATURATION = MCI_VID_STATUS_SATURATION;
+ MCI_OVLY_STATUS_GREYSCALE = MCI_VID_STATUS_GREYSCALE;
+ MCI_OVLY_STATUS_IMAGE_QUALITY = MCI_VID_STATUS_IMAGE_QUALITY;
+ MCI_OVLY_STATUS_SHARPNESS = MCI_VID_STATUS_SHARPNESS;
+ MCI_OVLY_STATUS_IMAGE_FILE_FORMAT = MCI_VID_STATUS_IMAGE_FILE_FORMAT;
+ MCI_OVLY_STATUS_TRANSPARENT_TYPE = MCI_VID_STATUS_TRANSPARENT_TYPE;
+ MCI_OVLY_STATUS_TRANSPARENT_COLOR = MCI_VID_STATUS_TRANSPARENT_COLOR;
+
+ //************************************************/
+ // Status Mode return values */
+ //************************************************/
+ MCI_MODE_NOT_READY = $00000001;
+ MCI_MODE_PAUSE = $00000002;
+ MCI_MODE_PLAY = $00000003;
+ MCI_MODE_STOP = $00000004;
+ MCI_MODE_RECORD = $00000005;
+ MCI_MODE_SEEK = $00000006;
+
+ //************************************************/
+ // Status Direction return values */
+ //************************************************/
+ MCI_FORWARD = $00000000;
+ MCI_REVERSE = $00000001;
+
+type
+ mci_Status_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulReturn : LongInt; // Return field
+ ulItem : LongInt; // Item field for STATUS item to query
+ ulValue : LongInt; // Status value field (this used to be)
+ // ulTrack but was changed in Rel 1.1
+ // to extend the status structure.
+ // See the programming reference on when
+ // ulValue is used and how...
+ end;
+ pmci_Status_Parms = ^mci_Status_Parms;
+
+
+ mci_CDXA_Status_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulReturn : LongInt; // Return field
+ ulItem : LongInt; // Item field for STATUS item to query
+ ulValue : LongInt; // Status value field (this used to be)
+ // ulTrack but was changed in Rel 1.1
+ // to extend the status structure.
+ // See the programming reference on when
+ // ulValue is used and how...
+ ulChannel : LongInt; // Channel
+ end;
+ pmci_CDXA_Status_Parms = ^mci_CDXA_Status_Parms;
+
+ //********************************************************************/
+ // flags and parameter structure for the MCI_STEP message */
+ // 0x00000X00 are reserved for MCI_STEP flags */
+ //********************************************************************/
+CONST
+ MCI_STEP_FRAMES = $00000100;
+ MCI_STEP_REVERSE = $00000200;
+
+type
+ mci_Step_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulStep : LongInt; // amount to step in current time format
+ end;
+ pmci_Step_Parms = ^mci_Step_Parms;
+
+ //********************************************************************/
+ // flags for the MCI_SYSINFO message */
+ // 0xXXXXXX00 are reserved for MCI_SYSINFO flags */
+ //********************************************************************/
+CONST
+ MCI_SYSINFO_QUANTITY = $00000100;
+ MCI_SYSINFO_OPEN = $00000200;
+ MCI_SYSINFO_NAME = $00000400;
+ MCI_SYSINFO_INSTALLNAME = $00000800;
+ MCI_SYSINFO_ITEM = $00001000;
+ MCI_SYSINFO_INI_LOCK = $00002000;
+
+ //*******************************************************/
+ // Extended SYSINFO functions */
+ //*******************************************************/
+ MCI_SYSINFO_INSTALL_DRIVER = $00000001;
+ MCI_SYSINFO_QUERY_DRIVER = $00000002;
+ MCI_SYSINFO_DELETE_DRIVER = $00000004;
+ MCI_SYSINFO_SET_PARAMS = $00000008;
+ MCI_SYSINFO_QUERY_PARAMS = $00000010;
+ MCI_SYSINFO_SET_CONNECTORS = $00000020;
+ MCI_SYSINFO_QUERY_CONNECTORS = $00000040;
+ MCI_SYSINFO_SET_EXTENSIONS = $00000080;
+ MCI_SYSINFO_QUERY_EXTENSIONS = $00000100;
+ MCI_SYSINFO_SET_ALIAS = $00000200;
+ MCI_SYSINFO_QUERY_NAMES = $00000400;
+ MCI_SYSINFO_SET_DEFAULT = $00000800;
+ MCI_SYSINFO_QUERY_DEFAULT = $00001000;
+ MCI_SYSINFO_SET_TYPES = $00002000;
+ MCI_SYSINFO_QUERY_TYPES = $00004000;
+
+ //*******************************************************/
+ // Device Flags */
+ //*******************************************************/
+ MCI_SYSINFO_DEV_CONTROLLABLE = $00000001;
+ MCI_SYSINFO_DEV_NONCONTROLLABLE = $00000002;
+ MCI_SYSINFO_DEVICESETTINGS = $00000004;
+
+ //********************************************************************/
+ // parameter structures for the MCI_SYSINFO message */
+ //********************************************************************/
+TYPE
+ MaxDevNameChar = array [0..Max_Device_Name-1] of CHAR;
+ MaxVerNumChar = array [0..Max_Version_Number-1] of CHAR;
+ MaxProdInfChar = array [0..Max_ProdInfo-1] of CHAR;
+ MaxPddNameChar = array [0..Max_Pdd_Name-1] of CHAR;
+ MaxClsShort = array [0..Max_Classes-1] of integer;
+ MaxClsShort2 = array [0..Max_Classes-1,0..Max_Classes-1] of integer;
+ MaxDevParmChar = array [0..Max_Dev_Params-1] of CHAR;
+
+ mci_SysInfo_Parms = record
+ hwndDummyCallback : hwnd; // NOTIFY not allowed for SYSINFO
+ pszReturn : pChar; // Pointer to return buffer
+ ulRetSize : LongInt; // Return buffer size
+ ulNumber : LongInt; // Ordinal Number
+ usDeviceType : Integer; // MCI device type number
+ usReserved0 : Integer; // Reserved field
+ ulItem : LongInt; // Used to indicate the MCI_SYSINFO
+ pSysInfoParm : Pointer; // extended function to perform
+ end;
+ pmci_SysInfo_Parms = ^mci_SysInfo_Parms;
+
+ mci_SysInfo_LogDevice = packed record
+ szInstallName : MaxDevNameChar; // Device install name
+ usDeviceType : Integer; // Device type number
+ ulDeviceFlag : Longint; // Flag indicating whether device
+ // device is controllable or not
+ szVersionNumber : MaxVerNumChar; // INI file version number
+ szProductInfo : MaxProdInfChar; // Textual product description
+ szMCDDriver : MaxDevNameChar; // MCI Driver dll name
+ szVSDDriver : MaxDevNameChar; // VSD dll name
+ szPDDName : MaxPddNameChar; // Device PDD name
+ szMCDTable : MaxDevNameChar; // Device type command table
+ szVSDTable : MaxDevNameChar; // Device specific command table
+ usShareType : Integer; // Device sharing mode
+ szResourceName : MaxDevNameChar; // Resource name
+ usResourceUnits : Integer; // Total resource units available
+ // for this device
+ usResourceClasses : Integer; // Number of resource classes for
+ // this device
+ ausClassArray : MaxClsShort; // Maximum number of resource
+ // units for each class
+ ausValidClassArray : MaxClsShort2; // Valid class combinations
+ end;
+ pmci_SysInfo_LogDevice = ^mci_SysInfo_LogDevice;
+
+
+ mci_SysInfo_DevParams = record
+ szInstallName : MaxDevNameChar; // Device install name
+ szDevParams : MaxDevParmChar; // Device specific parameters
+ end;
+ pmci_SysInfo_DevParams = ^mci_SysInfo_DevParams;
+
+type
+ Connect = record
+ usConnectType : Integer; // Connector type
+ szToInstallName : MaxDevNameChar; // Install name this connector
+ // is connected to
+ usToConnectIndex : Integer; // Connector index this connector
+ // is connected to
+ end;
+ pConnect = ^Connect;
+
+
+ MaxCnctCnct = array[0..MAX_CONNECTORS-1] of Connect;
+ MaxExtChar2 = array[0..MAX_EXTENSIONS-1,0..MAX_EXTENSION_NAME-1] of CHAR;
+ MaxAliasNameChar = array[0..Max_Alias_Name-1] of Char;
+ MaxTypeBufChar = array[0..Max_TypeBuffer] of Char;
+
+ mci_SysInfo_ConParams = record
+ szInstallName : MaxDevNameChar; // Device install name
+ usNumConnectors : Integer; // Number of device connectors
+ ConnectorList : MaxCnctCnct; // Connector list array
+ end;
+ pmci_SysInfo_ConParams = ^mci_SysInfo_ConParams;
+
+ mci_SysInfo_Extension = record
+ szInstallName : MaxDevNameChar; // Device install name
+ usNumExtensions : Integer; // Number of extensions
+ szExtension : MaxExtChar2; // Extension name array
+ end;
+ pmci_SysInfo_Extension = ^mci_SysInfo_Extension;
+
+ mci_SysInfo_Alias = record
+ szInstallName : MaxDevNameChar; // Device install name
+ szAliasName : MaxAliasNameChar; // Alias name
+ end;
+ pmci_SysInfo_Alias = ^mci_SysInfo_Alias;
+
+ mci_SysInfo_DefaultDevice = record
+ szInstallName : MaxDevNameChar; // Device install name
+ usDeviceType : Integer; // Device type number
+ end;
+ pmci_SysInfo_DefaultDevice = ^mci_SysInfo_DefaultDevice;
+
+ mci_SysInfo_Query_Name = record
+ szInstallName : MaxDevNameChar; // Device install name
+ szLogicalName : MaxDevNameChar; // Logical device name
+ szAliasName : MaxAliasNameChar; // Alias name
+ usDeviceType : Integer; // Device type number
+ usDeviceOrd : Integer; // Device type ordinal
+ end;
+ pmci_SysInfo_Query_Name = ^mci_SysInfo_Query_Name;
+
+ mci_SysInfo_Types = record
+ szInstallName : MaxDevNameChar; // Device install name
+ szTypes : MaxTypeBufChar; // EA types
+ end;
+ pmci_SysInfo_Types = ^mci_SysInfo_Types;
+
+
+ //********************************************************************/
+ // flags for the MCI_UNFREEZE message */
+ // 0x00000X00 are reserved for MCI_UNFREEZE flags */
+ //********************************************************************/
+CONST
+ MCI_OVLY_UNFREEZE_RECT = $00000100;
+ MCI_OVLY_UNFREEZE_RECT_OUTSIDE = $00000200;
+
+ //********************************************************************/
+ // flags for the MCI_WHERE message */
+ // 0x0000XX00 are reserved for MCI_WHERE flags */
+ //********************************************************************/
+ MCI_VID_WHERE_DESTINATION = $00000100;
+ MCI_VID_WHERE_SOURCE = $00000200;
+ MCI_VID_WHERE_WINDOW = $00000400;
+
+ MCI_DGV_WHERE_DESTINATION = MCI_VID_WHERE_DESTINATION;
+ MCI_DGV_WHERE_SOURCE = MCI_VID_WHERE_SOURCE;
+ MCI_DGV_WHERE_WINDOW = MCI_VID_WHERE_WINDOW;
+ MCI_DGV_WHERE_ADJUSTED = $00000800;
+
+ MCI_OVLY_WHERE_DESTINATION = MCI_VID_WHERE_DESTINATION;
+ MCI_OVLY_WHERE_SOURCE = MCI_VID_WHERE_SOURCE;
+ MCI_OVLY_WHERE_WINDOW = MCI_VID_WHERE_WINDOW;
+ //********************************************************************/
+ // flags and parameter structure for the MCI_WINDOW message */
+ // 0x0000XX00 are reserved for MCI_WINDOW flags */
+ //********************************************************************/
+ MCI_VID_WINDOW_hwnd = $00000100;
+ MCI_VID_WINDOW_STATE = $00000200;
+ MCI_VID_WINDOW_TEXT = $00000400;
+ MCI_VID_WINDOW_DEFAULT = $00000800;
+
+ MCI_DGV_WINDOW_hwnd = MCI_VID_WINDOW_hwnd;
+ MCI_DGV_WINDOW_STATE = MCI_VID_WINDOW_STATE;
+ MCI_DGV_WINDOW_TEXT = MCI_VID_WINDOW_TEXT;
+ MCI_DGV_WINDOW_DEFAULT = MCI_VID_WINDOW_DEFAULT;
+
+ MCI_OVLY_WINDOW_hwnd = MCI_VID_WINDOW_hwnd;
+ MCI_OVLY_WINDOW_STATE = MCI_VID_WINDOW_STATE;
+ MCI_OVLY_WINDOW_TEXT = MCI_VID_WINDOW_TEXT;
+ MCI_OVLY_WINDOW_DEFAULT = MCI_VID_WINDOW_DEFAULT;
+
+type
+ mci_Vid_Window_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ hwndDest : hwnd; // Handle to the client window used for
+ // the destination of the video image
+ usCmdShow : Integer; // Specifies how the window is displayed
+ usReserved1 : Integer; // Reserved
+ pszText : pChar; // The text to use as the window caption
+ pszAlias : pChar; // The window alias for the display window
+ end;
+ pmci_Vid_Window_Parms = ^mci_Vid_Window_Parms;
+
+ mci_dgv_Window_Parms = mci_Vid_Window_Parms;
+ pmci_dgv_Window_Parms = ^mci_dgv_Window_Parms;
+
+ mci_Ovly_Window_Parms = mci_Vid_Window_Parms;
+ pmci_Ovly_Window_Parms = ^mci_Ovly_Window_Parms;
+
+
+ //********************************************************************/
+ // flags and parameter structure for the MCI_TUNER message */
+ //********************************************************************/
+CONST
+ MCI_DGV_AUDIO_CHANNEL = $00010000;
+ MCI_DGV_TV_CHANNEL = $00020000;
+ MCI_DGV_FREQUENCY = $00040000;
+ MCI_DGV_FINETUNE_PLUS = $00080000;
+ MCI_DGV_FINETUNE_MINUS = $00100000;
+ MCI_DGV_REGION = $00200000;
+ MCI_DGV_AFC_ON = $00400000;
+ MCI_DGV_AFC_OFF = $00800000;
+ MCI_DGV_POLARIZATION = $00800000;
+ MCI_DGV_QUERY = $01000000;
+
+type
+ mci_Dgv_Tuner_Parms = record
+ hwndCallback : hwnd; // PM window handle for MCI notify message
+ ulFrequency : LongInt; // Tuner Frequency
+ ulReserved0 : LongInt; // Reserved 0
+ ulTVChannel : LongInt; // TV Channel
+ lFineTune : LongInt; // Fine tuning adjustments.
+ pszRegion : pChar; // TV Channel Region
+ ulReserved1 : LongInt; // Reserved 1
+ ulReserved2 : LongInt; // Reserved 2
+ end;
+ pmci_Dgv_Tuner_Parms = ^mci_Dgv_Tuner_Parms;
+
+ //********************************************************************/
+ // */
+ // MCI system value defines */
+ // */
+ //********************************************************************/
+CONST
+ MSV_CLOSEDCAPTION = $0;
+ MSV_MASTERVOLUME = $1;
+ MSV_HEADPHONES = $2;
+ MSV_SPEAKERS = $3;
+ MSV_WORKPATH = $4;
+ MSV_SYSQOSVALUE = $5;
+ MSV_SYSQOSERRORFLAG = $6;
+
+ MSV_MAX = $7;
+
+
+ //********************************************************************/
+ // Playlist defines */
+ //********************************************************************/
+ DATA_OPERATION = 0;
+ BRANCH_OPERATION = 1;
+ LOOP_OPERATION = 2;
+ CALL_OPERATION = 3;
+ RETURN_OPERATION = 4;
+ EXIT_OPERATION = 5;
+ NOP_OPERATION = 6;
+ MESSAGE_OPERATION = 7;
+ CUEPOINT_OPERATION = 8;
+ SEMWAIT_OPERATION = 9;
+ SEMPOST_OPERATION = 10;
+
+ //********************************************************************/
+ // */
+ // MCI Function prototypes */
+ // */
+ //********************************************************************/
+
+
+function mciSendCommand(usDeviceID: Integer; usMessage: Integer; ulParam1: LongInt;
+ var Param2; usUserParm: Integer): longint; cdecl;
+
+function mciSendString(pszCommandBuf: pChar; pszReturnString: pChar;
+ wReturnLength: Integer; hwndCallBack: hwnd; usUserParm: Integer): longInt; cdecl;
+
+function mciGetErrorString(ulError: LongInt; pszBuffer: pChar; usLength: Integer): longint; cdecl;
+
+function mciMakeGroup(var usDeviceGroupID:Integer; usDeviceCount: Integer;
+ var ausDeviceList: Integer; ulFlags: LongInt; ulMMTime: LongInt): longint; cdecl;
+
+function mciDeleteGroup(usGroupID:Integer): longint; cdecl;
+
+function mciSetSysValue(iSysValue: Integer; var Value): Boolean; cdecl;
+
+function mciQuerySysValue(iSysValue: Integer;var Value): Boolean; cdecl;
+
+function mciGetDeviceID(pszName: pChar): Longint; cdecl;
+
+Implementation
+
+function mSecToMM(Value: Cardinal): mmTime;
+begin
+ If Value > $FFFFFFFF div 3 then
+ mSecToMM := 0
+ else
+ mSecToMM := Value div 3;
+end;
+
+function mSecFromMM(Value: mmTime): LongInt;
+begin
+ mSecFromMM := (Value+1) div 3;
+end;
+
+function RedBookToMM(Value: Cardinal): mmTime;
+begin
+ RedBookToMM := ( Value and $0000FF ) * 60 * 3000 +
+ ( Value and $00FF00 ) * $100 * 3000 +
+ ( Value and $FF0000 ) * $10000 * 3000 div 75;
+
+end;
+
+function fps24ToMM(Value: Cardinal): mmTime;
+begin
+ fps24toMM := ( Value and $000000FF ) * 60 * 60 * 3000 +
+ ( Value and $0000FF00 ) * $100 * 60 * 3000 +
+ ( Value and $00FF0000 ) * $10000 * 3000 +
+ ( Value and $FF000000 ) * $10000 * 3000 div 24;
+end;
+
+function fps25ToMM(Value: Cardinal): mmTime;
+begin
+ fps25ToMM := ( Value and $000000FF ) * 60 * 60 * 3000 +
+ ( Value and $0000FF00 ) * $100 * 60 * 3000 +
+ ( Value and $00FF0000 ) * $10000 * 3000 +
+ ( Value and $FF000000 ) * $10000 * 3000 div 25;
+end;
+
+function fps30ToMM(Value: Cardinal): mmTime;
+begin
+ fps30ToMM := ( Value and $000000FF ) * 60 * 60 * 3000 +
+ ( Value and $0000FF00 ) * $100 * 60 * 3000 +
+ ( Value and $00FF0000 ) * $10000 * 3000 +
+ ( Value and $FF000000 ) * $10000 * 3000 div 30;
+end;
+
+function HMSToMM(Value: Cardinal): mmTime;
+begin
+ HMSToMM := ( Value and $0000FF ) * 60 * 60 * 3000 +
+ ( Value and $00FF00 ) * $100 * 60 * 3000 +
+ ( Value and $FF0000 ) * $10000 * 3000;
+end;
+
+function RedBookFromMM(Value: mmTime): Cardinal;
+begin
+ if Value+20 >= $100*60*3000 then
+ RedBookFromMM := 0
+ else
+ RedBookFromMM := (Value+20) div (60*3000) +
+ ((Value+20) mod ((60*3000) div 3000)) shl 8 +
+ ((Value+20) div ((3000 div 75) mod 75)) shl 16;
+end;
+
+function FPS24FromMM(Value: mmTime): Cardinal;
+begin
+ if Value+63 >= $A4CB8000 then // $100*60*60*3000 then
+ FPS24FromMM := 0
+ else
+ FPS24FromMM := ((((Value+63) mod 3000) div (3000 div 24)) shl 24) and $FF000000 +
+ ((((Value+63) div 3000) mod 60) shl 16) and $00FF0000 +
+ (((((Value+63) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
+ ((((Value+63) div 3000) div 60) div 60) and $000000FF;
+end;
+
+function FPS25FromMM(value: mmTime): Cardinal;
+begin
+ if Value+60 >= $A4CB8000 then // $100*60*60*3000
+ FPS25FromMM := 0
+ else
+ FPS25FromMM := ((((Value+60) mod 3000) div (3000 div 25)) shl 24) and $FF000000 +
+ ((((Value+60) div 3000) mod 60) shl 16) and $00FF0000 +
+ (((((Value+60) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
+ ((((Value+60) div 3000) div 60) div 60) and $000000FF;
+end;
+
+function FPS30FromMM(value: mmTime): Cardinal;
+begin
+ if Value+50 >= $A4CB8000 then // $100*60*60*3000
+ FPS30FromMM := 0
+ else
+ FPS30FromMM := ((((Value+50) mod 3000) div (3000 div 30)) shl 24) and $FF000000 +
+ ((((Value+50) div 3000) mod 60) shl 16) and $00FF0000 +
+ (((((Value+50) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
+ ((((Value+50) div 3000) div 60) div 60) and $000000FF;
+end;
+
+function HMSFromMM(value: mmTime): Cardinal;
+begin
+ if Value+50 >= $A4CB8000 then // $100*60*60*3000
+ HMSFromMM := 0
+ else
+ HMSFromMM := (((( Value+50) div 3000) mod 60) shl 16) and $00FF0000 +
+ (((((Value+50) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
+ (((( Value+50) div 3000) div 60) div 60) and $000000FF;
+end;
+
+function tmsf_track(time: mmTime): Byte;
+begin
+ tmsf_track := byte(time);
+end;
+
+function tmsf_minute(time: mmTime): Byte;
+begin
+ tmsf_minute := pbyte(pchar(@time)+1)^;
+end;
+
+function tmsf_second(time: mmTime): Byte;
+begin
+ tmsf_second := pbyte(pchar(@time)+2)^;
+end;
+
+function tmsf_frame(time: mmTime): Byte;
+begin
+ tmsf_frame := pbyte(pchar(@time)+3)^;
+end;
+
+function msf_minute(time: mmTime): Byte;
+begin
+ msf_minute := byte(time);
+end;
+
+function msf_second(time: mmTime): Byte;
+begin
+ msf_second := pbyte(pchar(@time)+1)^;
+end;
+
+function msf_frame(time: mmTime): Byte;
+begin
+ msf_frame := pbyte(pchar(@time)+2)^;
+end;
+
+function uLong_lwlb(var ul): Byte; // Low word low byte
+begin
+ uLong_lwlb := LongInt(ul);
+end;
+
+function uLong_lwhb(var ul): Byte; // Low word high byte
+begin
+ uLong_lwhb := pbyte(pchar(@ul)+1)^;
+end;
+
+function uLong_hwlb(var ul): Byte; // High word low byte
+begin
+ uLong_hwlb := pbyte(pchar(@ul)+2)^;
+end;
+
+function uLong_hwhb(var ul): Byte; // High word high byte
+begin
+ uLong_hwhb := pbyte(pchar(@ul)+3)^;
+end;
+
+function uLong_lowd(var ul): Word; // Low word
+begin
+ uLong_lowd:=pWord(pchar(@ul))^;
+end;
+
+function uLong_hiwd(var ul): Word; // High word
+begin
+ uLong_hiwd := pWord(pchar(@ul)+Sizeof(Word))^;
+end;
+
+function mciSendCommand(usDeviceID: Integer; usMessage: Integer; ulParam1: LongInt;
+ var Param2; usUserParm: Integer): longint; cdecl; external 'MDM' index 1;
+
+function mciSendString(pszCommandBuf: pChar; pszReturnString: pChar;
+ wReturnLength: Integer; hwndCallBack: hwnd; usUserParm: Integer): longInt; cdecl; external 'MDM' index 2;
+
+function mciGetErrorString(ulError: LongInt; pszBuffer: pChar; usLength: Integer): longint; cdecl; external 'MDM' index 3;
+
+function mciMakeGroup(var usDeviceGroupID:Integer; usDeviceCount: Integer;
+ var ausDeviceList: Integer; ulFlags: LongInt; ulMMTime: LongInt): longint; cdecl; external 'MDM' index 12;
+
+function mciDeleteGroup(usGroupID:Integer): longint; cdecl; external 'MDM' index 13;
+
+function mciSetSysValue(iSysValue: Integer; var Value): Boolean; cdecl; external 'MDM' index 10;
+
+function mciQuerySysValue(iSysValue: Integer;var Value): Boolean; cdecl; external 'MDM' index 11;
+
+function mciGetDeviceID(pszName: pChar): Longint; cdecl; external 'MDM' index 16;
+
+End.
diff --git a/packages/os2units/src/mciapi.pas b/packages/os2units/src/mciapi.pas
new file mode 100644
index 0000000000..24d374c023
--- /dev/null
+++ b/packages/os2units/src/mciapi.pas
@@ -0,0 +1,123 @@
+{
+ Copyright (c) 1992, 1993 by International Business Machines Corporation
+ Copyright (c) 2002 by Andry Svirgunov (cool2@ngs.ru)
+ Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ High-Level MCI Interfaces of OS/2 Multimedia subsystem
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(High-Level MCI Interfaces of OS/2 Multimedia subsystem)
+@author(Andry Svirgunov (cool2@ngs.ru))
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(01 Oct 2002)
+@lastmod(19 Jan 2003)
+This is the High-Level Macro Service API Routines of OS/2 Multimedia subsystem.
+All functions are from MCIAPI dll (which also contains REXX functions.
+See "Multimedia with REXX" for more information.).
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+Unit mciapi;
+
+{$MODE ObjFPC}
+
+Interface
+
+// Flags for mciPlayFile
+Const
+ // digital and overlay
+ MCI_OWNERISPARENT = $0001;
+ // stop playing whatever is playing
+ MCI_STOPACTIVE = $0002;
+ // play and return immediately
+ MCI_ASYNCRENDEZVOUS = $0004;
+ // wait til prev is finished then play
+ MCI_RENDEZVOUS = $0008;
+ // no syncup will be done
+ MCI_ASYNC = $0010;
+
+{
+This function plays a multimedia data file (video, audio) using MCI commands.
+hwndOwner is handle of owner window. If hwndOwner equial to zero used active
+ window.
+pszFile is pointer to asciiz name of data file. For compound files can be
+ used 'filename+element'.
+ulFlags is MCI_* flags.
+pszTitle is title of generated window (e.g. for video). Ignored if not generated.
+hwndViewport is handle of window for displaying video. If none, then default
+ window displayed.
+}
+Function mciPlayFile(hwndOwner: Cardinal; // Ownerwindow
+ pszFile: PChar; // File
+ ulFlags: Cardinal; // Flags
+ pszTitle: PChar; // Title
+ hwndViewport: Cardinal): // Viewport Window
+ Cardinal; cdecl;
+
+Function mciPlayResource(hwndOwner: Cardinal; // Owner Window
+ hmod: LongInt; // Module
+ resType: LongInt; // Resource Type
+ resID: LongInt; // Resource ID
+ ulFlags: Cardinal; // Flags
+ pszTitle: PChar; // Title
+ hwndViewport: Cardinal): // Viewport Window
+ Cardinal; cdecl;
+
+Function mciRecordAudioFile(hwndOwner: Cardinal;
+ pszFile,
+ pszTitle: PChar;
+ ulFlags: Cardinal):
+ Cardinal; cdecl;
+
+// Audio Macro Service Constants and Routines
+
+Const
+ MMIO_FE_FINDFIRST = 1;
+ MMIO_FE_FINDNEXT = 2;
+ MMIO_FE_FINDEND = 3;
+ MMIO_FE_FINDELEMENT = 4;
+
+ MMIO_RE_COMPACT = 1;
+
+Function mmioRemoveElement(pszFileElement: pChar;
+ ulFlag: LongInt):
+ Cardinal; cdecl;
+
+Function mmioFindElement(ulCode: LongInt; // Find Code
+ pszElement: PChar; // Element
+ ulElementLen: LongInt; // Element Buffer Length
+ pszFile: PChar;
+ ulReserved: LongInt): // Compound File
+ Cardinal; cdecl;
+
+
+
+Implementation
+
+Function mciPlayFile(hwndOwner: Cardinal; pszFile: PChar; ulFlags: Cardinal; pszTitle: PChar; hwndViewport: Cardinal): Cardinal; cdecl;
+ external 'MCIAPI' index 10;
+Function mciPlayResource(hwndOwner: Cardinal; hmod: LongInt; resType: LongInt; resID: LongInt; ulFlags: Cardinal; pszTitle: PChar; hwndViewport: Cardinal): Cardinal; cdecl;
+ external 'MCIAPI' index 11;
+Function mciRecordAudioFile(hwndOwner: Cardinal; pszFile, pszTitle: PChar; ulFlags: Cardinal): Cardinal; cdecl;
+ external 'MCIAPI' index 12;
+Function mmioRemoveElement(pszFileElement: PChar; ulFlag: LongInt): Cardinal; cdecl;
+ external 'MCIAPI' index 16;
+Function mmioFindElement(ulCode: LongInt; pszElement: PChar; ulElementLen: LongInt; pszFile: PChar; ulReserved: LongInt): Cardinal; cdecl;
+ external 'MCIAPI' index 18;
+
+end.
diff --git a/packages/os2units/src/mcidrv.pas b/packages/os2units/src/mcidrv.pas
new file mode 100644
index 0000000000..8dae915bff
--- /dev/null
+++ b/packages/os2units/src/mcidrv.pas
@@ -0,0 +1,358 @@
+{
+ Copyright (c) 1991, 1992 by International Business Machines Corporation
+ Copyright (c) 2002 by Andry Svirgunov (cool2@ngs.ru)
+ Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ MCI drivers interface
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(MCI drivers interface)
+@author(Andry Svirgunov (cool2@ngs.ru))
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(01 Oct 2002)
+@lastmod(19 Jan 2003)
+MCI drivers interface
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+Unit mcidrv;
+
+Interface
+
+Type
+ GID=Integer;
+
+///**************************************************************************/
+// MCI Driver message identifiers */
+///**************************************************************************/
+const
+ MCIDRV_SAVE = 900;
+ MCIDRV_RESTORE = 901;
+ MCIDRV_SYNC = 902;
+ MCIDRV_CHANGERESOURCE = 903;
+ MCIDRV_CONNECT = 904;
+ MCIDRV_ASSOCIATE = 905;
+ MCIDRV_DISCONNECT = 906;
+ MCIDRV_TEST_CONNECTION = 907;
+ MCIDRV_START = 908;
+ MCIDRV_SEEK = 909;
+ MCIDRV_STOP = 910;
+ MCIDRV_MODIFY_CONNECTION = 911;
+ MCIDRV_INIT_CONNECTION = 912;
+ MCIDRV_DEINIT_CONNECTION = 913;
+ MCIDRV_ENABLE_EVENT = 915;
+ MCIDRV_GETTIME = 917;
+
+///*******************************************************************/
+// The following messages are used by the MCIDRV_CONNECT message */
+///*******************************************************************/
+
+ MCIDRV_CONNECT_TARGET = $00010000;
+ MCIDRV_CONNECT_SOURCE = $00020000;
+ MCIDRV_SET_CONNNECTOR_TYPE = $00040000;
+ MCIDRV_CHANGE_SEM = $00080000;
+
+///*******************************************************************/
+// The following messages are used by MCIDRV_MODIFY_CONNECTION */
+///*******************************************************************/
+
+
+ MCIDRV_MODIFY_10 =$00100000; // back level MCI driver.
+ MCIDRV_MIX_STANDALONE =$00200000;
+
+
+///*******************************************************************/
+// The following messages are used by MCIDRV_START */
+///*******************************************************************/
+
+ MCIDRV_CUE_PLAYBACK = $00010000;
+ MCIDRV_CUE_RECORD = $00020000;
+ MCIDRV_START_PLAYBACK = $00040000;
+ MCIDRV_START_RECORD = $00080000;
+ MCIDRV_START_PREROLL = $00100000;
+
+///*******************************************************************/
+// The following messages are used by MCIDRV_ASSOCIATE */
+///*******************************************************************/
+
+ MCIDRV_OUTPUT = $00010000;
+ MCIDRV_INPUT = $00020000;
+
+///*******************************************************************/
+// The following messages are used by MCIDRV_STOP */
+///*******************************************************************/
+
+ MCIDRV_PAUSE_STREAM_NETWORK = $00010000;
+ MCIDRV_FLUSH_STREAM_NETWORK = $00020000;
+ MCIDRV_DISCARD_STREAM_NETWORK = $00040000;
+
+///*******************************************************************/
+// The following messages are used by MCIDRV_DEINIT_CONNECTION */
+///*******************************************************************/
+
+ MCIDRV_MODIFY_HANDLER =$00010000;
+
+
+
+///*******************************************************************/
+// The following range of message ID's are reserved for internal use */
+// by MCI drivers */
+///*******************************************************************/
+ MCI_INTERNAL_MESSAGES_START = 1000;
+ MCI_INTERNAL_MESSAGES_END = 1999;
+
+///*******************************************************************/
+// Flags used by the string parser for command tables */
+// NOTE: All flags must have an "L" suffix in order to be parsed as */
+// DWORDs by the resource compiler */
+///*******************************************************************/
+ MCI_COMMAND_HEAD = $00000001;
+ MCI_END_COMMAND = $00000002;
+ MCI_END_COMMAND_LIST = $00000003;
+ MCI_RETURN = $00000004;
+ MCI_STRING = $00000005;
+ MCI_FLAG = $00000006;
+ MCI_INTEGER = $00000007;
+ MCI_CONSTANT = $00000008;
+ MCI_CONSTANT_INTEGER = $00000009;
+ MCI_CONSTANT_STRING = $0000000A;
+ MCI_END_CONSTANT = $0000000B;
+ MCI_DEFAULT_STRING = $0000000C;
+ MCI_DEFAULT_INTEGER = $0000000D;
+ MCI_RETURN_TYPE = $0000000E;
+ MCI_RETURN_TYPE_STRING = $0000000F;
+ MCI_END_RETURN_TYPE = $00000010;
+ MCI_CONSTANT_2 = $00000011;
+ MCI_END_CONSTANT_2 = $00000012;
+ MCI_CONSTANT_PAIR = $00000013;
+ MCI_END_CONSTANT_PAIR = $00000014;
+ MCI_CONSTANT_INTEGER_PAIR = $00000015;
+ MCI_CONSTANT_STRING_PAIR = $00000016;
+ MCI_RECTL = $00000017;
+ MCI_CONSTANT_4 = $00000018;
+ MCI_END_CONSTANT_4 = $00000019;
+ MCI_FOURCC = $0000001A;
+ MCI_OR = $0000001B;
+ MCI_END_OR = $0000001C;
+ MCI_STRING_LIST = $0000001D;
+
+///*******************************************************************/
+// Return types supported by mciSendString */
+// Values 0x0000 -> 0xFF00 are reserved by MMPM2 */
+// Values 0xFF01 -> 0xFFFF are user definable */
+///*******************************************************************/
+ MCI_INTEGER_RETURNED = $1000;
+ MCI_COLONIZED2_RETURN = $2000;
+ MCI_COLONIZED3_RETURN = $3000;
+ MCI_COLONIZED4_RETURN = $4000;
+ MCI_TRUE_FALSE_RETURN = $5000;
+ MCI_ON_OFF_RETURN = $6000;
+ MCI_DEVICENAME_RETURN = $7000;
+ MCI_TIME_FORMAT_RETURN = $8000;
+ MCI_SPEED_FORMAT_RETURN = $9000;
+ MCI_MODE_RETURN = $A000;
+ MCI_MEDIA_TYPE_RETURN = $B000;
+ MCI_TRACK_TYPE_RETURN = $C000;
+ MCI_CONNECTOR_TYPE_RETURN = $D000;
+ MCI_CDXA_CHANNEL_DESTINATION_RETURN = $E000;
+ MCI_PREROLL_TYPE_RETURN = $F000;
+ MCI_FORMAT_TAG_RETURN = $F100;
+ MCI_SEQ_SYNCHRONIZATION_RETURN = $F200;
+ MCI_VIDEO_QUALITY_RETURN = $F300;
+ MCI_AUDIO_QUALITY_RETURN = $F400;
+ MCI_IMAGE_QUALITY_RETURN = $F500;
+ MCI_VIDEO_COMPRESSION_RETURN = $F600;
+ MCI_AUDIO_COMPRESSION_RETURN = $F700;
+ MCI_IMAGE_COMPRESSION_RETURN = $F800;
+ MCI_RECTL_RETURN = $F900;
+ MCI_FOURCC_RETURN = $FA00;
+ MCI_IMAGE_PELFORMAT_RETURN = $FB00;
+ MCI_DIRECTION_RETURN = $FC00;
+ MCI_SIGNED_INTEGER_RETURN = $FD00;
+
+ MCI_USER_RETURN = $FF01;
+///*******************************************************************/
+// End of msg text used by mciGetErrorString */
+///*******************************************************************/
+ MCIERR_BASE = 5000;
+ MCIERR_MSG_TABLE_END = MCIERR_BASE + 7000;
+
+///*******************************************************************/
+// */
+// MCI DEVICE shareability categories */
+// */
+///*******************************************************************/
+ FIXEDSINGLECONTEXT = $0001;
+ DYNAMICSINGLECONTEXT = $0002;
+ LIMITEDMULTIPLECONTEXT = $0003;
+ UNLIMITEDMULTIPLECONTEXT = $0004;
+
+///*******************************************************************/
+// MCI driver flag for close during exit list processing */
+///*******************************************************************/
+ MCI_CLOSE_EXIT = $10000000;
+
+///*******************************************************************/
+// MCI driver specific error table resource number base */
+///*******************************************************************/
+ MMERROR_TABLE_BASE = 500;
+
+///*******************************************************************/
+// */
+// MCIDRV_CHANGERESOURCE message flags */
+// */
+///*******************************************************************/
+
+Type
+ mciDrv_ChangeResource_Parms = record
+ pInstance : Pointer; // pointer to device instance
+ usResourceUnits : Integer; // required resource units
+ usResourceClass : Integer; // resource class
+ usResourcePriority : Integer; // resource priority
+ end;
+ pmciDrv_ChangeResource_Parms = ^mciDrv_ChangeResource_Parms;
+
+///*******************************************************************/
+// */
+// MCIDRV_ENABLE_EVENT message flags */
+// */
+///*******************************************************************/
+
+Type
+ HSTREAM=LongInt;
+ hID=LongInt;
+ hEvent = LongInt; // Event Handle
+ phEvent = ^hEvent; // Pointer to Event Handle
+ HWND = LongInt;
+ MMTIME = LongInt;
+Type
+ evcb = record
+ ulType : LongInt; // Event type (input)
+ ulSubType : LongInt; // Event SubType (input)
+ ulFlags : LongInt; // 0 (Input), status (Output)
+ hstream : HSTREAM; // handle to stream for this event
+ hid : hID; // handler Id (input/output)
+ ulStatus : LongInt; // Event status (output)
+ ulEventParm1 : LongInt; // Event parameters (input), hID if implicit event
+ ulEventParm2 : LongInt; // Event parameters (input)
+ ulEventParm3 : LongInt; // Event parameters (input)
+ end;
+ pevcb = ^evcb;
+
+Type
+ MCIDRV_EVENT_PARMS = record
+ ulLength:LongInt; // Length of event parms */
+ pevcb:PEVCB; // pointer to event control block */
+ phevent:PHEVENT; // pointer to the event to enable in network */
+ end;
+ PMCIDRV_EVENT_PARMS=^MCIDRV_EVENT_PARMS;
+
+///*******************************************************************/
+// */
+// MCIDRV_SYNC message flags */
+// */
+///*******************************************************************/
+Const
+ MCIDRV_SYNC_ENABLE = $00000100;
+ MCIDRV_SYNC_DISABLE = $00000200;
+ MCIDRV_SYNC_REC_PULSE = $00000400;
+ MCIDRV_SYNC_MASTER = $00000800;
+ MCIDRV_SYNC_SET_MASTER = $00001000;
+
+Type
+ sync_evcb = record
+ ulType : LongInt; // Event_SYNC
+ ulSubType : LongInt; // Not used
+ ulSyncFlags : LongInt; // 0 (input),status (output)
+ hstream : HStream; // handle to stream for this event
+ hid : hID; // Handler id
+ ulStatus : LongInt; // Event status (output)
+ mmtimeStart : mmTime; // Filled in by Sync/Stream manager
+ // at SpiEnableSync time. (input)
+ mmtimeMaster : mmTime; // Filled in by Master SH (input)
+ mmtimeSlave : mmTime; // Filled in by slave SH. (output)
+ end;
+ pSync_evcb = ^sync_Evcb;
+
+Type
+ mciDrv_Sync_Parms = record
+ hStreams : ^hStream; // Pointer to list of stream IDs
+ ulNumStreams : LongInt; // number of stream IDs
+ mmTime : mmTime; // Sync Pulse Time
+ NonStreamMaster : Boolean; // TRUE if this device can be master
+ pevcbSyncPulse : pSync_evcb; // pointer to EVCB address (output)
+ hidMaster : hID; // Master NULL sh ID (valid only on
+ // MCIDRV_SYNC_MASTER
+ ulReserved1 : LongInt; // Reserved field
+ ulReserved2 : LongInt; // Reserved field
+ end;
+ pmciDrv_Sync_Parms = ^mciDrv_Sync_Parms;
+
+
+//*******************************************************************/
+// contains information for open message for MCI drivers */
+//*******************************************************************/
+Type
+ mmDrv_Open_Parms = record
+ hwndCallback : hwnd; // call back handle
+ usDeviceID : Integer; // The device ID assigned to this instance
+ usDeviceType : Integer; // The device type number
+ usDeviceOrd : Integer; // The device ordinal number
+ pInstance : Pointer; // pointer to the instance structure allocated
+ // initialized by the driver. The MCI driver
+ // will fill in this parameter.
+ szDevDLLName : Array[0..259] of Char; // Character string containing the device
+ // specific DLL name to call for the open.
+ // (ie. ACPA.DLL)
+ pszElementName : pChar; // typically a file name or NULL
+ usDevParmLen : Integer; // Device parameters data block length.
+ pDevParm : Pointer; // Device parameters data block. This data
+ // block is unique to each type of device.
+ // (ie. LVD "COM1 9600 N 7 1").
+ Reserved0 : Pointer;
+ usResourceUnitsRequired : Integer; // number of resource units this instance
+ // requires.
+ usResourceClass : Integer; // resource class this instance belongs to
+ usResourcePriority : Integer; // resource priority for this instance
+ ulParam2 : LongInt; // Pointer to MCI_OPEN structure
+ end;
+ pmmDrv_Open_Parms = ^mmDrv_Open_Parms;
+
+
+///*******************************************************************/
+// */
+// MCIDRV_RESTORE message flags */
+// */
+///*******************************************************************/
+
+Type
+ MCIDRV_RESTORE_PARMS = record
+ ulLength:longint; // Length of restore parms */
+ ulMasterVolume:longint; // Master volume value */
+ end;
+ PMCIDRV_RESTORE_PARMS=^MCIDRV_RESTORE_PARMS;
+
+function mdmDriverNotify( usDeviceID: Integer; wnd: Hwnd; usMsgType: Integer;
+ usUserParm: Integer; ulMsgParm: LongInt): LongInt; cdecl;
+
+Implementation
+
+function mdmDriverNotify( usDeviceID: Integer; wnd: Hwnd; usMsgType: Integer;
+ usUserParm: Integer; ulMsgParm: LongInt): LongInt; cdecl; external 'MDM' index 17;
+
+End.
diff --git a/packages/os2units/src/mmbase.pas b/packages/os2units/src/mmbase.pas
new file mode 100644
index 0000000000..bb7ae75aa8
--- /dev/null
+++ b/packages/os2units/src/mmbase.pas
@@ -0,0 +1,3275 @@
+{
+ Copyright (c) 1990-1993 International Business Machines Corporation
+ Copyright (c) 2002 by Andry Svirgunov (cool2@ngs.ru)
+ Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ OS/2 Multimedia structures and definitions
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(Multimedia structures and definitions)
+@author(Andry Svirgunov (cool2@ngs.ru))
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(17 Dec 2002)
+@lastmod(19 Jan 2003)
+OS/2 Multimedia structures and definitions
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+//****************************************************************************/
+//* */
+//* Module Name: MMBase.pas */
+//* */
+//* OS/2 2.0 Multimedia Extensions Base Definitions */
+//* */
+//* Copyright (c) International Business Machines Corporation 1991, 1992 */
+//* All Rights Reserved */
+//* */
+//*------------------------------------------------------------------------- */
+//* Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+//* 14.11.2002. */
+//* Revised by Yuri Prokushev (prokushev@freemail.ru) */
+//****************************************************************************/
+
+Unit mmbase;
+
+{$MODE ObjFPC}
+
+Interface
+
+Uses Os2Def;
+
+Type
+ VERSION = WORD;
+ LPSTR = ^Char;
+ LPTR = Pointer;
+ LPRECT = Pointer;
+ HANDLE = HWND;
+ PW = ^Word;
+ PAW = ^Word;
+ PFN = Pointer ;
+ PPFN = ^PFN;
+
+type
+ FNMCI=Function(var p,w:Word;a,b,c:LongInt):Longint;
+
+TYPE
+ PFNMCI = ^FNMCI;
+ SZ = Char; //* ASCIIZ char string type*/
+ MMTIME = LongInt; //* universal Chinatown time (1/3000 second)*/
+ PMMTIME = ^MMTIME; //* Ptr to MMTIME unit*/
+ HMMIO = LongInt; //* Handle to an MMIO object*/
+ PHMMIO = ^HMMIO; //* Handle to an MMIO object*/
+
+
+TYPE
+ FOURCC=Cardinal;
+
+//**********************************************
+//*
+//* SPCBKEY - Stream Protocol Key
+//*
+//**********************************************/
+Type _SPCBKEY = record //* spcbkey SPCB key (Stream data type) */
+ ulDataType : LongInt;
+ ulDataSubType : LongInt;
+ ulIntKey : LongInt; //* generated internal key */
+ end;
+TYPE PSPCBKEY = ^_SPCBKEY;
+
+Const
+
+ _SPCBKEY_DEFINED = 1;
+
+//**********************************************
+// *
+// * MMTRACKINFO - This structure is used to
+// * represent a video, audio or
+// * some other type of track
+// * within a digital video movie
+// * file.
+// *
+// **********************************************/
+TYPE _MMTRACKINFO = record //* mmtrackinfo */
+ ulTrackID : LongInt; //* track identifier */
+ ulMediaType : LongInt; //* media type */
+ ulCountry : LongInt; //* country code for the track */
+ ulCodePage : LongInt; //* country code page for the track */
+ ulReserved1: LongInt; //* reserved must be 0 */
+ ulReserved2 : LongInt; //* reserved must be 0 */
+ end;
+
+TYPE PMMTRACKINFO = ^_MMTRACKINFO; //* Ptr to a track table entry */
+
+//************************
+// * Clipboard formats
+// ************************/
+CONST
+ CF_RMID = 10;
+ CF_RIFF = 11;
+ CF_WAVE = 12;
+ CF_AVI = 13;
+//************************
+// * Resource formats
+// ************************/
+ RT_RMID = 100;
+ RT_RIFF = 101;
+ RT_WAVE = 102;
+ RT_AVI = 103;
+ RT_AVS = 104;
+
+
+//************************
+// * Drag formats
+// ************************/
+ DRT_WAVE = 'DIGITAL AUDIO';
+ DRT_AVI = 'DIGITAL VIDEO';
+ DRT_MIDI = 'MIDI';
+
+
+//************************
+// * Sampling Rate
+// ************************/
+ HZ_8000 = 8000; //* 8.0 kHz*/
+ HZ_11025 = 11025; //* 11.025 kHz*/
+ HZ_14700 = 14700; //* 14.700 kHz (SPV/2)*/
+ HZ_18900 = 18900; //* 18.900 kHz (CD/XA LVL C)*/
+ HZ_22050 = 22050; //* 22.050 kHz*/
+ HZ_37800 = 37800; //* 37.800 kHz (CD/XA LVL B)*/
+ HZ_44100 = 44100; //* 44.100 kHz*/
+
+//************************
+// * Bits per Sample
+// ************************/
+ BPS_4 = 4; //* 4 bits/sample (ADPCM)*/
+ BPS_8 = 8; //* 8 bits/sample (PCM)*/
+ BPS_16 =16; //* 16 bits/sample(PCM)*/
+
+//************************
+//* Channels
+//************************/
+ CH_1 = 1; //* Mono*//
+ CH_2 = 2; //* Stereo*//
+ CH_4 = 4; //* Quad*//
+
+
+//*************************************************************************
+// * Multimedia Datatypes (spcbkey values)
+// *************************************************************************/
+
+
+///****************
+// * NULL datatype
+// ****************/
+ DATATYPE_NULL = $0000; //* NULL stream data type (NULL)*/
+ SUBTYPE_NONE = $0000; //* No subtype for this data type*/
+
+//*********************
+// * WAVEFORM datatypes
+// *********************/
+ DATATYPE_WAVEFORM = $0001; //* WAVEFORM audio (PCM)*/
+
+
+//* Subtypes for DATATYPE_WAVEFORM:*/
+ WAVE_FORMAT_1M08 = $0001; //* 11.025kHz, Mono , 8-bit*/
+ WAVE_FORMAT_1S08 = $0002; //* 11.025kHz, Stereo, 8-bit*/
+ WAVE_FORMAT_1M16 = $0003; //* 11.025kHz, Mono , 16-bit*/
+ WAVE_FORMAT_1S16 = $0004; //* 11.025kHz, Stereo, 16-bit*/
+ WAVE_FORMAT_2M08 = $0005; //* 22.05kHz , Mono , 8-bit*/
+ WAVE_FORMAT_2S08 = $0006; //* 22.05kHz , Stereo, 8-bit*/
+ WAVE_FORMAT_2M16 = $0007; //* 22.05kHz , Mono , 16-bit*/
+ WAVE_FORMAT_2S16 = $0008; //* 22.05kHz , Stereo, 16-bit*/
+ WAVE_FORMAT_4M08 = $0009; //* 44.1kHz , Mono , 8-bit*/
+ WAVE_FORMAT_4S08 = $000A; //* 44.1kHz , Stereo, 8-bit*/
+ WAVE_FORMAT_4M16 = $000B; //* 44.1kHz , Mono , 16-bit*/
+ WAVE_FORMAT_4S16 = $000C; //* 44.1kHz , Stereo, 16-bit*/
+ WAVE_FORMAT_8M08 = $000D; //* 8.0kHz , Mono , 8-bit*/
+ WAVE_FORMAT_8S08 = $000E; //* 8.0kHz , Stereo, 8-bit*/
+ WAVE_FORMAT_8M16 = $000F; //* 8.0kHz , Mono , 16-bit*/
+ WAVE_FORMAT_8S16 = $0010; //* 8.0kHz , Stereo, 16-bit*/
+
+//*********************
+// * DIGVIDEO datatypes
+// *********************/
+ DATATYPE_DIGVIDEO = $0002; //* Digital Video */
+
+//* Subtypes for DATATYPE_DIGVIDEO:*/
+ DIGVIDEO_PHOTOM = $544F4850; //* Photmotion video, FOURCC value for phio */
+ DIGVIDEO_ULTIM = $49544C55; //* Ultimotion video, FOURCC value for ulio */
+ DIGVIDEO_AVI = $20495641; //* AVI video, FOURCC value for avio */
+ DIGVIDEO_MONITOR = $206E6FD; //* MONITOR video, FOURCC value for monitoring */
+ DIGVIDEO_FLC = $63696C66; //* FLIC video, FOURCC value for flic */
+ DIGVIDEO_MPEG = $4745504D; //* MPEG video, FOURCC value for MPEG */
+
+//******************
+// * MuLaw datatypes
+//******************/
+ DATATYPE_MULAW = $0101; //* MuLaw*/
+ DATATYPE_RIFF_MULAW = $0007; //* MuLaw*/
+
+//* Subtypes for DATATYPE_MULAW:*/
+
+ MULAW_8B8KS = $0001; //* 8bit 8kHz stereo*/
+ MULAW_8B11KS = $0002; //* 8bit 11kHz stereo*/
+ MULAW_8B22KS = $0003; //* 8bit 22kHz stereo*/
+ MULAW_8B44KS = $0004; //* 8bit 44kHz stereo*/
+ MULAW_8B8KM = $0005; //* 8bit 8kHz mono*/
+ MULAW_8B11KM = $0006; //* 8bit 11kHz mono*/
+ MULAW_8B22KM = $0007; //* 8bit 22kHz mono*/
+ MULAW_8644KM = $0008; //* 8bit 44kHz mono*/
+
+//*****************
+// * ALaw datatypes
+// *****************/
+ DATATYPE_ALAW = $0102; //* ALaw*/
+ DATATYPE_RIFF_ALAW = $0006; //* ALaw*/
+
+//* Subtypes for DATATYPE_ALAW:*/
+ ALAW_8B8KS = $0001; //* 8bit 8kHz stereo*/
+ ALAW_8B11KS = $0002; //* 8bit 11kHz stereo*/
+ ALAW_8B22KS = $0003; //* 8bit 22kHz stereo*/
+ ALAW_8B44KS = $0004; //* 8bit 44kHz stereo*/
+ ALAW_8B8KM = $0005; //* 8bit 8kHz mono*/
+ ALAW_8B11KM = $0006; //* 8bit 11kHz mono*/
+ ALAW_8B22KM = $0007; //* 8bit 22kHz mono*/
+ ALAW_8B44KM = $0008; //* 8bit 44kHz mono*/
+
+//*******************************
+// * AVC ADPCM WAVEFORM datatypes
+// *******************************/
+ DATATYPE_ADPCM_AVC = $0103; //* ADPCM audio*/
+
+//* Subtypes for DATATYPE_ADPCM_AVC:*/
+ ADPCM_AVC_VOICE = $0001;
+ ADPCM_AVC_MUSIC = $0002;
+ ADPCM_AVC_STEREO = $0003;
+ ADPCM_AVC_HQ = $0004;
+
+//******************
+// * CT_ADPCM datatypes
+// ******************/
+ DATATYPE_CT_ADPCM = $0200; //* Creative technologies */
+
+//* Subtypes for DATATYPE_CT_ADPCM:*/
+
+ CD_ADPCM_16B8KS = $0001; //* 16bit 8kHz stereo*/
+ CD_ADPCM_16B11KS = $0002; //* 16bit 11kHz stereo*/
+ CD_ADPCM_16B22KS = $0003; //* 16bit 22kHz stereo*/
+ CD_ADPCM_16B44KS = $0004; //* 16bit 44kHz stereo*/
+ CD_ADPCM_16B8KM = $0005; //* 16bit 8kHz mono*/
+ CD_ADPCM_16B11KM = $0006; //* 16bit 11kHz mono*/
+ CD_ADPCM_16B22KM = $0007; //* 16bit 22kHz mono*/
+ CD_ADPCM_16B44KM = $0008; //* 16bit 44kHz mono*/
+
+//****************
+// * MIDI datatype
+// ****************/
+
+ DATATYPE_MIDI = $0201; //* MIDI*/
+//* SUBTYPE_NONE 0x0000L No subtype for this data type*/
+
+
+//********************
+// * GENERIC datatypes
+// ********************/
+ DATATYPE_GENERIC = $0202; //* Generic for files / memory. This*/
+ //* datatype will match any other*/
+ //* datatype at stream creation time.*/
+
+//**************************
+// * Speech Viewer datatypes
+// **************************/
+
+ DATATYPE_SPV2 = $0203; //* Speech Viewer*/
+
+//* Subtypes for DATATYPE_SPV2:*/
+
+ SPV2_BPCM = $0001;
+ SPV2_PCM = $0002;
+ SPV2_NONE = $0003;
+
+//******************
+// * CD-XA datatypes
+// ******************/
+
+ DATATYPE_CDXA_VIDEO = $0204; //* CD-XA Video datatype*/
+ DATATYPE_CDXA_DATA = $0205; //* CD-XA sub-band data datatype*/
+ DATATYPE_CDXA_AUDIO = $0206; //* CD-XA ADPCM Audio datatype*/
+ DATATYPE_CDXA_AUDIO_HD = $0207; //* CD-XA ADPCM Audio with Headers*/
+ DATATYPE_CDXA_HEADERS = $0208; //* CD-XA Headers and Subheaders*/
+
+//* Subtypes for DATATYPE_CDXA_AUDIO:*/
+
+ DATATYPE_LEVELB = $0000; //* LEVEL B Audio Stereo*/
+ DATATYPE_LEVELC = $0001; //* LEVEL C Audio Stereo*/
+ DATATYPE_LEVELB_MONO = $0002; //* LEVEL B Audio Mono*/
+ DATATYPE_LEVELC_MONO = $0003; //* LEVEL C Audio Mono*/
+
+//*********************
+// * DIGISPEECH datatype
+// *********************/
+ DATATYPE_DIGISPEECH = $0208; //* DIGISPEECH */
+ DATATYPE_NATIVE = $0001; //* Native digispeech */
+
+//*********************
+// * MPEG-1 Audio datatypes
+// *********************/
+ DATATYPE_MPEG1AUDIO = $0050; //* MPEG-1 Audio */
+
+//* Subtypes for DATATYPE_MPEG1AUDIO:*/
+ MPEG1_FORMAT_3M16 = $0001; //* 32.000kHz, Mono , 16-bit*/
+ MPEG1_FORMAT_3S16 = $0002; //* 32.000kHz, Stereo, 16-bit*/
+ MPEG1_FORMAT_4M16 = $0003; //* 44.1/48kHz, Mono , 16-bit*/
+ MPEG1_FORMAT_4S16 = $0004; //* 44.1/48kHz, Stereo, 16-bit*/
+
+//*******************
+// * UNKNOWN datatype
+// *******************/
+ DATATYPE_UNKNOWN = $FFFFFFFF; //* Unknown datatype */
+
+//* SUBTYPE_NONE 0x0000L No subtype for this data type*/
+
+
+// ERROR CODES
+
+CONST
+
+NO_ERROR = 0;
+//*****************************************/
+//* MCI Device Manager Error Return codes */
+//*****************************************/
+
+CONST
+MCIERR_BASE = 5000;
+MCIERR_SUCCESS = 0;
+MCIERR_INVALID_DEVICE_ID =(MCIERR_BASE + 1);
+MCIERR_NO_MASTER =(MCIERR_BASE + 2);
+MCIERR_UNRECOGNIZED_KEYWORD =(MCIERR_BASE + 3);
+MCIERR_MASTER_CONFLICT =(MCIERR_BASE + 4);
+MCIERR_UNRECOGNIZED_COMMAND =(MCIERR_BASE + 5);
+MCIERR_HARDWARE =(MCIERR_BASE + 6);
+MCIERR_INVALID_DEVICE_NAME =(MCIERR_BASE + 7);
+MCIERR_OUT_OF_MEMORY =(MCIERR_BASE + 8);
+MCIERR_DEVICE_OPEN =(MCIERR_BASE + 9);
+MCIERR_CANNOT_LOAD_DRIVER =(MCIERR_BASE + 10);
+MCIERR_MISSING_COMMAND_STRING =(MCIERR_BASE + 11);
+MCIERR_PARAM_OVERFLOW =(MCIERR_BASE + 12);
+MCIERR_MISSING_STRING_ARGUMENT =(MCIERR_BASE + 13);
+MCIERR_BAD_INTEGER =(MCIERR_BASE + 14);
+MCIERR_PARSER_INTERNAL =(MCIERR_BASE + 15);
+MCIERR_DRIVER_INTERNAL =(MCIERR_BASE + 16);
+MCIERR_MISSING_PARAMETER =(MCIERR_BASE + 17);
+MCIERR_UNSUPPORTED_FUNCTION =(MCIERR_BASE + 18);
+MCIERR_FILE_NOT_FOUND =(MCIERR_BASE + 19);
+MCIERR_DEVICE_NOT_READY =(MCIERR_BASE + 20);
+MCIERR_INTERNAL =(MCIERR_BASE + 21);
+MCIERR_DRIVER =(MCIERR_BASE + 22);
+MCIERR_CANNOT_USE_ALL =(MCIERR_BASE + 23);
+MCIERR_MULTIPLE =(MCIERR_BASE + 24);
+MCIERR_EXTENSION_NOT_FOUND =(MCIERR_BASE + 25);
+MCIERR_OUTOFRANGE =(MCIERR_BASE + 26);
+MCIERR_CANNOT_ADD_ALIAS =(MCIERR_BASE + 27);
+MCIERR_FLAGS_NOT_COMPATIBLE =(MCIERR_BASE + 28);
+MCIERR_CANNOT_USE_NOUNLOAD =(MCIERR_BASE + 29);
+MCIERR_FILE_NOT_SAVED =(MCIERR_BASE + 30);
+MCIERR_DEVICE_TYPE_REQUIRED =(MCIERR_BASE + 31);
+MCIERR_DEVICE_LOCKED =(MCIERR_BASE + 32);
+MCIERR_DUPLICATE_ALIAS =(MCIERR_BASE + 33);
+MCIERR_INSTANCE_INACTIVE =(MCIERR_BASE + 34);
+
+MCIERR_COMMAND_TABLE =(MCIERR_BASE + 35);
+MCIERR_INI_FILE_LOCKED =(MCIERR_BASE + 37);
+
+MCIERR_NO_AUDIO_SUPPORT =(MCIERR_BASE + 40);
+MCIERR_NOT_IN_PM_SESSION =(MCIERR_BASE + 41);
+MCIERR_DUPLICATE_KEYWORD =(MCIERR_BASE + 42);
+MCIERR_COMMAND_STRING_OVERFLOW =(MCIERR_BASE + 43);
+MCIERR_DRIVER_PROC_NOT_FOUND =(MCIERR_BASE + 44);
+MCIERR_INVALID_DEVICE_TYPE =(MCIERR_BASE + 45);
+MCIERR_INVALID_DEVICE_ORDINAL =(MCIERR_BASE + 46);
+MCIERR_HEADPHONES_NOT_SET =(MCIERR_BASE + 47);
+MCIERR_SPEAKERS_NOT_SET =(MCIERR_BASE + 48);
+MCIERR_SOUND_NOT_SET =(MCIERR_BASE + 49);
+MCIERR_INVALID_BUFFER =(MCIERR_BASE + 50);
+MCIERR_INVALID_MEDIA_TYPE =(MCIERR_BASE + 51);
+MCIERR_INVALID_CONNECTOR_INDEX =(MCIERR_BASE + 52);
+MCIERR_NO_CONNECTION =(MCIERR_BASE + 53);
+MCIERR_INVALID_FLAG =(MCIERR_BASE + 54);
+MCIERR_CANNOT_LOAD_DSP_MOD =(MCIERR_BASE + 55);
+MCIERR_ALREADY_CONNECTED =(MCIERR_BASE + 56);
+MCIERR_INVALID_CALLBACK_HANDLE =(MCIERR_BASE + 57);
+MCIERR_DRIVER_NOT_FOUND =(MCIERR_BASE + 58);
+MCIERR_DUPLICATE_DRIVER =(MCIERR_BASE + 59);
+MCIERR_INI_FILE =(MCIERR_BASE + 60);
+MCIERR_INVALID_GROUP_ID =(MCIERR_BASE + 61);
+MCIERR_ID_ALREADY_IN_GROUP =(MCIERR_BASE + 62);
+MCIERR_MEDIA_CHANGED =(MCIERR_BASE + 63);
+MCIERR_MISSING_FLAG =(MCIERR_BASE + 64);
+MCIERR_UNSUPPORTED_FLAG =(MCIERR_BASE + 65);
+MCIERR_DRIVER_NOT_LOADED =(MCIERR_BASE + 66);
+MCIERR_INVALID_MODE =(MCIERR_BASE + 67);
+MCIERR_INVALID_ITEM_FLAG =(MCIERR_BASE + 68);
+MCIERR_INVALID_TIME_FORMAT_FLAG =(MCIERR_BASE + 69);
+MCIERR_SPEED_FORMAT_FLAG =(MCIERR_BASE + 70);
+MCIERR_INVALID_AUDIO_FLAG =(MCIERR_BASE + 71);
+MCIERR_NODEFAULT_DEVICE =(MCIERR_BASE + 72);
+MCIERR_DUPLICATE_EXTENSION =(MCIERR_BASE + 73);
+MCIERR_FILE_ATTRIBUTE =(MCIERR_BASE + 74);
+MCIERR_DUPLICATE_CUEPOINT =(MCIERR_BASE + 75);
+MCIERR_INVALID_CUEPOINT =(MCIERR_BASE + 76);
+MCIERR_CUEPOINT_LIMIT_REACHED =(MCIERR_BASE + 77);
+MCIERR_MISSING_ITEM =(MCIERR_BASE + 78);
+MCIERR_MISSING_TIME_FORMAT =(MCIERR_BASE + 79);
+MCIERR_MISSING_SPEED_FORMAT =(MCIERR_BASE + 80);
+MCIERR_INVALID_CONNECTOR_TYPE =(MCIERR_BASE + 81);
+MCIERR_TARGET_DEVICE_FULL =(MCIERR_BASE + 82);
+MCIERR_UNSUPPORTED_CONN_TYPE =(MCIERR_BASE + 83);
+MCIERR_CANNOT_MODIFY_CONNECTOR =(MCIERR_BASE + 84);
+MCIERR_RECORD_ABORTED =(MCIERR_BASE + 85);
+MCIERR_GROUP_COMMAND =(MCIERR_BASE + 86);
+MCIERR_DEVICE_NOT_FOUND =(MCIERR_BASE + 87);
+MCIERR_RESOURCE_NOT_AVAILABLE =(MCIERR_BASE + 88);
+MCIERR_INVALID_IO_PROC =(MCIERR_BASE + 89);
+
+MCIERR_WAVE_OUTPUTSINUSE =(MCIERR_BASE + 90);
+MCIERR_WAVE_SETOUTPUTINUSE =(MCIERR_BASE + 91);
+MCIERR_WAVE_INPUTSINUSE =(MCIERR_BASE + 92);
+MCIERR_WAVE_SETINPUTINUSE =(MCIERR_BASE + 93);
+MCIERR_WAVE_OUTPUTUNSPECIFIED =(MCIERR_BASE + 94);
+MCIERR_WAVE_INPUTUNSPECIFIED =(MCIERR_BASE + 95);
+MCIERR_WAVE_OUTPUTSUNSUITABLE =(MCIERR_BASE + 96);
+MCIERR_WAVE_SETOUTPUTUNSUITABLE =(MCIERR_BASE + 97);
+MCIERR_WAVE_INPUTSUNSUITABLE =(MCIERR_BASE + 98);
+MCIERR_WAVE_SETINPUTUNSUITABLE =(MCIERR_BASE + 99);
+
+MCIERR_SEQ_DIV_INCOMPATIBLE =(MCIERR_BASE + 100);
+MCIERR_SEQ_PORT_INUSE =(MCIERR_BASE + 101);
+MCIERR_SEQ_PORT_NONEXISTENT =(MCIERR_BASE + 102);
+MCIERR_SEQ_PORT_MAPNODEVICE =(MCIERR_BASE + 103);
+MCIERR_SEQ_PORT_MISCERROR =(MCIERR_BASE + 104);
+MCIERR_SEQ_TIMER =(MCIERR_BASE + 105);
+
+MCIERR_VDP_COMMANDCANCELLED =(MCIERR_BASE + 106);
+MCIERR_VDP_COMMANDFAILURE =(MCIERR_BASE + 107);
+MCIERR_VDP_NOTSPUNUP =(MCIERR_BASE + 108);
+MCIERR_VDP_NOCHAPTER =(MCIERR_BASE + 109);
+MCIERR_VDP_NOSIDE =(MCIERR_BASE + 110);
+MCIERR_VDP_NOSIZE =(MCIERR_BASE + 111);
+MCIERR_VDP_INVALID_TIMEFORMAT =(MCIERR_BASE + 112);
+
+MCIERR_CLIPBOARD_ERROR =(MCIERR_BASE + 114);
+MCIERR_CANNOT_CONVERT =(MCIERR_BASE + 115);
+MCIERR_CANNOT_REDO =(MCIERR_BASE + 116);
+MCIERR_CANNOT_UNDO =(MCIERR_BASE + 117);
+MCIERR_CLIPBOARD_EMPTY =(MCIERR_BASE + 118);
+
+MCIERR_INVALID_WORKPATH =(MCIERR_BASE + 119);
+MCIERR_INDETERMINATE_LENGTH =(MCIERR_BASE + 120);
+MCIERR_DUPLICATE_EA =(MCIERR_BASE + 121);
+MCIERR_INVALID_CONNECTION =(MCIERR_BASE + 122);
+MCIERR_CHANNEL_OFF =(MCIERR_BASE + 123);
+MCIERR_CANNOT_CHANGE_CHANNEL =(MCIERR_BASE + 124);
+MCIERR_FILE_IO =(MCIERR_BASE + 125);
+MCIERR_SYSTEM_FILE =(MCIERR_BASE + 126);
+MCIERR_DISPLAY_RESOLUTION =(MCIERR_BASE + 127);
+MCIERR_NO_ASYNC_PLAY_ACTIVE =(MCIERR_BASE + 128);
+
+MCIERR_UNSUPP_FORMAT_TAG =(MCIERR_BASE + 129);
+MCIERR_UNSUPP_SAMPLESPERSEC =(MCIERR_BASE + 130);
+MCIERR_UNSUPP_BITSPERSAMPLE =(MCIERR_BASE + 131);
+MCIERR_UNSUPP_CHANNELS =(MCIERR_BASE + 132);
+MCIERR_UNSUPP_FORMAT_MODE =(MCIERR_BASE + 133);
+MCIERR_NO_DEVICE_DRIVER =(MCIERR_BASE + 134);
+MCIERR_CODEC_NOT_SUPPORTED =(MCIERR_BASE + 135);
+
+MCIERR_TUNER_NO_HW =(MCIERR_BASE + 136);
+MCIERR_TUNER_NO_AFC =(MCIERR_BASE + 137);
+MCIERR_TUNER_AFC_ON =(MCIERR_BASE + 138);
+MCIERR_TUNER_CHANNEL_SKIPPED =(MCIERR_BASE + 139);
+MCIERR_TUNER_CHANNEL_TOO_LOW =(MCIERR_BASE + 140);
+MCIERR_TUNER_CHANNEL_TOO_HIGH =(MCIERR_BASE + 141);
+MCIERR_AUD_CHANNEL_OUTOFRANGE =(MCIERR_BASE + 142);
+MCIERR_TUNER_INVALID_REGION =(MCIERR_BASE + 143);
+MCIERR_SIGNAL_INVALID =(MCIERR_BASE + 144);
+MCIERR_TUNER_MODE =(MCIERR_BASE + 145);
+MCIERR_TUNER_REGION_NOT_SET =(MCIERR_BASE + 146);
+MCIERR_TUNER_CHANNEL_NOT_SET =(MCIERR_BASE + 147);
+MCIERR_UNSUPP_CLASS =(MCIERR_BASE + 148);
+MCIERR_UNSUPPORTED_ATTRIBUTE =(MCIERR_BASE + 149);
+
+MCIERR_CUSTOM_DRIVER_BASE =(MCIERR_BASE + 256);
+
+//******************************************/
+//* Sync/Stream Manager Error Return codes */
+//******************************************/
+
+MEBASE =(MCIERR_BASE + 500);
+ERROR_INVALID_STREAM =(MEBASE + 1);
+ERROR_INVALID_HID =(MEBASE + 2);
+ERROR_INVALID_NETWORK =(MEBASE + 3);
+ERROR_INVALID_OBJTYPE =(MEBASE + 4);
+ERROR_INVALID_FLAG =(MEBASE + 5);
+ERROR_INVALID_EVCB =(MEBASE + 6);
+ERROR_INVALID_EVENT =(MEBASE + 7);
+ERROR_INVALID_MMTIME =(MEBASE + 8);
+ERROR_INVALID_NUMSLAVES =(MEBASE + 9);
+ERROR_INVALID_REQUEST =(MEBASE + 10);
+ERROR_INVALID_SPCBKEY =(MEBASE + 11);
+ERROR_INVALID_HNDLR_NAME =(MEBASE + 12);
+ERROR_INVALID_PROTOCOL =(MEBASE + 13);
+ERROR_INVALID_BUFFER_SIZE =(MEBASE + 14);
+ERROR_INVALID_BUFFER_RETURNED =(MEBASE + 15);
+ERROR_INVALID_ACB =(MEBASE + 16);
+ERROR_INVALID_RECORD_RETURNED =(MEBASE + 17);
+ERROR_INVALID_MESSAGE =(MEBASE + 18);
+
+ERROR_STREAM_NOT_OWNER =(MEBASE + 99);
+ERROR_STREAM_USED =(MEBASE + 100);
+ERROR_STREAM_CREATION =(MEBASE + 101);
+ERROR_STREAM_NOTMASTER =(MEBASE + 102);
+ERROR_STREAM_NOT_STOP =(MEBASE + 103);
+ERROR_STREAM_OPERATION =(MEBASE + 104);
+ERROR_STREAM_STOP_PENDING =(MEBASE + 105);
+ERROR_STREAM_ALREADY_STOP =(MEBASE + 106);
+ERROR_STREAM_ALREADY_PAUSE =(MEBASE + 107);
+ERROR_STREAM_NOT_STARTED =(MEBASE + 108);
+ERROR_STREAM_NOT_ACTIVE =(MEBASE + 109);
+ERROR_START_STREAM =(MEBASE + 110);
+ERROR_MASTER_USED =(MEBASE + 111);
+ERROR_SPCBKEY_MISMATCH =(MEBASE + 112);
+ERROR_INSUFF_BUFFER =(MEBASE + 113);
+ERROR_ALLOC_RESOURCES =(MEBASE + 114);
+ERROR_ACCESS_OBJECT =(MEBASE + 115);
+ERROR_HNDLR_REGISTERED =(MEBASE + 116);
+ERROR_DATA_ITEM_NOT_SPECIFIED =(MEBASE + 117);
+ERROR_INVALID_SEQUENCE =(MEBASE + 118);
+ERROR_INITIALIZATION =(MEBASE + 119);
+ERROR_READING_INI =(MEBASE + 120);
+ERROR_LOADING_HNDLR =(MEBASE + 121);
+ERROR_HNDLR_NOT_FOUND =(MEBASE + 122);
+ERROR_SPCB_NOT_FOUND =(MEBASE + 123);
+ERROR_DEVICE_NOT_FOUND =(MEBASE + 124);
+ERROR_TOO_MANY_EVENTS =(MEBASE + 125);
+ERROR_DEVICE_OVERRUN =(MEBASE + 126);
+ERROR_DEVICE_UNDERRUN =(MEBASE + 127);
+ERROR_HNDLR_NOT_IN_INI =(MEBASE + 128);
+ERROR_QUERY_STREAM_TIME =(MEBASE + 129);
+ERROR_DATA_ITEM_NOT_SEEKABLE =(MEBASE + 130);
+ERROR_NOT_SEEKABLE_BY_TIME =(MEBASE + 131);
+ERROR_NOT_SEEKABLE_BY_BYTES =(MEBASE + 132);
+ERROR_STREAM_NOT_SEEKABLE =(MEBASE + 133);
+ERROR_PLAYLIST_STACK_OVERFLOW =(MEBASE + 135);
+ERROR_PLAYLIST_STACK_UNDERFLOW =(MEBASE + 136);
+ERROR_LOCKING_BUFFER =(MEBASE + 137);
+ERROR_UNLOCKING_BUFFER =(MEBASE + 138);
+ERROR_SEEK_PAST_END =(MEBASE + 139);
+ERROR_SEEK_BACK_NOT_SUPPORTED =(MEBASE + 140);
+ERROR_INTERNAL_ERROR =(MEBASE + 141);
+ERROR_INTERNAL_CORRUPT =(MEBASE + 142);
+ERROR_INSUFF_MEM =(MEBASE + 143);
+ERROR_LARGE_SEEK_BY_TIME =(MEBASE + 144);
+ERROR_STREAM_PREROLLING =(MEBASE + 145);
+ERROR_INI_FILE =(MEBASE + 146);
+ERROR_SEEK_BEFORE_BEGINNING =(MEBASE + 147);
+ERROR_TOO_MANY_HANDLERS =(MEBASE + 148);
+ERROR_ALLOC_HEAP =(MEBASE + 149);
+ERROR_END_OF_PLAYLIST =(MEBASE + 150);
+ERROR_TOO_MANY_STREAMS =(MEBASE + 151);
+ERROR_FILE_FORMAT_INCORRECT =(MEBASE + 152);
+ERROR_DESTROY_STREAM =(MEBASE + 153);
+ERROR_INVALID_NUMMASTERS =(MEBASE + 154);
+ERROR_MASTER_CONFLICT =(MEBASE + 155);
+ERROR_NO_MASTER =(MEBASE + 156);
+ERROR_NO_SYNC =(MEBASE + 157);
+ERROR_STREAM_ALREADY_IN_NETWORK =(MEBASE + 158);
+ERROR_NO_STREAMS_IN_NETWORK =(MEBASE + 159);
+ERROR_MISSING_EVENT_ROUTINE =(MEBASE + 160);
+ERROR_CAN_NOT_REMOVE_STREAM =(MEBASE + 161);
+
+ERROR_BUFFER_NOT_AVAILABLE =(MEBASE + 400);
+ERROR_TOO_MANY_BUFFERS =(MEBASE + 401);
+ERROR_TOO_MANY_RECORDS =(MEBASE + 402);
+
+
+//*----- ERROR_INVALID_PROTOCOL ulErrorStatus defines -----*/
+//*----- Refer to SHC_NEGOTIATE_RESULT api.*/
+PROTOCOL_SPCBLENGTH =1;
+PROTOCOL_SPCBKEY =2;
+PROTOCOL_DATAFLAG =3;
+PROTOCOL_NUMRECORDS =4;
+PROTOCOL_BLOCKSIZE =5;
+PROTOCOL_BUFFERSIZE =6;
+PROTOCOL_MINNUMBUFFERS =7;
+PROTOCOL_MAXNUMBUFFERS =8;
+PROTOCOL_SOURCESTART =9;
+PROTOCOL_TARGETSTART =10;
+PROTOCOL_BUFFERFLAG =11;
+PROTOCOL_HANDLERFLAG =12;
+PROTOCOL_SYNCTOLERANCE =13;
+PROTOCOL_SYNCINTERVAL =14;
+PROTOCOL_INTERNALERROR =-1;
+
+//***********************************/
+//* MMIO Manager Error Return codes */
+//***********************************/
+
+MMIOERR_BASE =(MEBASE + 1000);
+MMIOERR_UNBUFFERED =(MMIOERR_BASE + 1);
+MMIOERR_CANNOTWRITE =(MMIOERR_BASE + 2);
+MMIOERR_CHUNKNOTFOUND =(MMIOERR_BASE + 3);
+
+MMIOERR_INVALID_HANDLE =(MMIOERR_BASE + 4);
+MMIOERR_INVALID_PARAMETER =(MMIOERR_BASE + 5);
+MMIOERR_INTERNAL_SYSTEM =(MMIOERR_BASE + 6);
+MMIOERR_NO_CORE =(MMIOERR_BASE + 7);
+
+MMIOERR_INI_OPEN =(MMIOERR_BASE + 8);
+MMIOERR_INI_READ =(MMIOERR_BASE + 9);
+
+MMIOERR_INVALID_BUFFER_LENGTH =(MMIOERR_BASE + 10);
+MMIOERR_NO_BUFFER_ALLOCATED =(MMIOERR_BASE + 11);
+MMIOERR_NO_FLUSH_FOR_MEM_FILE =(MMIOERR_BASE + 12);
+MMIOERR_NO_FLUSH_NEEDED =(MMIOERR_BASE + 13);
+MMIOERR_READ_ONLY_FILE =(MMIOERR_BASE + 14);
+MMIOERR_WRITE_ONLY_FILE =(MMIOERR_BASE + 15);
+MMIOERR_INSTALL_PROC_FAILED =(MMIOERR_BASE + 16);
+MMIOERR_READ_FAILED =(MMIOERR_BASE + 17);
+MMIOERR_WRITE_FAILED =(MMIOERR_BASE + 18);
+MMIOERR_SEEK_FAILED =(MMIOERR_BASE + 19);
+MMIOERR_CANNOTEXPAND =(MMIOERR_BASE + 20);
+MMIOERR_FREE_FAILED =(MMIOERR_BASE + 21);
+MMIOERR_EOF_SEEN =(MMIOERR_BASE + 22);
+MMIOERR_INVALID_ACCESS_FLAG =(MMIOERR_BASE + 23);
+MMIOERR_INVALID_STRUCTURE =(MMIOERR_BASE + 24);
+MMIOERR_INVALID_SIZE =(MMIOERR_BASE + 25);
+MMIOERR_INVALID_FILENAME =(MMIOERR_BASE + 26);
+
+MMIOERR_CF_DUPLICATE_SEEN =(MMIOERR_BASE + 27);
+MMIOERR_CF_ENTRY_NO_CORE =(MMIOERR_BASE + 28);
+MMIOERR_CF_WO_UNSUPPORTED =(MMIOERR_BASE + 29);
+MMIOERR_CF_ELEMENTS_OPEN =(MMIOERR_BASE + 30);
+MMIOERR_CF_NON_BND_FILE =(MMIOERR_BASE + 31);
+MMIOERR_CF_ENTRY_NOT_FOUND =(MMIOERR_BASE + 32);
+
+MMIOERR_DELETE_FAILED =(MMIOERR_BASE + 33);
+MMIOERR_OUTOFMEMORY =(MMIOERR_BASE + 34);
+
+MMIOERR_INVALID_DLLNAME =(MMIOERR_BASE + 35);
+MMIOERR_INVALID_PROCEDURENAME =(MMIOERR_BASE + 36);
+MMIOERR_MATCH_NOT_FOUND =(MMIOERR_BASE + 37);
+
+MMIOERR_SEEK_BEFORE_BEGINNING =(MMIOERR_BASE + 38);
+MMIOERR_INVALID_FILE =(MMIOERR_BASE + 39);
+MMIOERR_QOSUNAVAILABLE =(MMIOERR_BASE + 40);
+MMIOERR_MEDIA_NOT_FOUND =(MMIOERR_BASE + 41);
+
+MMIOERR_ERROR_IN_FRAME_DATA =(MMIOERR_BASE + 42);
+MMIOERR_INVALID_DIM_ALIGN =(MMIOERR_BASE + 43);
+MMIOERR_CODEC_NOT_SUPPORTED =(MMIOERR_BASE + 44);
+
+MMIOERR_UNSUPPORTED_FUNCTION =(MMIOERR_BASE + 45);
+MMIOERR_CLIPBRD_ERROR =(MMIOERR_BASE + 46);
+MMIOERR_CLIPBRD_ACTIVE =(MMIOERR_BASE + 47);
+MMIOERR_CLIPBRD_EMPTY =(MMIOERR_BASE + 48);
+MMIOERR_NEED_NEW_FILENAME =(MMIOERR_BASE + 49);
+MMIOERR_INVALID_TRACK_OPERATION=(MMIOERR_BASE + 50);
+MMIOERR_INCOMPATIBLE_DATA =(MMIOERR_BASE + 51);
+MMIOERR_ACCESS_DENIED =(MMIOERR_BASE + 52);
+MMIOERR_MISSING_FLAG =(MMIOERR_BASE + 53);
+MMIOERR_INVALID_ITEM_FLAG =(MMIOERR_BASE + 54);
+
+//*************************************/
+//* Real-Time MIDI Error Return Codes */
+//*************************************/
+
+MIDIERR_BASE =(MMIOERR_BASE + 500);
+
+MIDIERR_DUPLICATE_INSTANCE_NAME =(MIDIERR_BASE + 1);
+MIDIERR_HARDWARE_FAILED =(MIDIERR_BASE + 2);
+MIDIERR_INTERNAL_SYSTEM =(MIDIERR_BASE + 3);
+MIDIERR_INVALID_BUFFER_LENGTH =(MIDIERR_BASE + 4);
+MIDIERR_INVALID_CLASS_NUMBER =(MIDIERR_BASE + 5);
+MIDIERR_INVALID_CONFIG_DATA =(MIDIERR_BASE + 6);
+MIDIERR_INVALID_FLAG =(MIDIERR_BASE + 7);
+MIDIERR_INVALID_INSTANCE_NAME =(MIDIERR_BASE + 8);
+MIDIERR_INVALID_INSTANCE_NUMBER =(MIDIERR_BASE + 9);
+MIDIERR_INVALID_PARAMETER =(MIDIERR_BASE + 10);
+MIDIERR_INVALID_SETUP =(MIDIERR_BASE + 11);
+MIDIERR_NO_DRIVER =(MIDIERR_BASE + 12);
+MIDIERR_NO_DEFAULT_HW_NODE =(MIDIERR_BASE + 13);
+MIDIERR_NOT_ALLOWED =(MIDIERR_BASE + 14);
+MIDIERR_NOTIFY_MISSED =(MIDIERR_BASE + 15);
+MIDIERR_RESOURCE_NOT_AVAILABLE =(MIDIERR_BASE + 16);
+MIDIERR_SENDONLY =(MIDIERR_BASE + 17);
+MIDIERR_RECEIVEONLY =(MIDIERR_BASE + 18);
+
+TIMERERR_BASE =(MIDIERR_BASE + 100);
+
+TIMERERR_INVALID_PARAMETER =(TIMERERR_BASE + 1);
+TIMERERR_INTERNAL_SYSTEM =(TIMERERR_BASE + 2);
+
+
+//***********************************/
+//* User defined Error Return codes */
+//***********************************/
+
+USERERR_BASE =(MMIOERR_BASE + 1000);
+
+Const
+ FOURCC_ULTI:FOURCC=0;
+ FOURCC_RT21:FOURCC=0;
+ FOURCC_DIB :FOURCC=0;
+ FOURCC_R565:FOURCC=0;
+ FOURCC_R555:FOURCC=0;
+ FOURCC_R664:FOURCC=0;
+ FOURCC_RGB3:FOURCC=0;
+ FOURCC_BGR3:FOURCC=0;
+ FOURCC_RGB4:FOURCC=0;
+ FOURCC_BGR4:FOURCC=0;
+ FOURCC_LUT8:FOURCC=0;
+ FOURCC_LT12:FOURCC=0;
+ FOURCC_GREY:FOURCC=0;
+ FOURCC_GY16:FOURCC=0;
+ FOURCC_Y888:FOURCC=0;
+ FOURCC_Y2X2:FOURCC=0;
+ FOURCC_Y4X4:FOURCC=0;
+ FOURCC_YUV9:FOURCC=0;
+ FOURCC_Y644:FOURCC=0;
+ FOURCC_MONO:FOURCC=0;
+ FOURCC_Y422:FOURCC=0;
+ FOURCC_Y42B:FOURCC=0;
+ FOURCC_Y42D:FOURCC=0;
+ FOURCC_Y411:FOURCC=0;
+ FOURCC_VGA :FOURCC=0;
+
+Const
+ // FourCCs will be initialized in Initialization section
+ FourCC_RIFF : FourCC = 0;
+ FourCC_LIST : FourCC = 0;
+ FourCC_MEM : FourCC = 0;
+ FourCC_DOS : FourCC = 0;
+ FourCC_BND : FourCC = 0;
+ FourCC_FREE : FourCC = 0;
+ FourCC_DEL : FourCC = 0;
+ FourCC_CTOC : FourCC = 0;
+ FourCC_CGRP : FourCC = 0;
+ FourCC_CF : FourCC = 0;
+
+
+//****************************************************************************/
+//* */
+//* Module Name: AUDIO.H */
+//* */
+//* OS/2 2.0 Multimedia Extensions Audio Structures and definitions. */
+//* */
+//* Copyright (c) International Business Machines Corporation 1991, 1992 */
+//* All Rights Reserved */
+//* */
+//* Ported to FPC: CooL/2 Aka Andy Svirgunov. */
+//****************************************************************************/
+
+//*-------------------------------------------------------------------------*
+//* AUDIODD version level
+//-------------------------------------------------------------------------*/
+
+CONST
+ CURRENT_VERSION=$01020000;
+
+//*-------------------------------------------------------------------------*
+//* Control definitions
+//*-------------------------------------------------------------------------*/
+
+ AUDIO_IOCTL_CAT =$80;
+ AUDIO_INIT =$40;
+ AUDIO_STATUS =$41;
+ AUDIO_CONTROL =$42;
+ AUDIO_BUFFER =$43;
+ AUDIO_LOAD =$44;
+ AUDIO_WAIT =$45;
+ AUDIO_HPI =$46;
+ AUDIO_CAPABILITY =$48;
+
+ MIX_GETCONNECTIONS=$60;
+ MIX_SETCONNECTIONS=$61;
+ MIX_GETLINEINFO =$62;
+ MIX_GETCONTROL =$63;
+ MIX_SETCONTROL =$64;
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_INIT declarations and defines
+//*-------------------------------------------------------------------------*/
+
+ LOAD_PATH = 260;
+
+//* Values for AUDIO_INIT.sMode */
+
+ ADPCM =1; //* AVC type ADPCM */
+ PCM =2; //* Pulse Coded Modulation */
+ MU_LAW =3; //* mu-law */
+ MIDI =4; //* MIDI data */
+ A_LAW =5; //* a-law */
+ SOURCE_MIX=6; //* External audio source */
+ SPV2 =7; //* Speech Viewer/2 */
+ ADPCMXA =8; //* XA CD ROM */
+ SPV2BCPCM =25; //* Speech Viewer/2 */
+ SPV2PCM =26;
+ SPV2NONE =27;
+ IDLE =999;
+ CLAIM_HDWR=32000; //* Serialize access to hardware */
+
+//* Values for AUDIO_INIT.ulFlags */
+
+ FIXED =$00000001; // Fixed length data */
+ LEFT_ALIGNED =$00000002; // Left align bits on byte bndry */
+ RIGHT_ALIGNED =$00000004; // Right align bits on byte bndry*/
+ TWOS_COMPLEMENT =$00000008; // 2's complement data */
+ SIGNED =$00000010; // Signed data */
+ BIG_ENDIAN =$00000020; // MSB's first (motorola format) */
+ RIFF_DATATYPE =$00000040; // sMode contains a RIFF datatype*/
+ PITCH =$00100000; // Pitch control is supported */
+ INPUT =$00200000; // Input select is supported */
+ OUTPUT =$00400000; // Output select is supported */
+ MONITOR =$00800000; // Monitor is supported */
+ VOLUME =$01000000; // Volume control is supported */
+ VOLUME_DELAY =$02000000; // Volume delay is supported */
+ BALANCE =$04000000; // Balance control is supported */
+ BALANCE_DELAY =$08000000; // Balance delay is supported */
+ TREBLE =$10000000; // Treble control is supported */
+ BASS =$20000000; // Bass control supported */
+ BESTFIT_PROVIDED =$40000000; // bestfit returned */
+ LOAD_CODE =$80000000; // DSP load needed */
+
+//* Values for AUDIO_INIT.ulOperation */
+
+ OPERATION_PLAY =1;
+ OPERATION_RECORD =2;
+ PLAY_AND_RECORD =3;
+ ANALYSIS =6; // Speech Viewer/2 */
+ DISTANCE =7; // Speech Viewer/2 */
+ MIGRATION =8; // Speech Viewer/2 */
+
+//* Values for AUDIO_INIT.sReturnCode */
+
+ NO_PLAY =1;
+ NO_RECORD =2;
+ NO_RECORD_AND_PLAY =3;
+ INVALID_REQUEST =4;
+ CONFLICT =5;
+ OVERLOADED =6;
+ DOWNLEVEL_DD =7; // DD is down level from appl. */
+ DSP_LOAD_PENDING_ON_OTHER_TRK=8; // Other trk hasn't loaded dsp */
+
+ AUDIO_IGNORE =-1;
+
+//* Values for AUDIO_INIT.sDeviceID */
+
+ MINIDD =0;
+ ACPA =1;
+ MACPA =2;
+ MPU401 =3;
+ SOUND_BLASTER =4;
+ IMF =5;
+ PS1 =6;
+ PAS16 =7;
+
+//* AUDIO_INIT structure declaration */
+
+TYPE MCI_AUDIO_INIT = RECORD
+ lSRate:LongInt;
+ lBitsPerSRate:Longint;
+ lBsize:LongInt;
+ sMode:Integer;
+ sChannels:Integer;
+ lResolution:LongInt;
+ abLoadPath:ARRAY [0..LOAD_PATH] of CHAR;
+ ulFlags:LongInt;
+ ulOperation:LongInt;
+ sReturnCode:Integer;
+ sSlotNumber:Integer;
+ sDeviceID:Integer;
+ pvReserved:Pointer; //* MMPM2 uses this to pass back sysfilenum */
+ ulVersionLevel:LongInt;
+ end;
+TYPE PMCI_AUDIO_INIT = ^MCI_AUDIO_INIT;
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_DEVID declarations and defines
+//*-------------------------------------------------------------------------*/
+
+TYPE _MCI_AUDIO_DEVID = RECORD
+ ulDevType:LongInt;
+ ulDevNum:LongInt;
+ end;
+
+TYPE PMCI_AUDIO_DEVID = ^_MCI_AUDIO_DEVID;
+
+//* Input devices */
+
+CONST
+
+ NULL_INPUT =0;
+ STEREO_LINE_INPUT =1;
+ LEFT_LINE_INPUT =2;
+ RIGHT_LINE_INPUT =3;
+ MIC_INPUT =4;
+ BOOSTED_MIC_INPUT =5;
+ PHONE_LINE_INPUT =6;
+ HANDSET_INPUT =7;
+ SYNTH_INPUT =8;
+ DIGITAL_PHONE_LINE_INPUT=9;
+ DIGITAL_HANDSET_INPUT =10;
+ MIDI_IN_PORT =11;
+ LOOPBACK =11;
+ DEFAULT_INPUT =$FFFFFFFF;
+
+
+//* Output devices */
+
+ NULL_OUTPUT = 0;
+ STEREO_LINE_OUTPUT = 1;
+ LEFT_LINE_OUTPUT = 2;
+ RIGHT_LINE_OUTPUT = 3;
+ SPEAKER_OUTPUT = 4;
+ HEADSET_OUTPUT = 5;
+ PHONE_LINE_OUTPUT = 6;
+ HANDSET_OUTPUT = 7;
+ SYNTH_OUTPUT = 8;
+ DIGITAL_PHONE_LINE_OUTPUT= 9;
+ DIGITAL_HANDSET_OUTPUT = 10;
+ MIDI_OUT_PORT = 11;
+ DEFAULT_OUTPUT = $FFFFFFFF;
+
+//* Defined values for DevNum */
+
+ DEFAULT_DEVICE = 0;
+ DEVICE_1 = 1;
+ DEVICE_2 = 2;
+
+
+//*-------------------------------------------------------------------------*
+//* Valid Return codes for the ulSupport field of MCI_AUDIO_CAPS
+//*-------------------------------------------------------------------------*/
+ SUPPORT_SUCCESS =$00000000;
+ UNSUPPORTED_RATE =$00000001;
+ UNSUPPORTED_CHANNELS =$00000002;
+ UNSUPPORTED_BPS =$00000004;
+ UNSUPPORTED_DATATYPE =$00000008;
+ UNSUPPORTED_OPERATION =$00000010;
+
+
+TYPE _MCI_AUDIO_CAPS = RECORD
+ ulLength:LongInt; // in Structure length */
+ ulSamplingRate:LongInt; // in out Sampling rate to query */
+ ulChannels:LongInt; // in out Channels to query */
+ ulBitsPerSample:LongInt; // in out BPS to query */
+ ulDataType:LongInt; // in out RIFF Datatype to query */
+ ulOperation:LongInt; // in out OPERATION_PLAY or OPERATION_RECORD */
+ ulSupport:LongInt; // out BOOLEAN-does DD support this mode */
+ ulDataSubType:LongInt; // out Data-subtype to use */
+ ulResourceUnits:LongInt; // out Resource units this mode */
+ ulResourceClass:LongInt; // out Resource class for this mode */
+ ulBlockAlign:LongInt; // out Block alignment for this mode. */
+ fCanRecord:LongInt; // out Is recording possbile - this mode */
+ ulFlags:LongInt; // out */
+ ulCapability:LongInt; // out Capability of the device. */
+ end;
+
+TYPE PAUDIO_CAPS=^_MCI_AUDIO_CAPS;
+
+
+//*-------------------------------------------------------------------------*
+//* Valid Return codes for the ul field of MCI_AUDIO_CAPS
+//*-------------------------------------------------------------------------*/
+
+CONST
+
+SUPPORT_MIX =$00000001;// supports mixer functions */
+SUPPORT_RIFF_MODES =$00000002;// supports RIFF modes for AUDIO_INIT */
+SUPPORT_CAP =$80000000;// Capability IOCTL supported */
+
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_CHANGE declarations and defines
+//*-------------------------------------------------------------------------*/
+
+//* Values for AUDIO_CHANGE.lMonitor */
+
+MONITOR_OFF =0;
+MONITOR_UNCOMPRESSED =1;
+MONITOR_COMPRESSED =2;
+
+//* Values for AUDIO_CHANGE.lInput */
+
+HIGH_GAIN_MIC = 0;
+LINE_1 = 1;
+LINE_2 = 2;
+LINES_1AND2 = 3;
+LOW_GAIN_MIC = 4;
+ALL_LINES = $FFFF;
+INPUTS_LISTED = $5555;
+
+//* Values for AUDIO_CHANGE.lOutput */
+
+EXTERNAL_SPEAKER =1;
+INTERNAL_SPEAKER =2;
+OUTPUT_1 =4;
+OUTPUTS_LISTED =$5555;
+
+//* AUDIO_CHANGE structure declaration */
+
+TYPE _MCI_AUDIO_CHANGE = RECORD
+
+ pvDevInfo:Pointer;
+ lInput:LongInt;
+ lOutput:LongInt;
+ lMonitor:LongInt;
+ lVolume:LongInt;
+ lVolumeDelay:LongInt;
+ lBalance:LongInt;
+ lBalanceDelay:LongInt;
+ lTreble:LongInt;
+ lBass:LongInt;
+ lPitch:LongInt;
+ rInputList:ARRAY[0..8] OF _MCI_AUDIO_DEVID;
+ rOutputList:ARRAY[0..8] OF _MCI_AUDIO_DEVID;
+
+ prMoreInputs:PMCI_AUDIO_DEVID;
+ prMoreOutputs:PMCI_AUDIO_DEVID;
+ lGain:LongInt;
+ pvModeInfo:Pointer;
+ end;
+
+TYPE PMCI_AUDIO_CHANGE=^_MCI_AUDIO_CHANGE;
+
+TYPE MIDI_INFO = RECORD
+ sTempo:Integer;
+ sCPQN:Integer;
+ sMidiSwitches:Integer;
+ sReserved:ARRAY[0..5] OF Integer;
+ end;
+
+//*************************************************************************
+//* MIDI Switches
+//**************************************************************************/
+
+CONST
+
+ MIDI_THRU_THRU =0;
+ MIDI_THRU_OUT =1;
+
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_STATUS declarations and defines
+//*-------------------------------------------------------------------------*/
+
+//* Values for AUDIO_STATUS.ulOperation */
+
+ STOPPED =0;
+ PLAYING =1;
+ RECORDING =2;
+ PLAYING_AND_RECORDING =3;
+ UNITIALIZED =$FFFFFFFF;
+
+//* AUDIO_STATUS structure declaration */
+
+TYPE MCI_AUDIO_STATUS = RECORD
+ lSRate:LongInt;
+ lBitsPerSRate:LongInt;
+ lBsize:LongInt;
+ sMode:Integer;
+ sChannels:Integer;
+ ulFlags:longInt;
+ ulOperation:LongInt;
+ rAudioChange:_MCI_AUDIO_CHANGE;
+ end;
+
+TYPE PMCI_AUDIO_STATUS = MCI_AUDIO_STATUS;
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_CONTROL declarations and defines
+//*-------------------------------------------------------------------------*/
+
+//* Values for AUDIO_CONTROL.usIOCtlRequest */
+
+CONST
+
+ AUDIO_CHANGE =0;
+ AUDIO_START =1;
+ AUDIO_STOP =2;
+ AUDIO_PAUSE =3;
+ AUDIO_RESUME =4;
+
+//* Values for AUDIO_CONTROL.sReturnCode */
+
+AC_UNINITED = 1; // Device must be init'ed or loaded first */
+FULL_QUEUE = 2; // Maximum # requests exceeded */
+AC_UNPAUSED = 3; // Resume issued, but dev not paused */
+AC_UNSTARTED = 5; // Device must be started first */
+INVALID_INPUT_LIST = 7; // invalid change.input_list entry */
+INVALID_OUTPUT_LIST = 8; // invalid change.output_list entry */
+
+//* AUDIO_CONTROL structure declaration */
+
+TYPE MCI_AUDIO_CONTROL = RECORD
+ usIOCtlRequest:Integer;
+ pbRequestInfo:Pointer;
+ ulPosition:LongInt;
+ sReturnCode:Integer;
+ end;
+
+TYPE PMCI_AUDIO_CONTROL = MCI_AUDIO_CONTROL;
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_BUFFER declarations and defines
+//*-------------------------------------------------------------------------*/
+
+//* Values for AUDIO_BUFFER.ulFlags */
+
+CONST
+
+ AUDIO_UNDERRUN =1;
+ AUDIO_OVERRUN =2;
+
+//* Values for AUDIO_BUFFER.ulPositionType */
+
+ POS_MSECS =0;
+ MIDI_CLOCKS =1;
+ SMPTE_24 =24;
+ SMPTE_25 =25;
+ SMPTE_30DF =29;
+ SMPTE_30 =30;
+
+TYPE MCI_AUDIO_BUFFER = RECORD
+ ulFlags:LongInt;
+ ulReadBufSize:LongInt;
+ ulWriteBufSize:LongInt;
+ ulReadBufTime:LongInt;
+ ulWriteBufTime:LongInt;
+ ulReadBufMax:LongInt;
+ ulWriteBufMax:LongInt;
+ ulPosition:LongInt;
+ ulPositionType:LongInt;
+ lReadBufCap:LongInt;
+ lWriteBufCap:LongInt;
+ lRequestBufCap:LongInt;
+ end;
+
+TYPE PMCI_AUDIO_BUFFER =^MCI_AUDIO_BUFFER;
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_LOAD declarations and defines
+//*-------------------------------------------------------------------------*/
+
+//* Values for AUDIO_LOAD.ulFlags */
+
+CONST
+
+ LOAD_START =$01;
+ LOAD_END =$02;
+ LOAD_32BIT =$10;
+
+
+TYPE MCI_AUDIO_LOAD = RECORD
+ pbBuffer:^Char;
+ ulSize:LongInt;
+ ulFlags:LongInt;
+ end;
+
+TYPE PMCI_AUDIO_LOAD = MCI_AUDIO_LOAD;
+
+//*-------------------------------------------------------------------------*
+//* Track info declarations and defines
+//*-------------------------------------------------------------------------*/
+
+//* Track Info structure declaration */
+
+TYPE MCI_TRACK_INFO = RECORD
+ usMasterVolume:Integer;
+ usDitherPct:Integer; //* Percent of a bit dither during record */
+ usMasterVolumeDelay:Integer;
+ usMasterBalance:Integer;
+ usMasterBalanceDelay:Integer;
+ end;
+
+TYPE PMCI_TRACK_INFO = ^MCI_TRACK_INFO;
+
+
+//*-------------------------------------------------------------------------*
+//* IOBUFFER declarations and defines
+//*-------------------------------------------------------------------------*/
+
+CONST
+
+ STARTED =1;
+ PAUSED =2;
+
+TYPE _MCI_AUDIO_IOBUFFER = RECORD
+ lSize:LongInt;
+ pHead:^Char;
+ pTail:^Char;
+ lCount:LongInt;
+ ulPosition:LongInt;
+ lDelay:LongInt;
+ usRunFlags:Integer;
+ usSelInc:Integer;
+ pBuffer:^Char;
+ end;
+
+TYPE PMCI_AUDIO_IOBUFFER = ^_MCI_AUDIO_IOBUFFER;
+
+//*-------------------------------------------------------------------------*
+//* AUDIO_HPI declarations and defines
+//-------------------------------------------------------------------------*/
+
+CONST
+
+ CBXMIT =1;
+ CBREC =2;
+ CRTIMER =4;
+
+ EP_OPEN =0;
+ EP_CLOSE =1;
+ EP_READ =2;
+ EP_WRITE =3;
+ EP_INIT =4;
+ EP_STATUS =5;
+ EP_CONTROL =6;
+ EP_BUFFER =7;
+ EP_LOAD =8;
+ EP_WAIT =9;
+
+
+
+TYPE MCI_AUDIO_HPI = RECORD
+ pvEntry :procedure;
+ pvCallBack:procedure;
+// VOID (FAR *pvEntry)();
+// VOID (FAR *pvCallBack)();
+ prXBuff:PMCI_AUDIO_IOBUFFER;
+ prRBuff:PMCI_AUDIO_IOBUFFER;
+ usFlags:Integer;
+ end;
+
+TYPE PMCI_AUDIO_HPI = ^MCI_AUDIO_HPI;
+
+//**************************/
+//* AUDIO_UPDATE Structure */
+//**************************/
+TYPE AUDIO_UPDATE = RECORD
+
+ iobuf_type:Char; //* 0 - XMITIO, 1 - RECIO to be updated */
+ buffer_address:^Char; //* address to buffer to be added to array */
+ buffer_length:LongInt; //* length of buffer to be added */
+ rc:Integer; //* return code */
+ reserved:Pointer; //* future use */
+ end;
+
+TYPE UPDATE = ^AUDIO_UPDATE;
+
+//* audio_update.iobuf_type definitions */
+
+CONST
+
+ XMIT_IOBUF =0;
+ REC_IOBUF =1;
+
+//* audio_update.rc definitions */
+ MAX_NUM_BUFFERS_REACHED =9;
+ UPDATE_GENERAL_FAILURE =10;
+ INVALID_BUFFER_LENGTH =11;
+
+
+//****************************************************************************/
+//* */
+//* Module Name: CDAUDIO.H */
+//* */
+//* FUNCTION: This file contains the macro definition and common record */
+//* structures used between the CD Audio MCI Driver, its VSDs */
+//* (Vendor Specific Drivers), and the CD look-up table, */
+//* MMPMCD.INI. */
+//* */
+//* Copyright (c) International Business Machines Corporation 1991 - 1993 */
+//* All Rights Reserved */
+//****************************************************************************/
+//* */
+//* Ported to FPC: CooL/2 Aka Andy Svirgunov. */
+//* */
+//****************************************************************************/
+
+//*******************************************************************/
+//* CD MCD and VSD values and inter-modual communications */
+//*******************************************************************/
+
+
+//**********************************/
+//* Macro Definitions */
+//**********************************/
+
+Const
+
+UPC_SIZE = 7; //* UPC code size, CD serial number */
+CDMCD_CUEPOINT_MAX = 20; //* maximum number of cuepoints */
+CDROM_SPEC_START = 6000; //* 2 seconds, greatest min start address */
+MCI_INTERNAL_MESSAGES_START = 1000;
+
+//*************************************************************************/
+//* Internal messages between the MCI Driver and the VSD. */
+//*************************************************************************/
+
+MCIDRV_REGISTER_DISC =MCI_INTERNAL_MESSAGES_START + 1;
+MCIDRV_REGISTER_DRIVE =MCI_INTERNAL_MESSAGES_START + 2;
+MCIDRV_REGISTER_TRACKS =MCI_INTERNAL_MESSAGES_START + 3;
+MCIDRV_CD_READ_LONG =MCI_INTERNAL_MESSAGES_START + 4;
+MCIDRV_CD_SET_VERIFY =MCI_INTERNAL_MESSAGES_START + 5;
+MCIDRV_CD_STATUS_CVOL =MCI_INTERNAL_MESSAGES_START + 6;
+
+
+//*************************************************************************/
+//* Internal callback routine from the VSD to the MCI Driver. */
+//*************************************************************************/
+
+//typedef VOID (*PFNCDMCD) (DWORD, DWORD, DWORD);
+
+
+//***********************************/
+//* CDAudRegister record structures */
+//***********************************/
+
+TYPE MCI_CD_ID = Record //* ID a disc, used to verify a disc change */
+ //* must stay at 8 bytes to equal size of UPC */
+ Mode:byte; //* mode, 0=UPC, 1=ID */
+ wTrack1:word; //* address of track one in MMTIME */
+ NumTracks:byte; //* number of tracks */
+ dwLeadOut:word; //* address of lead out track */
+ end;
+
+TYPE MCI_CD_REGDRIVE_PARMS=RECORD //* CD-ROM Drive information, determines capabilities */
+
+ wCaps:WORD; //* capabilities */
+ dwPrerollType:WORD; //* preroll type */
+ dwPrerollTime:WORD; //* preroll time */
+ dwMinStartTime:WORD; //* minimum starting time */
+ dwCDMCDID:WORD; //* CD MCD ID for instance */
+// pCDMCDReturn:PFNCDMCD; //* addr of CD MCD Return function */
+ end;
+
+//*************************************************/
+//* These flags are valid for the wCaps Field */
+//*************************************************/
+CONST
+
+CDVSD_CAP_CAN_RECORD =$0001; //* Can record audio */
+CDVSD_CAP_HAS_AUDIO =$0002; //* Can play audio */
+CDVSD_CAP_HAS_VIDEO =$0004; //* Can play video */
+CDVSD_CAP_CAN_CLSDOOR =$0008; //* Can retract tray/close door */
+CDVSD_CAP_CAN_EJECT =$0010; //* Can eject disc */
+CDVSD_CAP_CAN_STREAM =$0020; //* Can stream */
+CDVSD_CAP_HAS_DAC =$0040; //* Can process internal */
+CDVSD_CAP_CAN_LOCK =$0080; //* Can disable manual eject */
+CDVSD_CAP_CAN_VOLUME =$0100; //* Can manipulate volume settings */
+CDVSD_CAP_CAN_REVERSE =$0200; //* Can play in reverse */
+CDVSD_CAP_CAN_V_SPEED =$0400; //* Can vary play speed */
+CDVSD_CAP_CAN_CUE =$0800; //* Can read sequent. after break */
+ //* Used for Cue, Pause, and Seek */
+
+
+TYPE MCI_CD_REGDISC_PARMS = RECORD //* Information about the disc */
+
+ LowestTrackNum:BYTE; //* lowest track number */
+ HighestTrackNum:BYTE; //* highest track number */
+ UPC:ARRAY [0..UPC_SIZE] of BYTE; //* upc, 13 BCD + 4bit 0 */
+ DiscID:MCI_CD_ID; //* Disc ID */
+ end;
+
+TYPE MCI_CD_REGTRACK_REC=RECORD //* Information about each track */
+
+ TrackNum:BYTE; //* track number */
+ dwStartAddr:WORD; //* starting address in MMTIME */
+ dwEndAddr:WORD; //* ending address */
+ TrackControl:BYTE; //* track control information */
+ end;
+
+TYPE MCI_CD_REGTRACKS_PARMS=RECORD //* Track information, used to verify address */
+ TrackRecArr:^MCI_CD_REGTRACK_REC; //* ptr to array of track recs */
+ dwBufSize:WORD; //* size of buffer */
+ end;
+
+//********************************************/
+//* Environment settings to save and restore */
+//********************************************/
+
+TYPE MCIDRV_CD_SAVE_PARMS=RECORD
+ dwPosition:WORD; //* current position in MMTIME */
+ dwEndPlay:WORD; //* end play position */
+ dwMode:WORD; //* Play mode: playing, paused, etc. */
+ dwLevel:WORD; //* volume levels */
+ dwVSDData:WORD; //* Extra VSD data storage area */
+ end;
+
+//********************************************/
+//* Read Long (2352-Byte) Sectors */
+//********************************************/
+
+//**************************************************************************/
+//* Flag for the MCIDRV_CD_READ_LONG message */
+//* Default addressing mode for the dwFrom field is Hardware Red Book. */
+//* Absolute sector addressing for ISO-9660, or High Sierra Group */
+//* requires a flag, as does an MMTIME address. */
+//**************************************************************************/
+
+CONST
+
+MCI_CD_READLONG_HSG =$00000100;
+MCI_CD_READLONG_MMTIME =$00000200;
+
+TYPE MCI_CD_READLONG_PARMS=RECORD
+ dwFrom:WORD; //* read from this position */
+ wCount:WORD; //* Number of sectors to read */
+ lpstrReturn:^CHAR; //* Pointer to return buffer */
+ dwRetSize:WORD; //* Return buffer size */
+ end;
+
+
+
+//*******************************************************************/
+//* CD Table INI file, MMPMCD.INI, values */
+//*******************************************************************/
+
+//*******************************************************************/
+//* Capability Flags I from the CD drive look-up table, MMPMCD.INI */
+//*******************************************************************/
+
+CONST
+
+CDHW_CAP_CAN_EJECT =$00000001; //* Can software eject disc */
+CDHW_CAP_CAN_LOCK =$00000002; //* Can lock drive/disable eject */
+CDHW_CAP_READS_RAW =$00000004; //* Can read raw sectors */
+CDHW_CAP_CAN_WRITE =$00000008; //* Can write to disc */
+CDHW_CAP_CAN_PLAY =$00000010; //* Can play CD-DA tracks */
+CDHW_CAP_CAN_INTERLEV =$00000020; //* Supports ISO-9660 interleaving */
+CDHW_CAP_CAN_PREFETCH =$00000080; //* Can prefetch internally */
+CDHW_CAP_MANIP_AUDIO =$00000100; //* Can manipulte audio channels */
+CDHW_CAP_USES_REDBOOK =$00000200; //* Can use Red Book mode */
+CDHW_CAP_READS_XA =$00000400; //* Can read CD-ROM/XA data */
+CDHW_CAP_CONT_READS =$00000800; //* Continues to read DA after stop */
+CDHW_CAP_CAN_REVERSE =$00001000; //* Can play in reverse */
+CDHW_CAP_READS_CDDA =$40000000; //* Can read CD-DA audio tracks */
+
+
+//*******************************************************************/
+//* Capability Flags II from the CD drive look-up table, MMPMCD.INI */
+//*******************************************************************/
+
+CDHW_VOL_DEP_MASK =$00000007; //* Volume dependency mask */
+CDHW_VOL_DEP_NONE = 0; //* Volume without dependency */
+CDHW_VOL_DEP_HIGH = 2; //* Volume is highest value */
+CDHW_VOL_DEP_LOW = 3; //* Volume is lowest value */
+CDHW_VOL_DEP_LEFT = 4; //* Volume is left volume */
+CDHW_VOL_DEP_RIGHT = 5; //* Volume is right volume */
+CDHW_VOL_INDEP_MUTE =$00000008; //* Mute has no dependency */
+CDHW_CAP_LOCK_MOUNT =$00000010; //* Can only lock when mounted */
+CDHW_CAP_PLAY_VIDEO =$00000020; //* Can play video */
+CDHW_CAP_MODAL_ONLY =$00000040; //* Stop req to interrupt PLAY */
+CDHW_CAP_SUP_SEEK =$00000080; //* Supports SEEK IOCTL */
+CDHW_CAP_SUP_UPC =$00000100; //* Supports UPC IOCTL */
+CDHW_CAP_SUP_SUBCHAN =$00000200; //* Supports sub-channel IOCTL */
+CDHW_CAP_CAN_CLS_TRAY =$00000400; //* Can close door/retract caddy */
+CDHW_CAP_NO_STREAM =$00001000; //* Cannot stream CD-DA when PDD */
+ //* says it can */
+CDHW_CAP_VAR_PLAY =$80000000; //* Supports variable speeds */
+
+//* INI file record structure */
+CDINI_APPSIZE = 8; //* Application name size */
+CDINI_KEYSIZE = 16; //* Key name size */
+CDINI_VSD_NAME_SIZE = 8; //* size of file name */
+VOLUME_CONTROL = 101; //* num of values, 0% - 100% */
+
+
+TYPE MMPMCD_REC=RECORD
+ usEntryVer:INTEGER; //* Entry version */
+ ulCaps1:LONGINT; //* Capability flag I */
+ ulCaps2:LONGINT; //* Capability flag II */
+ VSDName:ARRAY [0..CDINI_VSD_NAME_SIZE] of CHAR; //* DLL name for VSD */
+ ulMinStart:LONGINT; //* Min starting addr, 0x00MMSSFF */
+ usVolCnt:INTEGER; //* volume level counter */
+ ausVolValues:ARRAY [0..VOLUME_CONTROL] of INTEGER; //* volume control values */
+ end;
+
+//*************************START OF SPECIFICATIONS **************************/
+// */
+// Module NAME: VIDEO.H */
+// */
+// OS/2 2.0 Multimedia Extensions Video structures and definitions */
+// */
+// Copyright (c) International Business Machines Corporation 1993 */
+// All Rights Reserved */
+//***************************************************************************/
+// Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+// 14.11.2002 */
+// */
+//************************* END OF SPECIFICATIONS ***************************/
+
+TYPE _VIDEO_FRAME_HDR = RECORD // vfh */
+ FrameNumber : LongInt; // relative frame number */
+ FramesSkipped : LongInt; // no. frames skipped between this and last frames */
+ StreamTime : LongInt; // stream time in milliseconds */
+ FrameSize : LongInt; // size in bytes */
+ SHparm1 : LongInt; // used by stream handler */
+ reserved3 : LongInt; // unused */
+ reserved2 : LongInt; // unused */
+ reserved1 : LongInt; // unused */
+ end;
+
+TYPE PVIDEO_FRAME_HDR = ^_VIDEO_FRAME_HDR;
+
+//*************************START OF SPECIFICATIONS **************************/
+// */
+// COPYRIGHT: IBM - International Business Machines */
+// Copyright (c) IBM Corporation 1991, 1992, 1993 */
+// All Rights Reserved */
+// */
+// */
+// SOURCE FILE NAME: UMFORMAT.H */
+// */
+// DESCRIPTIVE NAME: Ultimotion File Format Headers (Beta) */
+// */
+// An Ultimotion file consists of interlevaed audio and video and text */
+// chunks within the data list chunk. */
+// */
+// A file may contain interleaved audio chunks or the soundtrack may */
+// be contained in a seperate file specified in the header chunk, or */
+// there may be no associated soundtrack (a silent movie). Multiple */
+// audio tracks are supported by this file format, either interleaved */
+// or in seperate files. Only one video track, track 0, is supported in */
+// a single file. Audio tracks are identified by a track number, with */
+// the first audio track being track 1. */
+// */
+// If a file specifies both interleaved audio tracks and external */
+// audio tracks (.WAV files), the external audio tracks are numbered */
+// consecutively following the interleaved audio tracks. For */
+// example, if a file specifies two interleaved audio tracks and two */
+// external audio tracks, the interleaved audio tracks will be tracks */
+// 0 and 1, and the external audio tracks will be tracks 2 and 3. */
+// Note that tracks can carry distinct audio information such as */
+// multiple languages, and that stereo audio can be carried in a */
+// single track. */
+// */
+//************************* END OF SPECIFICATIONS ***************************/
+
+// The hex fourcc value is also the SPCBKEY.ulDataSubType value for the */
+// Ultimotion file format - OS2MEDEF.H */
+//***************************************************************************/
+// Ultimotion File Format: */
+// */
+// */
+// Conventions used in this format: */
+// */
+// - A file is a collection of chunks */
+// - The first ULONG in a chunk is the chunk type (chunk ID) */
+// - The second ULONG in a chunk is the length of the chunk, */
+// including the header and the data, but excluding the chunk */
+// ID and chunk length. */
+// - For each interleaved audio track there is one audio frame that */
+// corresponds to each video frame */
+// - An audio frame has the same duration as its corresponding video */
+// frame */
+// - Audio frames always follow their corresponding video frame, and */
+// as such preceed the next video frame */
+// */
+// Legend: */
+// [<element name>] optional */
+// <element name> 1 */
+// <element name>... 1 or more */
+// [<element name>]... 0 or more */
+// */
+// */
+// */
+// SMV form */
+// --------- */
+// */
+// <RIFF( 'ummv' */
+// <LIST( 'umhl' - Header LIST */
+// <Videoheader-ck> - Video header chunk */
+// <videotitle-ck>... - Video title chunk(s) */
+// - */
+// [<LIST( 'umal' - Audio LIST(s) */
+// {<extaudiofilename-ck> | - Ext. WAV files */
+// <audioheader-ck>} - Audio header */
+// <audiotitle-ck>...)>]... - Audio title */
+// - */
+// [<LIST( 'umtl' - Text LIST */
+// <textheader-ck>...)>])> - Text header */
+// - */
+// <LIST( 'umfd' - Frame data LIST */
+// <LIST( 'umcd' { - Chapter data LIST */
+// <videoframe-ck> - Video frame */
+// [<audioframe-ck>] - Audio frame */
+// [<textframe-ck>]}...)>...) - Text frame */
+// - */
+// [<LIST( 'umci' - Chap index table LIST */
+// <LIST( 'umce' - Chap index entry LIST */
+// <chapterheader-ck> - Chapter index hdr */
+// <chapttitle-ck>... - Chapter title */
+// <frameindex-ck>)>...)>])> - frame index */
+// - table */
+// */
+//***************************************************************************/
+CONST
+
+ UMAUDIOFILENAMELENGTH =60;
+ SIZEOF_FORM =4;
+
+// ULTIMOTION FORMS */
+ UMFORM_MOVIE = 'ummv';
+ UMFORM_HEADERLIST = 'umhl';
+ UMFORM_AUDIOHDRLIST = 'umal';
+ UMFORM_TEXTHDRLIST = 'umtl';
+ UMFORM_FRAMEDATALIST = 'umfd';
+ UMFORM_CHAPTERDATALIST = 'umcd';
+ UMFORM_CHAPTERTABLELIST = 'umci';
+ UMFORM_CHAPTERENTRYLIST = 'umce';
+
+// byte swapped hex defines for ulong assignments... */
+ HEX_UMFORM_MOVIE =$766d6d75; // vmmu */
+ HEX_UMFORM_HEADERLIST =$6c686d75; // lhmu */
+ HEX_UMFORM_AUDIOHDRLIST =$6c616d75; // lamu */
+ HEX_UMFORM_TEXTHDRLIST =$6c746d75; // ltmu */
+ HEX_UMFORM_FRAMEDATALIST =$64666d75; // dfmu */
+ HEX_UMFORM_CHAPTERDATALIST =$64636d75; // dcmu */
+ HEX_UMFORM_CHAPTERTABLELIST =$69636d75; // icmu */
+ HEX_UMFORM_CHAPTERENTRYLIST =$65636d75; // ecmu */
+
+// ULTIMOTION CHUNK IDS */
+ UMID_VIDEOHEADER ='umvh';
+ UMID_EXTAUDIONAME ='umea';
+ UMID_AUDIOHEADER ='umah';
+ UMID_TEXTHEADER ='umth';
+ UMID_VIDEOTITLE ='umvt';
+ UMID_AUDIOTITLE ='umat';
+ UMID_TEXTFRAME ='umtf';
+ UMID_VIDEOFRAME ='umvf';
+ UMID_AUDIOFRAME ='umaf';
+ UMID_CHAPTERHEADER ='umch';
+ UMID_CHAPTERTITLE ='umct';
+ UMID_FRAMETABLE ='umfi';
+
+// byte swapped hex defines for ulong assignments... */
+ HEX_UMID_VIDEOHEADER =$68766d75; // hvmu */
+ HEX_UMID_EXTAUDIONAME =$61656d75; // aemu */
+ HEX_UMID_AUDIOHEADER =$68616d75; // hamu */
+ HEX_UMID_TEXTHEADER =$68746d75; // htmu */
+ HEX_UMID_VIDEOTITLE =$74766d75; // tvmu */
+ HEX_UMID_AUDIOTITLE =$74616d75; // tamu */
+ HEX_UMID_TEXTFRAME =$66746d75; // ftmu */
+ HEX_UMID_VIDEOFRAME =$66766d75; // fvmu */
+ HEX_UMID_AUDIOFRAME =$66616d75; // famu */
+ HEX_UMID_CHAPTERHEADER =$68636d75; // hcmu */
+ HEX_UMID_CHAPTERTITLE =$74636d75; // tcmu */
+ HEX_UMID_FRAMETABLE =$69666d75; // ifmu */
+
+
+
+//***************************************************************************/
+// CHUNK HEADER STRUCTURE - APPEARS AT START OF EACH CHUNK */
+//***************************************************************************/
+type UMCHUNKHEADER =record // umch */
+ ulChunkID:LongInt; // ID for this chunk */
+ ulChunkLength:LongInt; // Length of chunk that follows */
+ end;
+ PUMCHUNKHEADER=^UmChunkHeader; // pumch */
+
+
+//***************************************************************************/
+// VIDEO HEADER CHUNK - */
+// */
+// The UMVIDEOHEADER structure is followed by a list of */
+// usInterleavedTracks null-terminated external audio (.WAV) file */
+// names. The audio file name fields are fixed size to better enable */
+// changing the file names without re-writing the file. */
+//***************************************************************************/
+ UMVIDEOHEADER = record // umvh */
+ ulTotalDuration:LongInt; // Video duration in MMTIME */
+ ulMaxFrameSize:LongInt; // Max video frame size in bytes */
+ ulMaxAvgDataRate:LongInt; // Max avergage data rate */
+ ulMaxBurstInterval:LongInt; // Max interval for max data rate */
+ ulCompressionRatioX100:LongInt; // Compression ratio */
+ ulPosterFrameOffset:LongInt; // Poster for video (from beginning) */
+ usMaxFrameX:Word; // Max horizontal frame size */
+ usMaxFrameY:Word; // Max vertical frame size */
+ usNomFrameDuration:Word; // Nominal recorded frame duration */
+ usNomIFrameInterval:word; // I-frame every this many frames */
+ usNumCompressionTypes:Word; // number of different CODECS used in file */
+ aulCompressionTypes:Array [0..20] of LongInt;// List of CODECs found in this file */
+ Reserved:Array [0..16] of LongInt; // Reserved space */
+ end;
+ PUMVIDEOHEADER=^UMVIDEOHEADER; // pumvh */
+
+
+//***************************************************************************/
+// EXTERNAL AUDIO FILE NAME CHUNK */
+//***************************************************************************/
+ EXTAUDIONAME = record // umea */
+ usTrackNumber:Word; // Audio track number for this format */
+ szFileName:Array [0..UMAUDIOFILENAMELENGTH] of Char;
+ end;
+ PEXTAUDIONAME=^EXTAUDIONAME; // pumea */
+
+
+//***************************************************************************/
+// INTERLEAVED AUDIO TRACK HEADER CHUNK */
+//***************************************************************************/
+ AUDIOHEADER = record // umah */
+ usTrackNumber:Word; // Audio track number for this format */
+ usFormatTag:Word; // Type of wave format */
+ usChannels:Word; // Number of channels (1=mono 2=stereo)*/
+ ulSamplesPerSec:LongInt; // Sampling rate */
+ ulAvgBytesPerSec:LongInt; // Avg bytes per sec */
+ usBlockAlign:Word; // Block alignment in bytes */
+ usBitsPerSample:Word; // Bits per sample */
+ usCountryCode:Word; // Country code for this title */
+ end;
+ PAUDIOHEADER=^AUDIOHEADER; // pumah */
+
+
+//***************************************************************************/
+// INTERLEAVED TEXT TRACK HEADER CHUNK */
+//***************************************************************************/
+ TEXTHEADER = record // umth */
+ usTrackNumber:Word; // Audio track number for this format */
+ usCountryCode:Word; // Country code for this title */
+ end;
+ PTEXTHEADER=^TEXTHEADER; // pumth */
+
+
+//***************************************************************************/
+// TITLE CHUNK */
+//***************************************************************************/
+ TITLE =record // ttl */
+ usCountryCode:Word; // Country code for this title */
+ szTitle:Array [0..1] of Char; // Video title null-terminated */
+ end;
+ PTITLE=^TITLE; // pttl */
+
+
+//***************************************************************************/
+// AUDIO FRAME CHUNK */
+//***************************************************************************/
+ AUDIOFRAME =record // umaf */
+ usTrackNumber:Word; // audio track number */
+ bData:Array [0..1] of Byte;
+ end;
+ PAUDIOFRAME=^AUDIOFRAME; // pumaf */
+
+
+//***************************************************************************/
+// TEXT FRAME CHUNK */
+//***************************************************************************/
+ TEXTFRAME =record // umtf */
+ usTrackNumber:Word; // Text track number */
+ szText:Array [0..1] of Char; // Text null-terminated */
+ end;
+
+
+//***************************************************************************/
+// VIDEO FRAME CHUNK */
+//***************************************************************************/
+ VIDEOFRAME = record // umvf */
+ usTrackNumber:Word; // Video track number (0L only for now) */
+ ulDuration:LongInt; // Frame duration in MMTIME */
+ ulFrameFlags:LongInt; // Frame flags */
+ ulCompressionType:LongInt; // Compression type */
+ bData:Array [0..1] of Byte;
+ end;
+ PVIDEOFRAME =^VIDEOFRAME; // pumvf */
+
+// ulCompressionType defines: */
+CONST
+
+UM_VIDEO_COMPRESSION_TYPE_RAWRGB565 =1;
+UM_VIDEO_COMPRESSION_TYPE_RAWUVY556 =2;
+UM_VIDEO_COMPRESSION_TYPE_RAWYUV411 =3;
+UM_VIDEO_COMPRESSION_TYPE_BH146 =10; // BETA-RGB16 */
+UM_VIDEO_COMPRESSION_TYPE_BH211SCS4 =11; // 1.1 YUV16 subsampled chroma sub4 */
+UM_VIDEO_COMPRESSION_TYPE_BH211UCS4 =12; // unique chroma sub4 */
+
+// ulVideoFrameFlags defines: */
+ UM_VIDEO_FRAME_FLAG_DELTAFRAME =$1; // 1: delta frame, 0: I frame */
+ UM_VIDEO_FRAME_FLAG_SCENECHANGE =$2;
+
+
+//***************************************************************************/
+// CHAPTER INDEX HEADER (header for each entry in chapter index LIST */
+//***************************************************************************/
+ TYPE UMCHAPTERINDEX = record // umch */
+ ulChapterOffset:LongInt; // Offset from beginning of file */
+ ulChapterDuration:LongInt; // Duration of chapter in MMTIME */
+ ulPosterFrameOffset:LongInt; // Poster for chapter (offset from chapter)*/
+ end;
+ PUMCHAPTERINDEX =^UMCHAPTERINDEX; // pumch */
+
+
+//***************************************************************************/
+// FRAME INDEX ENTRY */
+//***************************************************************************/
+ UMFRAMEINDEX = record // umfi */
+ ulFrameOffsets:LongInt; // Offset from beginning of chapter */
+ ulFrameFlags:LongInt; // Frame flags (Refer to frame header) */
+ end;
+ PUMFRAMEINDEX =^UMFRAMEINDEX; // pumfi */
+
+
+//***************************************************************************/
+// */
+// Module Name: SPCB.H */
+// */
+// OS/2 2.0 Multimedia Extensions Sync/Stream Manager Stream Protocol */
+// Control Block Definitions. */
+// */
+// Copyright (c) International Business Machines Corporation 1991, 1992 */
+// All Rights Reserved */
+//--------------------------------------------------------------------------*/
+// Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+// 14.11.2002 */
+// */
+//***************************************************************************/
+
+//*********************************************
+// *
+// * SPCBKEY - Stream Protocol Key
+// *
+// **********************************************/
+//TYPE
+// MMTIME = Cardinal;
+
+ spcbKey = record
+ ulDataType : LongInt;
+ ulDataSubType : LongInt;
+ ulIntKey : LongInt; // Generated internal key
+ end;
+// pspcbKey = ^spcbKey;
+
+//*********************************************
+// *
+// * SPCB - Stream Protocol Control Block
+// *
+// **********************************************/
+ _spcb = record
+ ulSPCBLen : LongInt; // SPCB struture length
+ spcbkey : SPCBKEY;
+ ulDataFlags : LongInt; // Data type flags
+ ulNumRec : LongInt; // Max # records/buffer (Only used for Split streams)
+ ulBlockSize : LongInt; // Block alignment in bytes.
+ ulBufSize : LongInt; // Buffer size (SSM allocated buffers) must be
+ // a multiple of Block size
+ ulMinBuf : LongInt; // Minimum number of buffers needed to stream
+ ulMaxBuf : LongInt; // Maximum number of buffers needed to stream
+ ulSrcStart : LongInt; // # of EMPTY buffers required to start Source
+ ulTgtStart : LongInt; // # of FULL buffers required to start Target
+ ulBufFlags : LongInt; // Handler Protocol negotiation flags
+ ulHandFlags : LongInt; // Handler Protocol flags
+ mmtimeTolerance : mmTime; // Sync tolerance value...Used as check by SSM
+ // to determine whether to send a sync pulse
+ // to this specific slave Stream Handler.
+ // Algorithm:
+ // diff = abs(master time - slave time)
+ // if diff >= tolerance
+ // then send sync pulse
+ // (Valid only for Slave stream handlers)
+ mmtimeSync : mmTime; // Used to save sync pulse generation granularity
+ // if the master uses the Stream Manager Timer.
+ // if SpiSetSync passed NULL value for sync gran
+ // then use this default value. (since hardware
+ // must have it's own interrupt time interval.
+ // (Valid only for Master stream handlers)
+ ulBytesPerUnit : LongInt; // Bytes/unit of time. This is used to do seeks
+ // on linear data that is not compressed or
+ // of variable length.
+ mmtimePerUnit : mmTime; // The amount of mmtime each unit represents.
+ // A unit can be a second, minute or whatever.
+ end;
+ pspcb = ^_spcb;
+
+const
+ spcb_max_buf_Size = 1024*1024; // Largest buffer size in bytes
+
+
+//******************
+// * SPCB_ulDataFlags:
+// *******************/
+
+ // SPCB_ulDataFlags:
+ spcbData_CueTime = $0002; // This data type can support time cue points
+ spcbData_CueData = $0004; // This data type can support data cue points
+
+ spcbData_Seek = $0000; // Seeks can be performed on this data type.
+ spcbData_NoSeek = $0008; // NO seeks can be performed on this data type.
+ spcbData_YieldTime = $0010; // The ulBytes per unit field is used for a millisecond value
+ // It represents the amount of yield time between reads of
+ // each buffer. If this bit is set, the value of ulBytesPerUnit
+ // is used as input to DosSleep to yield for that period of time
+ ValidDataFlags = spcbData_CueTime OR spcbData_CueData OR
+ spcbData_YieldTime OR spcbData_NoSeek;
+
+
+//*******************
+//* SPCB_ulBufFlags:
+//********************/
+
+ // SPCB_ulBufFlags:
+ spcbBuf_USERPROVIDED = $0001; // User provides buffers for stream
+ // SSMgr will not allocate buffers,
+ // but must lock down provided buffers,
+ // so this will affect performance!!
+ // (Source Handler only)
+ spcbBuf_FIXEDBUF = $0002; // Buffer size is fixed for this data type
+ // in this handler. Can not be used
+ // with the spcbBuf_USERPROVIDED flags.
+ spcbBuf_NONCONTIGUOUS = $0004; // Buffer do not need to be contiguous
+ // in physical memory.
+ spcbBuf_INTERLEAVED = $0008; // Stream buffers can be interleaved.
+ // Can not be use with the
+ // spcbBuf_USERPROVIDED flag.
+ // (Source Handler only)
+ spcbBuf_MAXSIZE = $0010; // ulBufSize is the maximum size that
+ // can be used by this stream handler
+ spcbBuf_16MEG = $0020; // The Stream buffers may be allocated
+ // above the 16 Meg line. This is used
+ // by stream handlers that can support
+ // greater than 16 Megabyte addresses.
+ spcbBuf_FIXEDBLOCK = $0040; // Use the ulBlockSize field to represent
+ // the size of the IO reads that should
+ // be performed (Interleaved streams)
+ ValidBufFlags = spcbBuf_UserProvided OR spcbBuf_FixedBuf OR
+ spcbBuf_NonContiguous OR spcbBuf_Interleaved OR
+ spcbBuf_16Meg OR spcbBuf_FixedBlock OR
+ spcbBuf_MaxSize;
+
+//******************
+// * SPCB_ulHandFlags:
+// *******************/
+ // SPCB_ulHandFlags:
+ spcbHand_genSync = $0001; // (INPUT FROM HANDLER ONLY)
+ // This handler can generate sync pulses
+ // if it is the master.
+ spcbHand_RcvSync = $0002; // (INPUT FROM HANDLER ONLY)
+ // This handler can receive sync pulses
+ // if it is a slave
+ spcbHand_Timer = $0004; // Use Stream Manager Timer for Sync
+ spcbHand_NonStream = $0008; // Stream Handler is non-streaming
+ spcbHand_GenTime = $0010; // This handler contains real
+ // stream time. The handler that
+ // supports the SpiGetTime, data/time
+ // cue point calls for this stream.
+ spcbHand_NoPreRoll = $0020; // This stream can not be prerolled.
+ // (i.e. recording streams)
+ spcbHand_NoSync = $0040; // This stream can be group into a
+ // sync group, but does not send or
+ // receive sync pulses.
+ spcbHand_Phys_Seek = $0080; // This handler does a seek to a physical
+ // device or memory not just a time adjustment.
+ // (ssm will always call this handler first on
+ // an SpiSeekStream call).
+
+ ValidHandFlags = spcbHand_GenSync OR spcbHand_RcvSync OR
+ spcbHand_Timer OR spcbHand_NonStream OR
+ spcbHand_GenTime OR spcbHand_NoPreRoll OR
+ spcbHand_NoSync OR spcbHand_Phys_Seek;
+
+//**************************************************************************\
+//
+// Module Name: SHDD.H
+//
+// OS/2 2.0 Multimedia Extensions Stream Handler Device Driver Interfaces
+// Block defintions.
+//
+// Copyright (c) International Business Machines Corporation 1990,1991
+// All Rights Reserved
+// -------------------------
+// Ported by Andry Svirgunov
+//
+//**************************************************************************/
+
+//***************************************************************************/
+// D E F I N E S */
+//***************************************************************************/
+
+// Multimedia Extensions Stream Handler Device Driver Interfaces
+// Block defintions.
+
+type
+ shdfn = pointer;
+ ddcmdfn = pointer;
+ hstream = Longint;
+ hevent = LongInt;
+ hID = LongInt;
+// MMTIME = Cardinal;
+type
+ time_evcb = record
+ ulType : LongInt; // Event_CUE_TIME
+ ulSubType : LongInt; // Not used
+ ulFlags : LongInt; // Single/Recurring(input/output)
+ hstream : HSTREAM; // handle to stream for this event (input/output)
+ hid : hID; // handler Id (input/output)
+ ulStatus : LongInt; // Event status/error return code (output)
+ mmtimeStream : MMTIME; // Stream time (input/output)
+ unused1 : LongInt; // 0 (input)
+ unused2 : LongInt; // 0 (input)
+ end;
+ ptime_evcb = ^time_evcb;
+(*type
+ spcbKey = record
+ ulDataType : LongInt;
+ ulDataSubType : LongInt;
+ ulIntKey : LongInt; // Generated internal key
+ end;*)
+// pspcbKey = ^spcbKey;
+
+//***************************************************************************/
+// S T R U C T U R E S */
+//***************************************************************************/
+
+
+//***************************************************************************/
+//*** DDCMD Interface **/
+//***************************************************************************/
+
+const
+ // DDCMD Defines
+ DDCMD_SETUP = 0;
+ DDCMD_READ = 1;
+ DDCMD_WRITE = 2;
+ DDCMD_STATUS = 3;
+ DDCMD_CONTROL = 4;
+ DDCMD_REG_STREAM = 5;
+ DDCMD_DEREG_STREAM = 6;
+
+type
+ ddCmdCommon = record
+ ulFunction : LongInt; // Function requested by SH
+ Stream : hStream; // data stream instance
+ end;
+ pddCmdCommon = ^ddCmdCommon;
+
+ ddCmd_Setup_parm = record
+ ulFunction : LongInt; // Function requested by SH
+ hStream : HSTREAM;
+ pSetupParm : Pointer; // see SETUP_PARM struct
+ ulSetupParmSize : LongInt; // see SETUP_PARM struct
+ end;
+ pddCmdSetup = ^ddCmd_Setup_parm;
+
+
+ //*********************************************/
+ // SETUP_PARM structure */
+ //*********************************************/
+ // SETUP_PARM structure
+ Setup_Parm = record // DDCMDSETUP parameter block
+ ulStreamTime : LongInt; // stream time in milliseconds
+ ulFlags : LongInt; // various flags (input/output)
+ // NOTE: new fields will be added here
+ end;
+ pSetup_Parm = ^Setup_Parm;
+
+ //*********************************************/
+ // ulFlag defines */
+ //*********************************************/
+const
+ // ulFlag defines
+ SETUP_RECURRING_EVENTS = $00000001;
+ // the device driver sets this flag on return from the
+ // DDCMD_SETUP command if the device driver assumes events
+ // are recurring events---in this case, the stream handler
+ // will not have to re-enable a recurring event each time
+ // the event occurs by sending a DDCMD_CONTROL command to
+ // the device driver. this is useful when CUE_TIME or
+ // DATA_CUE events are expected to be used as RECURRING
+
+type
+ ccCmdReadWrite = record
+ ulFunction : LongInt; // Function requested by SH
+ hStream : HSTREAM;
+ pBuffer : Pointer;
+ ulBufferSize : LongInt;
+ pProcessLin : Pointer;
+ fEOS : Boolean;
+ ulParm1 : LongInt;
+ ulParm2 : LongInt;
+ ulLength : LongInt;
+ end;
+ pccCmdReadWrite = ^ccCmdReadWrite;
+ ppccCmdReadWrite = ^pccCmdReadWrite;
+
+ ccCmdStatus = record
+ ulFunction : LongInt; // Function requested by SH
+ hStream : HSTREAM;
+ pStatus : Pointer; // (output)ptr to current position time
+ ulStatusSize : LongInt; // (output)size of position time
+ end;
+ pccCmdStatus = ^ccCmdStatus;
+
+ //*********************************************/
+ // STATUS_PARM structure */
+ //*********************************************/
+ // STATUS_PARM structure
+ Status_Parm = record // DDCMDSTATUS parameter block
+ ulTime : LongInt; // current position time in milliseconds
+ // NOTE: new fields will be added here
+ end;
+ pStatus_Parm = ^Status_Parm;
+
+ ddCmdControl = record
+ ulFunction : LongInt; // Function requested by SH
+ hStream : HSTREAM;
+ hEvent : hEvent; // used for EVENTS only
+ ulCmd : LongInt;
+ pParm : Pointer; // see CONTROL_PARM structure
+ ulParmSize : LongInt; // see CONTROL_PARM structure
+ end;
+ pddCmdControl = ^ddCmdControl;
+ //*********************************************/
+ // ulCmd defines */
+ //*********************************************/
+const
+ // ulCmd defines
+ DDCMD_START = 1; // start device
+ DDCMD_STOP = 2; // stop device and return current position in pParm
+ DDCMD_PAUSE = 3; // pause device and return current position in pParm
+ DDCMD_RESUME = 4; // resume device
+ DDCMD_ENABLE_EVENT = 5; // ask PDD to create this event
+ DDCMD_DISABLE_EVENT = 6; // ask PDD to purge this event
+ DDCMD_PAUSE_TIME = 7; // pause time keeping, but not the stream
+ DDCMD_RESUME_TIME = 8; // resume time keeping.
+
+ //*********************************************/
+ // CONTROL_PARM structure */
+ //*********************************************/
+type
+ // CONTROL_PARM structure
+ Control_Parm = record // DDCMDCONTROL parameter block
+ ulTime : LongInt; // time in milliseconds
+ // SH sets cuetime when ulCmd is ENABLE_EVENT
+ // PDD returns current time for STOP, PAUSE
+ evcb : TIME_EVCB;
+ end;
+ pControl_Parm = ^Control_Parm;
+
+ //******************************************************************************/
+ // This structure is filled in by the amp mixer based on the instance */
+ // data. */
+ //******************************************************************************/
+TYPE AUDIOMODE = record // audio mode fields for DDCMDRegister */
+ lSRate:LongInt; // sample rate */
+ lBitsPerSRate:LongInt; // bits per sample */
+ sChannels:Integer; // Channels */
+ end;
+TYPE PAUDIOMODE=^AUDIOMODE;
+
+
+TYPE ddCmdRegister = record
+ ulFunction : LongInt; // Function requested by SH
+ hStream : HSTREAM; // Stream handle needed @ interrupt time
+ ulSysFileNum : LongInt; // Device Handle so pdd can map device instance to hstream
+ pSHDEntryPoint : SHDFN; // Stream handler entry point
+ ulStreamOperation : LongInt; // SH input Record or play
+ spcbkey : SPCBKEY;
+ ulBufSize : LongInt; // PDD output (optional) buffer size in bytes for SPCB
+ ulNumBufs : LongInt; // PDD output (optional) # of buffers for SPCB
+ ulAddressType : LongInt; // PDD output (required) addr ptr type to data buffer
+ ulBytesPerUnit : LongInt; // PDD output (required)
+ mmtimePerUnit : MMTIME; // PDD output (required)
+ AudioMode : AUDIOMODE; // SH input Device Control Block
+ hid : HID; // SH input stream handler id
+ end;
+ pddCmdRegister = ^ddCmdRegister;
+
+ //****************************/
+ // ulStreamOperation defines*/
+ //****************************/
+const
+ // ulStreamOperation defines
+ STREAM_OPERATION_MASK = $C000;
+ STREAM_OPERATION_CONSUME = $8000;
+ STREAM_OPERATION_PRODUCE = $C000;
+
+ //******************************************************************************/
+ // ulAddressType defines */
+ // The PDD will tell the SH what type of address ptr it expects the data buffer*/
+ // to be. The SH will then request this address type to the SSM, so that the */
+ // SSM will send the correct type of each buffer request. */
+ //******************************************************************************/
+ ADDRESS_TYPE_VIRTUAL = 0;
+ ADDRESS_TYPE_PHYSICAL = 1; //default
+ ADDRESS_TYPE_LINEAR = 2;
+
+type
+ ddCmdDeregister = record
+ ulFunction : LongInt; // Function requested by SH
+ Stream : hStream; // Stream handle needed @ interrupt time
+ end;
+ pddCmdDeregister = ^ddCmdDeregister;
+
+
+//***************************************************************************/
+//*** RING 0 Stream Handler SHD Interfaces ***/
+//***************************************************************************/
+
+const
+ // RING 0 Stream Handler SHD's:
+ SHD_REPORT_INT = 0; // PDD reports interrupt has arrived
+ SHD_REPORT_EVENT = 1; // PDD reports cuetime has arrived
+
+type
+ shd_Common = record
+ ulFunction : LongInt; // Function requested by PDD
+ Stream : hStream; // Stream handle needed @ interrupt time
+ end;
+ pshd_Common = ^shd_Common;
+
+type shd_ReportInt = record
+ ulFunction : LongInt; // Function requested by PDD
+ hStream : HSTREAM; // so SH knows which stream to process
+ pBuffer : Pointer; // return ptr to last used buffer
+ ulFlag : LongInt; // reason for interrupt
+ ulStatus : LongInt; // rc or bytes read/written
+ ulStreamTime : LongInt; // time in milliseconds of stream position
+ end;
+ pshd_ReportInt = ^shd_ReportInt;
+
+ //******************/
+ // ulFlag settings */
+ //******************/
+const
+ // ulFlag settings
+ ERROR = $80;
+ STREAM_STOP_NOW = $40;
+ SHD_READ_COMPLETE = 1;
+ SHD_WRITE_COMPLETE = 2;
+
+type
+ shd_ReportEvent = record
+ ulFunction : LongInt; // Function requested by PDD
+ hStream : HSTREAM; // so SH knows which stream to process
+ hEvent : hEvent; // event handle pass back to stream handler
+ ulStreamTime : LongInt; // time in milliseconds of stream position
+ end;
+ pshd_ReportEvent = ^shd_ReportEvent;
+
+
+
+//***************************************************************************/
+//*** RING 3 Stream Handler SHD Interfaces ***/
+//***************************************************************************/
+
+//*** RING 3 Stream Handler SHD Interfaces **
+
+const
+ // RING 3 Stream Handler SHD's: (Uses SpiSendMsg as interface)
+ SHC_REPORT_INT = $80000000; // ulMsgType for SHD_REPORT_INT
+ SHC_REPORT_EVENT = $80000001; // ulMsgType for SHD_REPORT_EVENT
+
+
+//*********************************************
+// *
+// * MSG_REPORTINT Control Block.
+// * pMsg field of SpiSendMsg api
+// *
+// **********************************************/
+type
+ // MSG_REPORTINT Control Block.
+ // pMsg field of SpiSendMsg api
+ msg_ReportInt = record
+ ulMsgLen : LongInt; // Length of structure
+ pBuffer : Pointer; // return ptr to last used buffer
+ ulFlag : LongInt; // reason for interrupt
+ ulStatus : LongInt; // rc or bytes read/written
+ ulStreamTime : LongInt; // time in milliseconds of stream position
+ end;
+ pmsg_ReportInt = ^msg_ReportInt;
+
+ // For ulFlag defines, refer to the _shd_reportint_parm structure */
+
+
+
+//*********************************************
+// *
+// * MSG_REPORTEVENT Control Block.
+// * pMsg field of SpiSendMsg api
+// *
+// **********************************************/
+type
+ // MSG_REPORTEVENT Control Block.
+ // pMsg field of SpiSendMsg api
+ msg_ReportEvent = record
+ ulMsgLen : LongInt; // Length of structure
+ hevent : hEvent; // event handle pass back to stream handler
+ ulStreamTime : LongInt; // time in milliseconds of stream position
+ end;
+type pmsg_ReportEvent = ^msg_ReportEvent;
+
+//***************************************************************************/
+// F U N C T I O N P R O T O T Y P E S */
+//***************************************************************************/
+
+//RC FAR SHDEntryPoint(PSHD_COMMON pCommon);
+//RC FAR DDCMDEntryPoint(PDDCMDCOMMON pCommon);
+
+//***************************************************************************\
+//* *
+//* Multimedia Mixer Software Development Kit Include File *
+//* *
+//* *
+//***************************************************************************/
+// Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+// 14.11.2002 */
+// */
+//***************************************************************************/
+
+ TYPE HMIXER = longint;
+ TYPE PHMIXER = ^HMIXER;
+
+
+TYPE _MIXERLINEINFO = RECORD
+ ulLength : LongInt; //length of the struct */
+ ulNumChannels : LongInt; // number of channels on input */
+ ulSupport : LongInt; // supported functionality (MIXLINEINFO) */
+ ulConnectionsPossible : LongInt;// lines connectable to */
+ ulLine : LongInt; // which line to operate on */
+ end;
+
+TYPE PMIXERLINEINFO = ^_MIXERLINEINFO;
+
+TYPE _LINECONNECTIONS = RECORD
+ ulLength : Longint; // length of the struct */
+ ulConnection : LongInt;
+ ulLine : Longint;
+ ulFlags : LongInt;
+ end;
+
+TYPE PLINECONNECTIONS = ^_LINECONNECTIONS;
+
+// flags for MIXERCONTROL ulFlags field */
+CONST
+ MIX_MASTER = $000000001; // indicates that this is master effect for the control */
+
+TYPE _MIXERCONTROL = RECORD
+ ulLength : LongInt; // length of the struct */
+ ulLine : LongInt;
+ ulControl : LongInt;
+ ulSettings : LongInt;
+ ulFlags : LongInt;
+ end;
+
+TYPE PMIXERCONTROL = ^_MIXERCONTROL;
+// -- need masteraudio command for the following. */
+
+
+// flags for MIXERLINEINFO ulSupport field */
+CONST
+ MIX_BALANCE = $00100000; // separate balance volume control */
+ MIX_ALC = $00000004; // supports Auto Level Control */
+ MIX_MONITOR = $00000002; // supports Monitor Control */
+ MIX_CROSSOVER = $00000010; // supports crossover change */
+ MIX_LOUDNESS = $00000020; // supports loudness equalization */
+ MIX_MUTE = $00000040; // supports channel mute */
+ MIX_REVERB = $00000080; // supports reverb */
+ MIX_STEREOENHANCE = $00000100; // supports stereo enhance */
+ MIX_CUSTOM1 = $00000200; // supports custom effect #1 */
+ MIX_CUSTOM2 = $00000400; // supports custom effect #2 */
+ MIX_CUSTOM3 = $00000800; // supports custom effect #3 */
+ MIX_LRVOLUME = $00001000; // separate left-right volume control */
+ MIX_BASS = $00800000; // supports Bass */
+ MIX_MID = $00020000; // supports Mid */
+ MIX_TREBLE = $00400000; // supports Treble */
+ MIX_PITCH = $00200000; // supports pitch modifications */
+ MIX_GAIN = $01000000; // supports gain modifications */
+ MIX_CHORUS = $00004000; // supports Bass */
+ MIX_VOLUME = 000800000; // supports volume controls */
+
+
+ MIX_STEREO_OFF = $00000000;
+ MIX_STEREO_STUDIO = $40004000;
+ MIX_STEREO_HALL = $80008000;
+ MIX_STEREO_STADIUM= $C000C000;
+
+ MCI_STEREO_OFF = $00000000;
+ MCI_STEREO_STUDIO = $00000001;
+ MCI_STEREO_HALL = $00000002;
+ MCI_STEREO_STADIUM= $00000004;
+
+ MIX_LOUDNESS_OFF = $00000000;
+ MIX_LOUDNESS_ON = $FFFFFFFF;
+
+ MCI_LOUDNESS_OFF = $00000000;
+ MCI_LOUDNESS_ON = $FFFFFFFF;
+
+
+// ERROR MESSAGES */
+CONST
+ MIXERR_BASE = 512;
+ MIXERR_NOERR = 0;
+ MIXERR_INVALIDHANDLE = MIXERR_BASE+0;
+ MIXERR_INVALIDINPUT = MIXERR_BASE+1;
+ MIXERR_INVALIDOUTPUT = MIXERR_BASE+2;
+ MIXERR_NOTSUPPORTED = MIXERR_BASE+7;
+
+
+// INPUT LINES */
+// SOURCES */
+ IN_SYNTHESIZER = 0;
+ IN_MIXER = 1;
+ IN_EXTERNAL = 2;
+ IN_INTERNAL = 3;
+ IN_MICROPHONE = 4;
+ IN_PCM = 5;
+ IN_PC_SPEAKER = 6;
+
+// SINKS */
+ OUT_AMPLIFIER = 0;
+ OUT_PCM = 1;
+
+
+// SOURCES */
+ SOURCE_SYNTHESIZER = $000000001;
+ SOURCE_LINE = $000000002;
+ SOURCE_INTERNAL_AUDIO = $000000004;
+ SOURCE_MICROPHONE = $000000008;
+ SOURCE_WAVE = $000000010;
+ SOURCE_PC_SPEAKER = $000000020;
+ SOURCE_NULL = $000000040;
+ SOURCE_MIDI = $000000080;
+
+// SINKS */
+// lad--these defines are invalid. */
+ SINK_LINE_OUT = $000100000;
+ SINK_SPEAKER = $000200000;
+ SINK_HEADPHONES = $000400000;
+ SINK_NULL = $000800000;
+ SINK_ALL = $001000000;
+
+// lad--wpos addition */
+ SINK_WAVE = $002000000;
+ SINK_MIDI = $004000000;
+
+//*************************START OF SPECIFICATIONS **************************/
+// */
+// Module NAME: MCD.H */
+// */
+// */
+// OS/2 2.0 Multimedia Extensions MCD structures and definitions */
+// */
+// Copyright (c) International Business Machines Corporation 1990,1991 */
+// All Rights Reserved */
+//*--------------------------------------------------------------------------*/
+//* Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+//* 14.11.2002 */
+//* */
+//************************//END OF SPECIFICATIONS ***************************/
+
+CONST
+
+ LIST_LEN=8;
+
+ LINE_IN_ON =$00000001;
+ MIC_ON =$00000002;
+ LINE_OUT_ON =$00000004;
+
+TYPE
+ PSZ = PChar;
+ SHandle = Word;
+ HFile = SHandle;
+// HMTX = Longint;
+
+//-------------------------------------------------------------------------*
+//RIFF to ACPA Mode conversion Table
+//------------------------------------------------------------------------*/
+
+TYPE RIFFTABLE = Record
+ ulDataType:LongInt;
+ ulAUDIODDMode:LongInt;
+ end;
+
+TYPE _MCI_PORT_LIST = Record // devid */
+ ulDevType:LongInt;
+ ulDevNum:LongInt;
+ end;
+//-------------------------------------------------------------------------*
+//Amp/Mixer instance structure declaration
+//------------------------------------------------------------------------*/
+
+TYPE _MCI_AMP_INSTANCE = Record
+ szDeviceName:Array [0..128] of char;
+ szDriverName:Array [0..15] of char;
+ hFile:HFile;
+ usDeviceID:Integer;
+ ulGlobalFile:LongInt;
+
+ usMasterVolume:Integer;
+ lLeftVolume:LongInt;
+ lRightVolume:LongInt;
+ lVolumeDelay:LongInt;
+ lBalance:LongInt;
+
+ lBalanceDelay:LongInt;
+ lBass:LongInt;
+
+ lTreble:LongInt;
+
+ lPitch:LongInt;
+ lGain:LongInt;
+
+ lSRate:LongInt;
+ lBitsPerSRate:LongInt;
+ lBsize:LongInt;
+ sMode:Integer;
+ sChannels:Integer;
+ ulFlags:LongInt;
+ lMonitor:LongInt;
+ lInput:LongInt;
+ lOutput:LongInt;
+ ulOperation:LongInt;
+ ulGainLevel:LongInt;
+
+ ulStoreRVolume:LongInt;
+ ulStoreLVolume:LongInt;
+
+
+ ulDosOpened:LongInt;
+ ulInitOpen:LongInt;
+ ulMasterVolume:LongInt;
+ ulActive:LongInt;
+ lStoreSRate:LongInt;
+ lStoreBitsPerSRate:LongInt;
+ ulStoreOperation:LongInt;
+ sStoreMode:Integer;
+ sStoreChannels:Integer;
+ ulSetAmpDefaults:LongInt;
+ ulDefaultsSet:LongInt;
+
+ ulOutputDev:LongInt;
+ ulInputDev:LongInt;
+ ulResourcesUsed:LongInt;
+ ulRestoreNotify:LongInt;
+ ulCallback:LongInt;
+ sUserParm:Integer;
+ lNotifyFlag:LongInt;
+// LONG ( //APIENTRY pfnAUDIOIF) ( PVOID, LONG, LONG, LONG, LONG);
+ hmtxInstanceSem:HMTX;
+ ulClass:LongInt;
+ ulBlockAlignment:LongInt;
+ ulHardwareMode:LongInt;
+ rInputList:Array [0.. LIST_LEN ] of _MCI_PORT_LIST;
+ rOutputList:Array [0.. LIST_LEN ] of _MCI_PORT_LIST;
+ ulNumInputs:LongInt;
+ ulNumOutputs:LongInt;
+
+ ulDataType:LongInt;
+ ulSubType:LongInt;
+ ulBytesPerBlock:LongInt;
+ ulMMTimePerBlock:LongInt;
+
+//-------------------------------------------------------------------------*
+//New resource management stuff
+//------------------------------------------------------------------------*/
+
+
+
+ pAudioModeData:Pointer; // ptr to dev. specific resource data */
+ pResourceDLL:Array [0.. 128 ] of Char;
+
+ pProdInfo:PSZ; // pointer to the product name */
+ ulDeviceID:LongInt; // pointer to the device id. */
+ ulNumMappingRows:LongInt; // num of RIFF->AUDIODD mapping modes */
+ ulMatch:LongInt;
+ pMapTable:^RIFFTABLE; // additional RIFF->AUDIODD mappings */
+
+ ulNumDataTypes:LongInt; // number of datatypes to check */
+ pDataTypeTable:Pointer;
+ fMute:Boolean;
+ ulResourceID:LongInt; // offset in the resource dll to use */
+ ulConnDefaults:LongInt; // Default values for connectors */
+
+ end;
+TYPE PMCI_AMP_INSTANCE = ^_MCI_AMP_INSTANCE;
+
+
+const
+ MIDINAMESIZE = 40;
+ MIDIPATCHNUM = 128;
+ MIDITYPEAPPNAME = 'MidiTypes'; // Appname in MIDITYPE.INI
+
+//*******************************************************************/
+// These structures describe the format of the MIDI maps that are */
+// located in the MIDITYPE.INI file. */
+//*******************************************************************/
+
+type
+ // These structures describe the format of the MIDI maps that are
+ // located in the MIDITYPE.INI file.
+ MidiTypeEntry = record
+ uGenMidiPatchNumber : Integer; // Device To General Midi Conversion
+ uDevMidiPatchNumber : Integer; // General Midi to Device Conversion
+ uVolumePercent : Integer; // Channel Patch Volume Scaler
+ uGenMidiKeyNumber : Integer; // Device To General Midi Perc. Key Conversion
+ uDevMidiKeyNumber : Integer; // General Midi to Device Perc. Key Conversion
+ end;
+ pMidiTypeEntry = ^MidiTypeEntry;
+
+ _MidiType = record
+ uStyle : Integer; // Midi Style
+ uDrums10 : Integer; // Patch 10 Drums if Perckey not supported
+ uDrums16 : Integer; // Patch 16 Drums if Perckey not supported
+ ulReserved : LongInt; // Reserved
+ MidiTypeEntry : array[0..midiPatchNum-1] of MIDITYPEENTRY;
+ // Array of MIDITYPEENTRYs
+ szPatchAndPercKeyName: array[0..2*MIDIPATCHNUM*MIDINAMESIZE-1] of char;
+ // List of 128 Patch Names
+ // that are null terminated, then a
+ // list of 128 Percussion key names that
+ // are double null terminated
+ // Each item is null terminated
+ end;
+ MidiTpye=_MidiType;
+ pMidiType = ^_MidiType;
+
+const
+ // Style Flags
+ MT_PERCUSSIONKEYS = $1; // Percussion Keys are supported
+ MT_MAPPERCKEYPATCHES = $2; // Map Percussion Key Patches
+
+
+CONST
+ STATUS_BIT = $80;
+
+ TRACK_OFF = 0;
+ TRACK_ON = 1;
+
+ NORMAL_SYSEX = $F0;
+ ESCAPE_SYSEX = $F7;
+
+ // User defined messages for IO PROC
+ MMIOM_START = $0E00;
+ MMIOM_USER = $0F00;
+ MMIOM_GETHEADER = MMIOM_START + 9;
+ META = $FF;
+// Meta stuff */
+// user defined messages for IO PROC */
+ MMIO_SEQ = MMIOM_USER + 1;
+ MMIO_MERGE = MMIOM_USER + 2;
+ MMIO_FROM_SEQ = MMIOM_USER + 3;
+ MMIO_TIMED_READ = MMIOM_USER + 4;
+ MMIO_SET_TRACKS = MMIOM_USER + 5;
+ MMIO_FORMAT_O = MMIOM_USER + 6;
+ MMIO_GETHEADER = MMIOM_GETHEADER;
+ MMIO_GETFILELENTH = MMIOM_USER +10;
+ MMIO_GETTRACKLENGTH = MMIOM_USER + 11;
+
+
+type
+ MidiHeader = record // midi header //
+ chHeaderChunk : array[0..3] of Char;
+ case Boolean of
+ true: (
+ dwHeaderLength : Dword;
+ wFormat : Word;
+ wNumTracks : Word;
+ wDivision : Word;
+ vpAdditionalInformation_ : ^LongInt;
+ );
+ false: (
+ ulHeaderLength : LongInt;
+ usFormat : Integer;
+ usNumTracks : Integer;
+ usDivision : Integer;
+ vpAdditionalInformation : Pointer;
+ )
+ end;
+ pMidiHeader = ^MidiHeader;
+
+ mmMidiHeader = record
+ case boolean of
+ true: (
+ ulHeaderLength : LongInt; // Length in Bytes
+ ulContentType : LongInt; // Image content
+ ulMediaType : LongInt; // type of media
+ midiheader : MidiHeader; // header
+ );
+ false: (
+ dwHeaderLength : DWORD; // Length in Bytes */
+ dwContentType : DWORD; // Image content */
+ dwMediaType : DWORD; // type of media */
+ midiheader_ : MIDIHEADER; // header */
+ )
+ end;
+ pmmMidiHeader = ^mmMidiHeader;
+
+//***************************************************************************/
+// */
+// Module Name: EVCB.H */
+// */
+// OS/2 2.0 Multimedia Extensions Sync/Stream Manager Event Control */
+// Block defintitions. */
+// */
+// Copyright (c) International Business Machines Corporation 1991, 1992 */
+// All Rights Reserved */
+//***************************************************************************/
+// Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+// 14.11.2002 */
+// */
+//***************************************************************************/
+
+//*********************************************
+// * List of Implicit events:
+// * EVENT_EOS - Use IMPL_EVCB
+// * EVENT_ERROR - Use IMPL_EVCB
+// * EVENT_STREAM_STOPPED - Use IMPL_EVCB
+// * EVENT_SYNC_PREROLLED - Use IMPL_EVCB
+// * EVENT_PLAYLISTMESSAGE - Use PLAYL_EVCB
+// * EVENT_PLAYLISTCUEPOINT - Use PLAYL_EVCB
+// * EVENT_QUEUE_OVERFLOW - Use IMPL_EVCB
+// **********************************************/
+
+//*********************************************
+// * List of Explicit events:
+// * EVENT_SYNCOVERRUN - Use OVRU_EVCB
+// * EVENT_CUE_TIME - Use TIME_EVCB
+// * EVENT_CUE_DATA - Use DATA_EVCB
+// * EVENT_DATAUNDERRUN - Use EVCB
+// * EVENT_DATAOVERRUN - Use EVCB
+// * EVENT_CUE_TIME_PAUSE - Use TIME_EVCB
+// **********************************************/
+CONST
+
+ EVENT_SYNCOVERRUN =$4;
+ EVENT_CUE_TIME =$5; // Cue point in terms of stream time*/
+ EVENT_CUE_DATA =$6; // Cue point in terms of data items */
+ EVENT_DATAUNDERRUN =$7; // data underrun event from SH */
+ EVENT_DATAOVERRUN =$8; // data underrun event from SH */
+ EVENT_CUE_TIME_PAUSE =$9; // Pause when cue-point reached. */
+ EVENT_STATUS_LEVEL =$10; // Report status level */
+
+
+
+//*********************************************
+// * SYNC_EVCB - Sync Pulse Event Control Block
+// * (This event is only seen by
+// * stream handlers)
+// **********************************************/
+ EVENT_SYNC =$1; // Synchronization point in stream */
+
+TYPE _SYNC_EVCB = RECORD // syevcb */
+ ulType:LongInt; // EVENT_SYNC */
+ ulSubType:LongInt; // Not used */
+ ulSyncFlags:LongInt; // 0 (input),status (output) */
+ hstream:LongInt; // handle to stream for this event */
+ hid:LongInt; // Handler id */
+ ulStatus:LongInt; // Event status (output) */
+ mmtimeStart:MMTIME; // Filled in by Sync/Stream manager */
+ // at SpiEnableSync time. (input) */
+ mmtimeMaster:MMTIME; // Filled in by Master SH (input) */
+ mmtimeSlave:MMTIME; // Filled in by slave SH. (output) */
+ end;
+
+TYPE PSYNC_EVCB = ^_SYNC_EVCB; // Ptr to a EVCB */
+
+// ulSyncFlags:
+CONST
+
+ SYNCOVERRUN =$0001; // Set by SSM if sync pulse comes in before */
+ // a has processed the current sync pulse. */
+ SYNCPOLLING =$0002; // SSM set this after filling the handler EVCB.*/
+ // Handler resets it after it processes the */
+ // contents of EVCB. The SSM must check this */
+ // bit before modifying EVCB. If bit already */
+ // set, set the SYNC overrun bit. */
+
+
+ EVENT_RESERVED =$2; // RESERVED */
+
+
+//*********************************************
+// * IMPL_EVCB - Implicit Event Control Block
+// * (This is a parameter on the
+// * SpiCreatStrem API)
+// **********************************************/
+ EVENT_IMPLICIT_TYPE=$3; // These events are always supported*/
+
+
+TYPE _IMPL_EVCB = RECORD // imevcb */
+ ulType:LongInt; // EVENT_IMPLICIT_TYPE */
+ ulSubType:LongInt; // One of the implicit events (input) */
+ ulFlags:LongInt; // 0 (Input), status (Output) */
+ hstream:LongInt; // handle to stream for this event (input/output) */
+ hid:LongInt; // 0 (input), handler Id (output) */
+ ulStatus:LongInt; // Event status/error return code (output) */
+ unused1:LongInt; // 0 (input) */
+ unused2:LongInt; // 0 (input) */
+ unused3:LongInt; // 0 (input) */
+ end;
+TYPE PIMPL_EVCB = ^_IMPL_EVCB;
+
+// ulSubtype: */
+
+CONST
+
+ EVENT_EOS =$1; // End of Stream */
+ EVENT_ERROR =$2; // Error in Stream handler or device driver */
+ EVENT_STREAM_STOPPED =$3; // Stream is in a stopped state (Discard or Flush) */
+ EVENT_SYNC_PREROLLED =$4; // All streams are prerolled (buffers */
+ // have been filled by the Source SH's.*/
+ EVENT_PLAYLISTMESSAGE =$5; // Memory SH playlist message event */
+ EVENT_PLAYLISTCUEPOINT =$6; // Memory SH playlist cue point */
+ EVENT_QUEUE_OVERFLOW =$7; // Event Queue overflow. Indicates lost */
+ // events. Application must use this */
+ // to clear any waiting conditions. */
+ EVENT_START =$8; // Start stream */
+
+
+//*********************************************
+// * PLAYL_EVCB - Playlist Message Event Control Block
+// **********************************************/
+// (IMPLICIT EVENT) */
+TYPE _PLAYL_EVCB=RECORD // plevcb */
+ ulType:LongInt; // EVENT_IMPLICIT_TYPE */
+ ulSubType:LongInt; // EVENT_PLAYLISTMESSAGE or EVENT_PLAYLISTCUEPOINT */
+ ulFlags:LongInt; // 0 (input), status (output) */
+ hstream:LongInt; // handle to stream for this event (input/output) */
+ hid:LongInt; // 0 (input), handler Id (output) */
+ ulStatus:LongInt; // Playlist Instruction number (output) */
+ ulMessageParm:LongInt; // 0 (input), Message from playlist (output) */
+ unused1:LongInt; // 0 (input) */
+ unused2:LongInt; // 0 (input) */
+ end;
+TYPE PPLAYL_EVCB = ^_PLAYL_EVCB; // Ptr to a EVCB */
+
+
+//*********************************************
+// * OVRU_EVCB - Sync Overrun Event Control Block
+// * (Applications can request to be
+// * notified whenever a Sync overrun
+// * occurs.
+// **********************************************/
+TYPE _OVRU_EVCB = RECORD // ovevcb */
+ ulType:LongInt; // EVENT_SYNCOVERRUN */
+ ulSubType:LongInt; // Not used */
+ ulFlags:LongInt; // 0 (input), status (output) */
+ hstream:LongInt; // handle to stream for this event (input/output) */
+ hid:LongInt; // handler Id (input/output) */
+ ulStatus:LongInt; // Event status/error return code (output) */
+ mmtimeSlave:MMTIME; // 0 (input), Slave stream time (output) */
+ mmtimeStart:MMTIME; // 0 (input), Slave start offset (offset) */
+ mmtimeMaster:MMTIME; // 0 (input), Master stream time (output) */
+ end;
+
+TYPE POVRU_EVCB = ^_OVRU_EVCB; // Ptr to a EVCB */
+
+
+//*********************************************
+// * TIME_EVCB - Cue Time Event Control Block
+// * (Applications can request to be
+// * notified for a time cue point)
+// **********************************************/
+
+TYPE _TIME_EVCB = RECORD // tievcb */
+ ulType:LongInt; // EVENT_CUE_TIME */
+ ulSubType:LongInt; // Not used */
+ ulFlags:LongInt; // Single/Recurring(input/output) */
+ hstream:LongInt; // handle to stream for this event (input/output)*/
+ hid:LongInt; // handler Id (input/output) */
+ ulStatus:LongInt; // Event status/error return code (output) */
+ mmtimeStream:MMTIME; // Stream time (input/output) */
+ unused1:LongInt; // 0 (input) */
+ unused2:LongInt; // 0 (input) */
+ end;
+
+//TYPE PTIME_EVCB = ^_TIME_EVCB; // Ptr to a EVCB */
+
+// */
+// ulFlags: */
+CONST
+
+ EVENT_SINGLE =$0; // This is single one time event */
+ EVENT_RECURRING =$1; // This is recurring event */
+
+
+//*********************************************
+// * DATA_EVCB - Cue Data Event Control Block
+// * (Applications can request to be
+// * notified for a data cue point)
+// **********************************************/
+
+TYPE _DATA_EVCB = RECORD // daevcb */
+ ulType:LongInt; // EVENT_CUE_DATA */
+ ulSubType:LongInt; // Event SubType */
+ ulFlags:LongInt; // Single/Recurring(input/output) */
+ hstream:LongInt; // handle to stream for this event (input/output) */
+ hid:LongInt; // handler Id (input/output) */
+ ulStatus:LongInt; // Event status/error return code (output) */
+ mmtimeStream:MMTIME; // Stream time (input/output) */
+ ulEventParm1:LongInt; // Data to Cue on (input/output) */
+ // This is interpreted by the stream handler */
+ ulEventParm2:LongInt; // Length of data cue buffer (input/output) */
+ end;
+TYPE PDATA_EVCB = ^_DATA_EVCB; // Ptr to a EVCB */
+
+// ulFlags: */
+//#define EVENT_SINGLE 0L This is single one time event */
+//#define EVENT_RECURRING 1L This is recurring event */
+
+CONST
+
+ EVENT_DATAPTR =$2; // ulEventParm1 if ptr to buffer and*/
+ // ulEventParm2 is a length of buffer, */
+ // else ulEventParm1 is data. */
+
+
+//*****************
+// * EVCB_ulType: (Stream Handler defined types)
+// ******************/
+ SH_TYPE =$80000000; // Stream Handler defined types must */
+ // have the high order bit set in the*/
+ // ulType field. */
+ // events: 0H - 7FFFFFFFH are reserved!*/
+
+//*********************************************
+// * EVCB - Generic Event Control Block (Use the
+// * specific one in the SSM.H if possible)
+// **********************************************/
+TYPE _EVCB = RECORD // evcb */
+ ulType:LongInt; // Event type (input) */
+ ulSubType:LongInt; // Event SubType (input) */
+ ulFlags:LongInt; // 0 (Input), status (Output) */
+ hstream:LongInt; // handle to stream for this event */
+ hid:LongInt; // handler Id (input/output) */
+ ulStatus:LongInt; // Event status (output) */
+ ulEventParm1:LongInt; // Event parameters (input), HID if implicit event */
+ ulEventParm2:LongInt; // Event parameters (input) */
+ ulEventParm3:LongInt; // Event parameters (input) */
+ end;
+TYPE PEVCB = ^_EVCB; // Ptr to a EVCB */
+
+//*********************************************
+// * STATUS_LEVEL_EVCB - Status Level Event Control Block
+// **********************************************/
+TYPE _STATUS_LEVEL_EVCB = RECORD // stevcb */
+ // standard part */
+ ulType:LongInt; // Event type (input) */
+ ulSubType:LongInt; // Event SubType (input) */
+ pMCDInstance:LongInt; // for MCD use */
+ hstream:LongInt; // handle to stream for this event */
+ hid:LongInt; // handler Id (input/output) */
+ // custom part */
+ ulSample:ARRAY [0..4] OF LongInt; // Samples */
+ end;
+TYPE PSTATUS_EVCB = ^_STATUS_LEVEL_EVCB; // Ptr to a EVCB */
+
+//***************************************************************************/
+// */
+// Module Name: DCB.H */
+// */
+// OS/2 2.0 Multimedia Extensions Sync/Stream Manager Device Control */
+// Block defintitions. */
+// */
+// Copyright (c) International Business Machines Corporation 1991, 1992 */
+// All Rights Reserved */
+//***************************************************************************/
+// Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+// 14.11.2002 */
+// */
+//***************************************************************************/
+
+CONST MAX_SPI_NAME = 9;
+
+//**************************************************************************
+// *
+// * DCB - Common Device Control Block
+// * (*** PACKED STRUCTURE ***)
+// ***************************************************************************/
+TYPE _DCB = RECORD // dcb - Device Control Block */
+ ulDCBLen : LongInt; // length of structure */
+ szDevName: Array [0..MAX_SPI_NAME] of char;// device driver name */
+ end;
+TYPE PDCB = ^_DCB;
+
+
+//**************************************************************************
+// *
+// * E_DCB - Extended Device Control Block
+// *
+// * This structure will grow over time as new fields are added
+// * to the end of the structure. If you manipulate the structure,
+// * be sure to check the length field.
+// *
+// * (*** PACKED STRUCTURE ***)
+// ***************************************************************************/
+
+TYPE E_DCB = RECORD // e_dcb - Extended Device Control Block */
+ ulDCBLen : LongInt; // length of structure */
+ szDevName: Array [0..MAX_SPI_NAME] of char;// device driver name */
+ ulSysFileNum: LongInt; // file handle number */
+ end;
+TYPE PE_DCB = ^E_DCB;
+TYPE PDCB_AUDIOSH = ^E_DCB;
+
+
+//**************************************************************************
+// *
+// * VSD_DCB - VSD Device Control Block
+// *
+// * This structure will allow stream handlers to use the VSD DLL
+// * by using by the additional fields in the structure.
+// *
+// * (*** PACKED STRUCTURE ***)
+// ***************************************************************************/
+TYPE _VSD_DCB = RECORD // vsd_dcb - VSD Device Control Block */
+ ulDCBLen : Longint; // length of structure */
+ szDevName: Array [0..MAX_SPI_NAME] of char;// device driver name */
+ ulSysFileNum: LongInt; // file handle number */
+ hvsd : LongInt; // Handle to VSD instance */
+ pfnEntryPoint : ^PFN; // Address of VSD entry point */
+ ulReserved1 : LongInt; // Reserved for system */
+ ulReserved2 : LongInt; // Reserved for system */
+ end;
+TYPE PVSD_DCB = ^_VSD_DCB;
+
+//****************************************************************************/
+//* */
+//* Module Name: ACB.H */
+//* */
+//* OS/2 2.0 Multimedia Extensions Sync/Stream Manager Associate */
+//* Control Block Definitions. */
+//* */
+//* Copyright (c) International Business Machines Corporation 1991, 1992 */
+//* All Rights Reserved */
+//*--------------------------------------------------------------------------*/
+//* Converted by Andry Svirgunov. Email: cool2@ngs.ru */
+//* 14.11.2002 */
+//* */
+//****************************************************************************/
+CONST
+
+ MAX_PORT_NAME=40; // Max port name length */
+ MAX_PORTS =16; // Max number ports */
+
+
+//**********************************************
+// *
+// * ACB - Associate Control Block
+// *
+// * Each stream handler must define the
+// * ACB for each data object type that
+// * expect ACB's from the application.
+// *
+// **********************************************/
+TYPE _ACB = RECORD //* acb - Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType : LongInt;
+ ulParm1 : LongInt;
+ ulParm2 : LongInt;
+ end;
+TYPE PACB = ^_ACB; //* Ptr to an ACB */
+
+
+//******************************************************
+// * FSSH - File system stream handler MMIO Object ACB
+// ******************************************************/
+CONST
+
+ ACBTYPE_MMIO=$0001; //* MMIO object */
+
+TYPE _ACB_MMIO = RECORD //* acbmmio - MMIO Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType : LongInt; //* ACBTYPE_MMIO */
+ hmmio : HMMIO ; //* Handle of media element mgr obj */
+ end;
+TYPE PACB_MMIO = ^_ACB_MMIO; //* Ptr to an ACB */
+
+
+//******************************************************
+// * MSH - Memory stream handler Playlist Object ACB
+// ******************************************************/
+CONST
+ ACBTYPE_MEM_PLAYL=$0003; //* Memory playlist object */
+
+TYPE _ACB_MEM_PLAYL = RECORD //* acbplyl - File system Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType : LongInt; //* ACBTYPE_MEM_PLAYL */
+ pMemoryAddr : Pointer; //* Starting address of memory obj */
+ end;
+TYPE PACB_MEM_PLAYL = ^_ACB_MEM_PLAYL; //* Ptr to an ACB */
+
+
+//******************************************************
+// * CDDASH - CD DA stream handler Object ACB
+// ******************************************************/
+CONST
+ ACBTYPE_CDDA=$0004; //* Compact disk - digital audio obj*/
+
+
+TYPE _ACB_CDDA = RECORD //* acbcdda - CD Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType : LongInt; //* ACBTYPE_CDDA */
+ bCDDrive : Char; //* CD drive letter */
+ end;
+TYPE PACB_CDDA = ^_ACB_CDDA; //* Ptr to an ACB */
+
+//******************************************************
+// * MISH - MIDI stream handler port-stream table ACB
+// ******************************************************/
+CONST
+ ACBTYPE_MISH=$0005; //* MIDI port-stream table */
+
+TYPE _ACB_MISH = RECORD //* acbmish - MIDI Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType: LongInt; //* ACBTYPE_MISH */
+ hStreamDefault : Longint;//* Default hstream to use when mapper */
+ //* is turned off. */
+ ulDeviceTypeID : LongInt;//* device type id */
+ ulpMapperPorts : LongInt;//* pointer to mapper port table */
+ ulNumInStreams : LongInt;
+ hStreamIn : Array [0..MAX_PORTS] of Longint;//* Array of Input streams */
+ ulNumOutStreams : LongInt;
+ hStreamsOut : Array [0..MAX_PORTS] of Longint;//* Array of Output streams */
+ //* The index into the array is */
+ //* the source channel for that */
+ //* stream. */
+
+ end;
+TYPE PACB_MISH = ^_ACB_MISH; //* Ptr to MIDI associate control block */
+
+//******************************************************
+// * MISH - MIDI stream handler SET ACB
+// ******************************************************/
+CONST
+ ACBTYPE_SET=$0006; //* MIDI set function */
+
+TYPE _ACB_SET = RECORD //* acbset - Set Assoc. Control Block */
+ ulACBLen :LongInt; //* length of structure */
+ ulObjType : LongInt; //* ACBTYPE_SET */
+ ulFlags : LongInt; //* Set flags */
+ ulReserved : Longint; //* Reserved */
+ end;
+TYPE PACB_SET = ^_ACB_SET; //* Ptr to set associate control block */
+
+//* ulFlags defines: */
+CONST
+
+ MIDI_MAP_ON =$0000; //* turn mapping function on in MISH */
+ MIDI_MAP_OFF=$0001; //* turn mapping function off in MISH */
+
+
+//******************************************************
+// * NULLSH - Null stream handler user ACB
+// ******************************************************/
+ ACBTYPE_NULLSH=$0007; //* User od Null stream handler */
+
+TYPE _ACB_NULISH = RECORD //* acbnullsh - NULLSH Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType : LongInt; //* ACBTYPE_NULLSH */
+ pfnEntry : PFN ; //* user callback entry point */
+ ulReserved : LongInt; //* Reserved */
+ end;
+TYPE PACB_NULISH = ^_ACB_NULISH;//* Ptr to an ACB */
+
+//******************************************************
+// * MTSH - MultiTrack Stream Handler Object ACB
+// ******************************************************/
+CONST
+
+ ACBTYPE_MTSH=$0008; //* MTSH object */
+
+TYPE _ACB_MTSH = RECORD //* acbmtsh - MTSH Assoc. Control Block */
+ ulACBLen : LongInt; //* length of structure */
+ ulObjType : Longint; //* ACBTYPE_MTSH */
+ hmmio : HMMIO; //* Handle of media element mgr obj */
+ mmtrackinfo : _MMTRACKINFO; //* track for this stream */
+ ulFlags : LongInt; //* flags */
+ ulMaxBytesPerSec : LongInt; //* Max bytes per second */
+ ulAvgBytesPerSec : Longint; //* Avg bytes per second */
+ mmtimePerFrame : MMTIME; //* frame display time or 0L */
+ ulTotalFrames : LongInt; //* total number of video frames */
+ end;
+TYPE PACB_MTSH = ^_ACB_MTSH; //* Ptr to an ACB */
+
+//* ulFlags defines: */
+CONST
+ TRACK_ACTIVATE =$0000; //* Activate track in stream handler */
+ TRACK_DEACTIVATE =$0001; //* Deactivate track in stream handler */
+
+
+//******************************************************
+// * CSH - CODEC stream handler Object ACB
+// ******************************************************/
+ ACBTYPE_CODECSH=$0009; //* CODEC object */
+TYPE _ACB_CODECSH = RECORD //* acbcodecsh - CODEC SH acb */
+ ulACBLen : Longint; //* length of structure */
+ ulObjType : Longint; //* ACBTYPE_CODECSH */
+ hstreamToPair : LongInt;//* 2nd stream of pair */
+ pMmioInfo : Longint; //* info for IO Proc */
+ ulInfoLength : Longint; //* length of MmioInfo */
+ pCodecControl : Longint;//* CODEC control info */
+ ulControlLength : Longint;//* length of CodecControl */
+ end;
+TYPE PACB_CODECSH = ^_ACB_CODECSH;//* Ptr to associate control block */
+
+
+Implementation
+
+Function mmioFOURCC(ch0,ch1,ch2,ch3:Char): Cardinal;
+begin
+ mmioFOURCC:=Cardinal(ord(ch0)) or (Cardinal(ord(ch1)) shl 8) or
+ (Cardinal(ord(ch2)) shl 16) or (Cardinal(ord(ch3)) shl 24);
+end;
+
+Begin
+ FOURCC_R565:=mmioFOURCC( 'R', '5', '6', '5' );
+ FOURCC_R555:=mmioFOURCC( 'R', '5', '5', '5' );
+ FOURCC_R664:=mmioFOURCC( 'R', '6', '6', '4' );
+ FOURCC_RGB3:=mmioFOURCC( 'R', 'G', 'B', '3' );
+ FOURCC_BGR3:=mmioFOURCC( 'B', 'G', 'R', '3' );
+ FOURCC_RGB4:=mmioFOURCC( 'R', 'G', 'B', '4' );
+ FOURCC_BGR4:=mmioFOURCC( 'B', 'G', 'R', '4' );
+ FOURCC_LUT8:=mmioFOURCC( 'L', 'U', 'T', '8' );
+ FOURCC_LT12:=mmioFOURCC( 'L', 'T', '1', '2' );
+ FOURCC_GREY:=mmioFOURCC( 'G', 'R', 'E', 'Y' );
+ FOURCC_GY16:=mmioFOURCC( 'G', 'Y', '1', '6' );
+ FOURCC_Y888:=mmioFOURCC( 'Y', '8', '8', '8' );
+ FOURCC_Y2X2:=mmioFOURCC( 'Y', '2', 'X', '2' );
+ FOURCC_Y4X4:=mmioFOURCC( 'Y', '4', 'X', '4' );
+ FOURCC_YUV9:=mmioFOURCC( 'Y', 'U', 'V', '9' );
+ FOURCC_Y644:=mmioFOURCC( 'Y', '6', '4', '4' );
+ FOURCC_MONO:=mmioFOURCC( 'M', 'O', 'N', 'O' );
+ FOURCC_Y422:=mmioFOURCC( 'Y', '4', '2', '2' );
+ FOURCC_Y42B:=mmioFOURCC( 'Y', '4', '2', 'B' );
+ FOURCC_Y42D:=mmioFOURCC( 'Y', '4', '2', 'D' );
+ FOURCC_Y411:=mmioFOURCC( 'Y', '4', '1', '1' );
+ FOURCC_VGA :=mmioFOURCC( 'V', 'G', 'A', ' ' );
+
+ FOURCC_ULTI:=mmioFOURCC('U', 'L', 'T', 'I');
+ FOURCC_RT21:=mmioFOURCC('R', 'T', '2', '1');
+ FOURCC_DIB :=mmioFOURCC('D', 'I', 'B', ' ');
+
+ FOURCC_RIFF:=mmioFOURCC( 'R', 'I', 'F', 'F' );
+ FOURCC_LIST:=mmioFOURCC( 'L', 'I', 'S', 'T' );
+ FOURCC_MEM :=mmioFOURCC( 'M', 'E', 'M', ' ' );
+ FOURCC_DOS :=mmioFOURCC( 'D', 'O', 'S', ' ' );
+ FOURCC_BND :=mmioFOURCC( 'B', 'N', 'D', ' ' );
+ FOURCC_FREE:=mmioFOURCC( 'F', 'R', 'E', 'E' );
+ FOURCC_DEL :=mmioFOURCC( 'D', 'E', 'L', ' ' );
+ FOURCC_CTOC:=mmioFOURCC( 'C', 'T', 'O', 'C' );
+ FOURCC_CGRP:=mmioFOURCC( 'C', 'G', 'R', 'P' );
+ FOURCC_CF :=mmioFOURCC( 'C', 'F', ' ', ' ' );
+End.
diff --git a/packages/os2units/src/mmio.pas b/packages/os2units/src/mmio.pas
new file mode 100644
index 0000000000..89ed31485c
--- /dev/null
+++ b/packages/os2units/src/mmio.pas
@@ -0,0 +1,1648 @@
+{
+ Copyright (c) 1990-1993 International Business Machines Corporation
+ Copyright (c) 2002 by Andry Svirgunov (cool2@ngs.ru)
+ Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ OS/2 2.0 Multimedia Extensions Input/Output Manager
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(OS/2 2.0 Multimedia Extensions Input/Output Manager)
+@author(Andry Svirgunov (cool2@ngs.ru))
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(17 Dec 2002)
+@lastmod(19 Jan 2003)
+OS/2 2.0 Multimedia Extensions Input/Output Manager
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+Unit MMIO;
+
+Interface
+
+Uses
+ MMBase;
+
+Const
+ LibName='MMPM'; // !!TODO!! Subject to replace by MMIO
+
+// MS compat defines.
+Type
+ HPSTR = PChar;
+ Hwnd = LongInt;
+ PFourCC = ^FourCC;
+ HMMCF = hmmIO;
+ HMODULE = LongInt;
+ PHModule = ^Hmodule;
+ pLong = ^LongInt;
+
+// Define MMIO public data structures.
+ mmCkInfo = record
+ ckid : FourCC; // Chunk id (FourCC)
+ ckSize : LongInt; // Chunk Size (bytes)
+ fccType : FourCC; // FourCC Type (if ckid RIFF or LIST)
+ ulDataOffset : LongInt; // File Offset of data portion of chunk
+ ulFlags : LongInt; // MMIO_DIRTY (if new chunk)
+ end;
+ pmmCkInfo = ^mmCkInfo;
+ lpmmckinfo = pmmckinfo; // MS compat define */
+
+ mmIOProc = function( pmmIOInfo: Pointer; usMsg: Word; lp1, lp2: LongInt): LongInt;
+ pmmIOProc = mmIOProc;
+ pCodecProc = mmIOProc;
+ ppmmioproc = mmIOProc;
+ LPMMIOProc = pmmIOProc;
+
+ mmIOInfo = record
+ ulFlags : LongInt; // Open flags
+ fccIOProc : FourCC; // FourCC of the IOProc to use
+ pIOProc : mmIOProc; // Function Pointer to IOProc to use
+ ulErrorRet : LongInt; // Extended Error return code
+ cchBuffer : LongInt; // I/O buff size (if used), Fsize if MEM
+ pchBuffer : pChar; // Start of I/O buff
+ pchNext : pChar; // Next char to read or write in buff
+ pchEndRead : pChar; // Last char in buff can be read + 1
+ pchEndWrite : pChar; // Last char in buff can be written + 1
+ lBufOffset : LongInt; // Offset in buff to pchNext
+ lDiskOffset : LongInt; // Disk offset in file
+ aulInfo : Array[0..3] of LongInt; // IOProc specific fields
+ lLogicalFilePos : LongInt; // Actual file position, buffered or not
+ ulTranslate : LongInt; // Translation field
+ fccChildIOProc : FourCC; // FourCC of Child IOProc
+ pExtraInfoStruct : Pointer; // Pointer to a structure of related data
+ mmio : hmmIO; // Handle to media element
+ end;
+ pmmIOInfo = ^mmIOInfo;
+ lpmmIOInfo = pmmIOInfo;
+
+
+ mmCfInfo = record
+ ulHeaderSize : LongInt; // CTOC header size
+ ulEntriesTotal : LongInt; // Num of CTOC table entries
+ ulEntriesDeleted : LongInt; // Num of CTOC table entries deleted
+ ulEntriesUnused : LongInt; // Num of unused CTOC entries
+ ulBytesTotal : LongInt; // Combined byte size of all CGRP elements
+ ulBytesDeleted : LongInt; // Byte size of all deleted CGRP elements
+ ulHeaderFlags : LongInt; // Info about entire compound file (CF)
+ usEntrySize : Word; // Size of each CTOC table entry
+ usNameSize : Word; // Size of name field in entry, default 13
+ usExHdrFields : Word; // Num CTOC header extra fields
+ usExEntFields : Word; // Num CTOC entry extra fields
+ end;
+
+// Note: The are variable length DWORD arrays that may be present
+// at the end of the MMCFINFO structure.
+
+// DWORD (*adwExHdrFldUsage)[]; */ // Array of header extra usage fields */
+// DWORD (*adwExtEntFldUsage)[]; */ // Array of entry extra usage fields */
+// DWORD (*adwExHdrField)[]; */ // Array of header extra fields */
+ pmmCfInfo = ^mmCfInfo;
+ lpmmCfInfo = pmmcfInfo;
+
+ mmCtocEntry = record
+ ulOffset : LongInt; // Offset of element within CGRP
+ ulSize : LongInt; // Size of element
+ ulMedType : LongInt; // Fourcc of element
+ ulMedUsage : LongInt; // Possible sub type
+ ulCompressTech : LongInt; // Compression technique used
+ ulUncompressBytes : LongInt; // Actual size of uncompressed element
+ end;
+
+
+// Note: A variable length name field and possibly a DWORD array may
+// be present at the end of the MMCTOCENTRY structure.
+
+// DWORD (*adwExEntField)[]; */ // Array of entry extra fields */
+// PSZ pszElementName[]; */ // Name of element, variable length */
+
+ pmmCtocEntry = ^mmCtocEntry;
+ lpmmCtocEntry = pmmCtocEntry;
+
+// Conversion Flags/Data Structures:
+
+const
+ // Conversion Flags/Data Structures:
+ MMIO_MEDIATYPE_IMAGE = $00000001; // Image media
+ MMIO_MEDIATYPE_AUDIO = $00000002; // Audio media
+ MMIO_MEDIATYPE_MIDI = $00000004; // MIDI media
+ MMIO_MEDIATYPE_COMPOUND = $00000008; // Cmpd media
+ MMIO_MEDIATYPE_OTHER = $00000010; // Other media
+ MMIO_MEDIATYPE_UNKNOWN = $00000020; // Unknown media
+ MMIO_MEDIATYPE_DIGITALVIDEO = $00000040; // Digital Video
+ MMIO_MEDIATYPE_ANIMATION = $00000080; // Future: Not Supported
+ MMIO_MEDIATYPE_MOVIE = $00000100; // Movie File
+
+ MMIO_CANREADTRANSLATED = $00000001; //IOProc Cpbilty Flgs
+ MMIO_CANWRITETRANSLATED = $00000002; // " " "
+ MMIO_CANREADWRITETRANSLATED = $00000004; // " " "
+ MMIO_CANREADUNTRANSLATED = $00000008; // " " "
+ MMIO_CANWRITEUNTRANSLATED = $00000010; // " " "
+ MMIO_CANREADWRITEUNTRANSLATED = $00000020; // " " "
+ MMIO_CANSEEKTRANSLATED = $00000040; // " " "
+ MMIO_CANSEEKUNTRANSLATED = $00000080; // " " "
+ MMIO_CANINSERTUNTRANSLATED = $00000100; // " " "
+ MMIO_CANSAVEUNTRANSLATED = $00000200; // " " "
+ MMIO_CANINSERTTRANSLATED = $00000400; // " " "
+ MMIO_CANSAVETRANSLATED = $00000800; // " " "
+ MMIO_CANMULTITRACKREADTRANSLATED = $00001000; // " " "
+ MMIO_CANMULTITRACKREADUNTRANSLATED = $00002000; // " " "
+ MMIO_CANMULTITRACKWRITETRANSLATED = $00004000; // " " "
+ MMIO_CANMULTITRACKWRITEUNTRANSLATED = $00008000; // " " "
+ MMIO_CANTRACKSEEKTRANSLATED = $00010000; // " " "
+ MMIO_CANTRACKSEEKUNTRANSLATED = $00020000; // " " "
+ MMIO_CANTRACKREADTRANSLATED = $00040000; // " " "
+ MMIO_CANTRACKREADUNTRANSLATED = $00080000; // " " "
+ MMIO_CANTRACKWRITETRANSLATED = $00100000; // " " "
+ MMIO_CANTRACKWRITEUNTRANSLATED = $00200000; // " " "
+
+ MMIO_IOPROC_STORAGESYSTEM = $00000001; // IOProc Types
+ MMIO_IOPROC_FILEFORMAT = $00000002;
+ MMIO_IOPROC_DATAFORMAT = $00000004;
+
+Type
+ mmFormatInfo = record
+ ulStructLen : LongInt; // Length of this structure
+ fccIOProc : FourCC; // IOProc identifier
+ ulIOProcType : LongInt; // Type of IOProc
+ ulMediaType : LongInt; // Media Type
+ ulFlags : LongInt; // IOProc capability flags
+ szDefaultFormatExt : Array[0..Sizeof(FourCC)] of Char;
+ // Default extension 4 + null
+ ulCodePage : LongInt; // Code Page
+ ulLanguage : LongInt; // Language
+ lNameLength : LongInt; // length of identifier string
+ end;
+ pmmFormatInfo = ^mmFormatInfo;
+
+Const
+ MMIO_IMAGE_UNKNOWN = $00000000; // Unknown image content
+ MMIO_IMAGE_DRAWING = $00000001; // Simple drawing
+ MMIO_IMAGE_GRAPH = $00000002; // Graphs & Cartoons
+ MMIO_IMAGE_PHOTO = $00000004; // Varying Color & Shades
+
+ MAX_PALETTE = 256;
+
+//*********************************************
+// *
+// * GENPAL - Generic Header Palette
+// *
+// **********************************************/
+
+Type
+ RGB2 = record
+ bBlue: Byte; { Blue component of the color definition }
+ bGreen: Byte; { Green component of the color definition}
+ bRed: Byte; { Red component of the color definition }
+ fcOptions: Byte; { Reserved, must be zero }
+ end;
+ PRGB2 = ^RGB2;
+
+Type
+ GENPAL = RECORD // genpal */
+ ulStartIndex:LongInt; // starting RGB index */
+ ulNumColors:LongInt; // number of following entries */
+ prgb2Entries:PRGB2; // 256 RGB entries */
+ end;
+ PGENPAL = ^GENPAL; // Ptr to a generic palette */
+
+Type
+ BitMapInfoHeader2 = record
+ cbFix: LongInt; { Length of structure }
+ cx: LongInt; { Bit-map width in pels }
+ cy: LongInt; { Bit-map height in pels }
+ cPlanes: Word; { Number of bit planes }
+ cBitCount: Word; { Number of bits per pel within a plane }
+ ulCompression: Longint; { Compression scheme used to store the bitmap }
+ cbImage: Longint; { Length of bit-map storage data in bytes}
+ cxResolution: Longint; { x resolution of target device }
+ cyResolution: Longint; { y resolution of target device }
+ cclrUsed: Longint; { Number of color indices used }
+ cclrImportant: Longint; { Number of important color indices }
+ usUnits: Word; { Units of measure }
+ usReserved: Word; { Reserved }
+ usRecording: Word; { Recording algorithm }
+ usRendering: Word; { Halftoning algorithm }
+ cSize1: Longint; { Size value 1 }
+ cSize2: Longint; { Size value 2 }
+ ulColorEncoding: Longint; { Color encoding }
+ ulIdentifier: Longint; { Reserved for application use }
+ end;
+ pbitmapinfoheader2=^bitmapinfoheader2;
+
+ xdibHdr_Prefix = record
+ ulMemSize : LongInt; // Length of bitmap
+ ulPelFormat : LongInt;
+ usTransType : Word;
+ ulTransVal : LongInt;
+ end;
+
+ mmxdibHeader = record // XDIB Header
+ XDIBHeaderPrefix : XDIBHDR_PREFIX;
+ BMPInfoHeader2 : BITMAPINFOHEADER2;
+ end;
+ pmmxdibHeader = ^mmxdibHeader;
+
+ mmImageHeader = record
+ ulHeaderLength : LongInt; // Length in Bytes
+ ulContentType : LongInt; // Image content
+ ulMediaType : LongInt; // Media Type
+ mmXDIBHeader : mmXDIBHeader; // OS/2 2.0 PM compat header
+ bmiColors : Array[0..MAX_PALETTE-1] of RGB2; // PM compatible palette
+ end;
+ pmmImageHeader = ^mmImageHeader;
+
+
+Const
+ MMIO_AUDIO_UNKNOWN = $00000000; // Unknown image content
+ MMIO_AUDIO_VOICE = $00000001; // Limited Range
+ MMIO_AUDIO_MUSIC = $00000002; // FM Radio or equivalent
+ MMIO_AUDIO_HIFI = $00000004; // High quality recording
+
+Type
+ Wave_Header = record
+ usFormatTag : Word; // Type of wave format
+ usChannels : Word; // Number of channels
+ ulSamplesPerSec : LongInt; // Sampling rate
+ ulAvgBytesPerSec : LongInt; // Avg bytes per sec
+ usBlockAlign : Word; // Block Alignment in bytes
+ usBitsPerSample : Word; // Bits per sample
+ end;
+
+ xWav_HeaderInfo = record
+ ulAudioLengthInMS : LongInt; // Audio data in millisecs
+ ulAudioLengthInBytes : LongInt; // Audio data in bytes
+ pAdditionalInformation : Pointer;
+ end;
+
+ mmxWav_Header = record
+ WAVEHeader : WAVE_HEADER; // Per RIFF WAVE Definition
+ XWAVHeaderInfo : XWAV_HEADERINFO; // Extended wave definition
+ end;
+
+ mmAudioHeader = record
+ ulHeaderLength : LongInt; // Length in Bytes
+ ulContentType : LongInt; // Image content
+ ulMediaType : LongInt; // Media Type
+ mmXWAVHeader : MMXWAV_HEADER; // header
+ end;
+ pmmAudioHeader = ^mmAudioHeader;
+
+Const
+ MMIO_MIDI_UNKNOWN = $00000000; // Unknown midi content
+ MMIO_MIDI_VOICE = $00000001; // Limited Range
+ MMIO_MIDI_MUSIC = $00000002; // FM Radio or equivalent
+ MMIO_MIDI_HIFI = $00000004; // High quality recording
+
+// MMPMMMIO.INI file structure and definitions.
+ CCHMAXPATH = 260;
+ DLLNAME_SIZE = CCHMAXPATH;
+ PROCNAME_SIZE = 32;
+ MAX_EXTENSION_NAME = 4;
+
+Type
+ mmIniFileInfo = record
+ fccIOProc : FourCC; // IOProc identifier
+ szDLLName : Array[0..DLLName_Size-1] of Char; // DLL name string
+ szProcName : Array[0..ProcName_Size-1] of Char; // Procedure name string
+ ulFlags : LongInt; // Flags for Preload
+ ulExtendLen : LongInt; // Length of ext fields
+ ulMediaType : LongInt; // Media type
+ ulIOProcType : LongInt; // Type of IOProc
+ szDefExt : Array[0..Max_Extension_Name] of Char;
+ end;
+ pmmIniFileInfo = ^mmIniFileInfo;
+
+// CODEC Structures and type definitions for Rel. 1.1
+Const
+ CODEC_INFO_SIZE = 8;
+ CODEC_HW_NAME_SIZE = 32;
+
+Type
+ CodecIniFileInfo = record
+ ulStructLen : LongInt; // length of this structure
+ fcc : FourCC; // File Format ID
+ szDLLName : Array[0..DLLName_Size-1] of Char; // DLL name string
+ szProcName : Array[0..ProcName_Size-1] of Char; // Procedure name string
+ ulCompressType : LongInt; // Compression Type
+ ulCompressSubType : LongInt; // Compression SubType
+ ulMediaType : LongInt; // Media type
+ ulCapsFlags : LongInt; // capabilities flags
+ ulFlags : LongInt; // flags
+ szHWID : Array[0..Codec_HW_Name_Size-1] of Char; // specific information
+ ulMaxSrcBufLen : LongInt; // max source buffer length
+ ulSyncMethod : LongInt; // Synchronization method
+ fccPreferredFormat: LongInt; // Preferred output format
+ ulXalignment : LongInt; // x alignment - video only
+ ulYalignment : LongInt; // y alignment - video only
+ ulSpecInfo : Array[0..Codec_Info_Size-1] of LongInt; // specific information
+ end;
+ pCodecIniFileInfo = ^CodecIniFileInfo;
+
+Const
+ // CODECINIFILEINFO synchronization method (ulSyncMethod) values.
+ CODEC_SYNC_METHOD_NO_DROP_FRAMES = 0;
+ CODEC_SYNC_METHOD_DROP_FRAMES_IMMEDIATELY = 1;
+ CODEC_SYNC_METHOD_DROP_FRAMES_PRECEDING_KEY = 2;
+ CODEC_SYNC_METHOD_HARDWARE = 3;
+
+ // CODECINIFILEINFO capabilities (ulCapsFlags) values.
+ CODEC_COMPRESS = $00000001;
+ CODEC_DECOMPRESS = $00000002;
+ CODEC_WINDOW_CLIPPING = $00000004;
+ CODEC_PALETTE_TRANS = $00000008;
+ CODEC_SELFHEAL = $00000010;
+ CODEC_SCALE_PEL_DOUBLE = $00000020;
+ CODEC_SCALE_PEL_HALVED = $00000040;
+ CODEC_SCALE_CONTINUOUS = $00000080;
+ CODEC_MULAPERTURE = $00000100;
+ CODEC_4_BIT_COLOR = $00000200;
+ CODEC_8_BIT_COLOR = $00000400;
+ CODEC_16_BIT_COLOR = $00000800;
+ CODEC_24_BIT_COLOR = $00001000;
+ CODEC_HARDWARE = $00002000;
+ CODEC_SYMMETRIC = $00004000;
+ CODEC_ASYMMETRIC = $00008000;
+ CODEC_DIRECT_DISPLAY = $00010000;
+ CODEC_DEFAULT = $00020000;
+ CODEC_ORIGIN_LOWERLEFT = $00040000;
+ CODEC_ORIGIN_UPPERLEFT = $00080000;
+ CODEC_SET_QUALITY = $00100000; // quality level is settable
+ CODEC_DATA_CONSTRAINT = $00200000; // data constraint supported
+ CODEC_HW_OVERLAY = $00400000;
+ CODEC_MULTI_BUFFER = $00800000;
+ CODEC_DITHER_OUTPUT = $01000000;
+
+ // Audio related flags
+ CODEC_COMP_REALTIME = $00020000;
+ CODEC_DECOMP_REALTIME = $00040000;
+
+// CODECINIFILEINFO Flag Values (ulFlags) values.
+
+ // Bit definitions for mmioSet()
+ MMIO_SET_EXTENDEDINFO = $0001;
+ MMIO_QUERY_EXTENDEDINFO_BASE = $0002;
+ MMIO_QUERY_EXTENDEDINFO_ALL = $0004;
+
+Type
+ // CODECASSOC structure
+ CodecAssoc = record
+ pCodecOpen : Pointer; // codec specific open header
+ pCODECIniInfo : PCodecIniFileInfo; // codecinifileinfo
+ end;
+ pCodecAssoc = ^CodecAssoc;
+
+ // MMEXTENDINFO structure
+ mmExtendInfo = record
+ ulStructLen : LongInt; // length of this structure
+ ulBufSize : LongInt; // total buffer size
+ ulFlags : LongInt; // flags
+ ulTrackID : LongInt; // track ID
+ ulNumCODECs : LongInt; // number of codec entries
+ pCODECAssoc : PCodecAssoc; // pointer to codec info array
+ end;
+ pmmExtendInfo = ^mmExtendInfo;
+
+const
+ // MMEXTENDINFO operation (ulFlags) values.
+ MMIO_TRACK = $00000001;
+ MMIO_NORMAL_READ = $00000002;
+ MMIO_SCAN_READ = $00000004;
+ MMIO_REVERSE_READ = $00000008;
+ MMIO_CODEC_ASSOC = $00000100;
+
+ // Audio Related defines
+ MMIO_REALTIME_CODEC = $00000200;
+
+ MMIO_RESETTRACKS = -1; // Turns off the active track number.
+
+ CODEC_START = $0EC0;
+ CODEC_END = $0EFF;
+
+ MMIOM_CODEC_CLOSE = CODEC_START + 1;
+ MMIOM_CODEC_OPEN = CODEC_START + 2;
+ MMIOM_CODEC_QUERYNAME = CODEC_START + 3;
+ MMIOM_CODEC_QUERYNAMELENGTH = CODEC_START + 4;
+ MMIOM_CODEC_COMPRESS = CODEC_START + 5;
+ MMIOM_CODEC_DECOMPRESS = CODEC_START + 6;
+
+ MMIOMP_CODEC_HW_CONTROL_STOP_DISCARD =0;
+ MMIOMP_CODEC_HW_CONTROL_STOP_FLUSH =1;
+ MMIOMP_CODEC_HW_CONTROL_STOP_PAUSE =2;
+ MMIOMP_CODEC_HW_CONTROL_DATATYPE =3;
+
+ // Flags:
+ MMIO_CREATE = $00000001; // Open
+ MMIO_CTOCFIRST = $00000002; // Open
+ MMIO_READ = $00000004; // Open
+ MMIO_WRITE = $00000008; // Open
+ MMIO_READWRITE = $00000010; // Open
+ MMIO_COMPAT = $00000020; // Open
+ MMIO_EXCLUSIVE = $00000040; // Open
+ MMIO_DENYWRITE = $00000080; // Open
+ MMIO_DENYREAD = $00000100; // Open
+ MMIO_DENYNONE = $00000200; // Open
+ MMIO_ALLOCBUF = $00000400; // Open
+ MMIO_DELETE = $00000800; // Open
+
+ MMIO_USE_TEMP = $00001000; // Open/Close/Save
+
+ MMIO_INSERTON = $00000001; // Insert
+ MMIO_INSERTOFF = $00000002; // Insert
+
+ MMIO_RWMODE = $00001000; // Open
+ MMIO_SHAREMODE = $00002000; // Open
+
+ MMIO_DIRTY = $00004000; // Write
+
+ MMIO_VERTBAR = $00008000; // Open
+ MMIO_BUFSHARED = $00010000; // Open
+ MMIO_APPEND = $00020000; // Open
+ MMIO_NOIDENTIFY = $00040000; // Open
+
+ MMIO_FINDFIRST = $00000001; // CF Find Entry
+ MMIO_FINDNEXT = $00000002; // CF Find Entry
+ MMIO_FINDUNUSED = $00000004; // CF Find Entry
+ MMIO_FINDDELETED = $00000008; // CF Find Entry
+
+ MMIO_CHANGEDELETED = $0001; // CF Change Entry
+
+ MMIO_CF_FQNAME = $0001; // CF Compact
+
+ MMIO_FHOPEN = $0001; // Close
+
+ MMIO_EMPTYBUF = $0001; // Flush
+
+ MMIO_CREATERIFF = $0001; // CreateChunk
+ MMIO_CREATELIST = $0002; // CreateChunk
+ MMIO_FINDCHUNK = $0004; // Descend
+ MMIO_FINDRIFF = $0008; // Descend
+ MMIO_FINDLIST = $0010; // Descend
+
+ CTOC_HF_SEQUENTIAL = $00000001; // CTOC ulHeaderFlags
+ CTOC_HF_MEDSUBTYPE = $00000002; // CTOC ulHeaderFlags
+
+ CTOC_EFU_UNUSED = $00000000; // CTOC extra usage code
+ CTOC_EFU_LASTMODTIME = $00000001; // CTOC extra usage code
+ CTOC_EFU_CODEPAGE = $00000002; // CTOC extra usage code
+ CTOC_EFU_LANGUAGE = $00000003; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM0 = $00000005; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM1 = $00000006; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM2 = $00000007; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM3 = $00000008; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM4 = $00000009; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM5 = $0000000A; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM6 = $0000000B; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM7 = $0000000C; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM8 = $0000000D; // CTOC extra usage code
+ CTOC_EFU_COMPRESSPARAM9 = $0000000E; // CTOC extra usage code
+ CTOC_CharSET_STANDARD = $00000000; // CTOC charset value
+
+ MMIO_INSTALLPROC = $00000001; // Install IO Proc
+ MMIO_REMOVEPROC = $00000002; // Install IO Proc
+ MMIO_FINDPROC = $00000004; // Install IO Proc
+
+ MMIO_MATCHFIRST = $00000010; // Ini File Handler
+ MMIO_MATCHNEXT = $00000020; // Ini File Handler
+ MMIO_MATCHFourCC = $00000040; // Ini File Handler
+ MMIO_MATCHDLL = $00000080; // Ini File Handler
+ MMIO_MATCHPROCEDURENAME = $00000100; // Ini File Handler
+ MMIO_FULLPATH = $00000200; // Ini File Handler
+ MMIO_NOVERIFY = $00000400; // Ini File Handler
+ MMIO_MATCHCOMPRESSTYPE = $00000800; // Ini File Handler
+ MMIO_EXTENDED_STRUCT = $00001000; // Ini File ulFlags
+ MMIO_MATCHCOMPRESSSUBTYPE = $00002000; // Ini File Handler
+ MMIO_MATCHHWID = $00004000; // Ini File Handler
+ MMIO_MATCHCAPSFLAGS = $00008000; // Ini File Handler
+ MMIO_SKIPMATCH = $00010000; // Ini/Load Handler
+
+ MMIO_TOUPPER = $0001; // StringToFourcc
+
+ MMIO_CF_ENTRY_EXISTS = $00000001; // Add CGRP element
+
+ MMIO_FORCE_IDENTIFY_SS = $00000001; // Identify
+ MMIO_FORCE_IDENTIFY_FF = $00000002; // Identify
+
+ MMIO_NOTRANSLATE = $00000000; // Translation
+ MMIO_TRANSLATEDATA = $00000001; // Translation
+ MMIO_TRANSLATEHEADER = $00000002; // Translation
+ MMIO_DECOMPRESS = $00000004; // CODEC Decompress
+
+ MMIO_DEFAULTBUFFER = 8192; // two pages under OS/2 2.0
+
+ MMIO_SEEK_IFRAME = $00010000; // Seek to nearest previous IFRAME
+
+
+
+ // Messages :
+ MMIOM_START = $0E00;
+ MMIOM_END = $0EFF;
+
+ MMIOM_GETCF = MMIOM_START + 1;
+ MMIOM_GETCFENTRY = MMIOM_START + 2;
+
+ MMIOM_CLOSE = MMIOM_START + 3;
+ MMIOM_OPEN = MMIOM_START + 4;
+ MMIOM_READ = MMIOM_START + 5;
+ MMIOM_SEEK = MMIOM_START + 6;
+ MMIOM_WRITE = MMIOM_START + 7;
+
+ MMIOM_IDENTIFYFILE = MMIOM_START + 8;
+ MMIOM_GETHEADER = MMIOM_START + 9;
+ MMIOM_SETHEADER = MMIOM_START + 10;
+ MMIOM_QUERYHEADERLENGTH = MMIOM_START + 11;
+ MMIOM_GETFORMATNAME = MMIOM_START + 12;
+ MMIOM_GETFORMATINFO = MMIOM_START + 13;
+ MMIOM_SEEKBYTIME = MMIOM_START + 14;
+ MMIOM_TEMPCHANGE = MMIOM_START + 15;
+ MMIOM_BEGININSERT = MMIOM_START + 16;
+ MMIOM_ENDINSERT = MMIOM_START + 17;
+ MMIOM_SAVE = MMIOM_START + 18;
+ MMIOM_SET = MMIOM_START + 19;
+ MMIOM_COMPRESS = MMIOM_START + 20;
+ MMIOM_DECOMPRESS = MMIOM_START + 21;
+ MMIOM_MULTITRACKREAD = MMIOM_START + 22;
+ MMIOM_MULTITRACKWRITE = MMIOM_START + 23;
+ MMIOM_DELETE = MMIOM_START + 24;
+ MMIOM_BEGINGROUP = MMIOM_START + 25;
+ MMIOM_ENDGROUP = MMIOM_START + 26;
+ MMIOM_UNDO = MMIOM_START + 27;
+ MMIOM_REDO = MMIOM_START + 28;
+ MMIOM_BEGINSTREAM = MMIOM_START + 29;
+ MMIOM_ENDSTREAM = MMIOM_START + 30;
+
+
+ MMIOM_CUT = MMIOM_START + 31;
+ MMIOM_COPY = MMIOM_START + 32;
+ MMIOM_PASTE = MMIOM_START + 33;
+ MMIOM_CLEAR = MMIOM_START + 34;
+ MMIOM_STATUS = MMIOM_START + 35;
+ MMIOM_WINMSG = MMIOM_START + 36;
+ MMIOM_BEGINRECORD = MMIOM_START + 37;
+ MMIOM_ENDRECORD = MMIOM_START + 38;
+
+ // These 3 new messages were added with feature 11710
+ MMIOM_QUERYIMAGE = MMIOM_START + 39;
+ MMIOM_QUERYIMAGECOUNT = MMIOM_START + 40;
+ MMIOM_SETIMAGE = MMIOM_START + 41;
+
+
+ MMIO_REALTIME = $00000001;
+ MMIO_NONREALTIME = $00000002;
+
+ MMIOM_USER = $0F00;
+ MMIOM_USER_END = $0FFF;
+
+Type
+ // Parameter structure for MMIOM_STATUS
+ mmIO_Status_Parms = record
+ hwndWindow : hwnd; // Some items require a window handle
+ ulReturn : LongInt; // Return field
+ ulItem : LongInt; // Use MCI_STATUS_... flags here
+ ulValue : LongInt; // Status value field
+ ulType : LongInt; // MCI_FORMAT_... of ulReturn
+ end;
+ pmmIO_Status_Parms = ^mmIO_Status_Parms;
+
+ // Parameter structure for MMIOM_COPY, MMIOM_CUT, MMIOM_CLEAR and MMIOM_PASTE
+ uSec = LongInt; // microsecond time format
+
+ mmIO_mEdit_Parms = record
+ ulStrucLen : LongInt; // length of this structure
+ hwndWindow : hwnd; // window handle
+ ulStartTime : uSec; // starting time in usec
+ ulDuration : uSec; // duration in usec
+ ulCurrentFilePosition : LongInt; // current file position in usec
+ ulNewFilePosition : LongInt; // returned by IO proc in usec, MCD will issue a seek
+ ulNewFileLength : LongInt; // return by IO proc in usec, MCD updates its headers
+ pBuffer : Pointer; // optional buffer
+ ulBufferLength : LongInt; // optional buffer's length
+ pHeader : Pointer; // optional pointer to header for buffer
+ end;
+ pmmIO_mEdit_Parms = ^mmIO_mEdit_Parms;
+
+ // Parameter structure for MMIOM_WINMSG
+ mmIO_WinMsg = record
+ hwndWindow : hwnd; // these are the parameters
+ usMessage : Word; // ... passed to the
+ pParam1 : Pointer; // ... window procedure
+ pParam2 : Pointer; // ... by PM
+ end;
+ pmmIO_WinMsg = ^mmIO_WinMsg;
+
+// JPEG IOproc specific structure
+Const
+ YUV_YVU =$0080; //v013 Compressed data is YUV///
+ DST_Y =20;
+ DST_YY =25;
+
+Type
+ jpegoptions = record // this comment needed by h2inc ///
+ ulStructLen:Longint; // size of this sturcture ///
+ usQuantization:Array [0..4] of word; // Each number may be 1 - 65535 ///
+ usScale:Word; // 1 (1/8 Size) - 8 (Full Size; default) ///
+ ulColorOrder:LongInt; // YUV_YVU (Default) or ~YUV_YVU ///
+ usColorSpaceOut:Word; // DST_YY (Default) or DST_Y ///
+ end;
+ pJpegOptions = ^JpegOptions;
+
+// Include error codes for MMIO only.
+Const
+ MMIO_SUCCESS = 0;
+ MMIO_WARNING = 2;
+ MMIO_ERROR = -1;
+ MMIOERR_UNSUPPORTED_MESSAGE = -2;
+
+ MMIO_CF_SUCCESS = 0;
+ MMIO_CF_FAILURE = 1;
+
+
+ MMIO_NLS_CharSET_INFO = 8000; // RCDATA Name ID for NLS
+ MMIO_IOPROC_NAME_TABLE = 8500; // RCDATA Name ID for string table
+ MMIO_CODEC_NAME_TABLE = 9000; // RCDATA Name ID for Codec table
+
+// Numeric equivalents of fourcc's. These are needed for the resource
+// compiler.
+
+ HEX_FourCC_DOS = $20534f44;
+ HEX_FourCC_MEM = $204d454d;
+ HEX_FourCC_BND = $20444e42;
+ HEX_FourCC_CF = $20204643;
+
+// Country codes (CC), languages (LC), and dialects (DC).
+
+ MMIO_DEFAULT_CODE_PAGE = 437;
+
+ MMIO_CC_NONE = 000;
+ MMIO_CC_USA = 001;
+ MMIO_CC_CANADA = 002;
+ MMIO_CC_LATIN_AMERICA = 003;
+ MMIO_CC_GREECE = 030;
+ MMIO_CC_NETHERLANDS = 031;
+ MMIO_CC_BELGIUM = 032;
+ MMIO_CC_FRANCE = 033;
+ MMIO_CC_SPAIN = 034;
+ MMIO_CC_ITALY = 039;
+ MMIO_CC_SWITZERLAND = 041;
+ MMIO_CC_AUSTRIA = 043;
+ MMIO_CC_UNITED_KINGDOM = 044;
+ MMIO_CC_DENMARK = 045;
+ MMIO_CC_SWEDEN = 046;
+ MMIO_CC_NORWAY = 047;
+ MMIO_CC_WEST_GERMANY = 049;
+ MMIO_CC_MEXICO = 052;
+ MMIO_CC_BRAZIL = 055;
+ MMIO_CC_AUSTRALIA = 061;
+ MMIO_CC_NEW_ZEALAND = 064;
+ MMIO_CC_JAPAN = 081;
+ MMIO_CC_KOREA = 082;
+ MMIO_CC_CHINA = 086;
+ MMIO_CC_TAIWAN = 088;
+ MMIO_CC_TURKEY = 090;
+ MMIO_CC_PORTUGAL = 351;
+ MMIO_CC_LUXEMBOURG = 352;
+ MMIO_CC_ICELAND = 354;
+ MMIO_CC_FINLAND = 358;
+
+ MMIO_LC_NONE = 0;
+ MMIO_DC_NONE = 0;
+ MMIO_LC_ARABIC = 1;
+ MMIO_DC_ARABIC = 1;
+ MMIO_LC_BULGARIAN = 2;
+ MMIO_DC_BULGARIAN = 1;
+ MMIO_LC_CATALAN = 3;
+ MMIO_DC_CATALAN = 1;
+ MMIO_LC_TRADITIONAL_CHINESE = 4;
+ MMIO_DC_TRADITIONAL_CHINESE = 1;
+ MMIO_LC_SIMPLE_CHINESE = 4;
+ MMIO_DC_SIMPLE_CHINESE = 2;
+ MMIO_LC_CZECH = 5;
+ MMIO_DC_CZECH = 1;
+ MMIO_LC_DANISH = 6;
+ MMIO_DC_DANISH = 1;
+ MMIO_LC_GERMAN = 7;
+ MMIO_DC_GERMAN = 1;
+ MMIO_LC_SWISS_GERMAN = 7;
+ MMIO_DC_SWISS_GERMAN = 2;
+ MMIO_LC_GREEK = 8;
+ MMIO_DC_GREEK = 1;
+ MMIO_LC_US_ENGLISH = 9;
+ MMIO_DC_US_ENGLISH = 1;
+ MMIO_LC_UK_ENGLISH = 9;
+ MMIO_DC_UK_ENGLISH = 2;
+ MMIO_LC_SPANISH = 10;
+ MMIO_DC_SPANISH = 1;
+ MMIO_LC_SPANISH_MEXICAN = 10;
+ MMIO_DC_SPANISH_MEXICAN = 2;
+ MMIO_LC_FINNISH = 11;
+ MMIO_DC_FINNISH = 1;
+ MMIO_LC_FRENCH = 12;
+ MMIO_DC_FRENCH = 1;
+ MMIO_LC_BELGIAN_FRENCH = 12;
+ MMIO_DC_BELGIAN_FRENCH = 2;
+ MMIO_LC_CANADIAN_FRENCH = 12;
+ MMIO_DC_CANADIAN_FRENCH = 3;
+ MMIO_LC_SWISS_FRENCH = 12;
+ MMIO_DC_SWISS_FRENCH = 4;
+ MMIO_LC_HEBREW = 13;
+ MMIO_DC_HEBREW = 1;
+ MMIO_LC_HUNGARIAN = 14;
+ MMIO_DC_HUNGARIAN = 1;
+ MMIO_LC_ICELANDIC = 15;
+ MMIO_DC_ICELANDIC = 1;
+ MMIO_LC_ITALIAN = 16;
+ MMIO_DC_ITALIAN = 1;
+ MMIO_LC_SWISS_ITALIAN = 16;
+ MMIO_DC_SWISS_ITALIAN = 2;
+ MMIO_LC_JAPANESE = 17;
+ MMIO_DC_JAPANESE = 1;
+ MMIO_LC_KOREAN = 18;
+ MMIO_DC_KOREAN = 1;
+ MMIO_LC_DUTCH = 19;
+ MMIO_DC_DUTCH = 1;
+ MMIO_LC_BELGIAN_DUTCH = 19;
+ MMIO_DC_BELGIAN_DUTCH = 2;
+ MMIO_LC_NORWEGIAN_BOKMAL = 20;
+ MMIO_DC_NORWEGIAN_BOKMAL = 1;
+ MMIO_LC_NORWEGIAN_NYNORSK = 20;
+ MMIO_DC_NORWEGIAN_NYNORSK = 2;
+ MMIO_LC_POLISH = 21;
+ MMIO_DC_POLISH = 1;
+ MMIO_LC_BRAZILIAN_PORTUGUESE = 22;
+ MMIO_DC_BRAZILIAN_PORTUGUESE = 1;
+ MMIO_LC_PORTUGUESE = 22;
+ MMIO_DC_PORTUGUESE = 2;
+ MMIO_LC_RHAETO_ROMANIC = 23;
+ MMIO_DC_RHAETO_ROMANIC = 1;
+ MMIO_LC_ROMANIAN = 24;
+ MMIO_DC_ROMANIAN = 1;
+ MMIO_LC_RUSSIAN = 25;
+ MMIO_DC_RUSSIAN = 1;
+ MMIO_LC_SERBO_CROATIAN_LATIN = 26;
+ MMIO_DC_SERBO_CROATIAN_LATIN = 1;
+ MMIO_LC_SERBO_CROATIAN_CYRILLIC = 26;
+ MMIO_DC_SERBO_CROATIAN_CYRILLIC = 2;
+ MMIO_LC_SLOVAK = 27;
+ MMIO_DC_SLOVAK = 1;
+ MMIO_LC_ALBANIAN = 28;
+ MMIO_DC_ALBANIAN = 1;
+ MMIO_LC_SWEDISH = 29;
+ MMIO_DC_SWEDISH = 1;
+ MMIO_LC_THAI = 30;
+ MMIO_DC_THAI = 1;
+ MMIO_LC_TURKISH = 31;
+ MMIO_DC_TURKISH = 1;
+ MMIO_LC_URDU = 32;
+ MMIO_DC_URDU = 1;
+ MMIO_LC_BAHASA = 33;
+ MMIO_DC_BAHASA = 1;
+
+
+// Ultimotion CODEC type for CODECINIFILEINFO ulCompressType */
+//#define FOURCC_ULTI mmioFOURCC('U', 'L', 'T', 'I')
+Const
+// FOURCC_ULTI:FOURCC=0;
+ HEX_FOURCC_ULTI=$49544C55; // ITLU */
+
+// Indeo CODEC type for CODECINIFILEINFO ulCompressType */
+//#define FOURCC_RT21 mmioFOURCC('R', 'T', '2', '1')
+// FOURCC_RT21:FOURCC=0;
+ HEX_FOURCC_RT21=$31325452; // 12TR */
+
+// Mondo CODEC type for CODECINIFILEINFO ulCompressType */
+//#define FOURCC_DIB mmioFOURCC('D', 'I', 'B', ' ')
+// FOURCC_DIB:FOURCC=0;
+ HEX_FOURCC_DIB=$20424944; // BID */
+
+
+
+// CODECVIDEOHEADER - CODEC video Header
+Type
+ TCODECVIDEOHEADER=record // codecvidhdr */
+ ulStructLen:LongInt;
+ cx:LongInt;
+ cy:LongInt;
+ cPlanes:Integer;
+ cBitCount:Integer;
+ ulColorEncoding:LongInt;
+ genpal:GENPAL;
+ end;
+ PCodecVideoHeader=^TCODECVIDEOHEADER;
+
+// ulColorEncoding defines: */
+Const
+ MMIO_RGB_5_6_5 =$0001; // Each pixel is a RGB_5_6_5 datatype */
+ MMIO_RGB_24 =$0002; // Each pixel is a RGB_24 datatype */
+ MMIO_YUV_4_1_1 =$0004; // Each pixel is a YUV_4_1_1 datatype */
+ MMIO_COMPRESSED =$0008; // The data is compressed */
+ MMIO_YUV_24 =$0010; // Each pixel is a YUV_24 datatype */
+ MMIO_PALETTIZED =$0020; // The data is palettized */
+ MMIO_OS2_BITMAP24 =$0020; // The data is palettized */
+
+
+//*********************************************
+// *
+// * MMVIDEOOPEN - Video Open Structure
+// *
+// * This structure is passed on the CODEC open
+// * message when video compression is being done
+// * to indicate information such as quality,
+// * frame rate, data rate, and key frame rate.
+// *
+// * Quality:
+// *
+// * The ulQuality field specifies a scalar value
+// * in the range 0 - 10000, where 0 is the lowest
+// * quality and 10000 is the highest quality. A
+// * value of -1 specifies the default quality level,
+// * and the default quality level (e.g. 5000) is
+// * returned in the ulQuality field.
+// *
+// *
+// * Key Frame rate:
+//*
+// * The ulKeyFrameRate structure specifies the key
+// * frame (aka I-frame, reference frame) frequency.
+// * Every Nth frame is a key frame as specified.
+// * A value of zero specifies that no periodic key
+// * are to be compressed. Additional key frames may
+// * be inserted at any point by specifying
+// * MMIO_IS_KEY_FRAME in the MMCOMPRESS structure.
+// *
+// * example: ulKeyFrameRate = 5 results in:
+//*
+//* key delta delta delta delta key delta delta delta delta key delta...
+// *
+//*
+// * Frame rate:
+// *
+// * Rate = number of time units per second
+// * Scale = number of time units per frame
+// *
+// * examples: Rate = 30 Scale = 1 => 30 FPS
+// * Rate = 15 Scale = 1 => 15 FPS
+// * Rate = 25 Scale = 2 => 12.5 FPS
+// *
+// *
+// * Data Constraint:
+// *
+// * Compressors which are capable of constraining the
+// * resultant compressed video data rate use the
+// * information in the ulDataConstraint and
+// * ulConstraintInterval fields. A non-zero value
+//* in ulDataConstraint specifies the number of bytes
+// * which is not to be exceeded over an interval of
+// * frames in the output data stream, regardless of
+// * the requested quality level. This value only
+// * considers video data, i.e. audio data and file format
+// * overhead must be considered seperately when determining
+// * the final output file data rate. The interval of
+// * frames over which the data is constrained is specified
+//* in ulConstraintInterval. A value of zero for
+// * ulDataContraint specifies that the data rate is not
+// * to be constrained and is compressed according to
+// * the requested quality level.
+// *
+// * example 1: ulDataConstraint = 150000 ulConstraintInterval = 15
+// *
+// * This results in an output stream wherein the sizes of any 15
+// * consecutive frames does not exceed 150000 bytes. If the
+// * frame rate is 15 FPS, the resultant data rate will not
+// * exceed 150000 bytes per second.
+// *
+// * example 2: ulDataConstraint = 10000 ulConstraintInterval = 1
+// *
+// * This results in an output stream wherein any single frame
+// * does not exceed 10000 bytes. If the frame rate is 15 FPS,
+// * the resultant data rate will not exceed 150000 bytes per
+// * second. Note the difference between this case and example 1
+// * where individual frames may exceed 10000 bytes (the average)
+// * so long other frames in any 15 frame sequence are sufficiently
+// * smaller to satisfy the constraint within the constraint interval.
+// *
+// **********************************************/
+TYPE _MMVIDEOOPEN = RECORD // mmvidopen */
+ ulStructLen:LongInt;
+ ulQuality:LongInt;
+ ulKeyFrameRate:LongInt;
+ ulScale:LongInt;
+ ulRate:LongInt;
+ ulDataConstraint:LongInt;
+ ulConstraintInterval:LongInt;
+ end;
+TYPE PMMVIDEOOPEN = ^_MMVIDEOOPEN;
+
+
+TYPE _MMAUDIOOPEN = RECORD
+ ulStructLen:LongInt; // Length of struct */
+ ulSamplesPerBlock:LongInt; // Samples in each block of compressed data */
+ ulBytesPerBlock:LongInt; // uncompressed bytes in each block */
+ ulFlags:LongInt; // Compression flags */
+ ulBestGuess:LongInt; // Guess at avg. compression ratio */
+ ulBlockAlignment:LongInt; // Block alignment of codec */
+ ulLength:LongInt; // Length of the file */
+ hCodec:LongInt; // Codec handle */
+ pfnCodec:PCodecProc;
+ end;
+
+TYPE PMMAUDIOOPEN = ^_MMAUDIOOPEN;
+
+// defines for the ulFlags field of the BUFER_INFORMATION */
+
+CONST
+
+ BLOCK_ORIENTED =$00000001;
+ NON_LINEAR =$00000002;
+ INIT_CODEC =$00000004;
+
+//*********************************************
+// *
+// * CODECOPEN - CODEC open structure
+// *
+// **********************************************/
+TYPE _CODECOPEN = RECORD // codecopen */
+ ulFlags:LongInt; // flags & events - Refer to ulCapsFlags in CODECINIFILEINFO */
+ pControlHdr:Pointer; // control header - (codec specific) */
+ pSrcHdr:Pointer; // source header - Ptr CODECVIDEOHEADER */
+ pDstHdr:Pointer; // destination header - Ptr CODECVIDEOHEADER */
+ pOtherInfo:Pointer; // other information - Ptr MMVIDEOOPEN/MMAUDIOOPEN */
+ end;
+TYPE PCODECOPEN = ^_CODECOPEN;
+
+const
+ // CODECINIFILEINFO capabilities (ulCapsFlags) values.
+
+ Valid_CodecOpen_InputFlags = CODEC_DECOMPRESS or
+ CODEC_WINDOW_CLIPPING or
+ CODEC_PALETTE_TRANS or
+ CODEC_SELFHEAL or
+ CODEC_SCALE_PEL_DOUBLE or
+ CODEC_SCALE_PEL_HALVED or
+ CODEC_SCALE_CONTINUOUS or
+ CODEC_MULAPERTURE or
+ CODEC_HARDWARE or
+ CODEC_DIRECT_DISPLAY;
+// Stream handler communication */
+
+TYPE _AUDIO_CODEC_INFO = RECORD
+ ulStructLen:LongInt; // Length of struct */
+ ulBytesPerBlock:LongInt; // uncompressed bytes in each block */
+ ulBlockAlignment:LongInt; // Block alignment of codec */
+ hCodec:LongInt; // Codec handle */
+ pfnCodec:PCODECPROC;
+// LONG (* APIENTRY pfnCodec) (PVOID, SHORT, LONG, LONG); */
+ end;
+
+CONST
+ AUDIO_CODEC_INF =1000;
+
+
+//*********************************************
+// *
+// * MMCOMPRESS - Compress structure
+// *
+// **********************************************/
+TYPE _MMCOMPRESS = RECORD // mmcomp */
+ ulStructLen:LongInt; // length of this structure */
+ ulFlags:LongInt; // command and status flags */
+ ulSrcBufLen:LongInt; // source buffer size */
+ pSrcBuf:Pointer; // source buffer */
+ ulDstBufLen:LongInt; // destination buffer length */
+ pDstBuf:Pointer; // destination buffer */
+ pRunTimeInfo:Pointer; // control information */
+ end;
+TYPE PMMCOMPRESS = ^_MMCOMPRESS;
+
+// ulFlags Input values for MMCOMPRESS structure: */
+// Note: MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined */
+// below, but are listed here for information purposes only. */
+// MMIO_IS_KEY_FRAME This bit is set by the application */
+// to instruct the IOProc to compress */
+// the pSrcBuf into a key or reference */
+// frame. If the bit is not set, a */
+// delta frame is compressed. */
+// MMIO_IS_PALETTE A video palette is provided. This */
+// is set by the application. */
+
+
+//*********************************************
+// *
+// * MMVIDEOCOMPRESS - Video Compress structure
+// *
+// **********************************************/
+
+TYPE _MMVIDEOCOMPRESS = RECORD // mmvidcomp */
+ ulStructLen:LongInt; // Structure length */
+ genpalVideo:GENPAL; // Video stream palette */
+ pControlHdr:Pointer; // control header (codec specific) */
+ end;
+TYPE PMMVIDEOCOMPRESS = ^_MMVIDEOCOMPRESS;
+
+CONST
+
+START_DECOMPRESSION =$00000001;
+CONTINUE_DECOMPRESSION =$00000002;
+START_SEEK =$00000004;
+CONTINUE_SEEK =$00000008;
+
+//*********************************************
+// *
+// * MMDECOMPRESS - Decompress Structure
+// *
+// **********************************************/
+TYPE _MMDECOMPRESS = Record // mmdec */
+ ulStructLen:LongInt; // length of this structure */
+ ulFlags:LongInt; // command and status flags */
+ ulSrcBufLen:LongInt; // source buffer size */
+ pSrcBuf:Pointer; // source buffer */
+ ulDstBufLen:LongInt; // destination buffer length */
+ pDstBuf:pointer; // destination buffer */
+ pRunTimeInfo:Pointer; // control information Ptr to MMVIDEODECOMPRESS */
+ end;
+TYPE PMMDECOMPRESS = ^_MMDECOMPRESS;
+
+// ulFlags defines: */
+CONST
+
+ MMIO_DROP_DELTA_FRAME =$0001; // Input/Output - Tells the IOProc to drop the delta */
+ // frame if the pSrcBuf contains a delta */
+ // frame. On return, the bit is reset */
+ // if the delta frame is dropped. */
+ MMIO_IS_KEY_FRAME =$0002; // Output - This bit is set by the IOProc when */
+ // the data contained in the pSrcBuf is */
+ // a key or reference frame. */
+ MMIO_IS_PALETTE =$0004; // Output - A video palette has been found. */
+ // This is set by the IOProc. */
+ MMIO_PALETTE_CHANGE =$0008; // Input - The physical palette has been changed */
+ // in... This is set by the application. */
+ MMIO_ORIGIN_LOWERLEFT =$0010; // Input - The video frame origin */
+ MMIO_RECTL_CHANGE =$0020; // Input - The valid rectl list has changed. */
+ MMIO_ORIGIN_UPPERLEFT =$0040; // Input - The video frame origin */
+ MMIO_DROP_FRAME_DECODE=$0080; // Input - Tells the IOProc to drop decoding */
+ MMIO_HIGH_QUALITY =$0100; // Input - Tells Codec to render best */
+ // quality image - not time critical */
+ MMIO_IGNORE_CLIPPING =$0200; // Ignore clipping rectangles used for bitmap capture */
+ // high performance */
+ MMIO_OUTPUT_FULL_IMAGE=$0400; // Output a complete image on decompress, even if this*/
+ // is a delta frame */
+ // of the frame. */
+
+ VALID_DECOMPRESS_INPUTFLAGS = MMIO_DROP_DELTA_FRAME or
+ MMIO_PALETTE_CHANGE or
+ MMIO_ORIGIN_LOWERLEFT or
+ MMIO_RECTL_CHANGE or
+ MMIO_DROP_FRAME_DECODE or
+ MMIO_ORIGIN_UPPERLEFT or
+ MMIO_HIGH_QUALITY or
+ MMIO_IGNORE_CLIPPING or
+ MMIO_OUTPUT_FULL_IMAGE;
+
+
+ START_COMPRESSION =$00000001;
+ CONTINUE_COMPRESSION =$00000002;
+ SOURCE_UNUSED =$00000004;
+ TARGET_UNUSED =$00000008;
+
+//*********************************************
+// *
+// * MMVIDEODECOMPRESS - Video Decompress structure
+// *
+// **********************************************/
+TYPE RectL = record
+ xLeft: Longint;
+ yBottom: Longint;
+ xRight: Longint;
+ yTop: Longint;
+ end;
+TYPE PRECTL = ^RECTL;
+
+TYPE _MMVIDEODECOMPRESS = Record // mmviddec */
+ ulStructLen:LongInt; // Structure length */
+ ulRectlCount:LongInt; // Valid rectangle count - for clipping */
+ prectl:PRECTL; // Valid rectangle array - for clipping */
+ ulSkipLength:LongInt; // Skipped line length */
+ ulDecodeLines:LongInt; // Num of lines to decompress */
+ genpalPhysical:GENPAL; // Physical palette */
+ genpalVideo:GENPAL; // Video stream palette */
+ rectlSrc:RECTL; // Source window rectangle */
+ rectlDst:RECTL; // Destination window rectangle */
+ ulDeltaCount:LongInt; // Number of remaining delta frames before the next I-Frame */
+ ulParm1:LongInt; // Codec specific parm */
+ ulParm2:Longint; // Codec specific parm */
+ ulParm3:LongInt; // Codec specific parm */
+ ulParm4:LongInt; // Codec specific parm */
+ end;
+TYPE PMMVIDEODECOMPRESS = ^_MMVIDEODECOMPRESS;
+
+//************************************************
+// *
+// * RECORDTAB - Record table
+// *
+// * NOTE: This structure maps to ESRCBUFTAB in ssm.h
+// *************************************************/
+TYPE _RECORDTAB = record // recordtab */
+ ulReserved1:LongInt; // reserved for system */
+ pRecord:Pointer; // ptr to record in buffer */
+ ulLength:LongInt; // length of record */
+ ulReserved2:LongInt; // reserved for system */
+ ulReserved3:LongInt; // reserved for system */
+ ulParm1:LongInt; // Record specific data */
+ ulParm2:LongInt; // Record specific data */
+ end;
+TYPE PRECORDTAB=^_RECORDTAB; // Ptr to a buffer entry */
+
+
+//**************************************************
+// *
+// * RECORDTABWRITE - Record table for video write
+// *
+// * NOTE: This structure maps to ETGTBUFTAB in ssm.h
+// ***************************************************/
+TYPE _RECORDTABWRITE=RECORD // recordtab */
+ pRecord:Pointer; // ptr to record in buffer */
+ ulReserved1:Longint; // reserved for system */
+ ulLength:Longint; // length of record */
+ ulReserved2:longint; // reserved for system */
+ ulReserved3:longint; // reserved for system */
+ ulParm1:longint; // Record specific data */
+ ulParm2:longint; // Record specific data */
+ end;
+type precordtabwrite=^_recordtabwrite;// Ptr to a buffer entry */
+
+
+// ulParm1 Return values for MULTITRACK_READ only: */
+// Note: MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined */
+// above, but are listed here for information purposes only */
+// as they are valid ulParm1 Return values for MULTITRACK_READ. */
+// MMIO_IS_KEY_FRAME Frame is a Key frame */
+// MMIO_IS_PALETTE Buffer contains a video palette */
+
+CONST
+
+ MMIO_INVISIBLE_FRAME =$1000; // Indicates a invisible video frame */
+ MMIO_NULL_FRAME =$2000; // Indicates a null video frame (zero length) */
+
+// ulParm2 Return values for MULTITRACK_READ only: */
+// This field contains the frame number for this video frame */
+// if this track is a video track. */
+
+
+
+// ulParm1 Input values for MULTITRACK_WRITE only: */
+// Note: MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined */
+// above, but are listed here for information purposes only */
+// as they are valid ulParm1 Input values for MULTITRACK_WRITE. */
+// MMIO_IS_KEY_FRAME Frame is a Key frame */
+// MMIO_IS_PALETTE Buffer contains a video palette */
+
+// ulParm2 Input values for MULTITRACK_WRITE only: */
+// This field contains the number of null frames */
+// that should be inserted before this frame */
+// (this recordtab entry). */
+
+
+//***********************************************
+// *
+// * TRACKMAP - This structure maps a track to
+// * a record table.
+// *
+// ************************************************/
+TYPE _TRACKMAP = RECORD // trackmap */
+ ulTrackID:LongInt; // Input - track ID */
+ ulNumEntries:LongInt; // Input - number of record entries */
+ pRecordTabList:PRecordTab; // Input/Output - Ptr to a record table */
+ end;
+TYPE PTRACKMAP=^_TRACKMAP; // Ptr to a track map table entry */
+
+//*********************************************
+// *
+// * MMMULTITRACKREAD - Multiple Track Read
+// *
+// **********************************************/
+TYPE _MMMULTITRACKREAD=RECORD // mtread */
+ ulLength:LongInt; // Input - Size of buffer to read. The IO should be performed on this size of */
+ // buffer. The actual buffer size may be bigger and is given in the */
+ // ulBufferLength field below. Video frames can span pBuffer+ulLength */
+ // as long as the frame is less than the ulBufferLength in size. */
+ // The purpose of this is to break the IO reads into smaller sizes */
+ // while still allowing large frame sizes. */
+ pBuffer:Pointer; // Input - ptr to read buffer */
+ ulFlags:LongInt; // Input/Output - read flags */
+ ulNumTracks:LongInt; // Input - number of track entries */
+ pTrackMapList:PTRACKMAP; // Input - ptr to track-to-record list */
+// End of old MMMULTITRACKREAD structure */
+ ulBufferLength:LongInt; // Input - Actual length of read buffer */
+ ulReserved:longInt; // Input - Reserved (must be 0) */
+ end;
+TYPE PMMMULTITRACKREAD=^_MMMULTITRACKREAD;
+
+// ulFlags Input Values: */
+
+CONST
+
+ MULTITRACKREAD_EXTENDED =$0004; // Indicates that the new extended multitrack */
+ // read structure is passed from caller instead */
+ // of the previous multitrack read structure. */
+
+// ulFlags Return Values: */
+ MULTITRACKREAD_NOTDONE =$0001; // Read is not done. Another read of the same */
+ // buffer is necessary. There were not enough record */
+ // entries in the record table passed to this api. */
+ MULTITRACKREAD_EOF =$0002; // End of File. Used because # bytes read may not */
+ // match the length of the buffer in cases of a */
+ // record that spans in the next buffer. */
+
+
+//*********************************************
+// *
+// * MMMULTITRACKWRITE - Multiple Track Write
+// *
+// **********************************************/
+TYPE _MMMULTITRACKWRITE=RECORD // mtwrite */
+ ulNumTracks:LongInt; // Input - number of track entries */
+ pTrackMapList:PTRACKMAP; // Input - ptr to track-to-record list */
+ ulFlags:LongInt; // Input - write flags (Default = 0) */
+ ulReserved:LongInt; // Input - Reserved (must be 0) */
+ end;
+TYPE PMMMULTITRACKWRITE=^_MMMULTITRACKWRITE;
+
+// ulFlags Input Values: */
+
+CONST
+
+ MULTITRACKWRITE_MERGE =$0001; // Attempt to interleave the data on the write. */
+ // The default (without this flag set) is to */
+ // write all records for each track then write */
+ // all records of the next track and so on. */
+
+
+//*********************************************
+// *
+// * MMMOVIEHEADER - standard movie header data
+// *
+// **********************************************/
+TYPE MMTrackInfo = record
+ ulTrackID : Longint; // track identifier
+ ulMediaType : Longint; // media type
+ ulCountry : Longint; // country code for the track
+ ulCodePage : Longint; // country code page for the track
+ ulReserved1 : Longint; // reserved must be 0
+ ulReserved2 : Longint; // reserved must be 0
+ end;
+//TYPE pMMTrackInfo = ^MMTrackInfo;
+
+//TYPE
+// PSZ = PChar;
+
+TYPE _MMMOVIEHEADER=RECORD // mmhdr */
+ ulStructLen:LongInt; // length of this structure */
+ ulContentType:LongInt; // movie content type */
+ ulMediaType:LongInt; // video media type */
+ ulMovieCapsFlags:LongInt; // capabilities */
+ ulMaxBytesPerSec:LongInt; // maximum transfer rate */
+ ulPaddingGranularity:LongInt;// pad to a multiple of this size */
+ ulSuggestedBufferSize:LongInt;
+ ulStart:LongInt; // delay time marking beginning or start of movie */
+ ulLength:LongInt;
+ ulNextTrackID:LongInt; // next available track id */
+ ulNumEntries:LongInt; // number of track entries */
+ pmmTrackInfoList:PMMTRACKINFO; // track information */
+ pszMovieTitle:PSZ; // movie title */
+ ulCountry:LongInt; // country code for the title string */
+ ulCodePage:LongInt; // country code page the title string */
+ ulAvgBytesPerSec:LongInt; // average transfer rate */
+ end;
+TYPE PMMMOVIEHEADER=^_MMMOVIEHEADER;
+
+// ulMovieCapsFlags Defines: */
+CONST
+
+ MOVIE_HAS_VIDEO =$0001; // The movie contains video. */
+ MOVIE_HAS_AUDIO =$0002; // The movie contains audio. */
+ MOVIE_CAN_SEEK =$0004; // The movie can seek. */
+ MOVIE_CAN_SCAN =$0008; // The movie can fast scan. */
+ MOVIE_HAS_COPYRIGHT =$0010; // The movie contains copyrighted data. */
+ MOVIE_WAS_CAPTUREFILE =$0020; // The movie is a specially allocated */
+ // file used for capturing real-time */
+ // video. Applications should warn */
+ // the user before writing over a file */
+ // with this flag set because the user */
+ // probably defragmented this file. */
+ // If this flag is set, then there is a chance */
+ // that not all of the records will be written */
+ // on the call. Caller must check for this whether */
+ // this flag is set or not. */
+
+//*********************************************
+// *
+// * MMVIDEOHEADER - Movie Video Track Header
+// *
+// **********************************************/
+
+TYPE _MMVIDEOHEADER=RECORD // mmvhdr */
+ ulStructLen:LongInt; // length of this structure */
+ ulContentType:LongInt; // video content type */
+ ulMediaType:LongInt; // video media type */
+ ulVideoCapsFlags:LongInt; // capabilities */
+ ulWidth:LongInt; // video width in pels */
+ ulHeight:LongInt; // video height in pels */
+ ulScale:LongInt;
+ ulRate:LongInt; // Rate / Scale == frames/second */
+ ulStart:LongInt; // delay time marking beginning or start of stream */
+ ulLength:LongInt;
+ ulTotalFrames:LongInt; // total number of video frames */
+ ulInitialFrames:LongInt;
+ mmtimePerFrame:MMTIME; // frame display time or 0L */
+ ulSuggestedBufferSize:LongInt;
+ genpalVideo:GENPAL; // palette */
+ pmmXDIBHeader:PMMXDIBHEADER; // windows DIB compatible header */
+ ulHHRWidth:LongInt; // Actual width of HHR video */
+ fHHR:Boolean; // HHR flag */
+ end;
+TYPE PMMVIDEOHEADER=_MMVIDEOHEADER;
+
+// ulContentType Defines: */
+CONST
+
+ MMIO_VIDEO_UNKNOWN =$00000000; // Unknown video content */
+ MMIO_VIDEO_DATA =$00000001; // Video */
+
+
+//
+// Base function prototypes:
+///
+
+function mmioAdvance( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
+function mmioAscend( mmIO: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
+function mmioClose( mmIO: hmmio; usFlags: Word ): Word; cdecl;
+function mmioCreateChunk( mmio: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
+function mmioDescend( mmIO: hmmio; pckinfo, pckinfoParent: pMMCkInfo; usFlags: Word ): Word; cdecl;
+function mmioFlush( mmIO: hmmio; usFlags: Word ): Word; cdecl;
+function mmioGetInfo( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
+function mmioGetLastError( mmIO: hmmio ): Longint; cdecl;
+function mmioInstallIOProc( fccIOProc: FourCC; pIOProc: pMMIOProc; ulFlags: Longint ): pmmIOProc; cdecl;
+function mmioOpen( pszFileName: pChar; mmIOInfo: pmmioinfo; ulOpenFlags: Longint ): hMMIO; cdecl;
+function mmioRead( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
+function mmioSeek( mmIO: hmmio; lOffset, lOrigin: Longint ): Longint; cdecl;
+function mmioSendMessage( mmIO: hmmio; usMsg: Word; lParam1, lParam2: Longint ): Longint; cdecl;
+function mmioSetBuffer( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint; usFlags: Word ): Word; cdecl;
+function mmioSetInfo( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
+function mmioStringToFourCC( pszString: pChar; usFlags: Word ): FourCC; cdecl;
+function mmioWrite( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
+
+//
+// Compound File function prototypes:
+///
+
+function mmioCFOpen( pszFileName: pChar; CfInfo, IOInfo: pmmcfinfo; ulFlags: Longint ): hMMCF; cdecl;
+function mmioCFClose( mmCf: hmmcf; ulFlags: Longint ): Longint; cdecl;
+function mmioCFGetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
+function mmioCFSetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
+function mmioCFFindEntry( mmCf: hmmcf; ctocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
+function mmioCFAddEntry( mmCf: hmmcf; cTocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
+function mmioCFChangeEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
+function mmioCFDeleteEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
+function mmioCFAddElement( mmCf: hmmcf; pszElementName: pChar; fccType: FourCC;
+ pchBuffer: pChar; cchBytes: LongInt; ulFlags: Longint ): Longint; cdecl;
+
+function mmioCFCopy( mmCfSource: hmmcf; pszDestFileName: pChar; ulFlags: Longint ): Longint; cdecl;
+//
+// Conversion Utility function prototypes:
+///
+
+function mmioQueryFormatCount( FormatInfo: pmmformatinfo;
+ plNumFormats: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+
+function mmioGetFormats( FormatInfo: pmmformatinfo;
+ lNumFormats: LongInt; pFormatInfoList: Pointer; plFormatsRead: pLong;
+ ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+
+function mmioGetFormatName( FormatInfo: pmmformatinfo; pszFormatName: pChar;
+ plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+
+function mmioIdentifyFile( pszFileName: pChar; MMIoInfo: pmmioinfo;
+ FormatInfo: pmmformatinfo; pfccStorageSystem: pFourCC; ulReserved: Longint;
+ ulFlags: Longint ): Longint; cdecl;
+
+function mmioQueryHeaderLength( mmIO: hmmio; plHeaderLength: pLong;
+ ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+
+function mmioGetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
+ plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+
+function mmioSetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
+ plBytesWritten: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+
+function mmioIniFileHandler( IniFileInfo: pmminifileinfo; ulFlags: Longint ): Longint; cdecl;
+
+function mmioIdentifyStorageSystem( pszFileName: pChar;
+ MMIoInfo: pmmioinfo; pfccStorageSystem: pFourCC ): Longint; cdecl;
+
+function mmioDetermineSSIOProc( pszFileName: pChar; MMIoInfo: pmmioinfo;
+ pfccStorageSystem: pFourCC; pszParsedRemainder: pChar ): Longint; cdecl;
+
+function mmioQueryIOProcModuleHandle( IOProc: pMMIOProc;
+ IOProcModule: phModule ): Longint; cdecl;
+
+function mmioCFCompact( pszFileName: pChar; ulFlags: Longint ): Longint; cdecl;
+
+//
+// MMPMMMIO.INI file migration utility
+///
+
+function mmioMigrateIniFile( ulFlags: Longint ): Longint; cdecl;
+
+//
+// MMIO CODEC APIs
+///
+
+function mmioIniFileCODEC( IniFile: pCODECIniFileInfo; ulFlags: Longint ): Longint; cdecl;
+function mmioSet( mmIO: hmmio; ExtendInfo: pmmExtendInfo; ulFlags: Longint): Longint; cdecl;
+function mmioQueryCODECName( IniInfo: pCODECIniFileinfo;
+ pszCODECName: pChar; pulBytesRead: pLongint ): Longint; cdecl;
+
+function mmioQueryCODECNameLength( IniInfo: pCODECIniFileinfo;
+ pulNameLength: pLongint ): Longint; cdecl;
+
+function mmioLoadCODECProc( IniInfo: pCODECIniFileInfo;
+ Module: phModule; ulFlags: Longint ): pCodecProc; cdecl;
+
+function mmioGetData( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
+
+Implementation
+
+//-------
+function mmioAdvance( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
+ external LibName index 55;
+
+function mmioAscend( mmIO: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
+ external LibName index 49;
+
+function mmioClose( mmIO: hmmio; usFlags: Word ): Word; cdecl;
+ external LibName index 45;
+
+function mmioCreateChunk( mmio: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
+ external LibName index 51;
+
+function mmioDescend( mmIO: hmmio; pckinfo, pckinfoParent: pMMCkInfo; usFlags: Word ): Word; cdecl;
+ external LibName index 50;
+
+function mmioFlush( mmIO: hmmio; usFlags: Word ): Word; cdecl;
+ external LibName index 44;
+
+function mmioGetInfo( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
+ external LibName index 52;
+
+function mmioGetLastError( mmIO: hmmio ): Longint; cdecl;
+ external LibName index 38;
+
+function mmioInstallIOProc( fccIOProc: FourCC; pIOProc: pMMIOProc; ulFlags: Longint ): pmmIOProc; cdecl;
+ external LibName index 39;
+
+function mmioOpen( pszFileName: pChar; mmIOInfo: pmmioinfo; ulOpenFlags: Longint ): hMMIO; cdecl;
+ external LibName index 40;
+
+function mmioRead( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
+ external LibName index 41;
+
+function mmioSeek( mmIO: hmmio; lOffset, lOrigin: Longint ): Longint; cdecl;
+ external LibName index 43;
+
+function mmioSendMessage( mmIO: hmmio; usMsg: Word; lParam1, lParam2: Longint ): Longint; cdecl;
+ external LibName index 54;
+
+function mmioSetBuffer( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint; usFlags: Word ): Word; cdecl;
+ external LibName index 56;
+
+function mmioSetInfo( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
+ external LibName index 53;
+
+function mmioStringToFourCC( pszString: pChar; usFlags: Word ): FourCC; cdecl;
+ external LibName index 37;
+
+function mmioWrite( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
+ external LibName index 42;
+
+function mmioCFOpen( pszFileName: pChar; CfInfo, IOInfo: pmmcfinfo; ulFlags: Longint ): hMMCF; cdecl;
+ external LibName index 57;
+
+function mmioCFClose( mmCf: hmmcf; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 58;
+
+function mmioCFGetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
+ external LibName index 64;
+
+function mmioCFSetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
+ external LibName index 65;
+
+function mmioCFFindEntry( mmCf: hmmcf; ctocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 62;
+
+function mmioCFAddEntry( mmCf: hmmcf; cTocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 59;
+
+function mmioCFChangeEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 61;
+
+function mmioCFDeleteEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 60;
+
+function mmioCFAddElement( mmCf: hmmcf; pszElementName: pChar; fccType: FourCC;
+ pchBuffer: pChar; cchBytes: LongInt; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 63;
+
+function mmioCFCopy( mmCfSource: hmmcf; pszDestFileName: pChar; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 66;
+
+function mmioQueryFormatCount( FormatInfo: pmmformatinfo;
+ plNumFormats: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 87;
+
+function mmioGetFormats( FormatInfo: pmmformatinfo;
+ lNumFormats: LongInt; pFormatInfoList: Pointer; plFormatsRead: pLong;
+ ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 88;
+
+function mmioGetFormatName( FormatInfo: pmmformatinfo; pszFormatName: pChar;
+ plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 93;
+
+function mmioIdentifyFile( pszFileName: pChar; MMIoInfo: pmmioinfo;
+ FormatInfo: pmmformatinfo; pfccStorageSystem: pFourCC; ulReserved: Longint;
+ ulFlags: Longint ): Longint; cdecl;
+ external LibName index 92;
+
+function mmioQueryHeaderLength( mmIO: hmmio; plHeaderLength: pLong;
+ ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 89;
+
+function mmioGetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
+ plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 90;
+
+function mmioSetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
+ plBytesWritten: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 91;
+
+function mmioIniFileHandler( IniFileInfo: pmminifileinfo; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 98;
+
+function mmioIdentifyStorageSystem( pszFileName: pChar;
+ MMIoInfo: pmmioinfo; pfccStorageSystem: pFourCC ): Longint; cdecl;
+ external LibName index 100;
+
+function mmioDetermineSSIOProc( pszFileName: pChar; MMIoInfo: pmmioinfo;
+ pfccStorageSystem: pFourCC; pszParsedRemainder: pChar ): Longint; cdecl;
+ external LibName index 101;
+
+function mmioQueryIOProcModuleHandle( IOProc: pMMIOProc;
+ IOProcModule: phModule ): Longint; cdecl;
+ external LibName index 106;
+
+function mmioCFCompact( pszFileName: pChar; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 113;
+
+//--------
+function mmioMigrateIniFile( ulFlags: Longint ): Longint; cdecl;
+ external LibName index 111;
+
+//
+// MMIO CODEC APIs
+///
+
+function mmioIniFileCODEC( IniFile: pCODECIniFileInfo; ulFlags: Longint ): Longint; cdecl;
+ external LibName index 112;
+
+function mmioSet( mmIO: hmmio; ExtendInfo: pmmExtendInfo; ulFlags: Longint): Longint; cdecl;
+ external LibName index 114;
+
+function mmioQueryCODECName( IniInfo: pCODECIniFileinfo;
+ pszCODECName: pChar; pulBytesRead: pLongint ): Longint; cdecl;
+ external LibName index 115;
+
+function mmioQueryCODECNameLength( IniInfo: pCODECIniFileinfo;
+ pulNameLength: pLongint ): Longint; cdecl;
+ external LibName index 118;
+
+function mmioLoadCODECProc( IniInfo: pCODECIniFileInfo;
+ Module: phModule; ulFlags: Longint ): pCodecProc; cdecl;
+ external LibName index 117;
+
+function mmioGetData( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
+ external LibName index 119;
+
+
+end.
diff --git a/packages/os2units/src/som.pas b/packages/os2units/src/som.pas
new file mode 100644
index 0000000000..e9db651961
--- /dev/null
+++ b/packages/os2units/src/som.pas
@@ -0,0 +1,1523 @@
+{
+ Copyright (c) 1994-1996 by International Business Machines Corporation
+ Copyright (c) 1997 Antony T Curtis.
+ Copyright (c) 2002-2005 by Yuri Prokushev (prokushev@freemail.ru)
+
+ System Object Model Run-time library API (SOM.DLL)
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+Unit SOM;
+
+Interface
+
+{$mode objfpc}
+{$warning This units doesn't work because FPC/2 doesn't implements external vars}
+{$warning This code is alpha!}
+
+//uses
+// SOMTypes;
+
+var
+{$warning support of external vars required}
+ SOM_MajorVersion, SOM_MinorVersion :Longint; (* SOM Version Numbers *)
+//³ 00070 ³ SOM_MajorVersion
+//³ 00071 ³ SOM_MinorVersion
+{$warning support of external vars required}
+ SOM_MaxThreads :Longint; // ³ 00095 ³ SOM_MaxThreads (* SOM Thread Support *)
+
+type
+ Flags =Longint;
+
+type
+ TSOMObject = Pointer;
+ SOMClassType = Pointer;
+ SOMMSingleInstanceType = Pointer;
+ SOMClassMgrType = Pointer;
+ SOMClassPtr = ^SOMClassType;
+ PSOMClass = ^SOMClassType;
+ PSOMObject = ^TSOMObject;
+ CORBAObjectType = TSOMObject; (* in SOM, a CORBA object is a SOM object *)
+
+ somToken =Pointer; (* Uninterpretted value *)
+ somId =^PChar;
+ somIdPtr =^somId;
+ PsomToken =^somToken; (* Uninterpretted value *)
+
+ somMToken =somToken;
+ somDToken =somToken;
+ somMTokenPtr =^somMToken;
+ somDTokenPtr =^somDToken;
+
+type
+ ImplId =^PChar;
+ RepositoryId = PChar;
+ AttributeDef_AttributeMode = Cardinal;
+ OperationDef_OperationMode = Longint;
+ ParameterDef_ParameterMode = Cardinal;
+
+ somMethodPtr =Pointer;
+ somBooleanVector =^Byte;
+ somCtrlInfo =somToken;
+
+ somSharedMethodData =somToken;
+ somSharedMethodDataPtr=^somSharedMethodData;
+
+ somClassInfoPtr =^somClassInfo;
+ somClassInfo =somToken;
+
+
+ Identifier =PChar; (* CORBA 7.5.1, p. 129 *)
+
+ TypeCode = pointer;
+
+(* CORBA 5.7, p.89 *)
+ any = record
+ _type : TypeCode;
+ _value : Pointer;
+ end;
+
+ NamedValue =record
+ name : Identifier;
+ argument : any;
+ len : Longint;
+ arg_modes : Flags;
+ end;
+
+(* -- Method/Data Tokens -- For locating methods and data members. *)
+
+ somRdAppType =LongInt; (* method signature code -- see def below *)
+ somFloatMap =Array[0..13] of LongInt; (* float map -- see def below *)
+ somFloatMapPtr =^somFloatMapPtr;
+
+ somMethodInfoStruct =record
+ callType :somRdAppType;
+ va_listSize :Longint;
+ float_map :somFloatMapPtr;
+ end;
+ somMethodInfo =somMethodInfoStruct;
+ somMethodInfoPtr =^somMethodInfo;
+
+ somMethodDataStruct =record
+ id :somId;
+ ctype :Longint; (* 0=static, 1=dynamic 2=nonstatic *)
+ descriptor :somId; (* for use with IR interfaces *)
+ mToken :somMToken; (* NULL for dynamic methods *)
+ method :somMethodPtr; (* depends on resolution context *)
+ shared :somSharedMethodDataPtr;
+ end;
+ somMethodData =somMethodDataStruct;
+ somMethodDataPtr =^somMethodDataStruct;
+
+ somMethodProc =Procedure(somSelf:TSOMObject);
+ somMethodProcPtr =^somMethodProc;
+
+
+(*---------------------------------------------------------------------
+ * C++-style constructors are called initializers in SOM. Initializers
+ * are methods that receive a pointer to a somCtrlStruct as an argument.
+ *)
+
+ somInitInfo =record
+ cls :SOMClassType;(* the class whose introduced data is to be initialized *)
+ defaultInit :somMethodProc;
+ defaultCopyInit :somMethodProc;
+ defaultConstCopyInit:somMethodProc;
+ defaultNCArgCopyInit:somMethodProc;
+ dataOffset :Longint;
+ legacyInit :somMethodProc;
+ end;
+
+ somDestructInfo =record
+ cls :SOMClassType;(* the class whose introduced data is to be destroyed *)
+ defaultDestruct :somMethodProc;
+ dataOffset :Longint;
+ legacyUninit :somMethodProc;
+ end;
+
+ somAssignInfo =record
+ cls :SOMClassType;(* the class whose introduced data is to be assigned *)
+ defaultAssign :somMethodProc;
+ defaultConstAssign :somMethodProc;
+ defaultNCArgAssign :somMethodProc;
+ udaAssign :somMethodProc;
+ udaConstAssign :somMethodProc;
+ dataOffset :Longint;
+ end;
+
+ _IDL_SEQUENCE_octet = record
+ _maximum : Cardinal;
+ _length : Cardinal;
+ _buffer : ^Byte;
+ end;
+ ReferenceData =_IDL_SEQUENCE_octet;
+
+(*
+ * A special info access structure pointed to by
+ * the parentMtab entry of somCClassDataStructure.
+ *)
+ somTD_somRenewNoInitNoZeroThunk =Procedure(var buf); cdecl;
+
+ somInitInfoPtr =^somInitInfo;
+
+ somInitCtrlStruct =record
+ mask :somBooleanVector;(* an array of booleans to control ancestor calls *)
+ info :somInitInfoPtr; (* an array of structs *)
+ infoSize :Longint; (* increment for info access *)
+ ctrlInfo :somCtrlInfo;
+ end;
+ somInitCtrl =somInitCtrlStruct;
+ som3InitCtrl =somInitCtrlStruct;
+
+ somDestructInfoPtr =^somDestructInfo;
+ somDestructCtrlStruct =record
+ mask :somBooleanVector;(* an array of booleans to control ancestor calls *)
+ info :somDestructInfoPtr;(* an array of structs *)
+ infoSize :Longint; (* increment for info access *)
+ ctrlInfo :somCtrlInfo;
+ end;
+ somDestructCtrl =somDestructCtrlStruct;
+ som3DestructCtrl =somDestructCtrlStruct;
+
+ somAssignInfoPtr =^somAssignInfo;
+ somAssignCtrlStruct =record
+ mask :somBooleanVector;(* an array of booleans to control ancestor calls *)
+ info :somAssignInfoPtr;(* an array of structs *)
+ infoSize :Longint; (* increment for info access *)
+ ctrlInfo :somCtrlInfo;
+ end;
+ somAssignCtrl =somAssignCtrlStruct;
+ som3AssignCtrl =somAssignCtrlStruct;
+
+(*----------------------------------------------------------------------
+ * The Class Data Structures -- these are used to implement static
+ * method and data interfaces to SOM objects.
+ *)
+
+type
+(* -- (Generic) Class data Structure *)
+ somClassDataStructure =record
+ classObject :SOMClassType; (* changed by shadowing *)
+ tokens :Array[0..0] of somToken; (* method tokens, etc. *)
+ end;
+ somClassDataStructurePtr=^somClassDataStructure;
+
+ somInitCtrlPtr =^somInitCtrl;
+ somDestructCtrlPtr =^somDestructCtrl;
+ somAssignCtrlPtr =^somAssignCtrl;
+
+(* -- For building lists of method tables *)
+ somMethodTabPtr =^somMethodTab;
+
+ somMethodTabs =^somMethodTabList;
+ somMethodTabList =record
+ mtab :somMethodTabPtr;
+ next :somMethodTabs;
+ end;
+
+ somParentMtabStruct =record
+ mtab :somMethodTabPtr; (* this class' mtab -- changed by shadowing *)
+ next :somMethodTabs; (* the parent mtabs -- unchanged by shadowing *)
+ classObject :SOMClassType; (* unchanged by shadowing *)
+ somRenewNoInitNoZeroThunk:somTD_somRenewNoInitNoZeroThunk; (* changed by shadowing *)
+ instanceSize :Longint; (* changed by shadowing *)
+ initializers :somMethodProcPtr; (* resolved initializer array in releaseorder *)
+ resolvedMTokens :somMethodProcPtr; (* resolved methods *)
+ initCtrl :somInitCtrl; (* these fields are filled in if somDTSClass&2 is on *)
+ destructCtrl :somDestructCtrl;
+ assignCtrl :somAssignCtrl;
+ embeddedTotalCount :Longint;
+ hierarchyTotalCount :Longint;
+ unused :Longint;
+ end;
+ somParentMtabStructPtr=^somParentMtabStruct;
+
+(*
+ * (Generic) Auxiliary Class Data Structure
+ *)
+ somCClassDataStructure=record
+ parentMtab :somParentMtabStructPtr;
+ instanceDataToken :somDToken;
+ wrappers :Array[0..0] of somMethodProc; (* for valist methods *)
+ end;
+ somCClassDataStructurePtr=^somCClassDataStructure;
+
+
+(*----------------------------------------------------------------------
+ * The Method Table Structure
+ *)
+
+(* -- to specify an embedded object (or array of objects). *)
+ somEmbeddedObjStructPtr=^somEmbeddedObjStruct;
+ somEmbeddedObjStruct =record
+ copp :SOMClassType; (* address of class of object ptr *)
+ cnt :Longint; (* object count *)
+ offset :Longint; (* Offset to pointer (to embedded objs) *)
+ end;
+
+ somMethodTabStruct =record
+ classObject :SOMClassType;
+ classInfo :somClassInfoPtr;
+ className :PChar;
+ instanceSize :Longint;
+ dataAlignment :Longint;
+ mtabSize :Longint;
+ protectedDataOffset :Longint; (* from class's introduced data *)
+ protectedDataToken :somDToken;
+ embeddedObjs :somEmbeddedObjStructPtr;
+ (* remaining structure is opaque *)
+ entries :Array[0..0] of somMethodProc;
+ end;
+ somMethodTab =somMethodTabStruct;
+
+(* -- For building lists of class objects *)
+ somClasses =^somClassList;
+ somClassList =record
+ cls :SOMClassType;
+ next :somClasses;
+ end;
+
+(* -- For building lists of objects *)
+ somObjects =^somObjectList;
+ somObjectList =record
+ obj :TSOMObject;
+ next :somObjects;
+ end;
+
+
+
+(*----------------------------------------------------------------------
+ * Method Stubs -- Signature Support
+ *
+ *
+ * This section defines the structures used to pass method signature
+ * ingo to the runtime. This supports selection of generic apply stubs
+ * and runtime generation of redispatchstubs when these are needed. The
+ * information is registered with the runtime when methods are defined.
+ *
+ * When calling somAddStaticMethod, if the redispatchStub is -1, then a
+ * pointer to a struct of type somApRdInfo is passed as the applyStub.
+ * Otherwise, the passed redispatchstub and applystub are taken as given.
+ * When calling somAddDynamicMethod, an actual apply stub must be passed.
+ * Redispatch stubs for dynamic methods are not available, nor is
+ * automated support for dynamic method apply stubs. The following
+ * atructures only appropriate in relation to static methods.
+ *
+ * In SOMr2, somAddStaticMethod can be called with an actual redispatchstub
+ * and applystub *ONLY* if the method doesn't return a structure. Recall
+ * that no SOMr1 methods returned structures, so SOMr1 binaries obey this
+ * restriction. The reason for this rule is that SOMr2 *may* use thunks,
+ * and thunks need to know if a structure is returned. We therefore assume
+ * that if no signature information is provided for a method through the
+ * somAddStaticMethod interface, then the method returns a scalar.
+ *
+ * If a structure is returned, then a -1 *must* be passed to
+ * somAddStaticMethod as a redispatchstub. In any case, if a -1 is passed,
+ * then this means that the applystub actually points to a structure of type
+ * somApRdInfo. This structure is used to hold and access signature
+ * information encoded as follows.
+ *
+ * If the somApRdInfo pointer is NULL, then, if the runtime was built with
+ * SOM_METHOD_STUBS defined, a default signature is assumed (no arguments,
+ * and no structure returned); otherwise, the stubs are taken as
+ * somDefaultMethod (which produces a runtime error when used) if dynamic
+ * stubs are not available.
+ *
+ * If the somApRdInfo pointer is not NULL, then the structure it points to can
+ * either include (non-null) redispatch and applystubs (the method is then
+ * assumed to return a structure), or null stubs followed by information needed
+ * to generate necessary stubs dynamically.
+ *)
+
+ somApRdInfoStruct =record
+ rdStub :somMethodProc;
+ apStub :somMethodProc;
+ stubInfo :somMethodInfoPtr;
+ end;
+ somApRdInfo =somApRdInfoStruct;
+
+
+(*
+ * Values for somRdAppType are generated by summing one from column A and one
+ * from column B of the following constants:
+ *)
+(* Column A: return type *)
+const
+ SOMRdRetsimple = 0; (* Return type is a non-float fullword *)
+ SOMRdRetfloat = 2; (* Return type is (single) float *)
+ SOMRdRetdouble = 4; (* Return type is double *)
+ SOMRdRetlongdouble = 6; (* Return type is long double *)
+ SOMRdRetaggregate = 8; (* Return type is struct or union *)
+ SOMRdRetbyte =10; (* Return type is a byte *)
+ SOMRdRethalf =12; (* Return type is a (2 byte) halfword *)
+(* Column B: are there any floating point scalar arguments? *)
+ SOMRdNoFloatArgs = 0;
+ SOMRdFloatArgs = 1;
+
+(* A somFloatMap is only needed on RS/6000 *)
+(*
+ * This is an array of offsets for up to the first 13 floating point arguments.
+ * If there are fewer than 13 floating point arguments, then there will be
+ * zero entries following the non-zero entries which represent the float args.
+ * A non-zero entry signals either a single- or a double-precision floating point
+ * argument. For a double-precision argument, the entry is the stack
+ * frame offset. For a single-precision argument the entry is the stack
+ * frame offset + 1. For the final floating point argument, add 2 to the
+ * code that would otherwise be used.
+ *)
+ SOMFMSingle = 1; (* add to indicate single-precision *)
+ SOMFMLast = 2; (* add to indicate last floating point arg *)
+
+const
+ SOM_SCILEVEL = 4;
+
+
+(* The SCI includes the following information:
+ *
+ * The address of a class's ClassData structure is passed.
+ * This structure should have the external name,
+ * <className>ClassData. The classObject field should be NULL
+ * (if it is not NULL, then a new class will not be built). somBuildClass will
+ * set this field to the address of the new class object when it is built.
+ *
+ * The address of the class's auxiliary ClassData structure is passed.
+ * Thi structure should have the external name,
+ * <className>CClassData. The parentMtab field will be set by somBuildClass.
+ * This field often allows method calls to a class object to be avoided.
+ *
+ * The other structures referenced by the static class information (SCI)
+ * are used to:
+ *)
+
+(*
+ * to specify a static method. The methodId used here must be
+ * a simple name (i.e., no colons). In all other cases,
+ * where a somId is used to identify a registered method,
+ * the somId can include explicit scoping. An explicitly-scoped
+ * method name is called a method descriptor. For example,
+ * the method introduced by TSOMObject as somGetClass has the
+ * method descriptor "TSOMObject::somGetClass". When a
+ * class is contained in an IDL module, the descriptor syntax
+ * <moduleName>::<className>::<methodName> can be used. Method
+ * descriptors can be useful when a class supports different methods
+ * that have the same name (note: IDL prevents this from occuring
+ * statically, but SOM itself has no problems with this).
+ *)
+
+type
+ somStaticMethodStruct =record
+ classData :somMTokenPtr;
+ methodId :somIdPtr; (* this must be a simple name (no colons) *)
+ methodDescriptor :somIdPtr;
+ method :somMethodPtr;//somMethodProc;
+ redispatchStub :somMethodPtr;//somMethodProc;
+ applyStub :somMethodPtr;//somMethodProc;
+ end;
+ somStaticMethod_t =somStaticMethodStruct;
+ somStaticMethod_p =^somStaticMethod_t;
+
+(* to specify an overridden method *)
+ somOverideMethodStruct=record
+ methodId :somIdPtr; (* this can be a method descriptor *)
+ method :somMethodPtr;//somMethodProc;
+ end;
+ somOverrideMethod_t =somOverideMethodStruct;
+ somOverrideMethod_p =^somOverrideMethod_t;
+
+(* to inherit a specific parent's method implementation *)
+ somInheritedMethodStruct=record
+ methodId :somIdPtr; (* identify the method *)
+ parentNum :Longint; (* identify the parent *)
+ mToken :somMTokenPtr; (* for parentNumresolve *)
+ end;
+ somInheritedMethod_t =somInheritedMethodStruct;
+ somInheritedMethod_p =^somInheritedMethod_t;
+
+(* to register a method that has been moved from this *)
+(* class <cls> upwards in the class hierachy to class <dest> *)
+ somMigratedMethodStruct=record
+ clsMToken :somMTokenPtr;
+ (* points into the <cls> classdata structure *)
+ (* the method token in <dest> will copied here *)
+ destMToken :somMTokenPtr;
+ (* points into the <dest> classdata structure *)
+ (* the method token here will be copied to <cls> *)
+ end;
+ somMigratedMethod_t =somMigratedMethodStruct;
+ somMigratedMethod_p =^somMigratedMethod_t;
+
+(* to specify non-internal data *)
+ somNonInternalDataStruct=record
+ classData :somDTokenPtr;
+ basisForDataOffset :PChar;
+ end;
+ somNonInternalData_t =somNonInternalDataStruct;
+ somNonInternalData_p =^somNonInternalData_t;
+
+(* to specify a "procedure" or "classdata" *)
+ somProcMethodsStruct =record
+ classData :somMethodProcPtr;
+ pEntry :somMethodProc;
+ end;
+ somProcMethods_t =somProcMethodsStruct;
+ somProcMethods_p =^somProcMethods_t;
+
+(* to specify a general method "action" using somMethodStruct *)
+(*
+ the type of action is specified by loading the type field of the
+ somMethodStruct. There are three bit fields in the overall type:
+
+ action (in type & 0xFF)
+ 0: static -- (i.e., virtual) uses somAddStaticMethod
+ 1: dynamic -- uses somAddDynamicMethod (classData==0)
+ 2: nonstatic -- (i.e., nonvirtual) uses somAddMethod
+ 3: udaAssign -- registers a method as the udaAssign (but doesn't add the method)
+ 4: udaConstAssign -- like 3, this doesn't add the method
+ 5: somClassResolve Override (using the class pointed to by *classData)
+ 6: somMToken Override (using the method token pointed to by methodId)
+ (note: classData==0 for this)
+ 7: classAllocate -- indicates the default heap allocator for this class.
+ If classData == 0, then method is the code address (or NULL)
+ If classData != 0, then *classData is the code address.
+ No other info required (or used)
+ 8: classDeallocate -- like 7, but indicates the default heap deallocator.
+ 9: classAllocator -- indicates a non default heap allocator for this class.
+ like 7, but a methodDescriptor can be given.
+
+ === the following is not currently supported ===
+ binary data access -- in (type & 0x100), valid for actions 0,1,2,5,6
+ 0: the method procedure doesn't want binary data access
+ 1: the method procedure does want binary data access
+
+ aggregate return -- in (type & 0x200), used when binary data access requested
+ 0: method procedure doesn't return a structure
+ 1: method procedure does return a structure
+*)
+
+ somMethodStruct =record
+ mtype :Longint;
+ classData :somMTokenPtr;
+ methodId :somIdPtr;
+ methodDescriptor :somIdPtr;
+ method :somMethodProc;
+ redispatchStub :somMethodProc;
+ applyStub :somMethodProc;
+ end;
+ somMethods_t =somMethodStruct;
+ somMethods_p =^somMethods_t;
+
+(* to specify a varargs function *)
+ somVarargsFuncsStruct =record
+ classData :somMethodProcPtr;
+ vEntry :somMethodProc;
+ end;
+ somVarargsFuncs_t =somVarargsFuncsStruct;
+ somVarargsFuncs_p =^somVarargsFuncs_t;
+
+(* to specify dynamically computed information (incl. embbeded objs) *)
+ somDynamicSCIPtr =^somDynamicSciPtr;
+ somDynamicSCI =record
+ version :Longint; (* 1 for now *)
+ instanceDataSize :Longint; (* true size (incl. embedded objs) *)
+ dataAlignment :Longint; (* true alignment *)
+ embeddedObjs :somEmbeddedObjStructPtr; (* array end == null copp *)
+ end;
+
+
+(*
+ to specify a DTS class, use the somDTSClass entry in the following
+ data structure. This entry is a bit vector interpreted as follows:
+
+ (somDTSClass & 0x0001) == the class is a DTS C++ class
+ (somDTSClass & 0x0002) == the class wants the initCtrl entries
+ of the somParentMtabStruct filled in.
+
+*)
+
+
+
+(*
+ * The Static Class Info Structure passed to somBuildClass
+ *)
+
+ somStaticClassInfoStruct=record
+ layoutVersion :Longint; (* this struct defines layout version SOM_SCILEVEL *)
+ numStaticMethods :Longint; (* count of smt entries *)
+ numStaticOverrides :Longint; (* count of omt entries *)
+ numNonInternalData :Longint; (* count of nit entries *)
+ numProcMethods :Longint; (* count of pmt entries *)
+ numVarargsFuncs :Longint; (* count of vft entries *)
+ majorVersion :Longint;
+ minorVersion :Longint;
+ instanceDataSize :Longint; (* instance data introduced by this class *)
+ maxMethods :Longint; (* count numStaticMethods and numMethods *)
+ numParents :Longint;
+ classId :somId;
+ explicitMetaId :somId;
+ implicitParentMeta :Longint;
+ parents :somIdPtr;
+ cds :somClassDataStructurePtr;
+ ccds :somCClassDataStructurePtr;
+ smt :somStaticMethod_p; (* basic "static" methods for mtab *)
+ omt :somOverrideMethod_p; (* overrides for mtab *)
+ nitReferenceBase :PChar;
+ nit :somNonInternalData_p; (* datatokens for instance data *)
+ pmt :somProcMethods_p; (* Arbitrary ClassData members *)
+ vft :somVarargsFuncs_p; (* varargs stubs *)
+ cif :pointer{^somTP_somClassInitFunc}; (* class init function *)
+ (* end of layout version 1 *)
+
+ (* begin layout version 2 extensions *)
+ dataAlignment :Longint; (* the desired byte alignment for instance data *)
+ (* end of layout version 2 *)
+
+//#define SOMSCIVERSION 1
+
+ (* begin layout version 3 extensions *)
+ numDirectInitClasses:Longint;
+ directInitClasses :somIdPtr;
+ numMethods :Longint; (* general (including nonstatic) methods for mtab *)
+ mt :somMethods_p;
+ protectedDataOffset :Longint; (* access = resolve(instanceDataToken) + offset *)
+ somSCIVersion :Longint; (* used during development. currently = 1 *)
+ numInheritedMethods :Longint;
+ imt :somInheritedMethod_p; (* inherited method implementations *)
+ numClassDataEntries :Longint; (* should always be filled in *)
+ classDataEntryNames :somIdPtr; (* either NULL or ptr to an array of somIds *)
+ numMigratedMethods :Longint;
+ mmt :somMigratedMethod_p; (* migrated method implementations *)
+ numInitializers :Longint; (* the initializers for this class *)
+ initializers :somIdPtr; (* in order of release *)
+ somDTSClass :Longint; (* used to identify a DirectToSOM class *)
+ dsci :somDynamicSCIPtr; (* used to register dynamically computed info *)
+ (* end of layout version 3 *)
+ end;
+ somStaticClassInfo =somStaticClassInfoStruct;
+ somStaticClassInfoPtr =^somStaticClassInfoStruct;
+
+
+type
+(*----------------------------------------------------------------------
+ * Typedefs for pointers to functions
+ *)
+
+ Contained_Description = record
+ name : Identifier;
+ value : any;
+ end;
+
+ InterfaceDef_FullInterfaceDescription = record
+ name : Identifier;
+ id, defined_in : RepositoryId;
+ {operation : IDL_SEQUENCE_OperationDef_OperationDescription;
+ attributes : IDL_SEQUENCE_AttributeDef_AttributeDescription;}
+ end;
+
+ InterfaceDef_InterfaceDescription = record
+ name : Identifier;
+ id, defined_in : RepositoryId;
+ end;
+
+(* CORBA 7.6.1, p.139 plus 5.7, p.89 enum Data Type Mapping *)
+type
+ TCKind = Cardinal;
+const
+ TypeCode_tk_null = 1;
+ TypeCode_tk_void = 2;
+ TypeCode_tk_short = 3;
+ TypeCode_tk_long = 4;
+ TypeCode_tk_ushort = 5;
+ TypeCode_tk_ulong = 6;
+ TypeCode_tk_float = 7;
+ TypeCode_tk_double = 8;
+ TypeCode_tk_boolean = 9;
+ TypeCode_tk_char = 10;
+ TypeCode_tk_octet = 11;
+ TypeCode_tk_any = 12;
+ TypeCode_tk_TypeCode = 13;
+ TypeCode_tk_Principal = 14;
+ TypeCode_tk_objref = 15;
+ TypeCode_tk_struct = 16;
+ TypeCode_tk_union = 17;
+ TypeCode_tk_enum = 18;
+ TypeCode_tk_string = 19;
+ TypeCode_tk_sequence = 20;
+ TypeCode_tk_array = 21;
+
+ TypeCode_tk_pointer = 101; (* SOM extension *)
+ TypeCode_tk_self = 102; (* SOM extension *)
+ TypeCode_tk_foreign = 103; (* SOM extension *)
+
+(* Short forms of tk_<x> enumerators *)
+
+ tk_null = TypeCode_tk_null;
+ tk_void = TypeCode_tk_void;
+ tk_short = TypeCode_tk_short;
+ tk_long = TypeCode_tk_long;
+ tk_ushort = TypeCode_tk_ushort;
+ tk_ulong = TypeCode_tk_ulong;
+ tk_float = TypeCode_tk_float;
+ tk_double = TypeCode_tk_double;
+ tk_boolean = TypeCode_tk_boolean;
+ tk_char = TypeCode_tk_char;
+ tk_octet = TypeCode_tk_octet;
+ tk_any = TypeCode_tk_any;
+ tk_TypeCode = TypeCode_tk_TypeCode;
+ tk_Principal = TypeCode_tk_Principal;
+ tk_objref = TypeCode_tk_objref;
+ tk_struct = TypeCode_tk_struct;
+ tk_union = TypeCode_tk_union;
+ tk_enum = TypeCode_tk_enum;
+ tk_string = TypeCode_tk_string;
+ tk_sequence = TypeCode_tk_sequence;
+ tk_array = TypeCode_tk_array;
+ tk_pointer = TypeCode_tk_pointer;
+ tk_self = TypeCode_tk_self;
+ tk_foreign = TypeCode_tk_foreign;
+
+type
+ SOMClass_somOffsets = record
+ cls : SOMClassType;
+ offset : Longint;
+ end;
+
+ _IDL_SEQUENCE_SOMClass = record
+ _maximum : Cardinal;
+ _length : Cardinal;
+ _buffer : SOMClassPtr;
+ end;
+ _IDL_SEQUENCE_SOMObject = record
+ _maximum : Cardinal;
+ _length : Cardinal;
+ _buffer : PSOMObject;
+ end;
+ SOMClass_SOMClassSequence = _IDL_SEQUENCE_SOMClass;
+
+(*----------------------------------------------------------------------
+ * Windows extra procedures:
+ *)
+
+(*
+ * Replaceable character output handler.
+ * Points to the character output routine to be used in development
+ * support. Initialized to <somOutChar>, but may be reset at anytime.
+ * Should return 0 (false) if an error occurs and 1 (true) otherwise.
+ *)
+type
+ somTD_SOMOutCharRoutine =Function(ch:Char):Longint; cdecl;
+
+var
+{$warning support of external vars required}
+ SOMOutCharRoutine :somTD_SOMOutCharRoutine;//³ 00015 ³ SOMOutCharRoutine
+
+Procedure somSetOutChar(outch:somTD_SOMOutCharRoutine); cdecl;
+ external 'som' name 'somSetOutChar'; {index 85}
+
+Function somMainProgram:SOMClassMgrType; cdecl;
+ external 'som' name 'somMainProgram'; {index 88}
+Procedure somEnvironmentEnd; cdecl;
+ external 'som' name 'somEnvironmentEnd'; {index 83}
+Function somAbnormalEnd:Boolean; cdecl;
+ external 'som' name 'somAbnormalEnd'; {index 84}
+
+(*--------------------------------------------------------*)
+
+
+(*---------------------------------------------------------------------
+ * Offset-based method resolution.
+ *)
+
+Function somResolve(obj:TSOMObject; mdata:somMToken):{somMethodProc}pointer; cdecl;
+ external 'som' name 'somResolve'; {index 37}
+Function somParentResolve(parentMtabs:somMethodTabs;
+ mToken:somMToken):somMethodProc; cdecl;
+ external 'som' name 'somParentResolve'; {index 33}
+Function somParentNumResolve(parentMtabs:somMethodTabs;
+ parentNum:Longint;mToken:somMToken):{somMethodProc}pointer; cdecl;
+ external 'som' name 'somParentNumResolve'; {index 50}
+Function somClassResolve(obj:SOMClassType; mdata:somMToken):{somMethodProc}pointer; cdecl;
+ external 'som' name 'somClassResolve'; {index 48}
+Function somAncestorResolve(obj:TSOMObject; (* the object *)
+ var ccds:somCClassDataStructure; (* id the ancestor *)
+ mToken:somMToken):{somMethodProc}pointer; cdecl;
+ external 'som' name 'somAncestorResolve'; {index 74}
+Function somResolveByName(obj:TSOMObject;
+ methodName:PChar):{somMethodProc}pointer; cdecl;
+ external 'som' name 'somResolveByName'; {index 61}
+(*------------------------------------------------------------------------------
+ * Offset-based data resolution
+ *)
+Function somDataResolve(obj:TSOMObject; dataId:somDToken):somToken; cdecl;
+ external 'som' name 'somDataResolve'; {index 47}
+Function somDataResolveChk(obj:TSOMObject; dataId:somDToken):somToken; cdecl;
+ external 'som' name 'somDataResolveChk'; {index 72}
+
+
+(*----------------------------------------------------------------------
+ * Misc. procedures:
+ *)
+
+(*
+ * Create and initialize the SOM environment
+ *
+ * Can be called repeatedly
+ *
+ * Will be called automatically when first object (including a class
+ * object) is created, if it has not already been done.
+ *
+ * Returns the SOMClassMgrObject
+ *)
+Function somEnvironmentNew:SOMClassMgrType; cdecl;
+ external 'som' name 'somEnvironmentNew'; {index 30}
+
+(*
+ * Test whether <obj> is a valid SOM object. This test is based solely on
+ * the fact that (on this architecture) the first word of a SOM object is a
+ * pointer to its method table. The test is therefore most correctly understood
+ * as returning true if and only if <obj> is a pointer to a pointer to a
+ * valid SOM method table. If so, then methods can be invoked on <obj>.
+ *)
+Function somIsObj(obj:somToken):Boolean; cdecl;
+ external 'som' name 'somIsObj'; {index 60}
+
+(*
+ * Return the class that introduced the method represented by a given method token.
+ *)
+Function somGetClassFromMToken(mToken:somMToken):SOMClassType; cdecl;
+ external 'som' name 'somGetClassFromMToken'; {index 82}
+
+
+(*----------------------------------------------------------------------
+ * String Manager: stem <somsm>
+ *)
+Function somCheckID(id:somId):somId; cdecl;
+ external 'som' name 'somCheckId'; {index 26}
+(* makes sure that the id is registered and in normal form, returns *)
+(* the id *)
+
+Function somRegisterId(id:somId):Longint; cdecl;
+ external 'som' name 'somRegisterId'; {index 36}
+(* Same as somCheckId except returns 1 (true) if this is the first *)
+(* time the string associated with this id has been registered, *)
+(* returns 0 (false) otherwise *)
+
+Function somIDFromString(aString:PChar):somId; cdecl;
+ external 'som' name 'somIdFromString'; {index 31}
+(* caller is responsible for freeing the returned id with SOMFree *)
+
+// Not found
+//Function somIdFromStringNoFree(aString:PChar):somId; cdecl;
+(* call is responsible for *not* freeing the returned id *)
+
+Function somStringFromId(id:somId):PChar; cdecl;
+ external 'som' name 'somStringFromId'; {index 40}
+
+Function somCompareIds(id1,id2:somId):Longint; cdecl;
+ external 'som' name 'somCompareIds'; {index 27}
+(* returns true (1) if the two ids are equal, else false (0) *)
+
+Function somTotalRegIds:Longint; cdecl;
+ external 'som' name 'somTotalRegIds'; {index 43}
+(* Returns the total number of ids that have been registered so far, *)
+(* you can use this to advise the SOM runtime concerning expected *)
+(* number of ids in later executions of your program, via a call to *)
+(* somSetExpectedIds defined below *)
+
+Procedure somSetExpectedIds(numIds:Longint{ulong}); cdecl;
+ external 'som' name 'somSetExpectedIds'; {index 39}
+(* Tells the SOM runtime how many unique ids you expect to use during *)
+(* the execution of your program, this can improve space and time *)
+(* utilization slightly, this routine must be called before the SOM *)
+(* environment is created to have any effect *)
+
+Function somUniqueKey(id:somId):Longint{ulong}; cdecl;
+ external 'som' name 'somUniqueKey'; {index 44}
+(* Returns the unique key for this id, this key will be the same as the *)
+(* key in another id if and only if the other id refers to the same *)
+(* name as this one *)
+
+Procedure somBeginPersistentIds; cdecl;
+ external 'som' name 'somBeginPersistentIds'; {index 24}
+(* Tells the id manager that strings for any new ids that are *)
+(* registered will never be freed or otherwise modified. This allows *)
+(* the id manager to just use a pointer to the string in the *)
+(* unregistered id as the master copy of the ids string. Thus saving *)
+(* space *)
+(* Under normal use (where ids are static varibles) the string *)
+(* associated with an id would only be freed if the code module in *)
+(* which it occured was unloaded *)
+
+Procedure somEndPersistentIds; cdecl;
+ external 'som' name 'somEndPersistentIds'; {index 29}
+(* Tells the id manager that strings for any new ids that are *)
+(* registered may be freed or otherwise modified. Therefore the id *)
+(* manager must copy the strings inorder to remember the name of an *)
+(* id. *)
+
+(*----------------------------------------------------------------------
+ * Class Manager: SOMClassMgrType, stem <somcm>
+ *)
+
+(* Global class manager object *)
+var
+{$warning support of external vars required}
+ SOMClassMgrObject : SOMClassMgrType;//³ 00007 ³ SOMClassMgrObject
+
+(* The somRegisterClassLibrary function is provided for use
+ * in SOM class libraries on platforms that have loader-invoked
+ * entry points associated with shared libraries (DLLs).
+ *
+ * This function registers a SOM Class Library with the SOM Kernel.
+ * The library is identified by its file name and a pointer
+ * to its initialization routine. Since this call may occur
+ * prior to the invocation of somEnvironmentNew, its actions
+ * are deferred until the SOM environment has been initialized.
+ * At that time, the SOMClassMgrObject is informed of all
+ * pending library initializations via the _somRegisterClassLibrary
+ * method. The actual invocation of the library's initialization
+ * routine will occur during the execution of the SOM_MainProgram
+ * macro (for statically linked libraries), or during the _somFindClass
+ * method (for libraries that are dynamically loaded).
+ *)
+Procedure somRegisterClassLibrary(libraryName:PChar;
+ libraryInitRun:somMethodProc); cdecl;
+ external 'som' name 'somRegisterClassLibrary'; {index 86}
+
+
+(*----------------------------------------------------------------------
+ * -- somApply --
+ *
+ * This routine replaces direct use of applyStubs in SOMr1. The reason
+ * for the replacement is that the SOMr1 style of applyStub is not
+ * generally available in SOMr2, which uses a fixed set of applyStubs,
+ * according to method information in the somMethodData. In particular,
+ * neither the redispatch stub nor the apply stub found in the method
+ * data structure are necessarily useful as such. The method somGetRdStub
+ * is the way to get a redispatch stub, and the above function is the
+ * way to call an apply stub. If an appropriate apply stub for the
+ * method indicated by md is available, then this is invoked and TRUE is
+ * returned; otherwise FALSE is returned.
+ *
+ * The va_list passed to somApply *must* include the target object,
+ * somSelf, as its first entry, and any single precision floating point
+ * arguments being passed to the the method procedure must be
+ * represented on the va_list using double precision values. retVal cannot
+ * be NULL.
+ *)
+
+Function somApply(var somSelf:TSOMObject;
+ var retVal:somToken;
+ mdPtr:somMethodDataPtr;
+ var ap):Boolean; cdecl;
+ external 'som' name 'somApply'; {index 69}
+
+(*---------------------------------------------------------------------
+ * -- somBuildClass --
+ *
+ * This procedure automates construction of a new class object. A variety of
+ * special structures are used to allow language bindings to statically define
+ * the information necessary to specify a class. Pointers to these static
+ * structures are accumulated into an overall "static class information"
+ * structure or SCI, passed to somBuildClass. The SCI has evolved over time.
+ * The current version is defined here.
+ *)
+
+
+Function somBuildClass(inherit_vars:Longint;
+ var sci:somStaticClassInfo;
+ majorVersion,minorVersion:Longint):SOMClassType; cdecl;
+ external 'som' name 'somBuildClass'; {index 49}
+
+ (*
+ The arguments to somBuildClass are as follows:
+
+ inherit_vars: a bit mask used to control inheritance of implementation
+ Implementation is inherited from parent i iff the bit 1<<i is on, or i>=32.
+
+ sci: the somStaticClassInfo defined above.
+
+ majorVersion, minorVersion: the version of the class implementation.
+
+ *)
+
+
+(*---------------------------------------------------------------------
+ * Used by old single-inheritance emitters to make class creation
+ * an atomic operation. Kept for backwards compatability.
+ *)
+type
+ somTD_classInitRoutine=Procedure(var a,b:SOMClassType); cdecl;
+
+Procedure somConstructClass(classInitRoutine:somTD_ClassInitRoutine;
+ parentClass,metaClass:SOMClassType;
+ var cds :somClassDataStructure); cdecl;
+ external 'som' name 'somConstructClass'; {index 28}
+
+
+(*
+ * Uses <SOMOutCharRoutine> to output its arguments under control of the ANSI C
+ * style format. Returns the number of characters output.
+ *)
+Function somPrintf(fnt:PChar;buf:pointer):Longint; cdecl;
+ external 'som' name 'somPrintf'; {index 35}
+
+// vprint form of somPrintf
+Function somVPrintf(fnt:PChar;var ap):Longint; cdecl;
+ external 'som' name 'somVprintf'; {index 45}
+
+// Outputs (via somPrintf) blanks to prefix a line at the indicated level
+Procedure somPrefixLevel(level:Longint); cdecl;
+ external 'som' name 'somPrefixLevel'; {index 34}
+
+// Combines somPrefixLevel and somPrintf
+Procedure somLPrintf(level:Longint;fmt:PChar;var buf); cdecl;
+ external 'som' name 'somLPrintf'; {index 32}
+
+Function SOMObjectNewClass(majorVersion,minorVersion:Longint):SOMClassType; cdecl;
+ external 'som' name 'SOMObjectNewClass'; {index 22}
+Function SOMClassNewClass(majorVersion,minorVersion:Longint):SOMClassType; cdecl;
+ external 'som' name 'SOMClassNewClass'; {index 21}
+
+Function SOMClassMgrNewClass(majorVersion,minorVersion:Longint):SOMClassType; cdecl;
+ external 'som' name 'SOMClassMgrNewClass'; {index 20}
+
+(*----------------------------------------------------------------------
+ * Pointers to routines used to do dynamic code loading and deleting
+ *)
+type
+ somTD_SOMLoadModule =Function({IN}Module:PChar (* className *);
+ {IN}FileName:PChar (* fileName *);
+ {IN}FuncName:PChar (* functionName *);
+ {IN}MajorVer:Longint (* majorVersion *);
+ {IN}MinorVer:Longint (* minorVersion *);
+ {OUT}var ref:somToken (* modHandle *)):Longint; cdecl;
+ somTD_SOMDeleteModule =Function({IN} ref:somToken (* modHandle *)):Longint; cdecl;
+ somTD_SOMClassInitFuncName =Function:PChar; cdecl;
+
+var
+{$warning support of external vars required}
+ SOMLoadModule :somTD_SOMLoadModule;//³ 00011 ³ SOMLoadModule
+{$warning support of external vars required}
+ SOMDeleteModule :somTD_SOMDeleteModule;//³ 00008 ³ SOMDeleteModule
+{$warning support of external vars required}
+ SOMClassInitFuncName :somTD_SOMClassInitFuncName; //³ 00004 ³ SOMClassInitFuncName
+
+(*----------------------------------------------------------------------
+ * Replaceable SOM Memory Management Interface
+ *
+ * External procedure variables SOMCalloc, SOMFree, SOMMalloc, SOMRealloc
+ * have the same interface as their standard C-library analogs.
+ *)
+
+type
+ somTD_SOMMalloc =Function({IN} size_t:Longint (* nbytes *)):somToken; cdecl;
+ somTD_SOMCalloc =Function({IN} size_c:Longint (* element_count *);
+ {IN} size_e:Longint (* element_size *)):somToken; cdecl;
+ somTD_SOMRealloc =Function({IN} ref:somToken (* memory *);
+ {IN} size:Longint (* nbytes *)):somToken; cdecl;
+ somTD_SOMFree =Procedure({IN} ref:somToken (* memory *)); cdecl;
+
+var
+{$warning support of external vars required}
+ SOMCalloc :somTD_SOMCalloc; // ³ 00001 ³ SOMCalloc
+{$warning support of external vars required}
+ SOMFree :somTD_SOMFree; //³ 00010 ³ SOMFree
+{$warning support of external vars required}
+ SOMMalloc :somTD_SOMMalloc;//³ 00012 ³ SOMMalloc
+{$warning support of external vars required}
+ SOMRealloc :somTD_SOMRealloc;//³ 00016 ³ SOMRealloc
+
+(*----------------------------------------------------------------------
+ * Replaceable SOM Error handler
+ *)
+
+type
+ somTD_SOMError =Procedure({IN} code:Longint (* code *);
+ {IN} fn:PChar (* fileName *);
+ {IN} ln:Longint (* linenum *)); cdecl;
+
+var
+{$warning support of external vars required}
+ SOMError :somTD_SOMError;//³ 00009 ³ SOMError
+
+(*----------------------------------------------------------------------
+ * Replaceable SOM Semaphore Operations
+ *
+ * These operations are used by the SOM Kernel to make thread-safe
+ * state changes to internal resources.
+ *)
+
+type
+ somTD_SOMCreateMutexSem =Function({OUT}var sem:somToken ):Longint; cdecl;
+ somTD_SOMRequestMutexSem =Function({IN}sem:somToken ):Longint; cdecl;
+ somTD_SOMReleaseMutexSem =Function({IN}sem:somToken ):Longint; cdecl;
+ somTD_SOMDestroyMutexSem =Function({IN}sem:somToken ):Longint; cdecl;
+
+var
+{$warning support of external vars required}
+ SOMCreateMutexSem :somTD_SOMCreateMutexSem;//³ 00090 ³ SOMCreateMutexSem
+{$warning support of external vars required}
+ SOMRequestMutexSem :somTD_SOMRequestMutexSem;//³ 00091 ³ SOMRequestMutexSem
+{$warning support of external vars required}
+ SOMReleaseMutexSem :somTD_SOMReleaseMutexSem;//³ 00092 ³ SOMReleaseMutexSem
+{$warning support of external vars required}
+ SOMDestroyMutexSem :somTD_SOMDestroyMutexSem;//³ 00093 ³ SOMDestroyMutexSem
+
+(*----------------------------------------------------------------------
+ * Replaceable SOM Thread Identifier Operation
+ *
+ * This operation is used by the SOM Kernel to index data unique to the
+ * currently executing thread. It must return a small integer that
+ * uniquely represents the current thread within the current process.
+ *)
+
+type
+ somTD_SOMGetThreadId =Function:Longint; cdecl;
+
+var
+{$warning support of external vars required}
+ SOMGetThreadId :somTD_SOMGetThreadId;//³ 00094 ³ SOMGetThreadId
+
+
+(*----------------------------------------------------------------------
+ * Externals used in the implementation of SOM, but not part of the
+ * SOM API.
+ *)
+
+Function somTestCls(obj:TSOMObject; classObj:SOMClassType;
+ fileName:PChar; lineNumber:Longint):TSOMObject; cdecl;
+ external 'som' name 'somTestCls'; {index 42}
+Procedure somTest(condition,severity:Longint;fileName:PChar;
+ lineNum:Longint;msg:PChar); cdecl;
+ external 'som' name 'somTest'; {index 41}
+Procedure somAssert(condition,ecode:Longint;
+ fileName:PChar;lineNum:Longint;msg:PChar); cdecl;
+ external 'som' name 'somAssert'; {index 23}
+
+type
+ exception_type = (NO_EXCEPTION, USER_EXCEPTION, SYSTEM_EXCEPTION);
+ completion_status = (YES, NO, MAYBE);
+ StExcep = record
+ minot : Cardinal;
+ completed : completion_status;
+ end;
+
+ Environment =^EnvironmentType;
+ EnvironmentType = record
+ _major : exception_type;
+ exception : record
+ _exception_name : PChar;
+ _params : Pointer;
+ end;
+ _somdAnchor : pointer;
+ end;
+
+Function somExceptionId(ev:Environment):PChar; cdecl;
+ external 'som' name 'somExceptionId'; {index 52}
+Function somExceptionValue(ev:Environment):Pointer; cdecl;
+ external 'som' name 'somExceptionValue'; {index 53}
+Procedure somExceptionFree(ev:Environment); cdecl;
+ external 'som' name 'somExceptionFree'; {index 54}
+Procedure somSetException(ev:Environment;major:exception_type;exception_name:PChar;params:pointer); cdecl;
+ external 'som' name 'somSetException'; {index 55}
+Function somGetGlobalEnvironment:Environment; cdecl;
+ external 'som' name 'somGetGlobalEnvironment'; {index 58}
+
+(* Exception function names per CORBA 5.19, p.99 *)
+Function exception_id(ev:Environment):PChar; cdecl;
+Function exception_value(ev:Environment):Pointer; cdecl;
+Procedure exception_free(ev:Environment); cdecl;
+
+
+(* Convenience macros for manipulating environment structures
+ *
+ * SOM_CreateLocalEnvironment returns a pointer to an Environment.
+ * The other 3 macros all expect a single argument that is also
+ * a pointer to an Environment. Use the create/destroy forms for
+ * a dynamic local environment and the init/uninit forms for a stack-based
+ * local environment.
+ *
+ * For example
+ *
+ * Environment *ev;
+ * ev = SOM_CreateLocalEnvironment ();
+ * ... Use ev in methods
+ * SOM_DestroyLocalEnvironment (ev);
+ *
+ * or
+ *
+ * Environment ev;
+ * SOM_InitEnvironment (&ev);
+ * ... Use &ev in methods
+ * SOM_UninitEnvironment (&ev);
+ *)
+Function SOM_CreateLocalEnvironment:Environment; cdecl;
+
+Procedure SOM_DestroyLocalEnvironment(ev:Environment); cdecl;
+
+Procedure SOM_InitEnvironment(ev:Environment); cdecl;
+
+Procedure SOM_UninitEnvironment(ev:Environment); cdecl;
+
+(*----------------------------------------------------------------------
+ * Macros are used in the C implementation of SOM... However, Pascal
+ * doesn't have macro capability... (from SOMCDEV.H)
+ *)
+
+{ Change SOM_Resolve(o,ocn,mn) to...
+ somTD_ocn_mn(somResolve(SOM_TestCls(o, ocnClassData.classObject), ocnClassData.mn)))
+
+ Change SOM_ResolveNoCheck(o,ocn,mn) to...
+ somTD_ocn_mn(somResolve(o,ocnClassData,mn))
+
+ Change SOM_ParentNumResolveCC(pcn,pcp,ocn,mn) to...
+ somTD_pcn_mn(somParentNumResolve(ocn_CClassData.parentMtab,pcp,pcnClassData.mn))
+
+ Change SOM_ParentNumResolve(pcn,pcp,mtabs,mn) to...
+ somTD_pcn_mn(somParentNumResolve(mtabs,pcp,pcnClassData.mn))
+
+ Change SOM_ClassResolve(cn,class,mn) to...
+ somTD_cn_mn(somClassResolve(class,cnClassData.mn))
+
+ Change SOM_ResolveD(o,tdc,cdc,mn) to...
+ somTD_tdc_mn(somResolve(SOM_TestCls(o,cdcClassData.classObject), cdcClassData.mn)))
+
+ Change SOM_ParentResolveE(pcn,mtbls,mn) to...
+ somTD_pcn_mn(somParentResolve(mtbls,pcnClassData.mn))
+
+ Change SOM_DataResolve(obj,dataId) to...
+ somDataResolve(obj, dataId)
+
+ Change SOM_ClassLibrary(name) to...
+ somRegisterClassLibrary(name,somMethodProc(SOMInitModule))
+}
+
+type
+ SOMClassCClassDataStructure = record
+ parentMtab : somMethodTabs;
+ instanceDataToken : somDToken;
+ end;
+
+var
+{$warning support of external vars required}
+ SOMClassCClassData : SOMClassCClassDataStructure;//³ 00002 ³ SOMClassCClassData
+
+type
+ SOMClassClassDataStructure = record
+ classObject : SOMClassType;
+ somNew : somMToken;
+ somRenew : somMToken;
+ somInitClass : somMToken;
+ somClassReady : somMToken;
+ somGetName : somMToken;
+ somGetParent : somMToken;
+ somDescendedFrom : somMToken;
+ somCheckVersion : somMToken;
+ somFindMethod : somMToken;
+ somFindMethodOk : somMToken;
+ somSupportsMethod : somMToken;
+ somGetNumMethods : somMToken;
+ somGetInstanceSize : somMToken;
+ somGetInstanceOffset : somMToken;
+ somGetInstancePartSize : somMToken;
+ somGetMethodIndex : somMToken;
+ somGetNumStaticMethods : somMToken;
+ somGetPClsMtab : somMToken;
+ somGetClassMtab : somMToken;
+ somAddStaticMethod : somMToken;
+ somOverrideSMethod : somMToken;
+ somAddDynamicMethod : somMToken;
+ somcPrivate0 : somMToken;
+ somGetApplyStub : somMToken;
+ somFindSMethod : somMToken;
+ somFindSMethodOk : somMToken;
+ somGetMethodDescriptor : somMToken;
+ somGetNthMethodInfo : somMToken;
+ somSetClassData : somMToken;
+ somGetClassData : somMToken;
+ somNewNoInit : somMToken;
+ somRenewNoInit : somMToken;
+ somGetInstanceToken : somMToken;
+ somGetMemberToken : somMToken;
+ somSetMethodDescriptor : somMToken;
+ somGetMethodData : somMToken;
+ somOverrideMtab : somMToken;
+ somGetMethodToken : somMToken;
+ somGetParents : somMToken;
+ somGetPClsMtabs : somMToken;
+ somInitMIClass : somMToken;
+ somGetVersionNumbers : somMToken;
+ somLookupMethod : somMToken;
+ _get_somInstanceDataOffsets : somMToken;
+ somRenewNoZero : somMToken;
+ somRenewNoInitNoZero : somMToken;
+ somAllocate : somMToken;
+ somDeallocate : somMToken;
+ somGetRdStub : somMToken;
+ somGetNthMethodData : somMToken;
+ somcPrivate1 : somMToken;
+ somcPrivate2 : somMToken;
+ _get_somDirectInitClasses : somMToken;
+ _set_somDirectInitClasses : somMToken;
+ somGetInstanceInitMask : somMToken;
+ somGetInstanceDestructionMask : somMToken;
+ somcPrivate3 : somMToken;
+ somcPrivate4 : somMToken;
+ somcPrivate5 : somMToken;
+ somcPrivate6 : somMToken;
+ somcPrivate7 : somMToken;
+ somDefinedMethod : somMToken;
+ somcPrivate8 : somMToken;
+ somcPrivate9 : somMToken;
+ somcPrivate10 : somMToken;
+ somcPrivate11 : somMToken;
+ somcPrivate12 : somMToken;
+ somcPrivate13 : somMToken;
+ somcPrivate14 : somMToken;
+ somcPrivate15 : somMToken;
+ _get_somDataAlignment : somMToken;
+ somGetInstanceAssignmentMask : somMToken;
+ somcPrivate16 : somMToken;
+ somcPrivate17 : somMToken;
+ _get_somClassAllocate : somMToken;
+ _get_somClassDeallocate : somMToken;
+ end;
+
+var
+{$warning support of external vars required}
+ SOMClassClassData : SOMClassClassDataStructure;//³ 00003 ³ SOMClassClassData
+{$warning support of external vars required}
+ SOMClassMgrCClassData : somCClassDataStructure;//³ 00005 ³ SOMClassMgrCClassData
+
+type
+ SOMClassMgrClassDataStructure = record
+ classObject : SOMClassType;
+ somFindClsInFile : somMToken;
+ somFindClass : somMToken;
+ somClassFromId : somMToken;
+ somRegisterClass : somMToken;
+ somUnregisterClass : somMToken;
+ somLocateClassFile : somMToken;
+ somLoadClassFile : somMToken;
+ somUnloadClassFile : somMToken;
+ somGetInitFunction : somMToken;
+ somMergeInto : somMToken;
+ somGetRelatedClasses : somMToken;
+ somSubstituteClass : somMToken;
+ _get_somInterfaceRepository : somMToken;
+ _set_somInterfaceRepository : somMToken;
+ _get_somRegisteredClasses : somMToken;
+ somBeginPersistentClasses : somMToken;
+ somEndPersistentClasses : somMToken;
+ somcmPrivate1 : somMToken;
+ somcmPrivate2 : somMToken;
+ somRegisterClassLibrary : somMToken;
+ somJoinAffinityGroup : somMToken;
+ end;
+
+var
+{$warning support of external vars required}
+ SOMClassMgrClassData : SOMClassMgrClassDataStructure;//³ 00006 ³ SOMClassMgrClassData
+
+type
+ SOMObjectCClassDataStructure = record
+ parentMtab :somMethodTabs;
+ instanceDataToken :somDToken;
+ end;
+
+var
+{$warning support of external vars required}
+ SOMObjectCClassData : SOMObjectCClassDataStructure;//³ 00013 ³ SOMObjectCClassData
+
+type
+ SOMObjectClassDataStructure = record
+ classObject : SOMClassType;
+ somInit : somMToken;
+ somUninit : somMToken;
+ somFree : somMToken;
+ somDefaultVCopyInit : somMToken;
+ somGetClassName : somMToken;
+ somGetClass : somMToken;
+ somIsA : somMToken;
+ somRespondsTo : somMToken;
+ somIsInstanceOf : somMToken;
+ somGetSize : somMToken;
+ somDumpSelf : somMToken;
+ somDumpSelfInt : somMToken;
+ somPrintSelf : somMToken;
+ somDefaultConstVCopyInit : somMToken;
+ somDispatchV : somMToken;
+ somDispatchL : somMToken;
+ somDispatchA : somMToken;
+ somDispatchD : somMToken;
+ somDispatch : somMToken;
+ somClassDispatch : somMToken;
+ somCastObj : somMToken;
+ somResetObj : somMToken;
+ somDefaultInit : somMToken;
+ somDestruct : somMToken;
+ somPrivate1 : somMToken;
+ somPrivate2 : somMToken;
+ somDefaultCopyInit : somMToken;
+ somDefaultConstCopyInit : somMToken;
+ somDefaultAssign : somMToken;
+ somDefaultConstAssign : somMToken;
+ somDefaultVAssign : somMToken;
+ somDefaultConstVAssign : somMToken;
+ end;
+
+var
+{$warning support of external vars required}
+ SOMObjectClassData : SOMObjectClassDataStructure;//³ 00014 ³ SOMObjectClassData
+
+(* Another not ported vars *)
+// Control the printing of method and procedure entry messages,
+// 0-none, 1-user, 2-core&user */
+ SOM_TraceLevel: Longint; //³ 00018 ³ SOM_TraceLevel
+
+// Control the printing of warning messages, 0-none, 1-all
+ SOM_WarnLevel: Longint; //³ 00019 ³ SOM_WarnLevel
+
+// Control the printing of successful assertions, 0-none, 1-user,
+// 2-core&user
+ SOM_AssertLevel: Longint; //³ 00017 ³ SOM_AssertLevel
+
+// ToDo: Move this to corresponding place
+Procedure somCheckArgs(argc: longint; argv: array of pchar); cdecl;
+ external 'som' name 'somCheckArgs'; {index 25}
+Procedure somUnregisterClassLibrary (libraryName: PChar); cdecl;
+ external 'som' name 'somUnregisterClassLibrary'; {index 89}
+Function somResolveTerminal(x : SOMClassPtr; mdata: somMToken): somMethodProcPtr; cdecl;
+ external 'som' name 'somResolveTerminal'; {index 133}
+Function somPCallResolve(obj: PSOMObject; callingCls: SOMClassPtr; method: somMToken): somMethodProcPtr; cdecl;
+ external 'som' name 'somPCallResolve'; {index 362}
+Function va_SOMObject_somDispatchA(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const): Pointer; cdecl;
+ external 'som' name 'va_SOMObject_somDispatchA'; {index 64}
+Function somva_SOMObject_somDispatchA(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const): Pointer; cdecl;
+ external 'som' name 'somva_SOMObject_somDispatchA'; {index 96}
+Function va_SOMObject_somDispatchL(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const): Longint; cdecl;
+ external 'som' name 'va_SOMObject_somDispatchL'; {index 66}
+Function somva_SOMObject_somDispatchL(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const): Longint; cdecl;
+ external 'som' name 'somva_SOMObject_somDispatchL'; {index 98}
+
+Function va_SOMObject_somDispatch(somSelf: PSOMObject;
+ retValue: PsomToken;
+ methodId: somId;
+ args: array of const): Boolean; cdecl;
+ external 'som' name 'va_SOMObject_somDispatch'; {index 68}
+
+Procedure va_SOMObject_somDispatchV(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const); cdecl;
+ external 'som' name 'va_SOMObject_somDispatchV'; {index 67}
+
+Procedure somva_SOMObject_somDispatchV(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const); cdecl;
+ external 'som' name 'somva_SOMObject_somDispatchV'; {index 99}
+
+Function va_SOMObject_somDispatchD(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const): double; cdecl;
+ external 'som' name 'va_SOMObject_somDispatchD'; {index 65}
+
+Function somva_SOMObject_somDispatchD(somSelf: PSOMObject;
+ methodId: somId;
+ descriptor: somId;
+ args: array of const): double; cdecl;
+ external 'som' name 'somva_SOMObject_somDispatchD'; {index 97}
+Function somva_SOMObject_somDispatch(somSelf: PSOMObject;
+ retValue: PsomToken;
+ methodId: somId;
+ args: array of const): boolean; cdecl;
+ external 'som' name 'somva_SOMObject_somDispatch'; {index 100}
+Function somva_SOMObject_somClassDispatch(somSelf: PSOMObject;
+ clsObj: PSOMClass;
+ retValue: PsomToken;
+ methodId: somId;
+ args: array of const): boolean; cdecl;
+ external 'som' name 'somva_SOMObject_somClassDispatch'; {index 101}
+
+Implementation
+
+Function exception_id(ev:Environment):PChar; cdecl;
+begin
+ Result := somExceptionId(ev)
+end;
+
+Function exception_value(ev:Environment):Pointer; cdecl;
+begin
+ Result := somExceptionValue(ev)
+end;
+
+Procedure exception_free(ev:Environment); cdecl;
+begin
+ somExceptionFree(ev)
+end;
+
+Function SOM_CreateLocalEnvironment:Environment; cdecl;
+begin
+ Result:=SOMCalloc(1, sizeof(EnvironmentType))
+end;
+
+Procedure SOM_DestroyLocalEnvironment(ev:Environment); cdecl;
+begin
+ somExceptionFree(ev);
+ if somGetGlobalEnvironment<>ev then SOMFree(ev);
+end;
+
+Procedure SOM_InitEnvironment(ev:Environment); cdecl;
+begin
+ if somGetGlobalEnvironment<>ev then FillChar(ev^,sizeof(EnvironmentType),0);
+end;
+
+Procedure SOM_UninitEnvironment(ev:Environment); cdecl;
+begin
+ somExceptionFree(ev);
+end;
+
+
+End.
+(*
+³ 00038 ³ somSaveMetrics // not found
+³ 00046 ³ somWriteMetrics // not found
+³ 00051 ³ somCreateDynamicClass // not found
+³ 00056 ³ SOM_IdTable // not found
+³ 00057 ³ SOM_IdTableSize // not found
+³ 00062 ³ somStartCriticalSection // not found
+³ 00063 ³ somEndCriticalSection // not found
+³ 00080 ³ somfixMsgTemplate // not found
+³ 00087 ³ SOMParentDerivedMetaclassClassData // not found
+³ 00132 ³ somFreeThreadData // not found
+³ 00135 ³ somIdMarshal // not found
+³ 00361 ³ somMakeUserRdStub // Not found
+*)
+
diff --git a/packages/os2units/src/sw.pas b/packages/os2units/src/sw.pas
new file mode 100644
index 0000000000..005f56da5b
--- /dev/null
+++ b/packages/os2units/src/sw.pas
@@ -0,0 +1,519 @@
+{
+ Copyright (c) 1990-1991 International Business Machines Corporation
+ Copyright (c) 2003 by Yuri Prokushev (prokushev@freemail.ru)
+
+ This is the multimedia unit file that has the typedefs, defines and
+ function prototypes for Multimedia Applets.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License (LGPL) as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. This program is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU Library General Public License for more details. You should
+ have received a copy of the GNU Library General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ **********************************************************************}
+
+{
+@abstract(OS/2 Multimedia Applets)
+@author(Yuri Prokushev (prokushev@freemail.ru))
+@created(19 Jan 2003)
+@lastmod(23 Jan 2003)
+This is the multimedia unit file that has the typedefs, defines and
+function prototypes for Multimedia Applets.
+Warning: This code is alfa. Future versions of this unit will propably
+not be compatible.
+}
+Unit SW;
+
+Interface
+
+Uses
+ Os2Def,
+ PmWin;
+
+Const
+ MAX_SMBDTEXT=35;
+
+ MB_ICONCUSTOM=$0001;
+
+ SC_DEFAULTSIZE=$c000; // WM_COMMAND from SysMenu
+
+ WM_INITSECONDARYWINDOW=$0519; // MP1: NULL, MP2: CreateParams
+
+ QS_FRAME=$1; // Flag set to query frame
+ QS_DIALOG=$2; // Flag set to query dialog
+
+// #pragma pack(4)
+
+Type
+ TSMBD=record
+ achText: Array[0..MAX_SMBDTEXT + 1] of Char; // Text of the button. eg. "~Cancel"
+ idButton: Cardinal; // Button ID returned when user chooses
+ flStyle: Longint; // Button style or'ed with internal
+ end;
+ PSMBD=^TSMBD;
+
+ TSMBINFO=record
+ hIcon: Cardinal; // Icon handle
+ cButtons: Cardinal; // Number of buttons
+ flStyle: Cardinal; // Icon style flags (MB_ICONQUESTION, etc...)
+ hwndNotify: HWND; // Reserved
+ smbd: PSMBD; // Array of button definitions
+ end;
+ PSMBINFO=^TSMBINFO;
+
+// #pragma pack()
+
+// Analogous to WinDlgBox
+function WinSecondaryWindow(hwndParent: hwnd; hwndOwner: hwnd;
+ pfnDlgProc: proc; hmod: Cardinal; idDlg: Cardinal; pCreateParams: Pointer): Cardinal; cdecl;
+
+// Analogous to WinLoadDlg
+function WinLoadSecondaryWindow(hwndParent: hwnd; hwndOwner: hwnd;
+ pfnDlgProc: proc; hmod: Cardinal; idDlg: Cardinal; pCreateParams: Cardinal): hwnd; cdecl;
+
+// Analogous to WinProcessDlg
+function WinProcessSecondaryWindow(hwndSW: hwnd): Cardinal; cdecl;
+
+// Analogous to WinCreateDlg
+function WinCreateSecondaryWindow(hwndParent: hwnd; hwndOwner: hwnd;
+ pfnDlgProc: proc; idDlg: Cardinal; pCreateParams: Pointer): hwnd; cdecl;
+
+function WinDefaultSize(Wnd: hwnd): Longbool; cdecl;
+
+function WinInsertDefaultSize(Wnd: hwnd; pszDefaultSize: pChar): Longbool; cdecl;
+
+function WinQuerySecondaryhwnd(Wnd: hwnd; ulFlag: Cardinal): hwnd; cdecl;
+
+//************************************************************************/
+//* WinSecondaryMessageBox */
+//* */
+//* Parameters: HWND hwndParent - handle of the parent window. */
+//* HWND hwndOwner - handle of the owner window. */
+//* PSZ pszText - message text. */
+//* PSZ pszCaption - title of the message box. */
+//* ULONG idWindow - Message box id */
+//* PSMBINFO psmbinfo - pointer to button/icon info */
+//************************************************************************/
+function WinSecondaryMessageBox(hwndParent: hwnd; hwndOwner: hwnd;
+ pszText: pChar; pszCaption: pChar; idWindow: Cardinal; smb: psmbinfo): Cardinal; cdecl;
+
+//************************************************************************/
+//* WinDismissSecondaryWindow */
+//* */
+//* This function should be called from within the dlg proc. The hwnd */
+//* passed in MUST be the handle to the actual dialog. */
+//************************************************************************/
+
+function WinDismissSecondaryWindow(hwndDlg: hwnd; ulResult: Cardinal): Longbool; cdecl;
+
+//************************************************************************/
+//* The parameter hwnd can be either the secondary window or the actual */
+//* dialog. */
+//************************************************************************/
+
+function WinDestroySecondaryWindow(Wnd: hwnd): Longbool; cdecl;
+
+function WinDefSecondaryWindowProc(Wnd: hwnd; msg: Cardinal;
+ mp1: mParam; mp2: mParam): mResult; cdecl;
+
+//************************************************************************/
+//* Graphic Buttons */
+//************************************************************************/
+
+//************************************************************************/
+//* Notes on Using GraphicButtons */
+//* */
+//* GraphicButton CONTROL DATA */
+//* */
+//* The format of the control data for GraphicButtons is */
+//* "button Text, number of bitmaps, bitmap resource id's ..." */
+//* */
+//* */
+//* Following are two example window templates of GraphicButtons: */
+//* */
+//* 1) CONTROL "", IDD_MP_REV, 120, 10, TS_PB_WIDTH, TS_PB_HEIGHT,*/
+//* WC_GRAPHICBUTTON, */
+//* GBS_TWOSTATE | GBS_HILITEBITMAP | */
+//* WS_VISIBLE | WS_TABSTOP */
+//* CTLDATA GB_RESOURCE,"~REV", 2, ID_MP_REV1, ID_MP_REV0*/
+//* */
+//* The above graphicbutton has id IDD_MP_REV and is of type */
+//* GBS_TWOSTATE and GBS_HILITEBITMAP. The GBS_HILITEBITMAP allows */
+//* a different bitmap to be displayed when the button is in the */
+//* hilite state. The graphicbutton will be displayed with text */
+//* "REV" and has "R" as the mnemonic. It has 2 bitmaps associated */
+//* with it. Their resource id are ID_MP_REV1 and ID_MP_REV0. */
+//* */
+//* */
+//* 2) CONTROL "", IDD_MP_PLAY, 175, 10, TS_PB_WIDTH, */
+//* TS_PB_HEIGHT, WC_GRAPHICBUTTON, */
+//* GBS_AUTOTWOSTATE | GBS_AUTOANIMATION | */
+//* WS_VISIBLE | WS_TABSTOP */
+//* CTLDATA GB_RESOURCE, "~PLAY", 9, */
+//* ID_MP_STOP0, ID_MP_PLAY1, ID_MP_PLAY2,*/
+//* ID_MP_PLAY3, ID_MP_PLAY4, ID_MP_PLAY5,*/
+//* ID_MP_PLAY6, ID_MP_PLAY7, ID_MP_REV1 */
+//* */
+//* The above graphicbutton has id IDD_MP_PLAY and is of type */
+//* GBS_AUTOTWOSTATE and GBS_AUTOANIMATE. When clicked upon, */
+//* the button will automatically toggle the state and animation. */
+//* The graphicbutton will be displayed with text "PLAY" */
+//* and mnemonic "P". It has 9 bitmaps associated with it. */
+//* */
+//* */
+//* */
+//* GraphicButton Painting */
+//* */
+//* Due to the PM design, whenever a graphicbutton is clicked, */
+//* it is sent a BN_PAINT (to paint a non-hilite state) and then */
+//* BN_CLICKED. Thus, for GBS_AUTO* style graphicbuttons, a paint */
+//* request is generated before the button has a chance to change */
+//* its state (BN_CLICKED). To avoid this premature painting, */
+//* code was inserted to delay the painting of graphicbuttons */
+//* GB_PAINT_RESOLUTION milliseconds whenever the button is switching */
+//* FROM the hilite paint state. */
+//* */
+//************************************************************************/
+
+Function WinRegisterGraphicButton: Longbool; cdecl;
+
+Const
+ WC_GRAPHICBUTTON=PChar($ffff0040);
+
+//************************************************************************/
+//* GraphicButton Animation/TwoState constants */
+//************************************************************************/
+
+//************************************************************************/
+//* Graphic Button Style bits */
+//************************************************************************/
+
+ GBS_TWOSTATE = $1000; // indicates TwoState button
+ GBS_AUTOTWOSTATE = $2000; // will auto toggle state up/down
+ GBS_ANIMATION = $4000; // indicates Animatable button
+ GBS_AUTOANIMATION = $8000; // will auto toggle anim. on/off
+ GBS_DISABLEBITMAP = $0010; // allows a diff. bitmap when disabled
+ GBS_HILITEBITMAP = $0020; // allows a diff. bitmap when hilited
+ GBS_3D_TEXTRECESSED = $0040; // display text in 3-D recessed
+ GBS_3D_TEXTRAISED = $0080; // display text in 3-D raised
+ GBS_MINIBUTTON = $0001; // mini button style
+
+//************************************************************************/
+//* Graphic Button User Constants */
+//************************************************************************/
+
+//************************************************************************/
+//* Codes to reference allowed GraphicButton states (or paint states) */
+//************************************************************************/
+
+ GB_ERROR = -1; // GraphicButton Error
+ GB_UP = 1; // GraphicButton up (and paint) state
+ GB_DOWN = 2; // GraphicButton down (and paint) state
+ GB_DISABLE = 3; // GraphicButton disabled state
+ GB_HILITE = 4; // GraphicButton paint state only
+ GB_OUTOFHILITE = 5; // Changing out of hilite paint state
+
+//************************************************************************/
+//* Codes for various GraphicButton message function parameters */
+//************************************************************************/
+
+ GB_TOGGLE = 10; // GraphicButton toggle
+ GB_CURRENTSTATE = 11; // GraphicButton's current state
+ GB_ANIMATIONBEGIN = 12; // when refering to index of anim start
+ GB_ANIMATIONEND = 13; // when refering to index of anim end
+ GB_MAXINDEX = 14; // GraphicButton max. index
+
+//************************************************************************/
+//* Codes to set/query text position relative to the bitmap */
+//************************************************************************/
+
+ GB_TEXTBELOW = 1; // place text below bitmap
+ GB_TEXTABOVE = 2; // place text above bitmap
+
+//************************************************************************/
+//* Codes used to set the animation frame with message GBM_SETBITMAPINDEX*/
+//************************************************************************/
+
+ GB_INDEX_FORWARD = -1; // advance one frame foward
+ GB_INDEX_BACKWARD = -2; // advance one frame backwards
+ GB_INDEX_FIRST = -3; // set to first frame of sequence
+ GB_INDEX_LAST = -4; // set to last frame of sequence
+
+// #pragma pack(1)
+
+type
+ TgbtnCdata = packed record
+ usReserved: Word;
+ pszText: PChar;
+ hmod: Cardinal;
+ cBitmaps: Word;
+ aidBitmap: Array[0..1] of Word;
+ end;
+ pgbtnCdata = ^TgbtnCdata;
+
+//#pragma pack()
+
+const
+ GB_RESOURCE = 1;
+ GB_STRUCTURE = 0;
+
+
+//************************************************************************/
+//* Notification Messages received by GraphicButton Parent */
+//***********************************************************************/
+//************************************************************************/
+//* GBN_BUTTONDOWN, GBN_BUTTONUP, and GBN_BUTTONHILITE */
+//* */
+//* The notification messages are passed as part of the WM_CONTROL */
+//* message. */
+//* */
+//* msg = WM_CONTROL */
+//* mp1 = MPFROM2SHORT(gpb_id, button_state) */
+//* gpd_id = identity of the displayed graphic pushbutton */
+//* button_state = GBN_BUTTONUP, GBN_BUTTONDOWN, or */
+//* GBN_BUTTONHILITE */
+//* */
+//************************************************************************/
+
+ GBN_BUTTONUP = $0524;
+ GBN_BUTTONDOWN = $0525;
+ GBN_BUTTONHILITE = $0526;
+ GBN_SETFOCUS = $0527; // mp2 TRUE for gaining focus
+
+//************************************************************************/
+//* Messages to GraphicButton Windows */
+//************************************************************************/
+
+//************************************************************************/
+//* GBM_SETGRAPHICDATA */
+//************************************************************************/
+//* mp1 = MPFROMP((PGBTNCDATA)&gbtncdata); Graphic button control data*/
+//* mp2 = NULL; not used */
+//* */
+//* WARNING: This message resets all button parameters. */
+//* */
+//************************************************************************/
+
+ GBM_SETGRAPHICDATA = $052A;
+
+//************************************************************************/
+//* GBM_ANIMATE */
+//************************************************************************/
+//* mp1 = MPFROMSHORT(fStart) TRUE to start animation, FALSE to stop*/
+//* mp2 = MPFROMSHORT(fContinue) TRUE continue anim. at currently */
+//* displayed bitmap, FALSE restart at */
+//* the beginning. */
+//* */
+//* Returns TRUE on Success */
+//* FALSE on Failure */
+//* */
+//************************************************************************/
+
+ GBM_ANIMATE = $052B;
+
+//************************************************************************/
+//* GBM_SETANIMATIONRATE */
+//************************************************************************/
+//* mp1 = MPFROMSHORT(ULmIL); Animation rate in milliseconds */
+//* mp2 = NULL not used */
+//* */
+//* */
+//* Returns TRUE on Success */
+//* FALSE on Failure */
+//* */
+//************************************************************************/
+
+ GBM_SETANIMATIONRATE = $052C;
+
+//************************************************************************/
+//* GBM_QUERYANIMATIONACTIVE */
+//************************************************************************/
+//* mp1 = NULL; not used */
+//* mp2 = NULL; not used */
+//* */
+//* */
+//* Returns TRUE if animation is active, else GB_ERROR */
+//* */
+//* */
+//************************************************************************/
+
+ GBM_QUERYANIMATIONACTIVE = $052D;
+
+//************************************************************************/
+//* GBM_QUERYANIMATIONRATE */
+//************************************************************************/
+//* mp1 = NULL; not used */
+//* mp2 = NULL; not used */
+//* */
+//* */
+//* Returns ULONG sepcifying animation rate in milliseconds */
+//* */
+//* */
+//************************************************************************/
+
+ GBM_QUERYANIMATIONRATE = $052E;
+
+//************************************************************************/
+//* GBM_SETBITMAPINDEX */
+//************************************************************************/
+//* mp1 = MPFROMSHORT(usGB_State) Bitmap index to change */
+//* GB_UP, */
+//* GB_DOWN, */
+//* GB_DISABLE, */
+//* GB_HILITE, */
+//* GB_ANIMATIONBEGIN, */
+//* GB_ANIMATIONEND, */
+//* or GB_CURRENTSTATE chng current state (up or down) bitmap*/
+//* mp2 = MPFROMSHORT(sFrameCode) Set according to code or frame desire */
+//* GB_INDEX_FORWARD, chng to next bitmap in circular array */
+//* GB_INDEX_BACKWARD, " " prev " " " " */
+//* GB_INDEX_FIRST, " " first " " " " */
+//* GB_INDEX_LAST, " " last " " " " */
+//* or desired_bitmap otherwise desired bmp index specified */
+//* */
+//* Returns TRUE on Success, otherwise FALSE */
+//* */
+//************************************************************************/
+
+ GBM_SETBITMAPINDEX = $052F;
+
+//************************************************************************/
+//* GBM_QUERYBITMAPINDEX */
+//************************************************************************/
+//* mp1 = MPFROMSHORT(usGB_State) Query bitmap index */
+//* GB_UP, */
+//* GB_DOWN, */
+//* GB_DISABLE, */
+//* GB_HILITE, */
+//* GB_ANIMATIONBEGIN, */
+//* GB_ANIMATIONEND, */
+//* or GB_CURRENTSTATE query current state (up or down) bitmap */
+//* mp2 = NULL; not used */
+//* */
+//* Returns USHORT specifying the index */
+//* */
+//* */
+//************************************************************************/
+
+ GBM_QUERYBITMAPINDEX = $0530;
+
+//************************************************************************/
+//* GBM_SETSTATE */
+//************************************************************************/
+//* mp1 = MPFROMSHORT(usStateCode) Set twostate button to specified */
+//* state */
+//* GB_UP, */
+//* GB_DOWN, */
+//* or GB_TOGGLE toggle (up/down) to (down/up) */
+//* mp2 = MPFROMBOOL(fRepaint) TRUE - state changed and displayed */
+//* FALSE - state changed, not displayed */
+//* */
+//* Returns TRUE on Success */
+//* FALSE on Failure */
+//* */
+//* */
+//************************************************************************/
+
+ GBM_SETSTATE = $0531;
+
+//************************************************************************/
+//* GBM_QUERYSTATE */
+//************************************************************************/
+//* */
+//* mp1 = NULL not used */
+//* mp2 = NULL not used */
+//* */
+//* Returns the state (GB_UP or GB_DOWN) else GB_ERROR. */
+//* */
+//* */
+//************************************************************************/
+
+ GBM_QUERYSTATE = $0532;
+
+//************************************************************************/
+//* GBM_SETTEXTPOSITION */
+//************************************************************************/
+//* mp1 = MPFROMSHORT(usTextPos) How to position text relative to */
+//* bitmap */
+//* GB_TEXTBELOW, */
+//* or GB_TEXTABOVE */
+//* mp2 = NULL not used */
+//* */
+//* Returns TRUE on Success, otherwise FALSE */
+//* */
+//************************************************************************/
+
+ GBM_SETTEXTPOSITION = $0533;
+
+//************************************************************************/
+//* GBM_QUERYTEXTPOSITION */
+//************************************************************************/
+//* */
+//* mp1 = NULL not used */
+//* mp2 = NULL not used */
+//* */
+//* Returns GB_TEXTBELOW, GB_TEXTABOVE, GB_TEXTRIGHT, GB_TEXTLEFT */
+//* on success, otherwise FALSE */
+//* */
+//************************************************************************/
+
+ GBM_QUERYTEXTPOSITION = $0534;
+
+//************************************************************************/
+//* GraphicButton END */
+//************************************************************************/
+
+ MM_TABHELP = $054C;
+
+Implementation
+
+function WinSecondaryWindow(hwndParent: hwnd; hwndOwner: hwnd;
+ pfnDlgProc: proc; hmod: Cardinal; idDlg: Cardinal; pCreateParams: Pointer): Cardinal; cdecl;
+ external 'SW' index 1;
+
+function WinLoadSecondaryWindow(hwndParent: hwnd; hwndOwner: hwnd;
+ pfnDlgProc: proc; hmod: Cardinal; idDlg: Cardinal; pCreateParams: Cardinal): hwnd; cdecl;
+ external 'SW' index 2;
+
+function WinProcessSecondaryWindow(hwndSW: hwnd): Cardinal; cdecl;
+ external 'SW' index 3;
+
+function WinCreateSecondaryWindow(hwndParent: hwnd; hwndOwner: hwnd;
+ pfnDlgProc: proc; idDlg: Cardinal; pCreateParams: Pointer): hwnd; cdecl;
+ external 'SW' index 4;
+
+function WinDefaultSize(Wnd: hwnd): Longbool; cdecl;
+ external 'SW' index 11;
+
+function WinInsertDefaultSize(Wnd: hwnd; pszDefaultSize: pChar): Longbool; cdecl;
+ external 'SW' index 12;
+
+function WinQuerySecondaryhwnd(Wnd: hwnd; ulFlag: Cardinal): hwnd; cdecl;
+ external 'SW' index 52;
+
+function WinSecondaryMessageBox(hwndParent: hwnd; hwndOwner: hwnd;
+ pszText: pChar; pszCaption: pChar; idWindow: Cardinal; smb: psmbinfo): Cardinal; cdecl;
+ external 'SW' index 5;
+
+function WinDismissSecondaryWindow(hwndDlg: hwnd; ulResult: Cardinal): Longbool; cdecl;
+ external 'SW' index 6;
+
+function WinDestroySecondaryWindow(Wnd: hwnd): Longbool; cdecl;
+ external 'SW' index 7;
+
+function WinDefSecondaryWindowProc(Wnd: hwnd; msg: Cardinal;
+ mp1: mParam; mp2: mParam): mResult; cdecl;
+ external 'SW' index 8;
+
+Function WinRegisterGraphicButton: Longbool; cdecl;
+ external 'SW' index 14;
+
+End.
diff --git a/packages/os2units/src/wpstk.pp b/packages/os2units/src/wpstk.pp
new file mode 100644
index 0000000000..5642d699e5
--- /dev/null
+++ b/packages/os2units/src/wpstk.pp
@@ -0,0 +1,751 @@
+{
+ Copyright (c) 2000-2003 by WPS Toolkit Project - Christian Langanke
+ Copyright (c) 2003-2004 by Yuri Prokushev (prokushev@freemail.ru)
+
+ Workplace Toolkit API
+
+ This file is part of the WPS Toolkit package and is free software.
+ You can redistribute it and/or modify it under the terms of the GNU
+ Library General Public License as published by the Free Software
+ Foundation, in version 2 as it comes in the "COPYING.LIB" file
+ of the WPS Toolkit main distribution. This library is distributed
+ in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+ License for more details.
+
+ **********************************************************************}
+
+Unit wpstk;
+
+Interface
+
+{$Mode ObjFpc}
+
+Uses
+ OS2Def, PMWin;
+
+// Please, rename wpstk.dll to another name to avoid version conflicts
+const
+ wpstkdll='wpstk';
+
+Function WtkQueryVersion(pszBuffer: PChar; ulBuflen: Cardinal): Cardinal; cdecl;
+ external wpstkdll name 'WtkQueryVersion';
+
+//*** handle types used by EA manager ***************************************/
+Type
+ LHANDLE=Cardinal;
+ HEA=LHANDLE;
+ PHEA=^HEA;
+
+Const
+ HEA_CREATE=HEA(-1);
+
+//*** EA type wildcard for WtkFindNextEaValue *******************************/
+ WTK_EAT_ANY=-1;
+
+//*** get size of all values of an EA ***************************************/
+Function WtkQueryEaSize(pszName, pszEaName: PChar; var pulSize: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkQueryEaSize';
+
+//*** read complete ea into memory and scan it ******************************/
+Function WtkReadEa(pszName: PChar; pszEaName: PChar; P_HEA: PHEA): Longint; cdecl;
+ external wpstkdll name 'WtkReadEa';
+
+Function WtkFindFirstEaValue(_HEA: HEA; var pulEaType: Cardinal; pszValue: PChar; var pulBuflen: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkFindFirstEaValue';
+
+Function WtkFindNextEaValue(_HEA: HEA; var pulEaType: Cardinal; pszValue: PChar; var pulBuflen: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkFindNextEaValue';
+
+//*** create new EA list in memory ******************************************/
+Function WtkCreateEa(pszName: PChar; pszEaName: PChar; _PHEA: PHEA): Longint; cdecl;
+ external wpstkdll name 'WtkCreateEa';
+
+//*** append a value ********************************************************/
+Function WtkAppendEaValue(HEA_: HEA; ulMultiType: Cardinal; ulEaType: Cardinal; var pbValue: Byte; ulValuelen: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkAppendEaValue';
+
+//*** write EA to disk ******************************************************/
+Function WtkSaveEa(_HEA: HEA; fWriteThru: Longbool; fEA: Byte): Longint; cdecl;
+ external wpstkdll name 'WtkSaveEa';
+
+//*** destroy EA in memory **************************************************/
+Function WtkCloseEa(_HEA: hea): Longint; cdecl;
+ external wpstkdll name 'WtkCloseEa';
+
+//*** WtkGetNextFile alike API, does WtkReadEa/WtkFind*EaValue/WtkCloseEa in one API */
+Function WtkGetNextEaValue(pszName, pszEaName: PChar; var pulEaType: Cardinal; PHEA_: PHEA; pszValue: PChar; var pulBuflen: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkGetNextEaValue';
+
+//*** read/appendWrite EA in one step ***************************************/
+Function WtkPutEaValue(pszName, pszEaName: PChar; ulMultiType, ulEaType: Cardinal; var pbValue: Byte; ulValuelen: Cardinal; fWriteThru: Longbool; fEA: Byte): Longint; cdecl;
+ external wpstkdll name 'WtkPutEaValue';
+
+//*** simplified APIs to read/write exatcly one string EA********************/
+Function WtkWriteStringEa(pszName, pszEaName, pszEaValue: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkWriteStringEa';
+Function WtkReadStringEa(pszName, pszEaName, pszEaValue: PChar; var pulBuflen: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkReadStringEa';
+
+Const
+ WTK_CFGSYS_UPDATE_ADD=0;
+ WTK_CFGSYS_UPDATE_DELETE=1;
+
+Function WtkUpdateConfigsys(pszUpdate: PChar; ulUpdateMode: Cardinal; pszBackupExtension: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkUpdateConfigsys';
+
+//* file handle type and structures */
+Type
+ HINIT=LHANDLE;
+ PHINIT=^HINIT;
+
+
+// structure to override default behaviour of parser
+ TINITPARMS=record
+ // specify all valid comment characters
+ // - specify nil to use ';' as default and only comment character
+ // - specify '/' to use "//" (c++ style comments)
+ pszCommentChars: PChar;
+ // specify all valid delimiter characters
+ // - specify nil to use '=' as default and only delimiter character
+ // - when multiple characters are specified, the first will be used
+ // for new entries
+ pszDelimiterChars: PChar;
+ // define layout for keys in new files
+ // (if keys already exist, the layout of
+ // the last read key is used)
+ //
+ // [SECTION]
+ //
+ // newkeyname1 = keyvalue1
+ // | | -> ulKeyIndent
+ //
+ // newkeyname2 = keyvalue2
+ // | | -> ulKeyNameLen
+ //
+ // newkeyname3 = keyvalue3
+ // | | -> ulValueIndent
+ ulKeyIndent,
+ ulKeyNameLen,
+ ulValueIndent: Cardinal;
+ end;
+ PINITPARMS=^TINITPARMS;
+
+//* define open modes (WtkOpenInitProfile - ulOpenMode) */
+Const
+ WTK_INIT_OPEN_READONLY=$0000;
+ WTK_INIT_OPEN_READWRITE=$0001;
+
+ WTK_INIT_OPEN_ALLOWERRORS=$8000;
+ WTK_INIT_OPEN_INMEMORY=$FFFF;
+
+//* define update modes (WtkOpenInitProfile - ulUpdateMode) */
+ WTK_INIT_UPDATE_DISCARDCOMMENTS=$0001;
+ WTK_INIT_UPDATE_SOFTDELETEKEYS=$0002;
+
+//* open and close file */
+Function WtkOpenInitProfile(pszName: PChar; var phinit: HINIT; ulOpenMode: Cardinal;
+ ulUpdateMode: Cardinal; pip: PINITPARMS): Longint; cdecl;
+ external wpstkdll name 'WtkOpenInitProfile';
+
+Function WtkCloseInitProfile(HINIT: HINIT; fUpdate: Longbool): Longint; cdecl;
+ external wpstkdll name 'WtkCloseInitProfile';
+
+const
+ WTK_INIT_CLOSE_DISCARD=0;
+ WTK_INIT_CLOSE_UPDATE=1;
+
+Function WtkCloseInitProfileBackup(_hinit: HINIT; fUpdateOriginal: Longbool; pszBackupFile: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkCloseInitProfileBackup';
+Function WtkInitProfileModified(_hinit: HINIT): Longbool; cdecl;
+ external wpstkdll name 'WtkInitProfileModified';
+
+//* query values */
+Function WtkQueryInitProfileString(_HINIT: hinit; pszSectionName, pszKeyName, pszDefault, pszBuffer: PChar; ulBuflen: Cardinal): Cardinal; cdecl;
+ external wpstkdll name 'WtkQueryInitProfileString';
+Function WtkQueryInitProfileSize(_HINIT: hinit; pszSectionName, pszKeyName: PChar; var pulDataLen: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkQueryInitProfileSize';
+
+//* update or delete keys and/or sections */
+Function WtkWriteInitProfileString(_HINIT: hinit; pszSectionName, pszKeyName, pszNewValue: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkWriteInitProfileString';
+
+//* file handle type and structures */
+
+Type
+ HSYSLEVEL = LHANDLE;
+ PHSYSLEVEL = ^HSYSLEVEL;
+
+Const
+ WTK_SYSLEVEL_MAXLEN_COMPID = 9;
+ WTK_SYSLEVEL_MAXLEN_NAME = 79;
+ WTK_SYSLEVEL_MAXLEN_PREFIX = 2;
+ WTK_SYSLEVEL_MAXLEN_CSDNUM = 4;
+ WTK_SYSLEVEL_MAXLEN_APPTYPE = 8;
+
+//* external data structure */
+//* NOTE: */
+//* - read/write version fields in hex */
+//* - use the WTK_SYSLEVEL_MAXLEN_* with */
+//* strncpy() to properly copy strings */
+//* to string fields (see sample !) */
+
+Type
+ TSYLEVELINFO = record
+ cbSize : Cardinal;
+ usSysId : Word;
+ szComponentId : array[0..(WTK_SYSLEVEL_MAXLEN_COMPID + 1)-1] of CHAR;
+ szName : array[0..(WTK_SYSLEVEL_MAXLEN_NAME + 1)-1] of CHAR;
+ bVersionMajor : BYTE;
+ bVersionMinor : BYTE;
+ bVersionRefresh : BYTE;
+ szCsdPrefix : array[0..(WTK_SYSLEVEL_MAXLEN_PREFIX + 1)-1] of CHAR;
+ chCsdLanguage : CHAR;
+ szCurrentCsd : array[0..(WTK_SYSLEVEL_MAXLEN_CSDNUM + 1)-1] of CHAR;
+ szPreviousCsd : array[0..(WTK_SYSLEVEL_MAXLEN_CSDNUM + 1)-1] of CHAR;
+ usDate : Word;
+ szAppType : array[0..(WTK_SYSLEVEL_MAXLEN_APPTYPE + 1)-1] of CHAR;
+ end;
+ PSYLEVELINFO = ^TSYLEVELINFO;
+
+Function WtkOpenSyslevel(pszName: PChar; var phsl: HSYSLEVEL): Longint; cdecl;
+ external wpstkdll name 'WtkOpenSyslevel';
+Function WtkCloseSyslevel(hsl: HSYSLEVEL; ulUpdateMode: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkCloseSyslevel';
+
+Const
+ WTK_SYSLEVEL_CLOSE_DISCARD = 0;
+ WTK_SYSLEVEL_CLOSE_UPDATE = 1;
+
+Function WtkQuerySyslevelInfo(hsl: HSYSLEVEL; var psli: TSYLEVELINFO): Longint; cdecl;
+ external wpstkdll name 'WtkCloseSyslevel';
+Function WtkSetSyslevelInfo(hsl: HSYSLEVEL; ulUpdateFlags: Cardinal; var psli: TSYLEVELINFO): Longint; cdecl;
+ external wpstkdll name 'WtkCloseSyslevel';
+
+Const
+ WTK_SYSLEVEL_UPDATE_ALL = -(1);
+ WTK_SYSLEVEL_UPDATE_SYSID = $00000001;
+ WTK_SYSLEVEL_UPDATE_COMPONENTID = $00000002;
+ WTK_SYSLEVEL_UPDATE_NAME = $00000004;
+ WTK_SYSLEVEL_UPDATE_VERSION = $00000008;
+ WTK_SYSLEVEL_UPDATE_CSDPREFIX = $00000010;
+ WTK_SYSLEVEL_UPDATE_CSDLANGUAGE = $00000020;
+ WTK_SYSLEVEL_UPDATE_CURRENTCSD = $00000040;
+ WTK_SYSLEVEL_UPDATE_PREVIOUSCSD = $00000080;
+ WTK_SYSLEVEL_UPDATE_DATE = $00000010;
+ WTK_SYSLEVEL_UPDATE_APPTYPE = $00000020;
+
+ {* flags for MmfAlloc parm ulOpenFlags */ }
+ {* NOTE: for all except MMF_ACCESS_READWRITE, only write by others is denied */ }
+ {* otherwise both read and write by others is denied */ }
+ MMF_ACCESS_READONLY = $00000000;
+ MMF_ACCESS_WRITEONLY = $00000001;
+ MMF_ACCESS_READWRITE = $00000002;
+ MMF_OPENMODE_OPENFILE = $00000000;
+ MMF_OPENMODE_RESETFILE = $00010000;
+
+ {* some sizes for usage with MmfAlloc parameter ulMaxSize */ }
+ MMF_MAXSIZE_KB = 1024;
+ MMF_MAXSIZE_MB = 1048576;
+
+ {* special NULL filename for MmfAlloc parameter pszFilename */ }
+ MMF_FILE_INMEMORY = nil;
+ {* define a handle type */ }
+
+//* define a handle type */
+Type
+ THMMF = LHANDLE;
+ PHMMF = ^THMMF;
+
+//* prototypes */
+Function WtkInitializeMmf(var phmmf: THMMF; ulMaxBuffer: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkInitializeMmf';
+Function WtkTerminateMmf(hmmf: THMMF): Longint; cdecl;
+ external wpstkdll name 'WtkTerminateMmf';
+Function WtkAllocMmf(hmmf: THMMF; Var ppvdata: Pointer; pszFilename: PChar; ulOpenFlags, ulMaxSize: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkAllocMmf';
+Function WtkFreeMmf(hmmf: THMMF; pvData: Pointer): Longint; cdecl;
+ external wpstkdll name 'WtkFreeMmfl';
+Function WtkUpdateMmf(hmmf: THMMF; pvData: Pointer): Longint; cdecl;
+ external wpstkdll name 'WtkUpdateMmf';
+
+Function WtkSetMmfSize(hmmf: THMMF; pvData: Pointer; ulNewSize: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkSetMmfSize';
+Function WtkQueryMmfSize(hmmf: THMMF; pvData: Pointer; var pulSize: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkQueryMmfSize';
+
+//* only be used for string translation for indexed */
+//* values by callback STM_CALLBACK_QUERYSTRING */
+Const
+ _STM_MAX_SETTINGSVALUE = 64;
+
+//*** handle types used by Setting manager **********************************/
+Type
+ HSETTINGTABLE = LHANDLE;
+ HVALUETABLE = LHANDLE;
+
+//*** callback procedure prototype ******************************************/
+Type
+ TFnCB=Function(ulAction: Cardinal; pvData, pvObjectInstance, pvObjectData: Pointer): Longbool; cdecl;
+ PFNCB = ^TFnCB;
+
+//*** callback actions ******************************************************/
+
+Const
+ { reports that class is being initialized }
+ STM_CALLBACK_REPORTINIT = $0000;
+ { queries infos about (sub)value }
+ STM_CALLBACK_QUERYVALUEINFO = $0001;
+ { queries target buffer when creating value table }
+ STM_CALLBACK_QUERYTARGETBUF = $0002;
+ { ask WPS class to validate a (sub)value }
+ STM_CALLBACK_VALIDATE = $0003;
+ { reports the change of a setting }
+ STM_CALLBACK_REPORTCHANGED = $0004;
+ { asks for update of target buffers }
+ STM_CALLBACK_QUERYVALUE = $0005;
+ { translates strings to array indicees }
+ STM_CALLBACK_QUERYINDEX = $0006;
+ { translates strings to array indicees }
+ STM_CALLBACK_QUERYSTRING = $0007;
+ { asks for initialization of GUI controls, }
+ STM_CALLBACK_INITCONTROL = $0008;
+ { useful for listboxes comboboxes etc. }
+ { reports errors from WtkValidateObjectValueTable }
+ STM_CALLBACK_REPORTERROR = $0009;
+ { reports that settings have been saved }
+ STM_CALLBACK_REPORTSAVED = $000A;
+ { reports that class settings table is destroyed }
+ STM_CALLBACK_REPORTDESTROYED = $000B;
+
+//*** data structure for callback STM_CALLBACK_REPORTINIT *************/
+//*** Note: on this callback, pvObjectInstance and pvObjectData are NULL ****/
+Type
+ TCBREPORTINIT = record
+ fInitialized : Longbool; //* no data really required here yet */
+ end;
+
+//*** data structures for callback STM_CALLBACK_QUERYVALUEINFO ********/
+//*** Note: on this callback, pvObjectInstance and pvObjectData are NULL ****/
+ TCBQUERYVALUEINFO = record
+ pszName : PChar; //* out - name of setting */
+ ulSettingId : Cardinal; //* out - id of setting */
+ ulValueIndex : Cardinal; //* out - index of subvalue */
+ ulValueType : Cardinal; //* #in - type of value - see VALUETYPE_* */
+ usDialogid : Word; //* in - id of dialog containing control */
+ usControlid : Word; //* in - id of control */
+ pfnwpSubclass : proc; //* in - subclass window proc for control */
+ pszDetailsTitle : PChar; //* in - title of folderdetails view */
+ end;
+ PCBQUERYVALUEINFO = ^TCBQUERYVALUEINFO;
+
+//*** data structures for callback CALLBACK_QUERYTARGETBUF ************/
+//* values marked with # MUST be specified, all others are optional */
+
+Type
+ TCBQUERYTARGETBUF = record
+ pvObjectInstance : Pointer; //* out - somSelf of object instance */
+ pszName : PChar; //* out - name of setting */
+ ulSettingId : Cardinal; //* out - id of setting */
+ ulValueIndex : Cardinal; //* out - index of subvalue (only > 0 for multivalue settings) */
+ ulBufMax : Cardinal; //* #in - len of target buffer */
+ pvTarget : Pointer; //* #in - target buffer */
+ end;
+ PCBQUERYTARGETBUF = ^TCBQUERYTARGETBUF;
+
+//* supported GUI controls: */
+//* - WC_ENTRYFIELD WC_MLE WC_BUTTON (checkbox and radio button) */
+//* - WC_LISTBOX WC_COMBOBOX WC_SPINBUTTON */
+//* - WC_SLIDER WC_CIRCULARSLIDER */
+
+//* types of possible values */
+//* */
+//* type validation target buffer possible GUI update */
+//* ------------- ---------- ------------- ------------------------------- */
+//* STRING NO CHAR[] <all supported> except WC_*SLIDER */
+//* - WC_COMBOBOX, WC_SPINBUTTON as listbox */
+//* INDEX YES LONG <all supported> */
+//* ITEM YES LONG selects item with WC_LISTBOX, WC_COMBOBOX, */
+//* behaves like LONG otherwise */
+//* LONG NO LONG <all supported> */
+//* TRUEFALSE YES BOOL <all supported> except WC_*SLIDER */
+//* YESNO YES BOOL <all supported> except WC_*SLIDER */
+//* ONOFF YES BOOL <all supported> except WC_*SLIDER */
+
+
+//*** value types for value target buffers **********************************/
+Const
+ STM_VALUETYPE_STRING = 0;
+ STM_VALUETYPE_INDEX = 1;
+ STM_VALUETYPE_LONG = 2;
+ STM_VALUETYPE_TRUEFALSE = 3;
+ STM_VALUETYPE_YESNO = 4;
+ STM_VALUETYPE_ONOFF = 5;
+ { for details only ! }
+ STM_VALUETYPE_CDATE = 6;
+ { for details only ! }
+ STM_VALUETYPE_CTIME = 7;
+ STM_VALUETYPE_INDEXITEM = 8;
+
+//*** data structures for callback CALLBACK_VALIDATION ****************/
+Type
+ TCBVALIDATE = record
+ pvObjectInstance : Pointer; //* out - somSelf of object instance */
+ ulSettingId : Cardinal; //* out - id of setting */
+ pszName : PChar; //* out - name of setting */
+ pszValue : PChar; //* out - name of value to be validated */
+ ulValueIndex : Cardinal; //* out - index of subvalue */
+ fResult : Longbool; //* in - result of validation */
+ end; //* return TRUE if your callback validates, */
+ PCBVALIDATE = ^TCBVALIDATE; //* FALSE for using standard validation */
+
+//*** data structures for callback CALLBACK_REPORTCHANGED ****************/
+Type
+ TCBREPORTCHANGED = record
+ pvObjectInstance : Pointer; //* out - somSelf of object instance */
+ ulSettingId : Cardinal; //* out - id of setting */
+ pszName : PChar; //* out - name of setting */
+ end;
+ PCBREPORTCHANGED = ^TCBREPORTCHANGED;
+
+//*** data structures for callback CALLBACK_QUERYVALUE ****************/
+ TCBQUERYVALUE = record
+ pvObjectInstance : Pointer; //* out - somSelf of object instance */
+ ulSettingId : Cardinal; //* out - id of setting */
+ pszName : PChar; //* out - name of setting */
+ ulQueryIndex : Cardinal; //* out - index of query */
+ end;
+ PCBQUERYVALUE = ^TCBQUERYVALUE;
+
+//*** data structures for callback CALLBACK_QUERYINDEX ****************/
+ TCBQUERYINDEX = record
+ pvObjectInstance : Pointer; //* out - somSelf of object instance */
+ ulSettingId : Cardinal; //* out - id of setting */
+ pszName : PChar; //* out - name of setting */
+ pszValue : PChar; //* out - string value to be translated */
+ ulValueIndex : Cardinal; //* out - index of subvalue */
+ ulStringIndex : Cardinal; //* in - index to be used */
+ end; //* return TRUE if processed, else FALSE */
+ PCBQUERYINDEX = ^TCBQUERYINDEX;
+
+//*** data structures for callback CALLBACK_QUERYSTRING ***************/
+ TCBQUERYSTRING = record
+ pvObjectInstance : Pointer; // out - somSelf of object instance */
+ ulSettingId : Cardinal; // out - id of setting */
+ pszName : PChar; // out - name of setting */
+ ulStringIndex : Cardinal; // out - index to be translated */
+ ulValueIndex : Cardinal; // out - index of subvalue */
+ szValue : array[0..(_STM_MAX_SETTINGSVALUE)-1] of CHAR;// in - string value to be used */
+ end; // return TRUE if processed, else FALSE */
+ PCBQUERYSTRING = ^TCBQUERYSTRING;
+
+//*** data structures for callback CALLBACK_INITCONTROL ***************/
+ TCBINITCONTROL = record
+ usDialogid : Word; //* out - id of dialog */
+ usControlid : Word; //* out - id of control */
+ hwndDialog : HWND; //* out - handle of dialog */
+ hwndControl : HWND; //* out - handle of control */
+ end;
+ PCBINITCONTROL = ^TCBINITCONTROL;
+
+//*** data structures for callback STM_CALLBACK_REPORTERROR ***********/
+ TCBREPORTERROR = record
+ pvObjectInstance : Pointer; //* out - somSelf of object instance */
+ ulSettingId : Cardinal; //* out - id of setting */
+ pszName : PChar; //* out - name of setting */
+ usDialogid : Word; //* out - id of dialog */
+ usControlid : Word; //* out - id of control */
+ hwndDialog : HWND; //* out - handle of dialog */
+ hwndControl : HWND; //* out - handle of control */
+ end; //* return TRUE to ignore error */
+ PCBREPORTERROR = ^TCBREPORTERROR;
+
+//*** data structures for callback STM_CALLBACK_REPORTSAVED ***********/
+ TCBREPORTSAVED = record
+ fSaved : Longbool; //* no data really required here yet */
+ end;
+ PCBREPORTSAVED = ^TCBREPORTSAVED;
+
+//*** data structures for callback STM_CALLBACK_DESTROYED *************/
+//*** Note: on this callback, pvObjectInstance and pvObjectData are NULL ***/
+ TCBREPORTDESTROYED = record
+ fDestroyed : Longbool; //* no data really required here yet */
+ end;
+ PCBREPORTDESTROYED = ^TCBREPORTDESTROYED;
+
+// ----------------------------------------
+// prototypes
+// ----------------------------------------
+
+//*** prototypes for (de)initializing the settings table for the metaclass **/
+Function WtkCreateClassSettingsTable(pvObjectClass: Pointer; pfnCallbackValue: PFNCB): HSETTINGTABLE; cdecl;
+ external wpstkdll name 'WtkCreateClassSettingsTable';
+Function WtkDestroyClassSettingsTable(hst: HSETTINGTABLE): Longbool; cdecl;
+ external wpstkdll name 'WtkDestroyClassSettingsTable';
+Function WtkAddClassSetting(hst: HSETTINGTABLE; ulSettingId: Cardinal; pszSetting: Pchar; ulQueryCount: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkAddClassSetting';
+Function WtkAddClassDetail(hst: HSETTINGTABLE; ulSettingId: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkAddClassDetail';
+Function WtkCloseClassSettingsTable(hst: HSETTINGTABLE): Longbool; cdecl;
+ external wpstkdll name 'WtkCloseClassSettingsTable';
+Function WtkDumpClassSettingsTable(hst: HSETTINGTABLE): Longbool; cdecl; // for testing purposes only, dumps to console
+ external wpstkdll name 'WtkDumpClassSettingsTable';
+
+//*** prototypes for maintaining setting values for object instances ********/
+Function WtkCreateObjectValueTable(hst: HSETTINGTABLE; pvObjectInstance, pvObjectData: Pointer): HVALUETABLE; cdecl;
+ external wpstkdll name 'WtkCreateObjectValueTable';
+Function WtkDestroyObjectValueTable(hvt: HVALUETABLE): Longbool; cdecl;
+ external wpstkdll name 'WtkDestroyObjectValueTable';
+Function WtkEvaluateObjectSettings(hvt: HVALUETABLE; pszSetup: PChar): Longbool; cdecl;
+ external wpstkdll name 'WtkEvaluateObjectSettings';
+Function WtkQueryObjectSettings(hvt: HVALUETABLE; pszBuffer: PChar; var pulMaxlen: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkQueryObjectSettings';
+
+//*** prototypes for providing automatic updates to GUI controls ************/
+Function WtkRegisterSettingsDialog(hvt: HVALUETABLE; hwndDialog: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkRegisterSettingsDialog';
+Function WtkDeregisterSettingsDialog(hvt: HVALUETABLE; hwndDialog: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkDeregisterSettingsDialog';
+Function WtkReadObjectValueTable(hvt: HVALUETABLE; hwndDialog: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkReadObjectValueTable';
+Function WtkWriteObjectValueTable(hvt: HVALUETABLE; hwndDialog: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkWriteObjectValueTable';
+Function WtkQueryGUIControlsChanged(hvt: HVALUETABLE; hwnd_: HWND; mp1, mp2:MPARAM; var pfOrgValue: Longbool): Longbool; cdecl;
+ external wpstkdll name 'WtkQueryGUIControlsChanged';
+
+//*** prototype for using same dialog templates under WARP 3 and WARP 4 *****/
+Function WtkRelocateNotebookpageControls(hwndDialog: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkRelocateNotebookpageControls';
+
+//*** prototypes for providing automatic validation of controls *************/
+//*** on close of settings notebook. *************/
+//*** NOTE: WtkValidateObjectValueTable needs not to be *************/
+//*** explicitely called for this, but is avaliable anyway. *************/
+Function WtkRegisterSettingsNotebook(hvt: HVALUETABLE; hwndNotebook: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkRegisterSettingsNotebook';
+Function WtkValidateObjectValueTable(hvt: HVALUETABLE; hwndNotebook: HWND): Longbool; cdecl;
+ external wpstkdll name 'WtkValidateObjectValueTable';
+
+//*** prototypes for providing details data *********************************/
+Function WtkQueryClassDetailsInfo(hst: HSETTINGTABLE; var ppClassFieldInfo: Pointer;
+ var pSize: Cardinal; ulParentColumns: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkQueryClassDetailsInfo';
+Function WtkQueryObjectDetailsData(hvt: HVALUETABLE; var ppDetailsData: Pointer; var pcp: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkQueryObjectDetailsData';
+
+//*** prototypes for saving/restoring data in WPS repository ****************/
+Function WtkSaveObjectState(hvt: HVALUETABLE; pszClass: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkSaveObjectState';
+Function WtkRestoreObjectState(hvt: HVALUETABLE; pszClass: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkRestoreObjectState';
+
+//*** prototypes for saving/restoring data in extern ini file ***************/
+//*** NOTE: you have to make sure yourself that you save to ***************/
+//*** a unique place per object instance !!! ***************/
+//*** NOTE: specify USER or SYSTEM as filename to write to ***************/
+//*** HINI_USERPROFILE or HINI_SYSTEMPROFILE ***************/
+Function WtkSaveObjectSettings(hvt: HVALUETABLE; pszFilename, pszApp, pszKey: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkSaveObjectSettings';
+Function WtkRestoreObjectSettings(hvt: HVALUETABLE; pszFilename, pszApp, pszKey: PChar): Longint; cdecl;
+ external wpstkdll name 'WtkRestoreObjectSettings';
+
+Function WtkGetTextMessage(var pTable: PChar; cTable: Cardinal;
+ var pbBuffer: Byte; cbBuffer: Cardinal;
+ pszMessageName, pszFile: PChar;
+ var pcbMsg: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkGetTextMessage';
+
+// data structures for 32-bit memory model
+
+Type
+ TBINDATA = record
+ cbSize : Cardinal;
+ bData : array[0..0] of BYTE;
+ end;
+ PBINDATA = ^TBINDATA;
+
+//*** prototypes for calculating CRC of data in memory *******************/
+//*** initialize pulCRC32 with -1 on first call **************************/
+Function WtkCalcMemCRC32(pvData: Pointer; ulDatalen: Cardinal; var pulCRC32: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkCalcMemCRC32';
+
+//*** prototypes for calculating CRC of files ****************************/
+Function WtkCalcFileCRC32(pszFilename: PChar; var pulCRC32: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkCalcFileCRC32';
+
+//*** prototypes for general functions **************************************/
+Function WtkQueryClassIndex(HWND_: hwnd): PChar; cdecl;
+ external wpstkdll name 'WtkQueryClassIndex';
+Function WtkIsOfPublicPmClass(HWND_: hwnd; pszClassIndex: PChar; ulPrimaryWindowStyle: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkIsOfPublicPmClass';
+
+//*** prototypes for specialized functions for certain window classes *******/
+Function WtkInitializeNumSpinbuttonArray(hwndSpinbutton: HWND; ulMinValue: Cardinal;
+ ulMaxValue: Cardinal; ulStep: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkInitializeNumSpinbuttonArray';
+Function WtkQueryNumSpinbuttonIndex(hwndSpinbutton: HWND; ulMinValue: Cardinal;
+ ulMaxValue: Cardinal; ulStep: Cardinal; ulValue: Cardinal): Longint; cdecl;
+ external wpstkdll name 'WtkQueryNumSpinbuttonIndex';
+
+//*** prototypes for filling MLEs from diverse resources ********************/
+Function WtkAddTextResourceToMLE(HWND_: hwnd; ulControlId: Cardinal;
+ hmod: Cardinal; ulResourceType, ulResId: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkAddTextResourceToMLE';
+
+//*** prototypes for PM error functions *************************************/
+Function WtkSetErrorInfo(rc: Cardinal): Longbool; cdecl;
+ external wpstkdll name 'WtkSetErrorInfo';
+
+Const
+ PMHERR_USE_EXISTING_ERRORINFO = -(1);
+
+//*** check existance of files & directories ********************************/
+Function WtkFileExists(pszName: PChar): Longbool;
+Function WtkDirExists(pszName: PChar): Longbool;
+Function WtkFileMaskExists(pszFileMask, pszFirstFile: PChar; ulBuflen: Cardinal): Longbool;
+Function WtkIsFile(pszName: PChar): Longbool; (* equivalent to WtkFileExists *)
+Function WtkIsDirectory(pszName: PChar): Longbool; (* equivalent to WtkDirExists *)
+
+//*** get fullname of directory or file *************************************/
+Function WtkQueryFullname(pszName, pszBuffer: PChar; ulBuflen: Cardinal): Longint;
+
+//*** extended file handling ************************************************/
+Function WtkDeleteFile(pszName: PChar): Longint;
+Function WtkMoveFile(pszOld, pszNew: PChar): Longint;
+
+//*** query disk and directory at one time **********************************/
+Function WtkQueryCurrentDir(ulDiskNum: Cardinal; pszBuffer: PChar; ulBuflen: Cardinal): Longint;
+Function WtkSetCurrentDir(pszDirectory: PChar): Longint;
+
+//*** create/delete path ****************************************************/
+Function WtkCreatePath(pszPath: PChar): Longint;
+Function WtkDeletePath(pszPath: PChar): Longint;
+
+//*** easy version of DosFindFirst/DosFindNext ******************************/
+Function WtkGetNextFile(pszFileMask: PChar; phdir: PHDIR;
+ pszNextFile: PChar; ulBuflen: Cardinal): Longint;
+Function WtkGetNextDirectory(pszFileMask: PChar; phdir: PHDIR;
+ pszNextDirectory: PChar; ulBuflen: Cardinal): Longint;
+
+//*** search part of filename ***********************************************/
+Function WtkFilespec(pszName: PChar; ulPart: Cardinal): PChar;
+
+Const
+ WTK_FILESPEC_PATHNAME = 1;
+ WTK_FILESPEC_NAME = 2;
+ WTK_FILESPEC_EXTENSION = 3;
+
+//*** get specific information about file ***********************************/
+Function WtkFileModified(pszName: PChar; pfs3: PFILESTATUS3): Longbool;
+Function WtkQueryFileSize(pszName: PChar): Cardinal;
+
+//*** read file into memory ************************************************/
+Function WtkReadFile(pszName: PChar; ppszBuffer: PPChar; pulBuflen: PCardinal): Longint;
+Function WtkWriteFile(pszName, pszBuffer: PChar; ulBuflen: Cardinal; fAppend: Longbool): Longint;
+
+//*** create tmp file *******************************************************/
+Function WtkCreateTmpFile(pszFileMask, pszBuffer: PChar; ulBuflen: Cardinal): Longint;
+
+//*** check file contents ***************************************************/
+Function WtkFileIsEmpty(pszName: PChar): Longbool;
+
+//*** prototypes for opening devices ****************************************/
+Function WtkOpenDevice(pszName: PChar; phdevice: PHFILE; ulOpenMode: Cardinal): Longint;
+
+Const
+ WTK_OPENDEVICE_SHARED = $0000;
+ WTK_OPENDEVICE_EXCLUSIVE = $0001;
+ WTK_OPENDEVICE_NOCACHE = $0002;
+ { implicitely set, when pszName specifies drive }
+ WTK_OPENDEVICE_BLOCKDEVICE = $0004;
+
+//*** prototypes for performing an I/o Control transaction ******************/
+Function WtkDevIOCtl(pszName: PChar; ulOpenMode: Cardinal;
+ ulCategory: Cardinal; ulFunction: Cardinal;
+ pvParams: Pointer; pcbParmLen: PCardinal;
+ pvData: Pointer; pcbDataLen: PCardinal): Longint;
+
+//*** prototypes for module information functions ***************************/
+APIRET APIENTRY WtkGetPackageFilename( PFN pfn, PChar pszSubdir, PChar pszFilename,
+ PChar pszFileext, PChar pszBuffer, ULONG ulBuflen);
+APIRET APIENTRY WtkGetModuleInfo( PFN pfn, PHMODULE phmod, PChar pszBuffer, ULONG ulBuflen);
+APIRET APIENTRY WtkGetModulePath( PFN pfn, PChar pszBuffer, ULONG ulBuflen);
+HMODULE APIENTRY WtkGetModuleHandle( PFN pfn);
+
+BOOL APIENTRY WtkIsRegularExpressionValid( PChar pszExpression);
+APIRET APIENTRY WtkMatchRegularExpression( PChar pszExpression, PChar pszText,
+ PChar pszBuffer, ULONG ulBuflen);
+APIRET APIENTRY WtkSubstRegularExpressionMatch( PChar pszExpression, PChar pszText,
+ PChar pszReplacePattern,
+ PChar pszBuffer, ULONG ulBuflen);
+
+//*** prototypes for system configuration functions *************************/
+Function WtkIsWarp4: Longbool; cdecl;
+ external wpstkdll name 'WtkIsWarp4';
+
+// distinct between OS/2 Warp and eComStation
+Function WtkQueryOperatingSystem: Cardinal; cdecl;
+ external wpstkdll name 'WtkQueryOperatingSystem';
+
+Const
+ WTK_OSTYPE_OS2 = $0000;
+ WTK_OSTYPE_ECS = $0001;
+
+Function WtkIsOS2: Longbool; cdecl;
+ external wpstkdll name 'WtkIsOS2';
+Function WtkIseComStation: Longbool; cdecl;
+ external wpstkdll name 'WtkIseComStation';
+
+Function WtkQueryBootDrive: Char; cdecl;
+ external wpstkdll name 'WtkQueryBootDrive';
+Function WtkQuerySysLanguage: PChar; cdecl;
+ external wpstkdll name 'WtkQuerySysLanguage';
+
+Function WtkReboot: Cardinal; cdecl;
+ external wpstkdll name 'WtkReboot';
+
+
+//*** prototypes for DATETIME struct handling ****************************/
+BOOL APIENTRY WtkSetDateTime( UCHAR uchDay, UCHAR uchMonth, USHORT usYear, UCHAR uchHours,
+ UCHAR uchMinutes, UCHAR uchSeconds, PDATETIME pdt);
+BOOL APIENTRY WtkDateTimeToTime( PDATETIME pdt, time_t* ptime);
+BOOL APIENTRY WtkTimeToDateTime( time_t* ptime, PDATETIME pdt);
+
+//*** prototypes for FTIME FDATE struct handling *************************/
+BOOL APIENTRY WtkSetFDateTime( UCHAR uchDay, UCHAR uchMonth, USHORT usYear, UCHAR uchHours,
+ UCHAR uchMinutes, UCHAR uchSeconds, PFDATE pfdate, PFTIME pftime);
+BOOL APIENTRY WtkFDateTimeToTime( PFDATE pfdate, PFTIME pftime, time_t* ptime);
+BOOL APIENTRY WtkTimeToFDateTime( time_t* ptime, PFDATE pfdate, PFTIME pftime);
+
+//*** prototypes for CDATE/CTIME struct handling ****************************/
+BOOL APIENTRY WtkSetCDateTime( UCHAR uchDay, UCHAR uchMonth, USHORT usYear, UCHAR uchHours,
+ UCHAR uchMinutes, UCHAR uchSeconds, PCDATE pcdate, PCTIME pctime);
+BOOL APIENTRY WtkCDateTimeToTime( PCDATE pcdate, PCTIME pctime, time_t* ptime);
+BOOL APIENTRY WtkTimeToCDateTime( time_t* ptime, PCDATE pcdate, PCTIME pctime);
+
+//*** prototypes for getting a timestamp *********************************/
+Const
+ WTK_TIMESTAMP_SORTEDDATETIME = 0;
+ WTK_TIMESTAMP_SORTEDDATE = 1;
+ WTK_TIMESTAMP_SORTEDTIME = 2;
+ WTK_TIMESTAMP_NLSDATETIME = 3;
+ WTK_TIMESTAMP_NLSDATE = 4;
+ WTK_TIMESTAMP_NLSTIME = 5;
+
+APIRET APIENTRY WtkQueryDateTimeStamp( PDATETIME pdt, ULONG ulStampType,
+ PChar pszBuffer, ULONG ulBuflen);
+APIRET APIENTRY WtkQueryFDateTimeStamp( PFDATE pfdate, PFTIME pftime, ULONG ulStampType,
+ PChar pszBuffer, ULONG ulBuflen);
+APIRET APIENTRY WtkQueryCDateTimeStamp( PCDATE pcdate, PCTIME pctime, ULONG ulStampType,
+ PChar pszBuffer, ULONG ulBuflen);
+
+//*** prototypes for getting last write time from a file or directory ****/
+APIRET APIENTRY WtkQueryFileDateTime( PDATETIME pdt, PChar pszName);
+APIRET APIENTRY WtkQueryFileFDateTime( PFDATE pfdate, PFTIME pftime, PChar pszName);
+APIRET APIENTRY WtkQueryFileCDateTime( PCDATE pcdate, PCTIME pctime, PChar pszName);
+
+
+implementation
+
+end.