gen_comp.sed 985 B

12345678910111213141516171819202122232425262728
  1. 1i\
  2. #include <stdio.h> \
  3. #include "../lib/util.h" \
  4. #define FUNC_ARGS (char __unused _o, const char __unused* _a, \\\
  5. uint32_t __unused _i, void __unused* _p) \
  6. #if defined(USE_ALSA) \
  7. # define VOLUME "alsa" \
  8. #elif defined(USE_PULSE) \
  9. # define VOLUME "pulse" \
  10. #else \
  11. # define VOLUME "default" \
  12. #endif
  13. /^\(void\s\+[^ ]\+\s\+FUNC_ARGS\);$/ {
  14. s//\1 {puts(__func__);}/
  15. /vol_perc/ {
  16. s!\(puts\)([^)]\+)!\1("file:volume/"VOLUME".c")!
  17. }
  18. /\(swap\|ram\)/ {
  19. s!}$!puts("file:../lib/meminfo.c");}!
  20. }
  21. p
  22. }