* Look for the file in our directory structure. Return 1 if successful, * 0 if not found. Fill in the size and starting position. */
| 172 | * 0 if not found. Fill in the size and starting position. |
| 173 | */ |
| 174 | staticfn boolean |
| 175 | find_file(const char *name, library **lib, long *startp, long *sizep) |
| 176 | { |
| 177 | int i, j; |
| 178 | library *lp; |
| 179 | |
| 180 | for (i = 0; i < MAX_LIBS && dlb_libs[i].fdata; i++) { |
| 181 | lp = &dlb_libs[i]; |
| 182 | for (j = 0; j < lp->nentries; j++) { |
| 183 | if (FILENAME_CMP(name, lp->dir[j].fname) == 0) { |
| 184 | *lib = lp; |
| 185 | *startp = lp->dir[j].foffset; |
| 186 | *sizep = lp->dir[j].fsize; |
| 187 | return TRUE; |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | *lib = (library *) 0; |
| 192 | *startp = *sizep = 0; |
| 193 | return FALSE; |
| 194 | } |
| 195 | |
| 196 | /* |
| 197 | * Open the library of the given name and fill in the given library |