Leaked source code of windows server 2003
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.

41 lines
989 B

  1. // list.h
  2. //
  3. // a VM growable array package
  4. VA VaAddList(VA far *vaList, LPV lpvData, WORD cbData, WORD grp);
  5. WORD CItemsList(VA vaList);
  6. WORD CItemsIterate(VA FAR *vaData, VA FAR *vaNext);
  7. #define ENM_LIST(start, type) \
  8. { \
  9. VA va##type##list = (start); \
  10. VA va##type##s; \
  11. int cnt##type, idx##type; \
  12. while (cnt##type = CItemsIterate(&va##type##s, &va##type##list)) {\
  13. g##type(va##type##s); \
  14. for (idx##type = 0; idx##type < cnt##type; idx##type++, (&c##type)++) {
  15. #define ENM_END } } }
  16. #define ENM_PUT(type) DirtyVa(va##type##s)
  17. #define ENM_VA(type) (va##type##s + sizeof(c##type)*idx##type)
  18. #define ENM_BREAK(type) va##type##list = 0; break;
  19. //
  20. // example use of ENM_LIST
  21. //
  22. //
  23. // ENM_LIST (vaPropList, PROP) {
  24. //
  25. // ... some things using CPROP (like below) ..
  26. //
  27. // printf("%s\n", GetAtomStr(cPROP.vaNameSym));
  28. //
  29. // ... other things using cPROP...
  30. //
  31. // } ENM_END