X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=util.h;h=a571ec84fb0e6e5511e27223b7ef4b3b6c938f86;hb=cd81270f2b1723e0798f4d6dcaee134f0b4aca7f;hp=2b0886cc0c98e3d4902e519c2554808417e6a38e;hpb=a0f731f21d6aa26dbf7246039a1c66c2ade0533f;p=polyglot.git diff --git a/util.h b/util.h index 2b0886c..a571ec8 100644 --- a/util.h +++ b/util.h @@ -7,6 +7,9 @@ // includes #include +#include +#include +#include // defines @@ -67,6 +70,10 @@ #define FormatBufferSize 4096 +#ifdef _MSC_VER +#define vsnprintf _vsnprintf +#endif + #define CONSTRUCT_ARG_STRING(format,buf) \ { \ va_list arg_list; \ @@ -77,13 +84,15 @@ format, \ arg_list); \ va_end(arg_list); \ - buf[sizeof(buf)]='\0'; \ + buf[sizeof(buf)-1]='\0'; \ if(written>=sizeof(buf) || written<0){ \ my_fatal("write_buffer overflow: file \"%s\", line %d\n", \ __FILE__,__LINE__); \ } \ } \ + + // types typedef signed char sint8; @@ -135,6 +144,9 @@ extern void my_log (const char format[], ...); extern void my_fatal (const char format[], ...); extern bool my_file_read_line (FILE * file, char string[], int size); +extern void my_path_join (char *join_path, const char *path, const char *file); + +extern int my_mkdir (const char *path); extern bool my_string_empty (const char string[]); extern bool my_string_whitespace (const char string[]);