+arm/wince more rtl units : winsock, sockets

+arm/wince more fcl units : resolve, ssockets

git-svn-id: trunk@2065 -
This commit is contained in:
oro06 2005-12-27 15:37:15 +00:00
parent 834ae15bd1
commit 19b6be7d8e
10 changed files with 1672 additions and 99 deletions

3
.gitattributes vendored
View File

@ -1044,6 +1044,7 @@ fcl/wince/ezcgi.inc svneol=native#text/plain
fcl/wince/fileinfo.pp svneol=native#text/plain
fcl/wince/pipes.inc svneol=native#text/plain
fcl/wince/process.inc svneol=native#text/plain
fcl/wince/resolve.inc svneol=native#text/plain
fcl/wince/simpleipc.inc svneol=native#text/plain
fcl/wince/syncobjs.pp svneol=native#text/plain
fcl/xml/Makefile svneol=native#text/plain
@ -4556,6 +4557,7 @@ rtl/wince/i386/wprt0.as svneol=native#text/plain
rtl/wince/messages.pp -text
rtl/wince/readme-winceapi-port -text
rtl/wince/readme.txt -text
rtl/wince/sockets.pp svneol=native#text/plain
rtl/wince/system.pp svneol=native#text/plain
rtl/wince/sysutils.pp -text
rtl/wince/tthread.inc -text
@ -4573,6 +4575,7 @@ rtl/wince/wininc/redef.inc -text
rtl/wince/wininc/struct.inc -text
rtl/wince/wininc/unidef.inc -text
rtl/wince/winres.inc -text
rtl/wince/winsock.pp svneol=native#text/plain
rtl/x86_64/int64p.inc svneol=native#text/plain
rtl/x86_64/makefile.cpu -text
rtl/x86_64/math.inc svneol=native#text/plain

View File

@ -392,7 +392,7 @@ ifeq ($(FULL_TARGET),i386-netwlibc)
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex resolve ssockets syncobjs
endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process fileinfo syncobjs simpleipc msgintf dbugintf
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
@ -452,7 +452,7 @@ ifeq ($(FULL_TARGET),arm-linux)
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
endif
ifeq ($(FULL_TARGET),arm-wince)
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process fileinfo syncobjs simpleipc msgintf dbugintf
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf

View File

@ -33,7 +33,7 @@ units_netbsd=process ssockets resolve fpasync simpleipc msgintf dbugintf
units_openbsd=process ssockets resolve fpasync simpleipc msgintf dbugintf
units_linux=process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
units_win32=process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
units_wince=process fileinfo syncobjs simpleipc msgintf dbugintf
units_wince=process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
units_os2=resolve ssockets
units_emx=resolve ssockets
units_netware=resolve ssockets

51
fcl/wince/resolve.inc Normal file
View File

@ -0,0 +1,51 @@
uses winsock;
Type
PHostEntry = PHostEnt;
PNetEntry = PNetEnt;
PServEntry = PServEnt;
Const
DNSErr : Integer = 0;
function getnetbyname ( Name : pchar) : PNetEntry;
begin
DNSErr:=-1;
Result:=Nil;
end;
function getnetbyaddr ( Net : Longint; nettype : Longint) : PNetEntry;
begin
DNSErr:=-2;
Result:=Nil;
end;
Function GetDNSError : Longint;
begin
If DNSErr<>0 then
begin
GetDNSError:=-DNSErr;
DNSErr:=0;
end
else
GetDNSError:=0; // Must get win32 error ?
end;
Function InitResolve : Boolean;
var
wsaData : TWsaData;
begin
Result:=WSAStartup(1,wsaData)=0;
end;
Function FinalResolve : Boolean;
begin
Result:=True;
end;

View File

@ -1,5 +1,5 @@
#
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/12/10]
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/12/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-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@ -249,115 +249,115 @@ GRAPHDIR=$(INC)/graph
include $(WININC)/makefile.inc
WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-go32v2)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-win32)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-os2)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-freebsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-beos)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-netbsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-solaris)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-qnx)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-netware)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-openbsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-wdosx)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-emx)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-watcom)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-freebsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-amiga)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-atari)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-openbsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),powerpc-macos)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),arm-wince)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts
override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types classes strutils convutils math dateutils varutils variants matrix ucomplex charset getopts winsock sockets
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_LOADERS+=wprt0 #wdllprt0

View File

@ -16,11 +16,10 @@ units=$(SYSTEMUNIT) ctypes objpas macpas strings \
strutils convutils math dateutils \
varutils variants \
matrix ucomplex \
charset getopts
# winsock initc cmem signals \
charset getopts winsock sockets
# initc cmem signals \
# crt graph \
# wincrt winmouse winevent sockets printer \
# wincrt winmouse winevent printer \
# video mouse keyboard \
# winsysut fpmkunit

380
rtl/wince/sockets.pp Normal file
View File

@ -0,0 +1,380 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by the Free Pascal development team
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
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.
**********************************************************************}
{$mode objfpc}
unit Sockets;
Interface
{$macro on}
{$define maybelibc:=}
Uses
windows,winsock,ctypes;
Type
size_t = cuint32;
ssize_t = cint32;
tsocklen= cint;
psocklen= ^tsocklen;
Const
AF_MAX = WinSock.AF_MAX;
PF_MAX = AF_MAX;
{$i socketsh.inc}
Implementation
{ Include filerec and textrec structures }
{$i filerec.inc}
{$i textrec.inc}
{******************************************************************************
Basic Socket Functions
******************************************************************************}
//function fprecvmsg (s:cint; msg: pmsghdr; flags:cint):ssize_t;
//function fpsendmsg (s:cint; hdr: pmsghdr; flags:cint):ssize;
//function fpsocket (domain:cint; xtype:cint; protocol: cint):cint;
function fpsocket (domain:cint; xtype:cint; protocol: cint):cint;
begin
fpSocket:=WinSock.Socket(Domain,xtype,ProtoCol);
if fpSocket<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpsend (s:cint; msg:pointer; len:size_t; flags:cint):ssize_t;
begin
fpSend:=WinSock.Send(S,msg,len,flags);
if fpSend<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpsendto (s:cint; msg:pointer; len:size_t; flags:cint; tox :psockaddr; tolen: tsocklen):ssize_t;
begin
// Dubious construct, this should be checked. (IPV6 fails ?)
fpSendTo:=WinSock.SendTo(S,msg,Len,Flags,Winsock.TSockAddr(tox^),toLen);
if fpSendTo<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fprecv (s:cint; buf: pointer; len: size_t; flags: cint):ssize_t;
begin
fpRecv:=WinSock.Recv(S,Buf,Len,Flags);
if fpRecv<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fprecvfrom (s:cint; buf: pointer; len: size_t; flags: cint; from : psockaddr; fromlen : psocklen):ssize_t;
begin
fpRecvFrom:=WinSock.RecvFrom(S,Buf,Len,Flags,Winsock.TSockAddr(from^),FromLen^);
if fpRecvFrom<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpconnect (s:cint; name : psockaddr; namelen : tsocklen):cint;
begin
fpConnect:=WinSock.Connect(S,WinSock.TSockAddr(name^),nameLen);
if fpConnect<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpshutdown (s:cint; how:cint):cint;
begin
fpShutDown:=WinSock.ShutDown(S,How);
if fpShutDown<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
Function socket(Domain,SocketType,Protocol:Longint):Longint;
begin
socket:=fpsocket(Domain,sockettype,protocol);
end;
Function Send(Sock:Longint;Const Buf;BufLen,Flags:Longint):Longint;
begin
send:=fpsend(sock,@buf,buflen,flags);
end;
Function SendTo(Sock:Longint;Const Buf;BufLen,Flags:Longint;Var Addr; AddrLen : Longint):Longint;
begin
sendto:=fpsendto(sock,@buf,buflen,flags,@addr,addrlen);
end;
Function Recv(Sock:Longint;Var Buf;BufLen,Flags:Longint):Longint;
begin
Recv:=fpRecv(Sock,@Buf,BufLen,Flags);
end;
Function RecvFrom(Sock : Longint; Var Buf; Buflen,Flags : Longint; Var Addr; var AddrLen : longint) : longint;
begin
RecvFrom:=fpRecvFrom(Sock,@Buf,BufLen,Flags,@Addr,@AddrLen);
end;
function fpbind (s:cint; addrx : psockaddr; addrlen : tsocklen):cint;
begin
fpbind:=WinSock.Bind(S,WinSock.PSockAddr(Addrx),AddrLen);
if fpbind<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fplisten (s:cint; backlog : cint):cint;
begin
fplisten:=WinSock.Listen(S,backlog);
if fplisten<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpaccept (s:cint; addrx : psockaddr; addrlen : psocklen):cint;
begin
fpAccept:=WinSock.Accept(S,WinSock.PSockAddr(Addrx),plongint(@AddrLen));
if fpAccept<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpgetsockname (s:cint; name : psockaddr; namelen : psocklen):cint;
begin
fpGetSockName:=WinSock.GetSockName(S,WinSock.TSockAddr(name^),nameLen^);
if fpGetSockName<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpgetpeername (s:cint; name : psockaddr; namelen : psocklen):cint;
begin
fpGetPeerName:=WinSock.GetPeerName(S,WinSock.TSockAddr(name^),NameLen^);
if fpGetPeerName<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpgetsockopt (s:cint; level:cint; optname:cint; optval:pointer; optlen : psocklen):cint;
begin
fpGetSockOpt:=WinSock.GetSockOpt(S,Level,OptName,OptVal,OptLen^);
if fpGetSockOpt<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpsetsockopt (s:cint; level:cint; optname:cint; optval:pointer; optlen :tsocklen):cint;
begin
fpSetSockOpt:=WinSock.SetSockOpt(S,Level,OptName,OptVal,OptLen);
if fpSetSockOpt<0 then
SocketError:=WSAGetLastError
else
SocketError:=0;
end;
function fpsocketpair (d:cint; xtype:cint; protocol:cint; sv:pcint):cint;
begin
end;
Function CloseSocket(Sock:Longint):Longint;
var i : longint;
begin
i := Winsock.CloseSocket (Sock);
if i <> 0 then
begin
SocketError:=WSAGetLastError;
CloseSocket := i;
end else
begin
CloseSocket := 0;
SocketError := 0;
end;
end;
Function Bind(Sock:Longint;Const Addr;AddrLen:Longint):Boolean;
begin
bind:=fpBind(Sock,@Addr,AddrLen)=0;
end;
Function Listen(Sock,MaxConnect:Longint):Boolean;
begin
Listen:=fplisten(Sock,MaxConnect)=0;
end;
Function Accept(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
begin
Accept:=FPAccept(sock,@addr,@addrlen);
end;
Function Shutdown(Sock:Longint;How:Longint):Longint;
begin
shutdown:=fpshutdown(sock,how);
end;
Function Connect(Sock:Longint;Const Addr;Addrlen:Longint):Boolean;
begin
connect:=fpconnect(sock,@addr,addrlen)=0;
end;
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
begin
GetSocketName:=fpGetSockName(sock,@addr,@addrlen);
end;
Function GetPeerName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
begin
GetPeerName:=fpGetPeerName(Sock,@addr,@addrlen);
end;
Function GetSocketOptions(Sock,Level,OptName:Longint;Var OptVal;Var optlen:longint):Longint;
begin
GetSocketOptions:=fpGetSockOpt(sock,level,optname,@optval,@optlen);
end;
Function SetSocketOptions(Sock,Level,OptName:Longint;Const OptVal;optlen:longint):Longint;
begin
SetSocketOptions:=fpsetsockopt(sock,level,optname,@optval,optlen);
end;
Function SocketPair(Domain,SocketType,Protocol:Longint;var Pair:TSockArray):Longint;
begin
// SocketPair:=SocketCall(Socket_Sys_SocketPair,Domain,SocketType,Protocol,longint(@Pair),0,0);a
end;
{$ifdef unix}
{ mimic the linux fpWrite/fpRead calls for the file/text socket wrapper }
function fpWrite(handle : longint;Const bufptr;size : dword) : dword;
begin
fpWrite := dword(WinSock.send(handle, bufptr, size, 0));
if fpWrite = dword(SOCKET_ERROR) then
begin
SocketError := WSAGetLastError;
fpWrite := 0;
end
else
SocketError := 0;
end;
function fpRead(handle : longint;var bufptr;size : dword) : dword;
var
d : dword;
begin
if ioctlsocket(handle,FIONREAD,@d) = SOCKET_ERROR then
begin
SocketError:=WSAGetLastError;
fpRead:=0;
exit;
end;
if d>0 then
begin
if size>d then
size:=d;
fpRead := dword(WinSock.recv(handle, bufptr, size, 0));
if fpRead = dword(SOCKET_ERROR) then
begin
SocketError:= WSAGetLastError;
fpRead := 0;
end else
SocketError:=0;
end
else
SocketError:=0;
end;
{$else}
{ mimic the linux fdWrite/fdRead calls for the file/text socket wrapper }
function fdWrite(handle : longint;Const bufptr;size : dword) : dword;
begin
fdWrite := dword(WinSock.send(handle, bufptr, size, 0));
if fdWrite = dword(SOCKET_ERROR) then
begin
SocketError := WSAGetLastError;
fdWrite := 0;
end
else
SocketError := 0;
end;
function fdRead(handle : longint;var bufptr;size : dword) : dword;
var
d : dword;
begin
if ioctlsocket(handle,FIONREAD,@d) = SOCKET_ERROR then
begin
SocketError:=WSAGetLastError;
fdRead:=0;
exit;
end;
if d>0 then
begin
if size>d then
size:=d;
fdRead := dword(WinSock.recv(handle, bufptr, size, 0));
if fdRead = dword(SOCKET_ERROR) then
begin
SocketError:= WSAGetLastError;
fdRead := 0;
end else
SocketError:=0;
end
else
SocketError:=0;
end;
{$endif}
{$i sockets.inc}
{ winsocket stack needs an init. and cleanup code }
var
wsadata : twsadata;
initialization
WSAStartUp($2,wsadata);
finalization
WSACleanUp;
end.

View File

@ -45,8 +45,10 @@
Changes :
08/15/2005 update for wince4.2 port,ORO06
12/27/2005 update
}
{$ifdef read_interface}
{$ifdef WINCE}
@ -64,6 +66,7 @@
MprDLLCore = KernelDLL;
ShellDLLCore = KernelDLL;
ShellDLL = 'CEShell';
winsockdll = 'ws2.dll';
{$endif WINCE}
{$ifdef WIN32}
@ -81,7 +84,8 @@
MprDLLCore = 'mpr';
ShellDLLCore = 'shell32';
ShellDLL = ShellDLLCore;
winsockdll = 'winsock.dll';
{$endif WIN32}
{$PACKRECORDS C}

View File

@ -23,6 +23,61 @@
//begin common win32 & wince
type
PIID = PGUID;
TIID = TGUID;
THANDLE = HANDLE;
PSmallRect = ^TSmallRect;
TSmallRect = SMALL_RECT;
PCharInfo = ^TCharInfo;
TCharInfo = _CHAR_INFO;
TFarProc = FARPROC;
TFNDlgProc = FARPROC;
TFNThreadStartRoutine = FARPROC;
TFNTimerAPCRoutine = FARPROC;
TFNFiberStartRoutine = FARPROC;
PObjectTypeList = ^TObjectTypeList;
_OBJECT_TYPE_LIST = record
Level: WORD;
Sbz: WORD;
ObjectType: PGUID;
end;
TObjectTypeList = _OBJECT_TYPE_LIST;
OBJECT_TYPE_LIST = _OBJECT_TYPE_LIST;
AUDIT_EVENT_TYPE = DWORD;
PBlendFunction = ^TBlendFunction;
_BLENDFUNCTION = packed record
BlendOp: BYTE;
BlendFlags: BYTE;
SourceConstantAlpha: BYTE;
AlphaFormat: BYTE;
end;
TBlendFunction = _BLENDFUNCTION;
BLENDFUNCTION = _BLENDFUNCTION;
_WIN_CERTIFICATE = Packed Record
dwLength : DWord;
wRevision : Word;
wCertificateType : Word;
bCertificate : Array[0..0] of Byte;
End;
TWinCertificate = _WIN_CERTIFICATE;
PWinCertificate = ^TWinCertificate;
TMaxLogPalette = Packed Record
palVersion : Word;
palNumEntries : Word;
palPalEntry : array[Byte] of TPaletteEntry;
end;
PMaxLogPalette = ^TMaxLogPalette;
//
// A language ID is a 16 bit value which is the combination of a
// primary language ID and a secondary language ID. The bits are
@ -127,59 +182,6 @@ function CreateProcessA(lpApplicationName: LPCSTR; lpCommandLine: LPCSTR; lpProc
{$ifdef WIN32}
//begin win32 or wince not checked
type
PIID = PGUID;
TIID = TGUID;
THANDLE = HANDLE;
PSmallRect = ^TSmallRect;
TSmallRect = SMALL_RECT;
PCharInfo = ^TCharInfo;
TCharInfo = _CHAR_INFO;
TFarProc = FARPROC;
TFNDlgProc = FARPROC;
TFNThreadStartRoutine = FARPROC;
TFNTimerAPCRoutine = FARPROC;
TFNFiberStartRoutine = FARPROC;
PObjectTypeList = ^TObjectTypeList;
_OBJECT_TYPE_LIST = record
Level: WORD;
Sbz: WORD;
ObjectType: PGUID;
end;
TObjectTypeList = _OBJECT_TYPE_LIST;
OBJECT_TYPE_LIST = _OBJECT_TYPE_LIST;
AUDIT_EVENT_TYPE = DWORD;
PBlendFunction = ^TBlendFunction;
_BLENDFUNCTION = packed record
BlendOp: BYTE;
BlendFlags: BYTE;
SourceConstantAlpha: BYTE;
AlphaFormat: BYTE;
end;
TBlendFunction = _BLENDFUNCTION;
BLENDFUNCTION = _BLENDFUNCTION;
_WIN_CERTIFICATE = Packed Record
dwLength : DWord;
wRevision : Word;
wCertificateType : Word;
bCertificate : Array[0..0] of Byte;
End;
TWinCertificate = _WIN_CERTIFICATE;
PWinCertificate = ^TWinCertificate;
TMaxLogPalette = Packed Record
palVersion : Word;
palNumEntries : Word;
palPalEntry : array[Byte] of TPaletteEntry;
end;
PMaxLogPalette = ^TMaxLogPalette;
const

1134
rtl/wince/winsock.pp Normal file

File diff suppressed because it is too large Load Diff