fixed some style issues.
This commit is contained in:
18
makefile
Normal file
18
makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
.POSIX:
|
||||
|
||||
# Compiler and archiver definitions
|
||||
CC = cc
|
||||
AR = ar
|
||||
CFLAGS = -O2 -I./source_code
|
||||
|
||||
# Targets
|
||||
all: liblog.a
|
||||
|
||||
source_code/log.o: source_code/log.c source_code/log.h
|
||||
$(CC) $(CFLAGS) -c source_code/log.c -o source_code/log.o
|
||||
|
||||
liblog.a: source_code/log.o
|
||||
$(AR) -rc liblog.a source_code/log.o
|
||||
|
||||
clean:
|
||||
rm -f source_code/log.o liblog.a
|
||||
@@ -22,6 +22,7 @@
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Original version can be found at: https://github.com/rxi/log.c
|
||||
*
|
||||
* Modified work Copyright (c) 2026 Emilia Marigold (AGPLv3)
|
||||
*
|
||||
@@ -33,12 +34,13 @@
|
||||
* See the LICENSE file for the full AGPLv3 terms and conditions.
|
||||
***/
|
||||
|
||||
#include "new_log.h"
|
||||
#include "log.h"
|
||||
|
||||
#define MAX_CALLBACKS 32
|
||||
|
||||
typedef
|
||||
struct callback_struct
|
||||
struct
|
||||
callback_struct
|
||||
{
|
||||
log_function function;
|
||||
void *user_data;
|
||||
@@ -46,7 +48,8 @@ struct callback_struct
|
||||
}
|
||||
callback_type;
|
||||
|
||||
static struct static_log_data_struct
|
||||
static struct
|
||||
static_log_data_struct
|
||||
{
|
||||
void *user_data;
|
||||
lock_function lock;
|
||||
@@ -62,7 +65,7 @@ level_strings[] =
|
||||
"TRACE",
|
||||
"DEBUG",
|
||||
"INFO",
|
||||
"WARNING",
|
||||
"WARN",
|
||||
"ERROR",
|
||||
"FATAL"
|
||||
};
|
||||
@@ -84,6 +87,7 @@ static void
|
||||
stdout_callback(log_event_type *event)
|
||||
{
|
||||
char buffer[16];
|
||||
|
||||
buffer[strftime(buffer,
|
||||
sizeof(buffer),
|
||||
"%H:%M:%S",
|
||||
@@ -16,10 +16,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#define LOG_VERSION "r:2.26.180.1"
|
||||
#define LOG_VERSION "2.26.180a"
|
||||
|
||||
typedef
|
||||
struct log_event_struct
|
||||
struct
|
||||
log_event_struct
|
||||
{
|
||||
va_list argument_pointer;
|
||||
const char *format;
|
||||
BIN
source_code/log.o
Normal file
BIN
source_code/log.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user