Lines Matching defs:dj
3279 DIR dj;
3304 dj.obj.fs = fs;
3313 res = follow_virentry(&dj.obj,path);
3320 fs = dj.obj.fs;
3324 res = follow_path(&dj, path); /* Follow the file path */
3327 if (dj.fn[NSFLAG] & NS_NONAME) { /* Origin directory itself? */
3332 res = chk_share(&dj, (mode & ~FA_READ) ? 1 : 0); /* Check if the file can be used */
3341 res = enq_share() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
3343 res = dir_register(&dj);
3350 if (dj.obj.attr & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */
3361 st_dword(dj.dir + DIR_CrtTime, tm); /* Set created time */
3362 st_dword(dj.dir + DIR_ModTime, tm); /* Set modified time */
3364 st_dword(dj.dir + DIR_CrtTime, 0); /* Set created time as 0*/
3365 st_dword(dj.dir + DIR_ModTime, 0); /* Set modified time as 0*/
3367 dj.dir[DIR_Attr] = AM_ARC; /* Reset attribute */
3368 cl = ld_clust(fs, dj.dir); /* Get cluster chain */
3369 st_clust(fs, dj.dir, 0); /* Reset file allocation info */
3370 st_dword(dj.dir + DIR_FileSize, 0);
3379 res = remove_chain(&dj.obj, cl, 0);
3387 res = remove_chain(&dj.obj, cl, 0);
3400 if (dj.obj.attr & AM_DIR) { /* File open against a directory */
3403 if ((mode & FA_WRITE) && (dj.obj.attr & AM_RDO)) { /* Write mode open against R/O file */
3416 fp->dir_ptr = dj.dir;
3418 fp->obj.lockid = inc_share(&dj, (mode & ~FA_READ) ? 1 : 0); /* Lock the file for this session */
3424 if (dj.fn[NSFLAG] & NS_NONAME) { /* Is it origin directory itself? */
3427 if (dj.obj.attr & AM_DIR) { /* Is it a directory? */
3436 fp->obj.sclust = ld_clust(fs, dj.dir); /* Get object allocation info */
3437 fp->obj.objsize = ld_dword(dj.dir + DIR_FileSize);
3919 DIR dj;
3927 dj.obj.fs = fs;
3929 res = follow_path(&dj, path); /* Follow the path */
3931 if (dj.fn[NSFLAG] & NS_NONAME) { /* Is it the start directory itself? */
3932 fs->cdir = dj.obj.sclust;
3934 if (dj.obj.attr & AM_DIR) { /* It is a sub-directory */
3935 fs->cdir = ld_clust(fs, dj.dir); /* Sub-directory cluster */
3962 DIR dj;
3981 dj.obj.fs = fs;
3987 dj.obj.sclust = fs->cdir; /* Start to follow upper directory from current directory */
3988 while ((ccl = dj.obj.sclust) != 0) { /* Repeat while current directory is a sub-directory */
3989 res = dir_sdi(&dj, 1 * SZDIRE); /* Get parent directory */
3991 res = move_window(fs, dj.sect);
3993 dj.obj.sclust = ld_clust(fs, dj.dir); /* Goto parent directory */
3994 res = dir_sdi(&dj, 0);
3997 res = DIR_READ_FILE(&dj);
3999 if (ccl == ld_clust(fs, dj.dir)) break; /* Found the entry */
4000 res = dir_next(&dj, 0);
4004 get_fileinfo(&dj, &fno); /* Get the directory name and push it to the buffer */
4392 DIR dj;
4397 res = mount_volume(&path, &dj.obj.fs, 0);
4399 INIT_NAMBUF(dj.obj.fs);
4400 res = follow_path(&dj, path); /* Follow the file path */
4402 if (dj.fn[NSFLAG] & NS_NONAME) { /* It is origin directory */
4405 if (fno) get_fileinfo(&dj, fno);
4411 LEAVE_FF(dj.obj.fs, res);
4604 DIR dj, sdj;
4621 dj.obj.fs = fs;
4634 res = follow_virentry(&dj.obj,path);
4641 fs = dj.obj.fs;
4645 res = follow_path(&dj, path); /* Follow the file path */
4646 if (FF_FS_RPATH && res == FR_OK && (dj.fn[NSFLAG] & NS_DOT)) {
4651 dj.atrootdir = 0;rtclst = 2;
4652 st_bak = PARENTFS(dj.obj.fs)->winsect;
4670 if (dj.clust == rtclst) {
4672 dj.atrootdir = 1;
4675 rtclst = get_fat(&(dj.obj),rtclst);
4678 if (dj.atrootdir == 1) {
4688 res = move_window(dj.obj.fs,st_bak);
4693 if (res == FR_OK) res = chk_share(&dj, 2); /* Check if it is an open object */
4696 if (dj.fn[NSFLAG] & NS_NONAME) {
4699 if (dj.obj.attr & AM_RDO) {
4704 dclst = ld_clust(fs, dj.dir);
4705 if (dj.obj.attr & AM_DIR) { /* Is it a sub-directory? */
4724 res = dir_remove(&dj); /* Remove the directory entry */
4726 res = remove_chain(&dj.obj, dclst, 0);
4753 DIR dj;
4766 dj.obj.fs = fs;
4770 dj.obj.sclust = 0;
4780 res = follow_virentry(&dj.obj,path);
4787 fs = dj.obj.fs;
4791 res = follow_path(&dj, path); /* Follow the file path */
4793 if (FF_FS_RPATH && res == FR_NO_FILE && (dj.fn[NSFLAG] & NS_DOT)) { /* Invalid name? */
4823 dir[SZDIRE + 1] = '.'; pcl = dj.obj.sclust;
4844 res = dir_register(&dj); /* Register the object to the directoy */
4847 dir = dj.dir;
4866 remove_chain(&dj.obj, dcl, 0); /* Could not register, remove cluster chain */
5051 DIR dj;
5068 res = follow_virentry(&dj.obj,path);
5075 fs = dj.obj.fs;
5079 res = follow_path(&dj, path); /* Follow the file path */
5080 if (res == FR_OK && (dj.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME; /* Check object validity */
5083 dj.dir[DIR_Attr] = (attr & mask) | (dj.dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change */
5116 DIR dj;
5122 dj.obj.fs = fs;
5124 res = follow_path(&dj, path); /* Follow the file path */
5125 if (res == FR_OK && (dj.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME; /* Check object validity */
5127 st_dword(dj.dir + DIR_ModTime, (DWORD)fno->fdate << 16 | fno->ftime);
5156 DIR dj;
5165 dj.obj.fs = fs; dj.obj.sclust = 0; /* Open root directory */
5166 res = dir_sdi(&dj, 0);
5168 res = DIR_READ_LABEL(&dj); /* Find a volume label entry */
5172 wc = dj.dir[si++];
5174 if (dbc_1st((BYTE)wc) && si < 11) wc = wc << 8 | dj.dir[si++]; /* Is it a DBC? */
5225 DIR dj;
5260 dj.obj.fs = fs; dj.obj.sclust = 0; /* Open root directory */
5261 res = dir_sdi(&dj, 0);
5263 res = DIR_READ_LABEL(&dj); /* Get volume label entry */
5266 mem_cpy(dj.dir, dirvn, 11); /* Change the volume label */
5268 dj.dir[DIR_Name] = DDEM; /* Remove the volume label */
5276 res = dir_alloc(&dj, 1); /* Allocate an entry */
5278 mem_set(dj.dir, 0, SZDIRE); /* Clean the entry */
5279 dj.dir[DIR_Attr] = AM_VOL; /* Create volume label entry */
5280 mem_cpy(dj.dir, dirvn, 11);