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.

76 lines
2.1 KiB

  1. //--------------------------------------------------------------------
  2. // Microsoft OLE-DB Monarch
  3. //
  4. // Copyright 1997 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // @doc
  7. //
  8. // @module treeutil.h |
  9. //
  10. // Contains prototypes for tree manipulation utility functions for OLE-DB trees.
  11. //
  12. //
  13. // @rev 0 | 04-Feb-97 | v-charca | Created
  14. //
  15. #ifdef DEBUG
  16. #include <iostream.h>
  17. #endif
  18. // Change a variant to from BSTR to I8 or UI8
  19. HRESULT PropVariantChangeTypeI64(PROPVARIANT* pvarValue);
  20. ////////// OLE-DB tree manipulation prototypes /////////////
  21. //Allocate a tree of given kind and type.
  22. DBCOMMANDTREE * PctAllocNode(DBVALUEKIND wKind,DBCOMMANDOP op = DBOP_DEFAULT);
  23. // Make a list of dbcommandtree nodes
  24. //--------------------------------------------------------------------
  25. // @func Links two DBCOMMANDTREEs together.
  26. //
  27. // @rdesc (inline) DBCOMMANDTREE *
  28. //
  29. _inline DBCOMMANDTREE * PctLink
  30. (
  31. DBCOMMANDTREE *pct1, // @parm IN | 1st node in list
  32. DBCOMMANDTREE *pct2 // @parm IN | 2nd node in list
  33. )
  34. {
  35. Assert(pct1 != NULL && pct2 != NULL);
  36. DBCOMMANDTREE* pct = pct1;
  37. while(pct->pctNextSibling != NULL)
  38. pct = pct->pctNextSibling;
  39. pct->pctNextSibling = pct2;
  40. return pct1;
  41. }
  42. DBCOMMANDTREE * PctCreateNode(DBCOMMANDOP op, DBVALUEKIND wKind, DBCOMMANDTREE * pctxpr, ...);
  43. DBCOMMANDTREE * PctCreateNode(DBCOMMANDOP op, DBCOMMANDTREE * pctxpr, ...);
  44. DBCOMMANDTREE * PctReverse(DBCOMMANDTREE * pct);
  45. // Count the number of siblings of a node
  46. UINT GetNumberOfSiblings(DBCOMMANDTREE *pct);
  47. // Delete tree
  48. void DeleteDBQT(DBCOMMANDTREE * pct);
  49. // Copy a tree.
  50. HRESULT HrQeTreeCopy(DBCOMMANDTREE **pctDest, const DBCOMMANDTREE *pctSrc);
  51. void SetDepthAndInclusion( DBCOMMANDTREE* pctInfo, DBCOMMANDTREE * pctScpList );
  52. // Defined in querylib.lib
  53. BOOL ParseGuid( WCHAR* pwszGuid, GUID & guid );
  54. #ifdef DEBUG
  55. // Print a wide character string
  56. ostream& operator <<(ostream &osOut, LPWSTR pwszName);
  57. // Print given tree
  58. ostream& operator <<(ostream &osOut, DBCOMMANDTREE& qe);
  59. ostream& operator <<(ostream &osOut, GUID guid);
  60. ostream& operator <<(ostream &osOut, DBID __RPC_FAR *pdbid);
  61. #endif