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.

85 lines
2.9 KiB

  1. //============== DAE: OS/2 Database Access Engine ===================
  2. //============== fileint.h: File Manager Internals ===================
  3. // the pragma is bad for efficiency, but we need it here so that the
  4. // THREEBYTES will not be aligned on 4-byte boundary
  5. #pragma pack(1)
  6. // Data kept at the "fields" node of a file
  7. typedef struct
  8. {
  9. FID fidFixedLast;
  10. FID fidVarLast;
  11. FID fidTaggedLast;
  12. } FIELDDATA;
  13. // Data kept at each son of "fields" (a field definition)
  14. typedef struct
  15. {
  16. FID fid;
  17. LANGID langid; // language of field
  18. WORD wCountry; // country of language
  19. USHORT cp; // code page of language
  20. BYTE bFlags;
  21. BYTE bColtyp;
  22. ULONG ulLength;
  23. CHAR szFieldName[JET_cbNameMost + 1];
  24. WORD cbDefault;
  25. BYTE rgbDefault[1]; // must be last field in structure
  26. } FIELDDEFDATA;
  27. // Data kept at each son of "indexes" for a file (an index definition)
  28. typedef struct
  29. {
  30. LANGID langid; // language of index
  31. #ifdef DATABASE_FORMAT_CHANGE
  32. #else
  33. // UNDONE: index should not have country code
  34. // UNDONE: index should not have cp
  35. WORD wCountry; // country of language
  36. USHORT cp; // code page of language
  37. #endif
  38. BYTE bFlags;
  39. BYTE bDensity;
  40. CHAR szIndexName[JET_cbNameMost + 1];
  41. BYTE iidxsegMac;
  42. IDXSEG rgidxseg[JET_ccolKeyMost]; // must be last field in structure
  43. } INDEXDEFDATA;
  44. #define PbIndexName( pfucb ) ( pfucb->lineData.pb + offsetof( INDEXDEFDATA, szIndexName ) )
  45. #define CbIndexName( pfucb ) ( strlen( PbIndexName( pfucb ) ) )
  46. #define FIndexNameNull( pfucb ) ( CbIndexName( pfucb ) == 0 )
  47. #pragma pack()
  48. ERR ErrFILESeek( FUCB *pfucb, CHAR *szTable );
  49. #define fBumpIndexCount (1<<0)
  50. #define fDropIndexCount (1<<1)
  51. #define fDDLStamp (1<<2)
  52. ERR ErrFILEIUpdateFDPData( FUCB *pfucb, ULONG grbit );
  53. /* field and index definition
  54. /**/
  55. ERR ErrRECNewIDB( IDB **ppidb );
  56. ERR ErrRECAddFieldDef( FDB *pfdb, FID fid, FIELD *pfieldNew );
  57. ERR ErrRECAddKeyDef( FDB *pfdb, IDB *pidb, BYTE iidxsegMac, IDXSEG *rgidxseg, BYTE bFlags, LANGID langid );
  58. #define RECFreeIDB(pidb) { MEMReleasePidb(pidb); }
  59. ERR ErrRECNewFDB( FDB **ppfdb, FID fidFixedLast, FID fidVarLast, FID fidTaggedLast );
  60. VOID FDBSet( FCB *pfcb, FDB *pfdb );
  61. ERR ErrFDBConstruct( FUCB *pfucb, FCB *pfcb, BOOL fBuildDefault );
  62. VOID FDBDestruct( FDB *pfdb );
  63. VOID FILEIDeallocateFileFCB( FCB *pfcb );
  64. ERR ErrFILEIGenerateFCB( FUCB *pfucb, FCB **ppfcb );
  65. ERR ErrFILEIFillInFCB( FUCB *pfucb, FCB *pfcb );
  66. ERR ErrFILEIBuildIndexDefs( FUCB *pfucb, FCB *pfcb );
  67. ERR ErrFILEIFillIn2ndIdxFCB( FUCB *pfucb, FDB *pfdb, FCB *pfcb );
  68. VOID FILEIDeallocateFileFCB( FCB *pfcb );
  69. VOID FILESetAllIndexMask( FCB *pfcbTable );
  70. ERR ErrFILEDeleteTable( PIB *ppib, DBID dbid, CHAR *szName );
  71. FIELD *PfieldFCBFromColumnName( FCB *pfcb, CHAR *szColumnName );
  72. FCB *PfcbFCBFromIndexName( FCB *pfcbTable, CHAR *szName );