Windows NT 4.0 source code leak
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.

126 lines
5.5 KiB

4 years ago
  1. #ifndef __NCPARSE_H__
  2. #define __NCPARSE_H__
  3. #include <pdb.h>
  4. #include <vcbudefs.h>
  5. #include <bsc.h>
  6. #include <time.h>
  7. // values of kinds:
  8. #define NCB_KIND_BASECLASS 0x01
  9. #define NCB_KIND_CONTAINMENT 0x02
  10. // PROP definition/declaration.
  11. // This information is hidden in last four bits of ATR
  12. #define INST_NCB_ATR_DECL 0x1000
  13. #define INST_NCB_ATR_DEFN 0x2000
  14. #define INST_NCB_ATR_JAVA 0x4000 // Flags prop as Java specific
  15. #define INST_NCB_ATR_FINAL 0x8000 // final attribute on classes
  16. #define NCB_MOD_ATR_NODEP 0x01
  17. #define NCBAttr(x) ((USHORT) (x & 0x0fff))
  18. interface NcbParse
  19. {
  20. // same as Bsc interface
  21. virtual BOOL close() pure; // close the ncbparse interface
  22. // INTERFACE FOR MODULE LEVEL
  23. // primitives for getting module information
  24. // same as Bsc interface
  25. virtual BOOL getModuleByName(SZ sz, OUT IMOD *pimod) pure;
  26. // same as Bsc interface
  27. virtual BOOL getModuleContents(IMOD imod, MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst) pure;
  28. // same as Bsc interface
  29. virtual void disposeArray(void *pAnyArray) pure;
  30. virtual BOOL openMod (SZ szMod, BOOL bCreate, OUT IMOD * pimod) pure;
  31. virtual BOOL closeMod (IMOD imod, BOOL bSave) pure;
  32. virtual BOOL clearModContent (IMOD imod) pure;
  33. virtual BOOL setModTime (IMOD imod, time_t tStamp) pure;
  34. virtual BOOL getModTime (IMOD imod, time_t *ptStamp) pure;
  35. // set module attributes
  36. virtual BOOL setModAtr (IMOD imod, BYTE bAtr) pure;
  37. virtual BOOL getModAtr (IMOD imod, BYTE * pbAtr) pure;
  38. // check if module is member of a specific target
  39. virtual BOOL isModInTarget (HTARGET hTarget, IMOD imod) pure;
  40. virtual BOOL setModAsSrc (HTARGET hTarget, IMOD imod, BOOL bSource) pure;
  41. virtual BOOL isModTargetSource (HTARGET hTarget, IMOD imod) pure;
  42. // primitives for adding a target to a module
  43. virtual BOOL addModToTarget (HTARGET hTarget, IMOD imod, BOOL bProjSrc) pure;
  44. // primitives for adding an include file
  45. virtual BOOL addInclToMod (IMOD inclimod, HTARGET hTarget, IMOD imod) pure;
  46. virtual BOOL isInclInMod (IMOD inclimod, HTARGET hTarget, IMOD imod) pure;
  47. // primitives for deleting an include file
  48. virtual BOOL delInclFrMod (IMOD inclimod, HTARGET hTarget, IMOD imod) pure;
  49. // primitives for deleting all include files
  50. virtual BOOL delAllInclFrMod (HTARGET hTarget, IMOD imod) pure;
  51. // primitives for deleting target from the database
  52. virtual BOOL delTarget (HTARGET hTarget) pure;
  53. // primitives for adding a target to the database
  54. virtual BOOL addTarget (HTARGET hTarget) pure;
  55. // primitives for deleting file from target
  56. virtual BOOL delModFrTarget (IMOD imod, HTARGET hTarget) pure;
  57. // primitives for setting all the include files:
  58. virtual BOOL getAllInclMod (HTARGET hTarget, IMOD imod, OUT IMOD ** ppimod, OUT ULONG * pcmod) pure;
  59. virtual BOOL getAllTarget (IMOD imod, OUT HTARGET ** ppTarget, OUT ULONG * pcTarget) pure;
  60. virtual BOOL getAllFlattenDeps (HTARGET hTarget, IMOD imod, OUT IMOD ** ppimod, OUT ULONG * pcmod, BOOL &bNotifyBuild) pure;
  61. // primitives for initializing target (ie: needs to do this
  62. // when target name change, first open a target)
  63. virtual BOOL mapTargetToSz (HTARGET hTarget, SZ szTarget) pure;
  64. virtual BOOL mapSzToTarget (SZ szTarget, HTARGET hTarget) pure;
  65. virtual BOOL imodInfo(IMOD imod, OUT SZ *pszModule) pure;
  66. // INTERFACE FOR OBJECT LEVEL
  67. // primitives for adding an info
  68. // IINST is used for containment
  69. virtual BOOL addProp (SZ szName, TYP typ, ATR atr, IMOD imod, OUT IINST * pinst) pure;
  70. virtual BOOL setKind (IINST iinst, IINST iinstP, BYTE kind) pure;
  71. virtual BOOL setLine (IINST iinst, LINE lnStart) pure;
  72. virtual BOOL setDefn (IINST iinst) pure;
  73. virtual BOOL delProp (IINST iinst) pure;
  74. // For function, the 1st param is always return type followed by real params.
  75. // For variable, the 1st param is always type.
  76. virtual BOOL addParam (IINST iinst, SZ szName) pure;
  77. virtual BOOL iinstInfo(IINST iinst, OUT SZ *psz, OUT TYP *ptyp, OUT ATR *patr) pure ;
  78. virtual BOOL getAllGlobalsArray(MBF mbf, OUT IINST **ppiinst, OUT ULONG *pciinst) pure;
  79. virtual BOOL getAllGlobalsArray(MBF mbf, OUT IinstInfo **ppiinstinfo, OUT ULONG *pciinst) pure;
  80. virtual BOOL getGlobalsArray (MBF mbf, IMOD imod, OUT IinstInfo ** ppiinstinfo, OUT ULONG * pciinst) pure;
  81. // Locking mechanism:
  82. virtual BOOL lock() pure;
  83. virtual BOOL unlock() pure;
  84. virtual BOOL notify() pure; // flush out notification queue!!
  85. virtual BOOL suspendNotify () pure;
  86. virtual BOOL resumeNotify() pure;
  87. virtual void graphBuilt() pure;
  88. virtual BOOL delUnreachable(HTARGET hTarget) pure;
  89. virtual BOOL isInit (HTARGET hTarget, IMOD imod) pure;
  90. virtual BOOL setInit (HTARGET hTarget, IMOD imod, BOOL bInit) pure;
  91. virtual BOOL notifyImod (OPERATION op, IMOD imod, HTARGET hTarget) pure;
  92. virtual BOOL notifyIinst (NiQ qItem, HTARGET hTarget) pure;
  93. virtual BOOL getBsc (HTARGET hTarget, SZ szTarget, Bsc ** ppBsc) pure;
  94. virtual BOOL delUninitTarget () pure;
  95. virtual BOOL imodFrSz (SZ szName, OUT IMOD *pimod) pure;
  96. virtual BOOL irefInfo(IREF iref, OUT SZ *pszModule, OUT LINE *piline) pure;
  97. virtual BOOL targetFiles (HTARGET hTarget, BOOL bSrcProjOnly, OUT IMOD ** ppimod, OUT ULONG * pcimod) pure;
  98. virtual BOOL setAllInit (HTARGET hTarget, BOOL bInit) pure;
  99. virtual void setNotifyBuild (IMOD imod, BOOL bNotifyBuild) pure;
  100. virtual BOOL isNotifyBuild (IMOD imod) pure;
  101. };
  102. PDBAPI (BOOL) OpenNcb (SZ szName, HTARGET hTarget, SZ szTarget, BOOL bOverwrite, Bsc ** ppBsc);
  103. PDBAPI (BOOL) OpenNcb (PDB * ppdb, HTARGET hTarget, SZ szTarget, Bsc ** ppBsc);
  104. PDBAPI (BOOL) OpenNcb (SZ szName, BOOL bOverwrite, NcbParse ** ppNcParse);
  105. PDBAPI (BOOL) OpenNcb (PDB * ppdb, NcbParse **ppNcParse);
  106. #endif