ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/Daodan_Utility.c
Revision: 269
Committed: Tue Mar 17 08:53:33 2009 UTC (16 years, 6 months ago) by rossy
Content type: text/x-csrc
File size: 527 byte(s)
Log Message:
Daodan WIP

File Contents

# Content
1 #include <stdlib.h>
2 #include <stdarg.h>
3 #include "oni_stdio.h"
4
5 #include "Daodan_Utility.h"
6 #include "BFW_Utility.h"
7
8 void __cdecl DDrStartupMessage(const char* fmt, ...)
9 {
10 va_list ap;
11 va_start(ap, fmt);
12 char* buffer = malloc(vsnprintf(NULL, 0, fmt, ap) + 1);
13
14 vsprintf(buffer, fmt, ap);
15 va_end(ap);
16
17 if (!ONgFileStartup)
18 if (!(ONgFileStartup = oni_fopen("startup.txt", "w")))
19 return;
20
21 oni_fprintf(ONgFileStartup, "%s\n", buffer);
22 free(buffer);
23
24 oni_fflush(ONgFileStartup);
25 return;
26 }