yafo lee | 2 Jul 2012 11:51
Picon

About variable name

Hi guys,
    I know there must be a variable  of type "struct alx_adapter*" in a 
function.
    sometimes it is in the funcion's argument list such as:
         int bar(struct alx_adapter  *adpt) {
           ...
       }
    sometimes it is in the function's body:
        int foo(int a{
           ...
            struct alx_adapter  *adpt= NULL;
            ...
       }

    I want to write a single rule to find the name of that pointer, and 
using it, such as:

     <at>  <at> 
    statement S1;
    statement S2;
     <at>  <at> 
    f(...) {
       ... when != S1
       + printf("%s: hello world\n", adpt->name);
      S2
      ... when any
    }

    Is that possible? how to achieve that?

Thanks. 


Gmane