X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/f7f273099c8798f70611550bfc06b417e5c28ac7..0ec4b50ff9d82409f851ea04b6587c42f97f1bdb:/unix/uxmisc.c diff --git a/unix/uxmisc.c b/unix/uxmisc.c index 76401ea1..8239158e 100644 --- a/unix/uxmisc.c +++ b/unix/uxmisc.c @@ -5,6 +5,8 @@ #include #include +#include "putty.h" + unsigned long getticks(void) { struct timeval tv; @@ -15,3 +17,26 @@ unsigned long getticks(void) */ return tv.tv_sec * 1000000 + tv.tv_usec; } + +Filename filename_from_str(const char *str) +{ + Filename ret; + strncpy(ret.path, str, sizeof(ret.path)); + ret.path[sizeof(ret.path)-1] = '\0'; + return ret; +} + +const char *filename_to_str(const Filename *fn) +{ + return fn->path; +} + +int filename_equal(Filename f1, Filename f2) +{ + return !strcmp(f1.path, f2.path); +} + +int filename_is_null(Filename fn) +{ + return !*fn.path; +}