Zitat von Graeme Geldenhuys <[EMAIL PROTECTED]>:

> Hi,
>
> I use the xlib.pp unit a lot. As far as I understand it and many
> others like it was created with a automated tool.  As I use the
> functions, I thought I could start changing the para1, para2... to
> more descriptive parameter names.  This makes it much easier to code
> if you use something like Lazarus that gives function declaration
> hints etc..
>
> It will not affect/break anybody's code if I start making those
> changes, but I would like to get the correct naming convention
> going...  I'm only doing this once!  :)
>
> Here's the original declaration:
>
> function XSetSelectionOwner(para1:PDisplay; para2:TAtom;
> para3:TWindow; para4:TTime):cint;cdecl;external libX11;
>
>
> what should the new parameters look like....
>
> Delphi / standard Object Pascal style:
>
> 1)
> function XSetSelectionOwner(ADisplay:PDisplay; ASelection:TAtom;
> AOwner:TWindow; ATime:TTime):cint;cdecl;external libX11;
>
> or maybe
>
> 2)
> function XSetSelectionOwner(display:PDisplay; selection:TAtom;
> owner:TWindow; time:TTime):cint;cdecl;external libX11;
>
>
>
> My preference is 1).  What's your thoughts?

Parameter names are needed by many headers.
Why not write a tool, that does it semi-automatically?
Give it the c file with nice parameter names and the pascal unit and it replaces
 para* with the c names.
This tool could be useful here:
http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries#Future_work_.2F_Missing_stuff


Mattias

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to