++ed by:
CKRAS KEEDI ZMUGHAL JETEVE ARISTOTLE
6 non-PAUSE users
Author image Marvin Humphrey
and 1 contributors

NAME

Clownfish::CBlock - A block of embedded C code.

DESCRIPTION

CBlock exists to support embedding literal C code within Clownfish header files:

    class Crustacean::Lobster {
        /* ... */

        /** Give a lobstery greeting.
         */
        inert inline void
        say_hello(Lobster *self);
    }

    __C__
    #include <stdio.h>
    static CHY_INLINE void
    crust_Lobster_say_hello(crust_Lobster *self)
    {
        printf("Prepare to die, human scum.\n");
    }
    __END_C__

METHODS

new

    my $c_block = Clownfish::CBlock->new(
        contents => $text,
    );
  • contents - Raw C code.

get_contents

Accessor.