MCPcopy Create free account
hub / github.com/MariaDB/server / ExtractFromPath

Function ExtractFromPath

storage/connect/plgdbutl.cpp:407–426  ·  view source on GitHub ↗

/ Extract from a path name the required component. */ This function assumes there is enough space in the buffer. */ /

Source from the content-addressed store, hash-verified

405/* This function assumes there is enough space in the buffer. */
406/***********************************************************************/
407char *ExtractFromPath(PGLOBAL g, char *pBuff, char *FileName, OPVAL op)
408 {
409 char *drive = NULL, *direc = NULL, *fname = NULL, *ftype = NULL;
410
411 switch (op) { // Determine which part to extract
412#if defined(_WIN32)
413 case OP_FDISK: drive = pBuff; break;
414#endif // !UNIX
415 case OP_FPATH: direc = pBuff; break;
416 case OP_FNAME: fname = pBuff; break;
417 case OP_FTYPE: ftype = pBuff; break;
418 default:
419 snprintf(g->Message, sizeof(g->Message), MSG(INVALID_OPER), op, "ExtractFromPath");
420 return NULL;
421 } // endswitch op
422
423 // Now do the extraction
424 _splitpath(FileName, drive, direc, fname, ftype);
425 return pBuff;
426 } // end of PlgExtractFromPath
427
428
429#ifdef NOT_USED

Callers 1

ReadColumnMethod · 0.85

Calls 1

_splitpathFunction · 0.85

Tested by

no test coverage detected