75 lines
1.4 KiB
C
75 lines
1.4 KiB
C
/*
|
|
* NewOswan
|
|
* log.c:
|
|
* Based on the original Oswan-unix
|
|
* Copyright (c) 2014-2021 986-Studio. All rights reserved.
|
|
*
|
|
*/
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "log.h"
|
|
|
|
FILE *log_stream = NULL;
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
int log_init(char *path)
|
|
{
|
|
//log_stream=fopen(path,"wrt");
|
|
log_stream = stdout;
|
|
|
|
if (log_stream == NULL)
|
|
{
|
|
return (0);
|
|
}
|
|
|
|
return (1);
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
FILE *log_get(void)
|
|
{
|
|
return (log_stream);
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
void log_done(void)
|
|
{
|
|
fclose(log_stream);
|
|
}
|