ANSI C library for aspect-oriented programming

I'm looking for a good ANSI C library for aspect-oriented programming.

Some desirable features:

  • Accessing and changing the arguments of the objective function.
  • Returning an objective function and managing the return value.

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

Is there any alternative?

+3


source to share


1 answer


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

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

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

}

      

And then you will have aspect.cc



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

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

      

Compile as > acc hello.ac world.mc

And the result:

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

      

+1


source







All Articles