[fpc-pascal] Problem translating c code to pascal

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Sep 23 17:39:00 CEST 2006


Hello,

I'm converting apache 1.3 headers to pascal, and I found something I
don't know how to convert. It's these lines:

static const handler_rec hw_handlers[] = {
     { "hw-app", hw_handle_req },
     { NULL }
};

Where handler_req is declared as:

  handler_t = function (param1: Prequest_rec): Integer; cdecl;

  handler_rec = record
    content_type: PChar;	{ MUST be all lower case }
    handler: handler_t;
  end;

And hw_handle_req is a function of type handler_t

I don't understand what exactly that constant is. I looks like a
dynamic array with 2 elements, but the second is NULL. How can a
structure be NULL ?

Also, the static modifier here plays any role? Looks redundant to me.

thanks,
-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list