From 20f8542d2730654ba7140dc59240c8d477476e77 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 21 Apr 2020 00:54:38 +0200 Subject: Add cc4group.getName and cc4group.getFullName --- src/platform/unix.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/platform/unix.c') diff --git a/src/platform/unix.c b/src/platform/unix.c index 01161fc..4e534a6 100644 --- a/src/platform/unix.c +++ b/src/platform/unix.c @@ -1,3 +1,11 @@ +#ifndef _XOPEN_SOURCE + #define _XOPEN_SOURCE 700 +#endif +#ifndef _GNU_SOURCE + #define _GNU_SOURCE +#endif +#include +#include #include "platform.h" void *cc4group_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) @@ -14,3 +22,8 @@ char* cc4group_absolutePath(const char* path) { return realpath(path, NULL); } + +char* cc4group_basename(const char* path) +{ + return strdup(basename(path)); +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf