Do we have a tool to automatically generate header files from c/c++files? - Unix

This is a discussion on Do we have a tool to automatically generate header files from c/c++files? - Unix ; Do we have a tool to automatically generate header files from c/c++ files? It collects from c/c++ files typedef's, macros, global variables and function prototypes, and moreover, it includes necessary system header files according to the function names and constant ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Do we have a tool to automatically generate header files from c/c++files?

  1. Do we have a tool to automatically generate header files from c/c++files?

    Do we have a tool to automatically generate header files from c/c++
    files? It collects from c/c++ files typedef's, macros, global variables
    and function prototypes, and moreover, it includes necessary system
    header files according to the function names and constant values you
    use, and your OS.

    I 've found this one: the makeheaders program, which seems to only have
    limited function. http://www.hwaci.com/sw/mkhdr/

    Thanks.

  2. Re: Do we have a tool to automatically generate header files fromc/c++ files?

    Terry wrote:
    > Do we have a tool to automatically generate header files from c/c++
    > files? It collects from c/c++ files typedef's, macros, global variables
    > and function prototypes, and moreover, it includes necessary system
    > header files according to the function names and constant values you
    > use, and your OS.
    >

    Why would you want to?

    --
    Ian Collins.

  3. Re: Do we have a tool to automatically generate header files fromc/c++ files?

    >> Do we have a tool to automatically generate header files from c/c++
    >> files? It collects from c/c++ files typedef's, macros, global variables
    >> and function prototypes, and moreover, it includes necessary system
    >> header files according to the function names and constant values you
    >> use, and your OS.
    >>

    >Why would you want to?


    cproto is a useful tool to automatically generate a header file
    from a C source file or files, containing function prototypes of
    the functions in the source files. It is useful for keeping the
    files and the header in sync.

    I'm not sure I'd want macros and global variables automatically put
    in header files. Including "necessary" system header files can
    cause problems if you unintentionally cause a collision between
    your names and one used by system headers you deliberately didn't
    include.


  4. Re: Do we have a tool to automatically generate header files fromc/c++ files?

    Gordon Burditt wrote:
    >>> Do we have a tool to automatically generate header files from c/c++
    >>> files? It collects from c/c++ files typedef's, macros, global variables
    >>> and function prototypes, and moreover, it includes necessary system
    >>> header files according to the function names and constant values you
    >>> use, and your OS.
    >>>

    >> Why would you want to?

    >
    > cproto is a useful tool to automatically generate a header file
    > from a C source file or files, containing function prototypes of
    > the functions in the source files. It is useful for keeping the
    > files and the header in sync.
    >
    > I'm not sure I'd want macros and global variables automatically put
    > in header files. Including "necessary" system header files can
    > cause problems if you unintentionally cause a collision between
    > your names and one used by system headers you deliberately didn't
    > include.
    >


    Yeah, including "necessary" system header and also properly handling
    corresponding portability issue do sound like an a little
    over-aggressive idea.

  5. Re: Do we have a tool to automatically generate header files from c/c++ files?

    On Mon, 26 May 2008 03:18:12 -0500 Gordon Burditt wrote:

    |>> Do we have a tool to automatically generate header files from c/c++
    |>> files? It collects from c/c++ files typedef's, macros, global variables
    |>> and function prototypes, and moreover, it includes necessary system
    |>> header files according to the function names and constant values you
    |>> use, and your OS.
    |>>
    |>Why would you want to?
    |
    | cproto is a useful tool to automatically generate a header file
    | from a C source file or files, containing function prototypes of
    | the functions in the source files. It is useful for keeping the
    | files and the header in sync.
    |
    | I'm not sure I'd want macros and global variables automatically put
    | in header files. Including "necessary" system header files can
    | cause problems if you unintentionally cause a collision between
    | your names and one used by system headers you deliberately didn't
    | include.

    This library I wrote uses tools included therein to generate headers from C
    source files. It's limited to specific parts of the C source designated to
    be used for that purpose, primarily to take prototypes and macros that define
    aliases for the functions. During development, this is a useful tool. Once
    the interfaces are stabilized and this library is out of beta, then I will
    copy the generated headers and make them fixed.

    http://libh.slashusr.org/

    --
    |WARNING: Due to extreme spam, googlegroups.com is blocked. Due to ignorance |
    | by the abuse department, bellsouth.net is blocked. If you post to |
    | Usenet from these places, find another Usenet provider ASAP. |
    | Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) |

  6. Re: Do we have a tool to automatically generate header files from c/c++ files?

    Terry wrote:
    > Do we have a tool to automatically generate header files from c/c++
    > files? It collects from c/c++ files typedef's, macros, global variables
    > and function prototypes, and moreover, it includes necessary system
    > header files according to the function names and constant values you
    > use, and your OS.
    >
    > I 've found this one: the makeheaders program, which seems to only have
    > limited function. http://www.hwaci.com/sw/mkhdr/
    >
    > Thanks.



    I've never heard of something that complete. I don't see why you would
    need all of that.

    I wrote an open source project you might like called Fed Builder for C
    code. It generates a file of function prototypes for each project.

    http://wiki.tcl.tk/11180
    http://www.xmission.com/~georgeps/im...der-25.tar.bz2

    My eventual goal is to make my code even more structured with added
    constraints, so that analysis is easier to perform on the code, for
    constraint violation/bug detection. I'm hoping that by adding a C
    parser I may get closer to that goal.


    George

+ Reply to Thread