akaros/scripts/spatch/plan9.cocci
<<
>>
Prefs
   1@ print@
   2@@
   3-print(
   4+printd(
   5...)
   6
   7@ kopen@
   8@@
   9-kopen(
  10+sysopen(
  11...)
  12
  13@ kclose @
  14@@
  15-kclose(
  16+sysclose(
  17...)
  18
  19@ kread@
  20@@
  21-kread(
  22+sysread(
  23...)
  24
  25@ qnoblock@
  26@@
  27-qnoblock(
  28+qdropoverflow(
  29...)
  30
  31@ channel @
  32identifier d;
  33@@
  34-Chan
  35+struct chan
  36d;
  37
  38@ channelstar @
  39identifier d;
  40@@
  41-Chan *
  42+struct chan *
  43d;
  44
  45@mount@
  46identifier d;
  47@@
  48-Mount
  49+struct mount
  50d;
  51
  52@ mountstar @
  53identifier d;
  54@@
  55-Chan *
  56+struct mount *
  57d;
  58
  59@uvlong@
  60identifier d;
  61@@
  62-uvlong
  63+uint64_t
  64d;
  65@vlong@
  66identifier d;
  67@@
  68-vlong
  69+int64_t
  70d;
  71@ulong@
  72identifier d;
  73@@
  74-ulong
  75+uint32_t
  76d;
  77@ushort@
  78identifier d;
  79@@
  80-ushort
  81+uint16_t
  82d;
  83
  84@ rulesm @
  85identifier t;
  86identifier f;
  87expression E1;
  88type T;
  89@@
  90T f(...){<...
  91t = smalloc(E1);
  92...>}
  93@@
  94identifier rulesm.f;
  95expression E1;
  96@@
  97
  98- smalloc(E1
  99+ kzmalloc(E1, 0
 100   )
 101
 102@ rulem @
 103identifier t;
 104identifier f;
 105expression E1;
 106type T;
 107@@
 108T f(...){<...
 109t = malloc(E1);
 110...>}
 111@@
 112identifier rulem.f;
 113expression E1;
 114@@
 115
 116- malloc(E1
 117+ kzmalloc(E1, 0
 118   )
 119
 120@@
 121@@
 122-getcallerpc(...);
 123@@
 124@@
 125-setmalloctag(...);
 126
 127@@
 128type T;
 129@@
 130-T validname0(...){...}
 131
 132@@
 133type T;
 134@@
 135-T kstrcpy(...){...}
 136
 137@@
 138@@
 139-if (up){
 140+if (current){
 141...  } else {...}
 142
 143@@
 144expression E;
 145@@
 146-strcpy(up->errstr,
 147+set_errstr(
 148E)
 149@@
 150@@
 151-saveregisters(...);
 152@@
 153@@
 154-saveregisters(...){...}
 155@@
 156@@
 157+//
 158muxclose(...);
 159