diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2020-04-21 00:54:38 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2020-04-21 00:54:38 +0200 |
| commit | 20f8542d2730654ba7140dc59240c8d477476e77 (patch) | |
| tree | 2c48120a8882e70142fea964906e50f95d08d171 /src/platform/unix.c | |
| parent | 830ee22b85f1e91c547354435af2b6a79578f7ce (diff) | |
| download | cc4group-20f8542d2730654ba7140dc59240c8d477476e77.tar.gz cc4group-20f8542d2730654ba7140dc59240c8d477476e77.zip | |
Add cc4group.getName and cc4group.getFullName
Diffstat (limited to 'src/platform/unix.c')
| -rw-r--r-- | src/platform/unix.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 <stdlib.h> +#include <string.h> #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 |
