X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Fplbasename.h;fp=src%2Fplbasename.h;h=28786a11c1266d8bc9c5c3c516febce5c6330df0;hp=0000000000000000000000000000000000000000;hb=591bd42a2c2ef80a7e1753e00001ea0633978660;hpb=480d14d757f48039c49aadf5571d7086c9c91dfb diff --git a/src/plbasename.h b/src/plbasename.h new file mode 100644 index 0000000..28786a1 --- /dev/null +++ b/src/plbasename.h @@ -0,0 +1,45 @@ +#ifdef WIN32 +/* + * + * Cross-platform basename/dirname + * + * Copyright 2005 Syd Logan, All Rights Reserved + * + * This code is distributed without warranty. You are free to use this + * code for any purpose, however, if this code is republished or + * redistributed in its original form, as hardcopy or electronically, + * then you must include this copyright notice along with the code. + * + */ + +// minor changes 2008 by Stefan Ludewig stefan.ludewig@exitgames.com for WIN32 version RRDtool + +#if !defined(__PL_BASENAME_H__) +#define __PL_BASENAME_H__ + +/* + path dirname basename + "/usr/lib" "/usr" "lib" + "/usr/" "/" "usr" + "usr" "." "usr" + "/" "/" "/" + "." "." "." + ".." "." ".." +*/ + +#if defined(__cplusplus) +extern "C" { +#endif + +const char *PL_basename(const char *name); +const char *PL_dirname(const char *name); + +#define basename(name) ((char*)PL_basename(name)) +#define dirname(name) ((char*)PL_dirname(name)) + +#if defined(__cplusplus) +} +#endif + +#endif +#endif // WIN32