[fpc-pascal] Get value of PPChar ?

fredvs fiens at hotmail.com
Sun Apr 16 16:58:17 CEST 2017


A C method is defined like this:

MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta);

and translated in Pascal with this:

function mpg123_icy(mh: Tmpg123_handle; var icy_meta: PPChar): integer;

OK, the function seems to work because the result = 0 (no error).

But how to retrieve the data icy_meta (PPChar) ?

theicytag : PPChar;
resu : integer;

resu := mpg123_icy(ahandle, theicytag);
if resu = 0 then writeln(theicytag^); --> raise exception + crash 

resu := mpg123_icy(ahandle, theicytag);
if resu = 0 then writeln(theicytag^^); --> also raise exception + crash 


Many thanks ;-)
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Get-value-of-PPChar-tp5728277.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

More information about the fpc-pascal mailing list