12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879openCtypesmoduleC(T:Cstubs_structs.TYPE)=structopenTletcs=constantsintletlibcephfs_VER_MAJOR=c"LIBCEPHFS_VER_MAJOR"letlibcephfs_VER_MINOR=c"LIBCEPHFS_VER_MINOR"letlibcephfs_VER_EXTRA=c"LIBCEPHFS_VER_EXTRA"letenoent=constant"ENOENT"intletcs=constantscharletdt_BLK=c"DT_BLK"(* This is a block device. *)letdt_CHR=c"DT_CHR"(* This is a character device. *)letdt_DIR=c"DT_DIR"(* This is a directory. *)letdt_FIFO=c"DT_FIFO"(* This is a named pipe (FIFO). *)letdt_LNK=c"DT_LNK"(* This is a symbolic link. *)letdt_REG=c"DT_REG"(* This is a regular file. *)letdt_SOCK=c"DT_SOCK"(* This is a UNIX domain socket. *)letdt_UNKNOWN=c"DT_UNKNOWN"(* The file type could not be determined. *)letcs=constantsintleto_RDONLY=c"O_RDONLY"leto_WRONLY=c"O_WRONLY"leto_RDWR=c"O_RDWR"leto_CREAT=c"O_CREAT"leto_EXCL=c"O_EXCL"leto_TRUNC=c"O_TRUNC"leto_DIRECTORY=c"O_DIRECTORY"leto_NOFOLLOW=c"O_NOFOLLOW"typedirentletstruct_dirent:direntstructuretyp=structure"dirent"let(-:)tylabel=fieldstruct_direntlabeltyletd_inode=int64_t-:"d_ino"(* could use PosixTypes.ino_t but libcephfs explicitly requires int64 *)letd_off=int64_t-:"d_off"letd_reclen=short-:"d_reclen"letd_type=char-:"d_type"letd_name=char-:"d_name"(* char d_name[] *)let()=sealstruct_direntletcs=constantsuintletstatx_ALL_STATS=c"CEPH_STATX_ALL_STATS"letstatx_BASIC_STATS=c"CEPH_STATX_BASIC_STATS"letstatx_MODE=c"CEPH_STATX_MODE"letstatx_SIZE=c"CEPH_STATX_SIZE"letstatx_MTIME=c"CEPH_STATX_MTIME"letstatx_BTIME=c"CEPH_STATX_BTIME"typetimespecletstruct_timespec:timespecstructuretyp=structure"timespec"lettv_sec=fieldstruct_timespec"tv_sec"(lift_typPosixTypes.time_t)lettv_nsec=fieldstruct_timespec"tv_nsec"longlet()=sealstruct_timespectypestatxletstruct_statx:statxstructuretyp=structure"ceph_statx"let(-:)tylabel=fieldstruct_statxlabeltyletstx_mode=uint16_t-:"stx_mode"letstx_size=uint64_t-:"stx_size"letstx_mtime=struct_timespec-:"stx_mtime"letstx_btime=struct_timespec-:"stx_btime"let()=sealstruct_statx(* inode(7) *)letcs=constantsuint16_tlets_IFMT=c"S_IFMT"(* bit mask for the file type bit field *)lets_IFSOCK=c"S_IFSOCK"lets_IFLNK=c"S_IFLNK"lets_IFREG=c"S_IFREG"lets_IFBLK=c"S_IFBLK"lets_IFDIR=c"S_IFDIR"lets_IFCHR=c"S_IFCHR"lets_IFIFO=c"S_IFIFO"end