Fix plugin file the structure and format
Signed-off-by: qintl <qintl@yytek.com>pull/37/head
parent
a9a7b9123e
commit
b3c38630e9
@ -1,34 +0,0 @@
|
|||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include "elog_file.h"
|
|
||||||
|
|
||||||
/* initialize OK flag */
|
|
||||||
static bool init_ok = false;
|
|
||||||
|
|
||||||
ElogErrCode elog_file_init(void)
|
|
||||||
{
|
|
||||||
ElogErrCode result = ELOG_NO_ERR;
|
|
||||||
|
|
||||||
elog_file_port_init();
|
|
||||||
|
|
||||||
init_ok = true;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void elog_file_write(const char *log, size_t size)
|
|
||||||
{
|
|
||||||
ELOG_ASSERT(init_ok);
|
|
||||||
ELOG_ASSERT(log);
|
|
||||||
|
|
||||||
elog_file_port_lock();
|
|
||||||
elog_file_port_write(log, size);
|
|
||||||
elog_file_port_unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
void elog_file_deinit(void)
|
|
||||||
{
|
|
||||||
elog_file_port_deinit();
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
#ifndef __ELOG_FILE__H__
|
|
||||||
#define __ELOG_FILE__H__
|
|
||||||
|
|
||||||
#include <elog.h>
|
|
||||||
|
|
||||||
/* EasyLogger file log plugin's software version number */
|
|
||||||
#define ELOG_FILE_SW_VERSION "V1.0.0"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
/* elog_file.c */
|
|
||||||
ElogErrCode elog_file_init(void);
|
|
||||||
void elog_file_set_name(const char *name);
|
|
||||||
void elog_file_get_name(const char *name);
|
|
||||||
void elog_file_write(const char *log, size_t size);
|
|
||||||
void elog_file_deinit(void);
|
|
||||||
|
|
||||||
/* elog_file_port.c */
|
|
||||||
ElogErrCode elog_file_port_init(void);
|
|
||||||
void elog_file_port_write(const char *log, size_t size);
|
|
||||||
void elog_file_port_lock(void);
|
|
||||||
void elog_file_port_unlock(void);
|
|
||||||
void elog_file_port_deinit(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Loading…
Reference in New Issue