00001
00023 #ifndef _LIBCOMPREX_UTILS_H_
00024 #define _LIBCOMPREX_UTILS_H_
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #include <comprex.h>
00031
00032
00033
00039 #ifdef DEBUG_REF
00040 # define CX_LINK(ptr) \
00041 printf("[%p] inc refcount: %d -> %d\n", (ptr), (ptr)->refCount, \
00042 (ptr)->refCount + 1); \
00043 ++(ptr)->refCount
00044 #else
00045 # define CX_LINK(ptr) ++(ptr)->refCount
00046 #endif
00047
00057 #ifdef DEBUG_REF
00058 # define CX_UNLINK(ptr) \
00059 printf("[%p] dec refcount: %d -> %d\n", (ptr), (ptr)->refCount,\
00060 (ptr)->refCount - 1); \
00061 --(ptr)->refCount
00062 #else
00063 # define CX_UNLINK(ptr) --(ptr)->refCount
00064 #endif
00065
00077 char *cxGetBaseName(const char *path);
00078
00090 char *cxGetBasePath(const char *path);
00091
00102 char *cxFixPath(const char *path);
00103
00118 char *cxGetFullFilePath(const char *filename);
00119
00120 #ifdef __cplusplus
00121 }
00122 #endif
00123
00124 #endif
00125