2025-12-10 16:29 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

99 views
Skip to first unread message

Przemyslaw Czerpak

unread,
Dec 10, 2025, 10:29:37 AM (4 days ago) Dec 10
to harbou...@googlegroups.com
2025-12-10 16:29 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/evpmd.c
* contrib/hbssl/hbssl.h
* moved hb_EVP_MD_ptr_to_id() function from static to public area

* contrib/hbssl/hbssl.hbx
* contrib/hbssl/hbssl.hbm
+ contrib/hbssl/d2i.c
* added new functions to extract asynchronous keys and certificates
from DER data:
D2I_PUBKEY( <cDER> ) -> <pEVPKey>
D2I_RSAPUBLICKEY( <cDER> ) -> <pRSAKey>
D2I_X509( <cDER> ) -> <pX509Cert>

* contrib/hbssl/hbssl.hbx
* contrib/hbssl/evppkey.c
+ added new functions to get/set RSA asymmetric keys parameters
encapsulated in EVP_PKEY structures:
EVP_PKEY_CTX_get_RSA_padding()
EVP_PKEY_CTX_set_RSA_padding()
EVP_PKEY_CTX_get_RSA_OAEP_md()
EVP_PKEY_CTX_set_RSA_OAEP_md()
EVP_PKEY_CTX_get_RSA_MGF1_md()
EVP_PKEY_CTX_set_RSA_MGF1_md()

* src/common/hbdate.c
* accept up to 9 fractional digits (nanoseconds) in timestamp strings
though only first three ones (milliseconds) are significant.
Recently some tools begin to generate such timestamp values and
Harbour had problems with decoding them correctly.

* src/compiler/hbmain.c
+ allow to pass file name for source code compiled by hb_compileFromBuf()
It works like in all other versions of hb_compile*() functions - it's
enough to pass it as argument without option prefix (option prefix
is "-" on all platforms and also "/" on DOS, OS2, MS-Win).
Please remember that first parameter after control ones is used as
compiler name in generated output messages regardless of its option
prefix.

best regards
Przemek

toninhofwi

unread,
Dec 10, 2025, 11:01:38 AM (4 days ago) Dec 10
to Harbour Developers
Thank you! Regards.
Message has been deleted

Przemyslaw Czerpak

unread,
Dec 11, 2025, 5:10:44 PM (3 days ago) Dec 11
to harbou...@googlegroups.com
Hi Lailton,

I think some things have to be4 clarified.
There are two different places where source file names can be stored.
One is for programing logic and allows to implement some of OOP scopes
like MODULE FRIENDLY static functions and variables scope, module width
variable declarations and the second is for debugger.
In the 1-st case when .prg files is compiled it mat include any other ones
and code from them anyhow for compiler and HVM it is single module.
HVM recognizes such modules by their symbol tables. Each module has
its own symbol table. It's possible to attach file name to such symbol table
though it may contain functions from different files. Harbour 3.2 do that
but AFAIR Viktor removed this functionality from 3.4 branch to not
propagate such information to final users of binary code. In fact it has
only informative character and cannot be safely used in debugger.
HRB storage format was not designed to encapsulate such information
so HRB files do not contain module name. When HRB files is loaded at
runtime from the file the HRB filename is registered as module name.
When it's loaded from the memory buffer arbitrary name "pcode.hrb"
is used. ProcFile() PRG functions returns such name (if any).
The second case is support for debugger. As I said each function in
single module (obj/hrb) can come from different source file. To show
correct source file debugger needs to know it's exact name. To resolve
this problem -b compiler switch is used. As result inside beginning of
each function special PCODEs are added to pass on module names
and also local and static variable names to debugger. It doesn't matter
how the PCODE is stored and compiled. HRB files and OBJ files created
from C code generated with -gc, -gc2 or -gc3 contains such information
and debugger can extract it. Anyhow please remember that runtime
environment can use different paths then compiler what can create
problems for relative paths. To resolve it debugger has option which
allow to set directories for source files. It greatly helps though some
times is necessary to reload the file when program contains code
from files with the same name but different directories. Anyhow it
can be done though it slows done the debugging process.

best regards,
Przemek


W dniu 10.12.2025 o 23:20, Lailton Fernando Mariano pisze:
Przemyslaw,

Can you provide an example how are you using this change with hb_compileFromBuf?

I am using it with it:

cBuffer := hb_compileFromBuf( hb_memoRead( cDir + cFile ), .t., cFile, "-w", "-n2" , "-q2", "-es2" )
hb_hrbLoad( cBuffer )

inside main.prg used here I am using procFile() and it return pcode.hrb and not the main.prg

Am I using it wrong?

I Noticied too that inside hb_hrbLoad the third argument is exected to inform the file name is passed as NULL

maybe need some improve?

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/ae4e4141-53d6-4cd1-8218-ee00673cd2e4n%40googlegroups.com.

Lailton Fernando Mariano

unread,
Dec 11, 2025, 5:20:34 PM (3 days ago) Dec 11
to Harbour Developers
Hi Przemek,

That's make sense.

Thank you for your time
Reply all
Reply to author
Forward
0 new messages