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.

61 lines
2.2 KiB

  1. /*****************************************************************************
  2. *
  3. * stream.h
  4. *
  5. *****************************************************************************/
  6. /*****************************************************************************
  7. *
  8. * File handles
  9. *
  10. *****************************************************************************/
  11. #define cbErr ((CB)-1)
  12. /*****************************************************************************
  13. *
  14. * Streams
  15. *
  16. * A STREAM is something that produces characters (not tokens).
  17. *
  18. * Streams can be (and frequently are) chained. When a stream
  19. * runs out of characters, the stream pointed to by pstmNext
  20. * becomes the new source of characters.
  21. *
  22. * For example, when you perform an `include', a new file stream
  23. * is created and pushed onto the head of the stream list. When
  24. * a macro is expanded, a new string stream is created and pushed
  25. * onto the head of the stream list.
  26. *
  27. *****************************************************************************/
  28. typedef struct STREAM STM, *PSTM;
  29. struct STREAM { /* stm */
  30. D(SIG sig;) /* Signature */
  31. PTCH ptchCur; /* Next byte to return from stream */
  32. PTCH ptchMax; /* One past last byte in stream */
  33. PTCH ptchMin; /* Beginning of stream buffer */
  34. HF hf; /* File handle (or hfNil if not a file) */
  35. PTCH ptchName; /* Name of file */
  36. PSTM pstmNext; /* Next stream in the chain */
  37. };
  38. #define sigStm sigABCD('S', 't', 'r', 'm')
  39. #define AssertPstm(pstm) AssertPNm(pstm, Stm)
  40. TCH STDCALL tchPeek(void);
  41. TCH STDCALL tchGet(void);
  42. void STDCALL UngetTch(TCH tch);
  43. PSTM STDCALL pstmPushStringCtch(CTCH ctch);
  44. PSTM STDCALL pstmPushHfPtch(HFILE hf, PTCH ptch);
  45. void STDCALL PushPtok(PCTOK ptok);
  46. void STDCALL PushZPtok(PDIV pdiv, PCTOK ptok);
  47. void STDCALL PushTch(TCH tch);
  48. void STDCALL PushQuotedPtok(PCTOK ptok);
  49. extern PSTM g_pstmCur; /* Current head of stream chain */
  50. #define ctchMinPush 1024 /* minimum string stream size */
  51. #define ctchFile 4096 /* minimum file stream size */