fix off by 1 error
[rrdtool.git] / src / plbasename.h
1 #ifdef WIN32
2 /*
3  *
4  * Cross-platform basename/dirname
5  *
6  * Copyright 2005 Syd Logan, All Rights Reserved
7  *
8  * This code is distributed without warranty. You are free to use this
9  * code for any purpose, however, if this code is republished or
10  * redistributed in its original form, as hardcopy or electronically,
11  * then you must include this copyright notice along with the code.
12  *
13  */
14
15 // minor changes 2008 by Stefan Ludewig stefan.ludewig@exitgames.com for WIN32 version RRDtool
16
17 #if !defined(__PL_BASENAME_H__)
18 #define __PL_BASENAME_H__
19
20 /*
21        path           dirname        basename
22        "/usr/lib"     "/usr"         "lib"
23        "/usr/"        "/"            "usr"
24        "usr"          "."            "usr"
25        "/"            "/"            "/"
26        "."            "."            "."
27        ".."           "."            ".."
28 */
29
30 #if defined(__cplusplus)
31 extern "C" {
32 #endif
33
34 const char *PL_basename(const char *name);
35 const char *PL_dirname(const char *name);
36
37 #define basename(name) ((char*)PL_basename(name))
38 #define dirname(name) ((char*)PL_dirname(name))
39
40 #if defined(__cplusplus)
41 }
42 #endif
43
44 #endif
45 #endif // WIN32