This commit is contained in:
yuri 2003-10-14 14:42:09 +00:00
parent 048fbd8228
commit e5b1812da0
6 changed files with 1780 additions and 30 deletions

View File

@ -1,8 +1,8 @@
#
# Don't edit, this file is generated by FPCMake Version 1.1 [2003/10/09]
# Don't edit, this file is generated by FPCMake Version 1.1 [2003/08/11]
#
default: all
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx
override PATH:=$(subst \,/,$(PATH))
ifeq ($(findstring ;,$(PATH)),)
inUnix=1
@ -203,7 +203,7 @@ else
UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
endif
PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
override TARGET_DIRS+=ftpapi mmtk hwvideo lvm
override TARGET_DIRS+=ftpapi mmtk hwvideo lvm clkdll
override INSTALL_FPCPACKAGE=y
override INSTALL_FPCSUBDIR=packages
ifdef REQUIRE_UNITSDIR
@ -422,11 +422,6 @@ STATICLIBPREFIX=
FPCMADE=fpcmade.dos
ZIPSUFFIX=go32
endif
ifeq ($(OS_TARGET),watcom)
STATICLIBPREFIX=
FPCMADE=fpcmade.dos
ZIPSUFFIX=watcom
endif
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
@ -529,11 +524,6 @@ STATICLIBPREFIX=
FPCMADE=fpcmade.dos
ZIPSUFFIX=go32
endif
ifeq ($(OS_TARGET),watcom)
STATICLIBPREFIX=
FPCMADE=fpcmade.dos
ZIPSUFFIX=watcom
endif
ifeq ($(OS_TARGET),linux)
EXEEXT=
HASSHAREDLIB=1
@ -793,17 +783,15 @@ TARPROG:=$(firstword $(TARPROG))
endif
endif
export TARPROG
ASNAME=$(BINUTILSPREFIX)as
LDNAME=$(BINUTILSPREFIX)ld
ARNAME=$(BINUTILSPREFIX)ar
RCNAME=$(BINUTILSPREFIX)rc
ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
ASNAME=as
LDNAME=ld
ARNAME=ar
RCNAME=rc
ifeq ($(OS_TARGET),win32)
ASNAME=asw
LDNAME=ldw
ARNAME=arw
endif
endif
ifndef ASPROG
ifdef CROSSBINDIR
ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
@ -1006,11 +994,6 @@ ifeq ($(CPU_TARGET),i386)
REQUIRE_PACKAGES_RTL=1
endif
endif
ifeq ($(OS_TARGET),watcom)
ifeq ($(CPU_TARGET),i386)
REQUIRE_PACKAGES_RTL=1
endif
endif
ifdef REQUIRE_PACKAGES_RTL
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/$(OS_TARGET)/Makefile.fpc,$(PACKAGESDIR))))))
ifneq ($(PACKAGEDIR_RTL),)
@ -1046,11 +1029,6 @@ endif
ifeq ($(OS_SOURCE),openbsd)
override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
endif
ifndef CROSSBOOTSTRAP
ifneq ($(BINUTILSPREFIX),)
override FPCOPT+=-XP$(BINUTILSPREFIX)
endif
endif
ifdef UNITDIR
override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
endif
@ -1315,6 +1293,7 @@ TARGET_DIRS_FTPAPI=1
TARGET_DIRS_MMTK=1
TARGET_DIRS_HWVIDEO=1
TARGET_DIRS_LVM=1
TARGET_DIRS_CLKDLL=1
ifdef TARGET_DIRS_FTPAPI
ftpapi_all:
$(MAKE) -C ftpapi all
@ -1487,6 +1466,49 @@ lvm:
$(MAKE) -C lvm all
.PHONY: lvm_all lvm_debug lvm_smart lvm_release lvm_examples lvm_shared lvm_install lvm_sourceinstall lvm_exampleinstall lvm_distinstall lvm_zipinstall lvm_zipsourceinstall lvm_zipexampleinstall lvm_zipdistinstall lvm_clean lvm_distclean lvm_cleanall lvm_info lvm_makefiles lvm
endif
ifdef TARGET_DIRS_CLKDLL
clkdll_all:
$(MAKE) -C clkdll all
clkdll_debug:
$(MAKE) -C clkdll debug
clkdll_smart:
$(MAKE) -C clkdll smart
clkdll_release:
$(MAKE) -C clkdll release
clkdll_examples:
$(MAKE) -C clkdll examples
clkdll_shared:
$(MAKE) -C clkdll shared
clkdll_install:
$(MAKE) -C clkdll install
clkdll_sourceinstall:
$(MAKE) -C clkdll sourceinstall
clkdll_exampleinstall:
$(MAKE) -C clkdll exampleinstall
clkdll_distinstall:
$(MAKE) -C clkdll distinstall
clkdll_zipinstall:
$(MAKE) -C clkdll zipinstall
clkdll_zipsourceinstall:
$(MAKE) -C clkdll zipsourceinstall
clkdll_zipexampleinstall:
$(MAKE) -C clkdll zipexampleinstall
clkdll_zipdistinstall:
$(MAKE) -C clkdll zipdistinstall
clkdll_clean:
$(MAKE) -C clkdll clean
clkdll_distclean:
$(MAKE) -C clkdll distclean
clkdll_cleanall:
$(MAKE) -C clkdll cleanall
clkdll_info:
$(MAKE) -C clkdll info
clkdll_makefiles:
$(MAKE) -C clkdll makefiles
clkdll:
$(MAKE) -C clkdll all
.PHONY: clkdll_all clkdll_debug clkdll_smart clkdll_release clkdll_examples clkdll_shared clkdll_install clkdll_sourceinstall clkdll_exampleinstall clkdll_distinstall clkdll_zipinstall clkdll_zipsourceinstall clkdll_zipexampleinstall clkdll_zipdistinstall clkdll_clean clkdll_distclean clkdll_cleanall clkdll_info clkdll_makefiles clkdll
endif
all: $(addsuffix _all,$(TARGET_DIRS))
debug: $(addsuffix _debug,$(TARGET_DIRS))
smart: $(addsuffix _smart,$(TARGET_DIRS))

View File

@ -3,7 +3,7 @@
#
[target]
dirs=ftpapi mmtk hwvideo lvm
dirs=ftpapi mmtk hwvideo lvm clkdll
[install]
fpcpackage=y

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
#
# Makefile.fpc for CLKDLL.DLL interface unit
#
[package]
name=clkdll
version=1.0.8
[target]
units=clkdll
examples=clktest
[install]
fpcpackage=y
[default]
fpcdir=../../../..

View File

@ -0,0 +1,177 @@
{
$Id$
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.
{
$Log$
Revision 1.1 2003-10-14 14:42:09 yuri
+ Import
}

View File

@ -0,0 +1,18 @@
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.
{
$Log$
Revision 1.1 2003-10-14 14:42:09 yuri
+ Import
}