[fpc-pascal]Convert C to Pascal

Peter Vreman peter at freepascal.org
Thu Feb 19 08:40:30 CET 2004


> Hallo,
>
> i know this is not exactly question to this maillist but
> maybe somebody could help me how can i convert only the following
> definition of "reg_drq_block_call_back" into FPC Pascal notation:
>
> void ( * reg_drq_block_call_back ) ( struct REG_CMD_INFO * );
>
> where definition is
>
> struct REG_CMD_INFO
> {
>    unsigned char cmd;
>    ... etc.
> } ;
>
> struct REG_CMD_INFO reg_cmd_info;
>
> ("struct" is simply converted to "record", that is not the problem)

Pascal style:

type
  REG_CMD_INFO = record
    cmd : byte;
  end;

  reg_drq_block_call_back = procedure(var r:REG_CMD_INFO);

or more close to C style with pointers:

type
  REG_CMD_INFO = record
    cmd : byte;
  end;
  REG_CMD_INFO = ^REG_CMD_INFO;

  reg_drq_block_call_back = procedure(pr:PREG_CMD_INFO);






More information about the fpc-pascal mailing list