*/
#include <stdio.h>
+#include <unistd.h>
#include <sys/time.h>
#include "putty.h"
return tv.tv_sec * 1000000 + tv.tv_usec;
}
-Filename filename_from_str(char *str)
+Filename filename_from_str(const char *str)
{
Filename ret;
strncpy(ret.path, str, sizeof(ret.path));
return ret;
}
-char *filename_to_str(Filename fn)
+const char *filename_to_str(const Filename *fn)
{
- return fn.path;
+ return fn->path;
}
int filename_equal(Filename f1, Filename f2)
{
return !*fn.path;
}
+
+#ifdef DEBUG
+static FILE *debug_fp = NULL;
+
+void dputs(char *buf)
+{
+ if (!debug_fp) {
+ debug_fp = fopen("debug.log", "w");
+ }
+
+ write(1, buf, strlen(buf));
+
+ fputs(buf, debug_fp);
+ fflush(debug_fp);
+}
+#endif