4 #include <windows.h> /* MB_OK */
7 static char debug_git_file
[MAX_PATH
];
8 static FILE * debug_git_fd
= NULL
;
10 void debug_git_set_file(const char * filename
)
18 strncpy(debug_git_file
, filename
, MAX_PATH
);
19 debug_git_file
[MAX_PATH
-1] = '\0';
21 debug_git_fd
= fopen(debug_git_file
, "a+");
24 void debug_git(char * format
, ...)
28 debug_git_set_file(DEFAULT_DEBUG_GIT_FILE
);
31 /* Check again in case the above debug_git_set_file failed. */
38 va_start(params
, format
);
39 length
= vsnprintf(buffer
, sizeof(buffer
), format
, params
);
41 fwrite(buffer
, sizeof(char), length
, debug_git_fd
);
42 fputc('\n', debug_git_fd
);
47 void debug_git_mbox(char *format
, ...)
52 va_start(params
, format
);
53 vsnprintf(buffer
, sizeof(buffer
), format
, params
);
55 MessageBox(0, buffer
, "Hello", MB_OK
|MB_ICONEXCLAMATION
);