mirror of
https://github.com/rzzzwilson/pymlac.git
synced 2025-06-10 09:32:41 +00:00
Initial commit
This commit is contained in:
33
vimlac/log.c
Normal file
33
vimlac/log.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Log routines for the imlac simulator.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
char *LogFile = "vimlac.log";
|
||||
char *LogPrefix = "";
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
Description : printf()-style log routine.
|
||||
Parameters : like printf()
|
||||
Returns :
|
||||
Comments :
|
||||
******************************************************************************/
|
||||
void
|
||||
vlog(char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buff[1024];
|
||||
FILE *fd;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buff, fmt, ap);
|
||||
fd = fopen(LogFile, "a");
|
||||
fprintf(fd, "%s: %s\n", LogPrefix, buff);
|
||||
fclose(fd);
|
||||
va_end(ap);
|
||||
}
|
||||
11
vimlac/log.h
Normal file
11
vimlac/log.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Log routines for the imlac simulation.
|
||||
*/
|
||||
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
void vlog(char *fmt, ...);
|
||||
extern char *LogPrefix;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user