Lines Matching refs:cp

195 getblkcomplete(char *cp, struct stat64 *dat)
204 if ((dp = strstr(cp, "/rfd")) != NULL) {
205 if ((new_path = malloc(strlen(cp))) == NULL)
210 (void) strcpy(new_path, cp); /* save first part of it */
222 if ((dp = strstr(cp, "/rdiskette")) != NULL) {
223 if ((new_path = malloc(strlen(cp))) == NULL)
228 (void) strcpy(new_path, cp); /* save first part of it */
248 getrawcomplete(char *cp, struct stat64 *dat)
257 if ((dp = strstr(cp, "/fd")) != NULL) {
259 if ((new_path = malloc(strlen(cp)+2)) == NULL)
264 (void) strcpy(new_path, cp); /* save first part of it */
276 if ((dp = strstr(cp, "/diskette")) != NULL) {
278 if ((new_path = malloc(strlen(cp)+2)) == NULL)
283 (void) strcpy(new_path, cp); /* save first part */
336 getfullblkname(char *cp)
343 if (cp == NULL)
349 if ((cp = getfullname(cp)) == NULL)
352 if (*cp == '\0')
353 return (cp);
355 if (stat64(cp, &buf) != 0) {
356 free(cp);
361 return (cp);
364 free(cp);
368 if ((dp = getvfsspecial(cp, GET_BLK)) != NULL) {
369 free(cp);
378 if ((dp = strstr(cp, "/rdsk/")) == NULL &&
379 (dp = strstr(cp, "/" LOFI_CHAR_NAME "/")) == NULL &&
380 (dp = strstr(cp, "/" RD_CHAR_NAME "/")) == NULL &&
381 (dp = strstr(cp, "/" SNAP_CHAR_NAME "/")) == NULL &&
382 (dp = strrchr(cp, '/')) == NULL) {
384 free(cp);
389 dp = getblkcomplete(cp, &buf);
390 free(cp);
393 if ((new_path = malloc(strlen(cp))) == NULL) {
394 free(cp);
397 (void) strncpy(new_path, cp, dp - cp);
400 (void) strcpy(new_path + (dp - cp), dp + 1);
403 free(cp);
409 dp = getblkcomplete(cp, &buf);
410 free(cp);
418 getfullrawname(char *cp)
425 if (cp == NULL)
431 if ((cp = getfullname(cp)) == NULL)
434 if (*cp == '\0')
435 return (cp);
437 if (stat64(cp, &buf) != 0) {
438 free(cp);
443 return (cp);
446 free(cp);
452 if ((dp = getvfsspecial(cp, GET_RAW)) != NULL) {
453 free(cp);
460 if ((dp = strstr(cp, "/dsk/")) == NULL &&
461 (dp = strstr(cp, "/" LOFI_BLOCK_NAME "/")) == NULL &&
462 (dp = strstr(cp, "/" RD_BLOCK_NAME "/")) == NULL &&
463 (dp = strstr(cp, "/" SNAP_BLOCK_NAME "/")) == NULL &&
464 (dp = strrchr(cp, '/')) == NULL) {
466 free(cp);
471 if ((new_path = malloc(strlen(cp)+2)) == NULL) {
472 free(cp);
475 (void) strncpy(new_path, cp, dp - cp);
477 new_path[dp - cp] = 'r';
478 (void) strcpy(new_path + (dp - cp) + 1, dp);
481 free(cp);
486 dp = getrawcomplete(cp, &buf);
487 free(cp);