MCPcopy Create free account
hub / github.com/NetHack/NetHack / CASE2

Function CASE2

sys/vms/vmsfiles.c:264–343  ·  view source on GitHub ↗

i/o error */

(SS$_NOSUCHDEV, SS$_DEVNOTMOUNT)

Source from the content-addressed store, hash-verified

262 CASE2(RMS$_IFI, RMS$_ISI):
263 VALUE(EIO); /* i/o error */
264 CASE1(RMS$_DEV):
265 CASE2(SS$_NOSUCHDEV, SS$_DEVNOTMOUNT):
266 VALUE(ENXIO); /* no such device or address codes */
267 CASE1(RMS$_DME):
268 /* CASE1(LIB$INSVIRMEM): */
269 CASE2(SS$_VASFULL, SS$_INSFWSL):
270 VALUE(ENOMEM); /* not enough core */
271 CASE1(SS$_ACCVIO):
272 VALUE(EFAULT); /* bad address */
273 CASE2(RMS$_DNR, SS$_DEVASSIGN):
274 CASE2(SS$_DEVALLOC, SS$_DEVALRALLOC):
275 CASE2(SS$_DEVMOUNT, SS$_DEVACTIVE):
276 VALUE(EBUSY); /* mount device busy codes to name a few */
277 CASE2(RMS$_FEX, SS$_FILALRACC):
278 VALUE(EEXIST); /* file exists */
279 CASE2(RMS$_IDR, SS$_BADIRECTORY):
280 VALUE(ENOTDIR); /* not a directory */
281 CASE1(SS$_NOIOCHAN):
282 VALUE(EMFILE); /* too many open files */
283 CASE1(RMS$_FUL):
284 CASE2(SS$_DEVICEFULL, SS$_EXDISKQUOTA):
285 VALUE(ENOSPC); /* no space left on disk codes */
286 CASE2(RMS$_WLK, SS$_WRITLCK):
287 VALUE(EROFS); /* read-only file system */
288 default:
289 VALUE(EVMSERR);
290 };
291/* clang-format on */
292/* *INDENT-ON* */
293
294 errno = trans;
295 vaxc$errno = code;
296 return code; /* (not very useful) */
297}
298
299#undef VALUE
300#undef CASE1
301#undef CASE2
302
303static char base_name[NAM$C_MAXRSS + 1];
304
305/* return a copy of the 'base' portion of a filename */
306char *
307vms_basename(const char *name, boolean keep_suffix)
308{
309 unsigned len;
310 char *base, *base_p, *xtra_p;
311 const char *name_p;
312
313 /* skip directory/path */
314 if ((name_p = strrchr(name, ']')) != 0)
315 name = name_p + 1;
316 if ((name_p = strrchr(name, '>')) != 0)
317 name = name_p + 1;
318 if ((name_p = strrchr(name, ':')) != 0)
319 name = name_p + 1;
320 if ((name_p = strrchr(name, '/')) != 0)
321 name = name_p + 1;

Callers 1

vmsfiles.cFile · 0.85

Calls 2

strrchrFunction · 0.85
isupperFunction · 0.85

Tested by

no test coverage detected