The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

tools/dev/headerizer.pl - Generates the function header parts of .h files from .c files

SYNOPSIS

  $ perl tools/dev/headerizer.pl [object files]

Generates C function declarations based on the function definitions in the C source code.

DESCRIPTION

The headerizer works off of directives in the source and header files.

One source file's public declarations can only go into one header file. In other words, headers-to-source is one-to-many.

HEADERIZER BEGIN: source-filename / HEADERIZER END: source-filename

Marks the beginning and end of a block of declarations in a header file.

    # In file foo.h
    /* HEADERIZER BEGIN: src/foo.c */
    /* HEADERIZER END: src/foo.c */

    /* HEADERIZER BEGIN: src/bar.c */
    /* HEADERIZER END: src/bar.c */
HEADERIZER HFILE: header-filename

Tells the headerizer where the declarations for the functions should go

    # In file foo.c
    /* HEADERIZER HFILE: foo.h */

    # In file bar.c
    /* HEADERIZER HFILE: foo.h */

COMMAND-LINE OPTIONS

--macro=X

Print a list of all functions that have macro X. Example:

    $> perl tools/dev/headerizer.pl --macro=PARROT_CAN_RETURN_NULL src/list.o

    src/list.c
        Parrot_list_pop
        Parrot_list_remove
    2 PARROT_CAN_RETURN_NULL functions

AUTHOR

The original headerizer program was created by Andy Lester in May 2006, with assistance from Jerry Gay and others. In the last half of 2010, Most of the code was refactored into lib/Parrot/Headerizer.pm and lib/Parrot/Headerizer/Functions.pm by James E Keenan.