为提高性能,改用c替换原本的flask
This commit is contained in:
27
c/tools/log/log.h
Normal file
27
c/tools/log/log.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef LOG
|
||||
#define LOG
|
||||
|
||||
#include <semaphore.h>
|
||||
|
||||
#define MAX_LOG 256
|
||||
|
||||
typedef struct logs
|
||||
{
|
||||
char log[1024];
|
||||
struct logs *next;
|
||||
}logs;
|
||||
|
||||
typedef struct log_manager
|
||||
{
|
||||
int (*in_log)(logs *,struct log_manager*);
|
||||
logs* (*out_log)(struct log_manager*);
|
||||
void *(*clear_log)(void*);
|
||||
sem_t log_sem;
|
||||
logs *log;
|
||||
logs *rear;
|
||||
int count;
|
||||
}log_manager;
|
||||
|
||||
int init_loger(log_manager *self);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user