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.

156 lines
4.3 KiB

  1. #ifdef SYSTABLES
  2. typedef struct _cdesc /* Column Description */
  3. {
  4. char *szColName; /* Column Name */
  5. JET_COLTYP coltyp; /* Column Type */
  6. JET_GRBIT grbit; /* Flag bits */
  7. ULONG ulMaxLen; /* Max Length of Column */
  8. } CDESC;
  9. typedef struct _idesc /* Index Description */
  10. {
  11. char *szIdxName; /* Index Name */
  12. char *szIdxKeys; /* Key String */
  13. JET_GRBIT grbit; /* Flag bits */
  14. } IDESC;
  15. typedef struct {
  16. const char *szName;
  17. CODECONST(CDESC) *pcdesc;
  18. CODECONST(IDESC) *pidesc;
  19. BYTE ccolumn;
  20. BYTE cindex;
  21. CPG cpg;
  22. JET_COLUMNID *rgcolumnid;
  23. } SYSTABLEDEF;
  24. #define itableSo 0 /* MSysObjects */
  25. #define itableSc 1 /* MSysColumns */
  26. #define itableSi 2 /* MSysIndexes */
  27. #define itableSa 3 /* MSysACEs */
  28. #define itableSq 4 /* MSysQueries */
  29. #define itableSr 5 /* MSysRelationShips */
  30. #define iMSO_Id 0
  31. #define iMSO_ParentId 1
  32. #define iMSO_Name 2
  33. #define iMSO_Type 3
  34. #define iMSO_DateCreate 4
  35. #define iMSO_DateUpdate 5
  36. #define iMSO_Rgb 6
  37. #define iMSO_Lv 7
  38. #define iMSO_Owner 8
  39. #define iMSO_Database 9
  40. #define iMSO_Connect 10
  41. #define iMSO_ForeignName 11
  42. #define iMSO_RmtInfoShort 12
  43. #define iMSO_RmtInfoLong 13
  44. #define iMSO_Flags 14
  45. #define iMSO_LvExtra 15
  46. #define iMSO_Description 16
  47. #define iMSO_LvModule 17
  48. #define iMSO_LvProp 18
  49. #define iMSO_Pages 19
  50. #define iMSO_Density 20
  51. #define iMSC_ObjectId 0
  52. #define iMSC_Name 1
  53. #define iMSC_ColumnId 2
  54. #define iMSC_Coltyp 3
  55. #define iMSC_FAutoincrement 4
  56. #define iMSC_FDisallowNull 5
  57. #define iMSC_FVersion 6
  58. #define iMSC_CodePage 7
  59. #define iMSC_LanguageId 8
  60. #define iMSC_Country 9
  61. #define iMSC_FRestricted 10
  62. #define iMSC_RmtInfoShort 11
  63. #define iMSC_RmtInfoLong 12
  64. #define iMSC_Description 13
  65. #define iMSC_LvExtra 14
  66. #define iMSC_POrder 15
  67. #define iMSI_ObjectId 0
  68. #define iMSI_Name 1
  69. #define iMSI_FUnique 2
  70. #define iMSI_FPrimary 3
  71. #define iMSI_FDisallowNull 4
  72. #define iMSI_FExcludeAllNull 5
  73. #define iMSI_FClustered 6
  74. #define iMSI_MatchType 7
  75. #define iMSI_UpdateAction 8
  76. #define iMSI_DeleteAction 9
  77. #define iMSI_ObjectIdReference 10
  78. #define iMSI_IdxidReference 11
  79. #define iMSI_RgkeydReference 12
  80. #define iMSI_RglocaleReference 13
  81. #define iMSI_FDontEnforce 14
  82. #define iMSI_RmtInfoShort 15
  83. #define iMSI_RmtInfoLong 16
  84. #define iMSI_LvExtra 17
  85. #define iMSI_Description 18
  86. #define iMSI_Density 19
  87. // UNDONE: include later
  88. // #define iMSI_LanguageId 20
  89. // #define iMSI_Country 21
  90. /* max number of columns
  91. /**/
  92. #define ilineSxMax 21
  93. #define CheckTableObject( szTable ) \
  94. { \
  95. ERR err; \
  96. OBJID objid; \
  97. JET_OBJTYP objtyp; \
  98. \
  99. err = ErrFindObjidFromIdName( ppib, \
  100. dbid, \
  101. objidTblContainer, \
  102. szTable, \
  103. &objid, \
  104. &objtyp ); \
  105. if ( err >= JET_errSuccess ) \
  106. { \
  107. if ( objtyp == JET_objtypQuery ) \
  108. return JET_errQueryNotSupported; \
  109. if ( objtyp == JET_objtypLink ) \
  110. return JET_errLinkNotSupported; \
  111. if ( objtyp == JET_objtypSQLLink ) \
  112. return JET_errSQLLinkNotSupported; \
  113. } \
  114. else \
  115. return err; \
  116. }
  117. /* prototypes
  118. /**/
  119. ERR ErrSysTabCreate( PIB *ppib, DBID dbid );
  120. ERR ErrSysTabInsert( PIB *ppib, DBID dbid, INT itable, LINE rgline[], OBJID objid );
  121. ERR ErrSysTabDelete( PIB *ppib, DBID dbid, INT itable, CHAR *szName, OBJID objid );
  122. ERR ErrSysTabRename(
  123. PIB *ppib,
  124. DBID dbid,
  125. CHAR *szNew,
  126. CHAR *szName,
  127. OBJID objid,
  128. INT itable );
  129. ERR ErrSysTabTimestamp( PIB *ppib, DBID dbid, OBJID objid );
  130. ERR ErrFindObjidFromIdName(
  131. PIB *ppib,
  132. DBID dbid,
  133. OBJID objidParentId,
  134. const CHAR *lszName,
  135. OBJID *pobjid,
  136. JET_OBJTYP *pobjtyp );
  137. ERR ErrFindNameFromObjid( PIB *ppib, DBID dbid, OBJID objid, OUTLINE *poutName );
  138. ERR VTAPI ErrIsamGetObjidFromName( JET_SESID sesid, JET_DBID vdbid, const char *lszCtrName, const char *lszObjName, OBJID *pobjid );
  139. ERR VTAPI ErrIsamCreateObject( JET_SESID sesid, JET_DBID vdbid, OBJID objidParentId, const char *szName, JET_OBJTYP objtyp );
  140. ERR VTAPI ErrIsamDeleteObject( JET_SESID sesid, JET_DBID vdbid, OBJID objid );
  141. #endif /* SYSTABLES */