FerCa
FerCa

Reputation: 2077

ANSI C library for Aspect-Oriented Programming

I'm searching for a good ANSI C library for Aspect-Oriented Programming.

Some desired features are:

I found aspeCt C (https://sites.google.com/a/gapp.msrg.utoronto.ca/aspectc/home), reading the documentation it seems to have everything I need, but when, following the instructions, I run make to compile and pass the tests, the tests fail.

There is any alternative?

Upvotes: 3

Views: 1120

Answers (1)

Tomás
Tomás

Reputation: 3561

You can try AspectC++ is a project that extends the AspectJ approach to C/C++.

For example if you want to a simple C program using Aspect:

int main() {
    printf("world");

}

And then you will have an aspect.cc

before(): execution(int main()) {
    printf("Hello ");
}

after(): execution(int main()) {
    printf(" from AspectC ! \n");
}

You compile both with > acc hello.ac world.mc

And the result is:

gcc hello.c world.c
>./a.out
 Hello world from AspectC !

Upvotes: 1

Related Questions