FreeCalypso > hg > freecalypso-tools
comparison target-utils/libtiffs/basicfind.c @ 60:87cb03b35f77
target-utils: long-overdue s/mpffs/tiffs/ and s/MPFFS/TIFFS/ rename
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 26 Oct 2016 15:52:14 +0000 |
parents | e7502631a0f9 |
children |
comparison
equal
deleted
inserted
replaced
59:819335e06fd1 | 60:87cb03b35f77 |
---|---|
12 { | 12 { |
13 int ino; | 13 int ino; |
14 struct inode *irec; | 14 struct inode *irec; |
15 | 15 |
16 for (ino = start; ino != 0xFFFF; ino = irec->sibling) { | 16 for (ino = start; ino != 0xFFFF; ino = irec->sibling) { |
17 irec = mpffs_active_index + ino; | 17 irec = tiffs_active_index + ino; |
18 if (!irec->type) | 18 if (!irec->type) |
19 continue; | 19 continue; |
20 if (!strcmp(inode_to_dataptr(irec), seekname)) | 20 if (!strcmp(inode_to_dataptr(irec), seekname)) |
21 return(ino); | 21 return(ino); |
22 } | 22 } |
23 return(0); | 23 return(0); |
24 } | 24 } |
25 | 25 |
26 mpffs_pathname_to_inode(pathname) | 26 tiffs_pathname_to_inode(pathname) |
27 char *pathname; | 27 char *pathname; |
28 { | 28 { |
29 int ino, stat; | 29 int ino, stat; |
30 struct inode *irec; | 30 struct inode *irec; |
31 char *cur, *next; | 31 char *cur, *next; |
32 | 32 |
33 stat = mpffs_init(); | 33 stat = tiffs_init(); |
34 if (stat < 0) | 34 if (stat < 0) |
35 return(stat); | 35 return(stat); |
36 cur = pathname; | 36 cur = pathname; |
37 if (*cur == '/') | 37 if (*cur == '/') |
38 cur++; | 38 cur++; |
39 for (ino = mpffs_root_ino; cur; cur = next) { | 39 for (ino = tiffs_root_ino; cur; cur = next) { |
40 if (!*cur) | 40 if (!*cur) |
41 break; | 41 break; |
42 next = index(cur, '/'); | 42 next = index(cur, '/'); |
43 if (next == cur) { | 43 if (next == cur) { |
44 printf("malformed pathname: multiple adjacent slashes\n"); | 44 printf("malformed pathname: multiple adjacent slashes\n"); |
45 return(-1); | 45 return(-1); |
46 } | 46 } |
47 if (next) | 47 if (next) |
48 *next++ = '\0'; | 48 *next++ = '\0'; |
49 irec = mpffs_active_index + ino; | 49 irec = tiffs_active_index + ino; |
50 if (irec->type != OBJTYPE_DIR) { | 50 if (irec->type != OBJTYPE_DIR) { |
51 printf("Error: non-terminal non-directory\n"); | 51 printf("Error: non-terminal non-directory\n"); |
52 if (next) | 52 if (next) |
53 next[-1] = '/'; | 53 next[-1] = '/'; |
54 return(-1); | 54 return(-1); |