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.

55 lines
1.6 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. */
  4. #ifndef __SDP_STATE_TRANSITIONS__
  5. #define __SDP_STATE_TRANSITIONS__
  6. #define STATE_TRANSITION_ENTRY(State, TransitionsArray) \
  7. {State, sizeof(TransitionsArray)/sizeof(STATE_TRANSITION), TransitionsArray }
  8. struct STATE_TRANSITION
  9. {
  10. CHAR m_Type;
  11. PARSE_STATE m_NewParseState;
  12. };
  13. struct TRANSITION_INFO
  14. {
  15. PARSE_STATE m_ParseState;
  16. BYTE m_NumTransitions;
  17. const STATE_TRANSITION *m_Transitions; // array of state transitions
  18. };
  19. // macro for parsing a line into a member field of a list element
  20. // this cannot be done using a template because several members of the
  21. // list element may have the same type
  22. /* get the current element in the list */
  23. /* get the member in the element */
  24. /* parse the line into the member */
  25. #define ParseMember(ELEMENT_TYPE, List, MEMBER_TYPE, MemberFunction, Line, Result) \
  26. { \
  27. ELEMENT_TYPE *Element = (ELEMENT_TYPE *)List.GetCurrentElement(); \
  28. \
  29. MEMBER_TYPE &Member = Element->MemberFunction(); \
  30. \
  31. Result = Member.ParseLine(Line); \
  32. }
  33. #endif // __SDP_STATE_TRANSITIONS__