version 1.4.46b
[polyglot.git] / util.h
diff --git a/util.h b/util.h
index 2b0886c..4eee73a 100644 (file)
--- a/util.h
+++ b/util.h
@@ -7,6 +7,9 @@
 // includes\r
 \r
 #include <stdio.h>\r
+#include <sys/types.h>\r
+#include <sys/timeb.h>\r
+#include <sys/stat.h>\r
 \r
 // defines\r
 \r
 \r
 #define FormatBufferSize 4096\r
 \r
+#ifdef _MSC_VER\r
+#define vsnprintf _vsnprintf\r
+#endif\r
+\r
 #define CONSTRUCT_ARG_STRING(format,buf)                                 \\r
     {                                                                    \\r
         va_list arg_list;                                                \\r
                           format,                                        \\r
                           arg_list);                                     \\r
         va_end(arg_list);                                                \\r
-        buf[sizeof(buf)]='\0';                                           \\r
+        buf[sizeof(buf)-1]='\0';                                         \\r
         if(written>=sizeof(buf) || written<0){                           \\r
            my_fatal("write_buffer overflow: file \"%s\", line %d\n",     \\r
                    __FILE__,__LINE__);                                   \\r
         }                                                                \\r
     }                                                                    \\r
 \r
+\r
+\r
 // types\r
 \r
 typedef signed char sint8;\r
@@ -135,11 +144,20 @@ extern void   my_log                (const char format[], ...);
 extern void   my_fatal              (const char format[], ...);\r
 \r
 extern bool   my_file_read_line     (FILE * file, char string[], int size);\r
+extern void   my_path_join          (char *join_path, const char *path, const char *file);\r
+\r
+extern int    my_mkdir              (const char *path);\r
 \r
 extern bool   my_string_empty       (const char string[]);\r
 extern bool   my_string_whitespace  (const char string[]);\r
 extern bool   my_string_equal       (const char string_1[], const char string_2[]);\r
 extern bool   my_string_case_equal  (const char string_1[], const char string_2[]);\r
+extern const char* my_string_case_contains(const char haystack[], \r
+                                          const char needle[]);\r
+\r
+\r
+extern bool   my_string_to_lower    (char dst[], const char src[]);\r
+\r
 extern char * my_strdup             (const char string[]);\r
 \r
 extern void   my_string_clear       (const char * * variable);\r