[fpc-devel] C header conversion question

ABorka fpc-devel at aborka.com
Mon Sep 22 01:48:39 CEST 2008


Original C header from the Apache 2.2.9 httpd.h :
--------------------------------
     /** Are we still talking? */
     unsigned aborted:1;

     /** Are we going to keep the connection alive for another request?
      * @see ap_conn_keepalive_e */
     ap_conn_keepalive_e keepalive;

     /** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
      *  1 yes/success */
     signed int double_reverse:2;

-------------------------------
in fpc/packages/httpd22/src/httpd.inc :
     { Are we still talking? }
     flags: Cardinal;

     (* Useless bitset variables to make the code obscure  //start 
commenting out

      Are we still talking?
     unsigned aborted:1;

      Are we going to keep the connection alive for another request?
      * @see ap_conn_keepalive_e
     signed int keepalive:2;

      have we done double-reverse DNS? -1 yes/failure, 0 not yet,
      *  1 yes/success
     signed int double_reverse:2;
     *)//end commenting out

basically the whole C header part is converted to a flags: Cardinal;
------------------------------
in Delphi:
     (** Are we still talking? *)
     flags1: Cardinal;
     { The following are in the flags bitset:
     unsigned aborted:1; }

     (** Are we going to keep the connection alive for another request?
      * @see ap_conn_keepalive_e *)
     keepalive: ap_conn_keepalive_e;

     flags2: Cardinal;
     { The following are in the flags bitset:
     (** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
      *  1 yes/success *)
     signed int double_reverse:2;
     }

The C header part is converted to 2 x Cardinal + a structure

Is the FPC or the Delphi one correct?
I don't know if having this right or not is any cause for compiling good 
Apache modules.


AB




More information about the fpc-devel mailing list