efs_dir.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * efs_dir.h
  3.  *
  4.  * Copyright (c) 1999 Al Smith
  5.  */
  6. #ifndef __EFS_DIR_H__
  7. #define __EFS_DIR_H__
  8. #define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS
  9. #define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
  10. struct efs_dentry {
  11. unsigned int inode;
  12. unsigned char namelen;
  13. char name[3];
  14. };
  15. #define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1)
  16. #define EFS_MAXNAMELEN  ((1 << (sizeof(char) * 8)) - 1)
  17. #define EFS_DIRBLK_HEADERSIZE 4
  18. #define EFS_DIRBLK_MAGIC 0xbeef /* moo */
  19. struct efs_dir {
  20. unsigned short magic;
  21. unsigned char firstused;
  22. unsigned char slots;
  23. unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
  24. };
  25. #define EFS_MAXENTS 
  26. ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) / 
  27.  (EFS_DENTSIZE + sizeof(char)))
  28. #define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot])
  29. #define EFS_REALOFF(offset) ((offset << 1))
  30. #endif /* __EFS_DIR_H__ */