2 * ES1370 Haiku Driver for ES1370 audio
4 * Copyright 2002-2007, Haiku, Inc.
5 * Distributed under the terms of the MIT License.
8 * Marcus Overhagen, marcus@overhagen.de
9 * Jerome Duval, jerome.duval@free.fr
13 #include <KernelExport.h>
20 #include <directories.h>
28 static const char *logfile
= kSystemLogDirectory
"/es1370.log";
29 static sem_id loglock
;
33 void debug_printf(const char *text
,...);
34 void log_printf(const char *text
,...);
35 void log_create(void);
38 void debug_printf(const char *text
,...)
44 vsprintf(buf
,text
,ap
);
47 dprintf(DRIVER_NAME
": %s",buf
);
54 int fd
= open(logfile
, O_WRONLY
| O_CREAT
| O_TRUNC
, 0666);
55 const char *text
= DRIVER_NAME
", " VERSION
"\n";
56 loglock
= create_sem(1,"logfile sem");
57 write(fd
,text
,strlen(text
));
63 void log_printf(const char *text
,...)
71 vsprintf(buf
,text
,ap
);
74 dprintf(DRIVER_NAME
": %s",buf
);
77 fd
= open(logfile
, O_WRONLY
| O_APPEND
);
78 write(fd
,buf
,strlen(buf
));