Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. /*****************************************************************************
  2. *
  3. * each.c
  4. *
  5. * Walking argument lists.
  6. *
  7. *****************************************************************************/
  8. #include "m4.h"
  9. /*****************************************************************************
  10. *
  11. * EachOpcArgvDw
  12. * EachReverseOpcArgvDw
  13. *
  14. * Call opc once for each argument in the argv. dw is reference data.
  15. *
  16. * EachOpcArgvDw walks the list forwards; EachReverseOpcArgvDw backwards.
  17. *
  18. *****************************************************************************/
  19. void STDCALL
  20. EachOpcArgvDw(OPC opc, ARGV argv, DWORD dw)
  21. {
  22. IPTOK iptok;
  23. for (iptok = 1; iptok <= ctokArgv; iptok++) {
  24. opc(ptokArgv(iptok), iptok, dw);
  25. }
  26. }
  27. void STDCALL
  28. EachReverseOpcArgvDw(OPC opc, ARGV argv, DWORD dw)
  29. {
  30. IPTOK iptok;
  31. for (iptok = ctokArgv; iptok >= 1; iptok--) {
  32. opc(ptokArgv(iptok), iptok, dw);
  33. }
  34. }
  35. /*****************************************************************************
  36. *
  37. * EachMacroOp
  38. *
  39. * Call op once for each macro in current existence.
  40. *
  41. *****************************************************************************/
  42. void STDCALL
  43. EachMacroOp(MOP mop)
  44. {
  45. HASH hash;
  46. for (hash = 0; hash < g_hashMod; hash++) {
  47. PMAC pmac;
  48. for (pmac = mphashpmac[hash]; pmac; pmac = pmac->pmacNext) {
  49. mop(pmac);
  50. }
  51. }
  52. }