* include/hbcom.ch
* Changed functions names to use proper camelcasing so that
they also hold true for C level API.
* include/hbsocket.ch
+ Readded .prg level function names to address array constant
comment.
+ Added 'this is also used in C file' comment.
* contrib/hbsms/hbsms.prg
! Fixed COM port reading function after last update.
I finally restored original defaulting logic (instead of
FETCHCHARS() method) which by default waits for 64 bytes
and 5 seconds. Pls check me.
* harbour/src/rtl/hbsocket.c
* harbour/include/hbsocket.ch
! cleaned a little bit HB_SOCKET_AF_*/HB_SOCKET_PF_* usage to not confuse
other developers and users.
* harbour/src/vm/task.c
! fixed casting for C++ builds
* harbour/src/lang/msges.c
! added hack for Solaris builds where ES is macro
TODDO: sync names of lang and corresponding code modules.
* harbour/src/vm/dynlibhb.c
* pacified warning
* harbour/contrib/xpp/xppextrn.ch
* harbour/contrib/xpp/dbcmdx.c
* harbour/include/hbextern.ch
* harbour/src/rdd/dbcmd53.c
! moved ordWildSeek() from XPP to HBRDD library.
I have no idea if XPP has such function or if it's or not
compatible with ORDWILDSEEK() functions I created for [x]Harbour
* disable ordCount() and ordWildSeek() functions when HB_CLP_STRICT
macro is set
* harbour/include/hbsocket.ch
+ added macro values interface info flags: HB_SOCKET_IFF_*
+ added macro values for interface info array indexes: HB_SOCKET_IFINFO_*
* harbour/include/hbsocket.h
* harbour/src/rtl/hbsocket.c
+ added new C function:
PHB_ITEM hb_socketGetIFaces( int af, HB_BOOL fNoAliases );
it returns array with existing interfaces description.
This code was added for non MS-Windows based platforms only.
Support for MS-Windows has to be added yet.
Some platforms may not fill all fields in the returned array.
When some fields are not supported by platform or interface then
they can contain NIL value.
On some platforms this code can effectively work only with IP4
interfaces and IP6 ones will need different implementation.
TODO: add support for alternative long interface introduced in some
new systems using 'struct lifreq' with SIOCGLIF* ioctls instead
of 'struct ifreq' and SIOCGIF*
TODO: add support for extracting hardware addreses (i.e. ethernet
macaddresses) for systems which do not support SIOCGIFHWADDR.
Please test this code with OS2 using OpenWatcom and GCC (old and
new socket API). I enabled HB_HAS_SOCKADDR_SA_LEN in OS2 builds.
OpenWatocm OS2 header files have such fields but I do know if it's
also present in GCC socket API.
* harbour/include/hbextern.ch
* harbour/src/rtl/hbinet.c
+ added new PRG function:
hb_inetIfInfo( [<lNoAliases>] [, <nAddrFamily>] ) -> <aInfo>
<lNoAliases> is .F. by default so aliases are included
<nAddrFamily> is HB_SOCKET_AF_INET by default
<aInfo> is an array in which each entry is also array with the
following fields:
HB_SOCKET_IFINFO_FAMILY 1 // adress family
HB_SOCKET_IFINFO_NAME 2 // interface name
HB_SOCKET_IFINFO_FLAGS 3 // flags HB_SOCKET_IFF_*
HB_SOCKET_IFINFO_ADDR 4 // interface address
HB_SOCKET_IFINFO_NETMASK 5 // subnetmask
HB_SOCKET_IFINFO_BROADCAST 6 // broadcast address
HB_SOCKET_IFINFO_P2PADDR 7 // point-to-point address
HB_SOCKET_IFINFO_HWADDR 8 // hardware address
Please use this code on different non MS-Windows platforms:
proc main( noAlias )
local iface
? os(), version()
? "interfaces:"
for each iface in hb_inetIfInfo( !empty( noAlias ), 0 )
? hb_valToExp( iface )
next
?
return
and check if it returns correct information about available
interfaces.
* harbour/include/hbstack.h
+ added socket error codes to HB_IOERRORS
* harbour/include/Makefile
+ harbour/include/hbsocket.ch
+ harbour/include/hbsocket.h
* harbour/source/rtl/Makefile
+ harbour/source/rtl/hbsocket.c
+ added new BSD socket functions: hb_socket*(). They should be quite
close to low level C socket interface with few modifications which
help to hide some platform differences. Unfortunately we do not use
autoconf so I had to arbitrary set which features are available
on some platforms. In practice it means that it reduces portability
to older OS-es, i.e. it should work with current Linux versions
but it will not without some modifications in macros used to control
supported features with older Linuxes using kernel 2.2 or 2.0.
The same can happen with other *nix ports like Darwin, SunOS, HP-UX
or with different versions of some Windows compilers. I also do not
know which functionality is available in OS2 GCC ports and I would
like to ask OS2 users to make tests and disable not working features.
We also need tests with HP-UX, Darwin and SunOS.
IP6 support is enabled only in *nixes. If Windows users are interested
in IP6 then please add support for it. Most of Windows compilers do
not support standard POSIX functions so I do not want to make it
myself using unknown for me API without testing.
In *nix builds PF_UNIX/PF_LOCAL sockets are also supported.
Support for other socket types can be easy added if someone is
interested in them.
The constant values used in hbsocket.ch are equal to original BSD
socket definitions. If it's necessary then it's possible to enable
their translation inside hbsocket.c code though I do not think we
will find such OS.
The list of hb_socket*() functions was designed to cover all existing
functionality in hbinet.c and socket.c. Most of functions supports
timeout parameter what effectively allows to hide direct select()
usage.
Please make test with real applications and report any problems
with hb_inet*() functions you will find.
* harbour/source/vm/hvm.c
* minor cleanup
* harbour/source/rtl/hbi18n1.c
* cleaned variable name
* harbour/source/rtl/hbinet.c
* harbour/examples/uhttpd2/socket.c
* harbour/contrib/hbssl/hbssl.c
* updated to use hb_socket*() functions
* harbour/include/hbextern.ch
* enabled HB_INET*() functions in DOS builds - they will simply return
errors
- harbour/include/hbapinet.h
- removed old header file
* harbour/source/pp/ppcore.c
! modified ENDTEXT marker to work also with comments in the same line
It's more closer to Clipper though intentionally we are not fully
CA-Cl*pper compatible here.