Re: [fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-25 Thread Henry Vermaak
On Fri, May 25, 2018 at 12:48:20PM +0200, Gabor Boros wrote:
> 2018. 05. 24. 9:37 keltezéssel, Michael Van Canneyt írta:
> >Are these functions callbacks ? If so, is the calling convention correct ?
> 
> I used xmlSchemaSetValidErrors and the documentation say "Set the error and
> warning callback informations". Tried with and without cdecl.

These functions use varargs, so the calling convention is different:

https://www.freepascal.org/docs-html/ref/refsu87.html

I thought it only works with external code, though.  Would be useful if
the documentation mentioned anything.

Henry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-25 Thread Gabor Boros

2018. 05. 24. 9:37 keltezéssel, Michael Van Canneyt írta:

Are these functions callbacks ? If so, is the calling convention correct ?



I used xmlSchemaSetValidErrors and the documentation say "Set the error 
and warning callback informations". Tried with and without cdecl.


Meanwhile tried xmlSchemaSetValidStructuredErrors and that works with 
Win32, Win64 and Linux 64bit.


Is libxml package have a maintainer or is it a legacy/deprecated thing? 
I experienced some differences between the documentation of libxml2 and 
the "Interfaces for validating" section in xmlschemas.inc.


Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-24 Thread Michael Van Canneyt



On Wed, 23 May 2018, Gabor Boros wrote:


Same problem with Win64. So not Linux specific.


Are these functions callbacks ? If so, is the calling convention correct ?

Michael.


Gabor

2018. 05. 22. 10:06 keltezéssel, Gabor Boros írta:

Hi All,

I need to accomplish validate XML files with an XSD. Found libxml in 
packages and works as expected with Win32. But I have problem with 
messages on Linux 64bit. Got %s instead the real message text. I use the 
below code to get the messages. Any idea why not works with Linux64 bit?


var
   SL_Warning,SL_Error:TStringList;

procedure SchemaValidityWarningFunc(ctx: Pointer; const msg: PChar);
begin
   SL_Warning.Add(msg);
end;

procedure SchemaValidityErrorFunc(ctx: Pointer; const msg: PChar);
begin
   SL_Error.Add(msg);
end;

Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-23 Thread Gabor Boros

Same problem with Win64. So not Linux specific.

Gabor

2018. 05. 22. 10:06 keltezéssel, Gabor Boros írta:

Hi All,

I need to accomplish validate XML files with an XSD. Found libxml in 
packages and works as expected with Win32. But I have problem with 
messages on Linux 64bit. Got %s instead the real message text. I use the 
below code to get the messages. Any idea why not works with Linux64 bit?


var
   SL_Warning,SL_Error:TStringList;

procedure SchemaValidityWarningFunc(ctx: Pointer; const msg: PChar);
begin
   SL_Warning.Add(msg);
end;

procedure SchemaValidityErrorFunc(ctx: Pointer; const msg: PChar);
begin
   SL_Error.Add(msg);
end;

Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-22 Thread Gabor Boros

Hi All,

I need to accomplish validate XML files with an XSD. Found libxml in 
packages and works as expected with Win32. But I have problem with 
messages on Linux 64bit. Got %s instead the real message text. I use the 
below code to get the messages. Any idea why not works with Linux64 bit?


var
  SL_Warning,SL_Error:TStringList;

procedure SchemaValidityWarningFunc(ctx: Pointer; const msg: PChar);
begin
  SL_Warning.Add(msg);
end;

procedure SchemaValidityErrorFunc(ctx: Pointer; const msg: PChar);
begin
  SL_Error.Add(msg);
end;

Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal