From 9d09d66a273f68fae7efb71504bf40c664b91983 Mon Sep 17 00:00:00 2001 From: nasr Date: Mon, 13 Apr 2026 15:33:05 +0200 Subject: feature(main): init feature(main): init feature(main): init feature(main): init --- .gitignore | 12 +++ Makefile | 27 +++++++ README.md | 3 + source/base/base.h | 81 ++++++++++++++++++++ source/base/base_arena.c | 138 +++++++++++++++++++++++++++++++++ source/base/base_arena.h | 26 +++++++ source/base/base_error.h | 47 ++++++++++++ source/base/base_hash.c | 12 +++ source/base/base_include.h | 34 +++++++++ source/base/base_io.h | 60 +++++++++++++++ source/base/base_mem.h | 26 +++++++ source/base/base_os.h | 67 ++++++++++++++++ source/base/base_stack.c | 187 +++++++++++++++++++++++++++++++++++++++++++++ source/base/base_stack.h | 22 ++++++ source/base/base_string.h | 53 +++++++++++++ source/base/base_test.h | 46 +++++++++++ source/base/bash_hash.h | 15 ++++ source/tb_db/tb_ml.c | 9 +++ 18 files changed, 865 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100755 source/base/base.h create mode 100755 source/base/base_arena.c create mode 100755 source/base/base_arena.h create mode 100644 source/base/base_error.h create mode 100644 source/base/base_hash.c create mode 100755 source/base/base_include.h create mode 100644 source/base/base_io.h create mode 100644 source/base/base_mem.h create mode 100644 source/base/base_os.h create mode 100755 source/base/base_stack.c create mode 100755 source/base/base_stack.h create mode 100644 source/base/base_string.h create mode 100644 source/base/base_test.h create mode 100644 source/base/bash_hash.h create mode 100644 source/tb_db/tb_ml.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..05a7b85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +idea/ +idea +idea/* +.idea +/build +/notes.txt +/test +/tags +/helper.sh +/tests +/tags +/.cache/clangd/index diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f5d478 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +BIN = build/tb_ml +SRC = source/tb_ml/tb_ml.c + +# CC = gcc +CC = clang + +COMPILER := $(shell $(CC) --version | grep -o "gcc\|clang" | head -1) + +# check for compile optimizations per compiler +ifeq ($(COMPILER),gcc) + CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -Werror -O0 +else ifeq ($(COMPILER),clang) + CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0 +else + CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0 +endif + +$(BIN): $(SRC) + mkdir -p build + $(CC) $(CFLAGS) $< -o $@ + +run: $(BIN) + $(BIN) + +.PHONY: clean +clean: + rm -rf build diff --git a/README.md b/README.md new file mode 100644 index 0000000..7297d23 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +TB_ML + +Attempt at writing a machine learning library in c using tb_db for the input data. diff --git a/source/base/base.h b/source/base/base.h new file mode 100755 index 0000000..b9e317a --- /dev/null +++ b/source/base/base.h @@ -0,0 +1,81 @@ +#ifndef BASE_H +#define BASE_H + +/* assert an expression and output the file and the line */ + +#define internal static +#define global_variable static +#define local_persist static + +#define ERR_OK 0 +#define ERR_IO 1 +#define ERR_PARSE 2 +#define ERR_PERM 3 +#define ERR_INVALID 4 + +#define KiB(n) (((u64)(n)) << 10) +#define MiB(n) (((u64)(n)) << 20) +#define GiB(n) (((u64)(n)) << 30) + +#define unused(x) (void)(x) + +#define PATH_MAX_LEN 128 +#define BUFF_SMALL 128 +#define BUFF_DEFAULT 256 +#define BUFF_LARGE 512 + +#define NIL 0 + +#define DEPRECATED __attribute__((__deprecated__)) + +#if defined(__arm__) || defined(__aarch64__) +#define breakpoint __asm__ volatile("brk #0"); +#define temp_breakpoint __asm__ volatile("udf #0"); +#elif defined(__i386__) || defined(__x86_64__) +#define breakpoint __asm__ volatile("int3"); +#endif + +#define MemCpy(dest, src, len) memcpy((dest), (src), (len)) +#define MemSet(dest, len) memset((dest), (0), (len)) + +#if COMPILER_MSVC || (COMPILER_CLANG && OS_WINDOWS) +#pragma section(".rdata$", read) +#define read_only __declspec(allocate(".rdata$")) +#elif (COMPILER_CLANG && OS_LINUX) +#define read_only __attribute__((section(".rodata"))) +#else +#define read_only +#endif + +typedef uint64_t u64; +typedef uint32_t u32; +typedef uint16_t u16; +typedef uint8_t u8; + +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; + +typedef float f32; +typedef double f64; + +typedef s32 b32; +typedef s16 b16; +typedef s8 b8; + +typedef uintptr_t umm; +typedef intptr_t smm; + +#define TRUE (1 == 1) +#define FALSE (1 != 1) + +#define RED "\x1b[31m" +#define GREEN "\x1b[32m" +#define RESET "\x1b[0m" +#define BLUE "\x1b[34m" +#define YELLOW "\x1b[33m" + +#define LEN(s) (sizeof(s) - 1) + +#endif diff --git a/source/base/base_arena.c b/source/base/base_arena.c new file mode 100755 index 0000000..7e9c44b --- /dev/null +++ b/source/base/base_arena.c @@ -0,0 +1,138 @@ +internal mem_arena * +arena_create(u64 capacity) +{ + mem_arena *arena = (mem_arena *)mmap( + /* kernel decides where to throw the arena */ + NULL, + capacity + sizeof(mem_arena), + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, + -1, + 0); + + if (arena == MAP_FAILED) + { + return NULL; + } + + arena->capacity = capacity; + arena->base_position = (u8 *)arena + sizeof(mem_arena); + arena->current_position = 0; + arena->previous_position = 0; + + return arena; +} + +internal void +arena_destroy(mem_arena *arena) +{ + if (!arena) + { + return; + } + munmap(arena, arena->capacity + sizeof(mem_arena)); +} +internal void * +arena_alloc(mem_arena *arena, u64 size, b32 zero) +{ + if (!arena) + { + return NULL; + } + u64 aligned = Align(arena->current_position, ARENA_ALIGN); + u64 new_pos = aligned + size; + if (new_pos > arena->capacity) + { + return NULL; + } + + void *out = arena->base_position + aligned; + + arena->previous_position = arena->current_position; + arena->current_position = aligned + size; + + if (zero) MemSet(out, size); + + return out; +} + +internal void +arena_pop(mem_arena *arena, u64 size) +{ + size = MIN(size, arena->current_position); + arena->current_position -= size; +} + +internal void +arena_pop_to(mem_arena *arena, u64 pos) +{ + u64 size = pos < arena->current_position ? arena->current_position - pos : 0; + arena_pop(arena, size); +} + +internal void +arena_clear(mem_arena *arena) +{ + arena->current_position = 0; +} + +internal mem_arena * +arena_resize_align(mem_arena *arena, void *old_memory, u64 new_size, u64 old_size, umm alignment) +{ + u8 *old_mem = (u8 *)old_memory; + + if (!is_pow(alignment)) + { + Align(arena->current_position, alignment); + } + + if (old_memory == NULL || old_size == 0) + { + return (mem_arena *)arena_alloc(arena, new_size, 0); + } + else if ((old_mem >= arena->base_position && old_mem < arena->base_position + arena->capacity)) + { + if ((arena->base_position + arena->previous_position) == old_memory) + { + arena->current_position = arena->previous_position + new_size; + if (new_size > old_size) + { + MemSet(&arena->current_position, new_size - old_size); + } + return (mem_arena *)old_memory; + } + else + { + void *new_memory = arena_alloc(arena, new_size, 0); + umm copy_size = old_size < new_size ? old_size : new_size; + memmove(new_memory, old_mem, copy_size); + } + } + else + { + verify(0); + } + return NULL; +} + +internal mem_arena * +arena_resize(mem_arena *arena, void *old_memory, u64 new_size, u64 old_size) +{ + return arena_resize_align(arena, old_memory, new_size, old_size, ARENA_ALIGN); +} + +internal temp_arena +temp_arena_begin(mem_arena *arena) +{ + temp_arena t; + t.arena = arena; + t.start_position = arena->current_position; + + return t; +} + +internal void +temp_arena_end(temp_arena temp) +{ + temp.arena->current_position = temp.start_position; +} diff --git a/source/base/base_arena.h b/source/base/base_arena.h new file mode 100755 index 0000000..2818ae4 --- /dev/null +++ b/source/base/base_arena.h @@ -0,0 +1,26 @@ +#ifndef BASE_ARENA_H +#define BASE_ARENA_H + +#define Align(pointer, alignment) align((u64)(pointer), (umm)(alignment)) +#define PushStruct(arena, type) (type *)arena_alloc((arena), sizeof(type), 0) +#define PushStructZero(arena, type) (type *)arena_alloc((arena), sizeof(type), 1) +#define PushArray(arena, type, len) (type *)arena_alloc((arena), sizeof(type) * (len), 0) +#define PushArrayZero(arena, type, len) (type *)arena_alloc((arena), sizeof(type) * (len), 1) + +typedef struct mem_arena mem_arena; +struct mem_arena +{ + u64 current_position; + u64 previous_position; + u64 capacity; + u8 *base_position; +}; + +typedef struct temp_arena temp_arena; +struct temp_arena +{ + mem_arena *arena; + u64 start_position; +}; + +#endif /* BASE_ARENA_H */ diff --git a/source/base/base_error.h b/source/base/base_error.h new file mode 100644 index 0000000..b2bb4c0 --- /dev/null +++ b/source/base/base_error.h @@ -0,0 +1,47 @@ +/* base library internal logging system */ +#ifndef BASE_ERROR_H +#define BASE_ERROR_H + +#define error_at(msg) \ + do \ + { \ + os_write(STDERR_FD, RED "[ERROR] ", LEN(RED "[ERROR] ")); \ + write_string(STDERR_FD, __FILE__); \ + write_string(STDERR_FD, ":"); \ + write_int(__LINE__); \ + write_string(STDERR_FD, " in "); \ + write_string(STDERR_FD, __func__); \ + write_string(STDERR_FD, ": "); \ + write_string(STDERR_FD, (msg)); \ + os_write(STDERR_FD, RESET "\n", LEN(RESET "\n")); \ + } while (0) + +#define fatal(msg) \ + do \ + { \ + error_at(msg); \ + _exit(1); \ + } while (0) + +#define assert_msg(expr, msg) \ + do \ + { \ + if (!(expr)) \ + { \ + fatal(msg); \ + } \ + } while (0) + +#define warn(msg) \ + do \ + { \ + os_write(STDERR_FD, YELLOW "[WARN] ", LEN(YELLOW "[WARN] ")); \ + write_string(STDERR_FD, __FILE__); \ + write_string(STDERR_FD, ":"); \ + write_int(__LINE__); \ + write_string(STDERR_FD, ": "); \ + write_string(STDERR_FD, (msg)); \ + os_write(STDERR_FD, RESET "\n", LEN(RESET "\n")); \ + } while (0) + +#endif /* BASE_ERROR_H */ diff --git a/source/base/base_hash.c b/source/base/base_hash.c new file mode 100644 index 0000000..1964441 --- /dev/null +++ b/source/base/base_hash.c @@ -0,0 +1,12 @@ + +internal u64 +generate_hash() +{ + + + +} + +internal hash_map +make_hash_map + diff --git a/source/base/base_include.h b/source/base/base_include.h new file mode 100755 index 0000000..c8eec41 --- /dev/null +++ b/source/base/base_include.h @@ -0,0 +1,34 @@ +#ifndef BASE_INCLUDE_H +#define BASE_INCLUDE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "base.h" +#include "base_mem.h" +#include "base_arena.h" +#include "base_stack.h" +#include "base_string.h" + +#include "base_io.h" +#include "base_error.h" +#include "base_test.h" + +#ifdef BASE_UNITY + +#include "base_arena.c" +#include "base_stack.c" + +#endif + +#include "base_os.h" + + +#endif diff --git a/source/base/base_io.h b/source/base/base_io.h new file mode 100644 index 0000000..ac55737 --- /dev/null +++ b/source/base/base_io.h @@ -0,0 +1,60 @@ +#ifndef BASE_IO_H +#define BASE_IO_H + +#define STDIN_FD 0 +#define STDOUT_FD 1 +#define STDERR_FD 2 + +internal s64 +os_write(s32 fd, void const *buf, u64 count) +{ + return syscall(SYS_write, fd, buf, count); +} + +internal s64 +os_read(s32 fd, void *buf, u64 count) +{ + return syscall(SYS_read, fd, buf, count); +} + +internal void +print_s8(string8 s) +{ + os_write(STDOUT_FILENO, s.data, s.size); +} + +internal void +print(const char *str) +{ + s32 len = 0; + while (str[len]) len++; + os_write(STDOUT_FILENO, str, len); + +} + +internal void +write_int(s32 num) +{ + + if (num < 0) + { + write(STDERR_FILENO, "-", 1); + num = -num; + } + if (num >= 10) + write_int(num / 10); + char digit = '0' + (num % 10); + + write(STDERR_FILENO, &digit, 1); +} + +internal void +write_string(s32 fd, const char *str) +{ + s32 len = 0; + while (str[len]) len++; + os_write(fd, str, len); +} + + +#endif /* BASE_IO_H */ diff --git a/source/base/base_mem.h b/source/base/base_mem.h new file mode 100644 index 0000000..2778fce --- /dev/null +++ b/source/base/base_mem.h @@ -0,0 +1,26 @@ +#ifndef BASE_MEM_H +#define BASE_MEM_H + +#define ARENA_ALIGN (2 * sizeof(void *)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + +internal inline b8 +is_pow(umm x) +{ + return (x & (x - 1)) == 0; +} + +internal inline u64 +align(u64 pointer, umm alignment) +{ + if ((alignment & (alignment - 1)) == 0) + { + return pointer; + } + + return (pointer + alignment - 1) & ~(alignment - 1); +} + + +#endif diff --git a/source/base/base_os.h b/source/base/base_os.h new file mode 100644 index 0000000..388f665 --- /dev/null +++ b/source/base/base_os.h @@ -0,0 +1,67 @@ +#ifndef BASE_OS_H +#define BASE_OS_H + +internal string8 +load_file(mem_arena *arena, const char *path) +{ + string8 result = {0}; + struct stat sbuf = {0}; + + s32 file = open(path, O_RDONLY); + if(file == -1) + { + warn("fialed to open file. path could be invalid"); + return (string8){0}; + } + + if(fstat(file, &sbuf) == -1) + { + warn("error: fstat failed"); + close(file); + return (string8){0}; + } + + + result = PushString(arena, sbuf.st_size); + + result.size = (u64)sbuf.st_size; + if(result.size != 0) + { + result.data = (u8 *)mmap(0, result.size, PROT_READ, MAP_PRIVATE, file, 0); + } + + close(file); + return result; +} + +internal string8 +write_file(const char *path, string8 data) +{ + + string8 result = {0}; + s32 file = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if(file == -1) + { + warn("failed to open file for writing. path could be invalid"); + return (string8){0}; + } + + u64 written = 0; + while(written < data.size) + { + s64 err = write(file, data.data + written, data.size - written); + if(err == -1) + { + warn("write syscall failed"); + close(file); + return (string8){0}; + } + written += err; + } + + close(file); + result = data; + return result; +} + +#endif /* BASE_OS_H */ diff --git a/source/base/base_stack.c b/source/base/base_stack.c new file mode 100755 index 0000000..9c1218a --- /dev/null +++ b/source/base/base_stack.c @@ -0,0 +1,187 @@ +internal mem_stack * +stack_create(u64 capacity) +{ + mem_stack *stack = (mem_stack *)mmap( + 0, + capacity + sizeof(mem_stack), + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, + -1, + 0); + + if (stack == MAP_FAILED) + { + return NULL; + } + + stack->capacity = capacity; + stack->base_position = (u8 *)stack + sizeof(mem_stack); + stack->current_offset = 0; + + return stack; +} + +internal u8 +calculate_padding(u64 pointer, u8 alignment, u64 header_size) +{ + u8 modulo, padding; + + if (!is_pow(alignment)) + { + return 0; + } + + modulo = pointer & (u8)(alignment - 1); + + padding = 0; + + if (0 == modulo) + { + padding = alignment - modulo; + } + + if (padding < header_size) + { + header_size -= padding; + + if ((header_size & (alignment - 1)) != 0) + { + padding += alignment * (1 + (header_size / alignment)); + } + else + { + padding += alignment * (header_size / alignment); + } + } + + return padding; +} + +internal mem_stack * +stack_push_align(mem_stack *stack, u64 size, u8 alignment) +{ + u8 padding = 0; + + if (!is_pow(alignment)) + { + return (0); + } + + if (alignment > 128) + { + alignment = 128; + } + + u64 current_address = (u64)stack->base_position + stack->current_offset; + padding = calculate_padding(current_address, alignment, sizeof(mem_stack_header)); + + if (stack->current_offset + padding + size > stack->capacity) + { + return 0; + } + + stack->current_offset += padding; + + u64 next_address = current_address + (u64)padding; + mem_stack_header *header = (mem_stack_header *)(next_address - sizeof(mem_stack_header)); + header->padding = padding; + + stack->current_offset += size; + + return MemSet((void *)next_address, size); +} +internal void * +stack_push(mem_stack *stack, u64 size) +{ + return stack_push_align(stack, size, ARENA_ALIGN); +} + +internal void +stack_pop(mem_stack *stack, void *pointer) +{ + if (pointer != NULL) + { + u64 start, end, current_address; + mem_stack_header *header; + u64 prev_offset; + + start = (u64)stack->base_position; + end = start + (u64)stack->capacity; + current_address = (u64)pointer; + + if (!(start <= current_address && current_address < end)) + { + if (0 && "Out of bounds memory address passed to stack allocator (free)") + { + return; + } + return; + } + + if (current_address >= start + (u64)stack->base_position) + { + return; + } + + header = (mem_stack_header *)(current_address - sizeof(mem_stack_header)); + prev_offset = (size_t)(current_address - (u64)header->padding - start); + stack->current_offset = prev_offset; + } +} + +internal mem_stack * +stack_resize_align(mem_stack *stack, void *pointer, u64 old_size, u64 new_size, u8 alignment) +{ + if (pointer == NULL) + { + return stack_push_align(stack, new_size, alignment); + } + else if (new_size == 0) + { + stack_pop(stack, pointer); + return NULL; + } + + u64 start, end, current_address; + u64 min_size = old_size < new_size ? old_size : new_size; + void *new_pointer; + + start = (u64)stack->base_position; + end = start + (u64)stack->capacity; + current_address = (u64)pointer; + if (!(start <= current_address && current_address < end)) + { + return NULL; + } + + if (current_address >= start + (u64)stack->current_offset) + { + return NULL; + } + + if (old_size == new_size) + { + return pointer; + } + + new_pointer = stack_push_align(stack, new_size, alignment); + memmove(new_pointer, pointer, min_size); + return new_pointer; +} + +internal void +stack_pop_all(mem_stack *stack) +{ + stack->current_offset = 0; +} + +internal void +stack_destroy(mem_stack *stack) +{ + if (!stack) + { + return; + } + + munmap(stack, stack->capacity + sizeof(mem_stack)); +} diff --git a/source/base/base_stack.h b/source/base/base_stack.h new file mode 100755 index 0000000..54d61d3 --- /dev/null +++ b/source/base/base_stack.h @@ -0,0 +1,22 @@ +#ifndef STACK_H +#define STACK_H + +typedef struct mem_stack_header mem_stack_header; +struct mem_stack_header +{ + u8 padding; + u8 previous_offset; +}; + + +typedef struct mem_stack mem_stack; +struct mem_stack +{ + mem_stack_header *header; + + u64 current_offset; + u64 capacity; + u8 *base_position; +}; + +#endif diff --git a/source/base/base_string.h b/source/base/base_string.h new file mode 100644 index 0000000..29ccf1e --- /dev/null +++ b/source/base/base_string.h @@ -0,0 +1,53 @@ +#ifndef BASE_STRING_H +#define BASE_STRING_H + +#define PushString(arena, count) (string8){ .data = (PushArrayZero(arena, u8, (count))), .size = (count) } +#define StringCast(data, size) (string8){(u8 *)(data), (u64)(size) } +#define StringPCast(data, size) (string8 *){(u8 *)(data), (u64)(size) } + +#define StringFmt "%.*s" +#define ULongFmt "%lu" +#define ULLongFmt "%llu" + +typedef struct string8 string8; +struct string8 +{ + u8 *data; + u64 size; +}; + +internal b8 +string8_cmp(string8 a, string8 b) +{ + if (a.size != b.size) return 0; + return (b8)(memcmp(a.data, b.data, a.size) == 0); +} + +internal u64 +string8_to_u64(u8 *buf, umm len) +{ + u64 value = 0; + for (umm i = 0; i < len; ++i) + { + u8 c = buf[i]; + if (c < '0' || c > '9') break; + value = value * 10 + (c - '0'); + } + return value; +} + +internal void +string8_append_char(string8 *buf, u8 c) +{ + buf->data[buf->size] = c; + buf->size += 1; +} + +read_only global_variable +string8 nil_string = +{ + .data = NULL, + .size = 0, +}; + +#endif /* BASE_STRING_H */ diff --git a/source/base/base_test.h b/source/base/base_test.h new file mode 100644 index 0000000..fd47abc --- /dev/null +++ b/source/base/base_test.h @@ -0,0 +1,46 @@ +// TODO(nasr): metaprogram that takes an expected output and generates a test for that specified +// function +/* base library testing framework */ +#ifndef BASE_TEST_H +#define BASE_TEST_H + +// helper macro +#define show \ + do \ + { \ + write(STDOUT_FILENO, __FILE__, sizeof(__FILE__) - 1); \ + write(STDOUT_FILENO, ":", 1); \ + write(STDOUT_FILENO, __func__, sizeof(__func__) - 1); \ + write(STDOUT_FILENO, ":", 1); \ + write_int(__LINE__); \ + write(STDOUT_FILENO, "\n", 1); \ + } while (0) + +#define test(expr) \ + { \ + if ((expr) != 0) \ + { \ + write(STDERR_FILENO, "[FAILED] ", LEN("[FAILED] ")); \ + show; \ + _exit(1); \ + } \ + } + +#define verify(expr) \ + { \ + if ((expr) != 0) \ + { \ + write(STDERR_FILENO, RED "[ERROR] ", LEN(RED "[ERROR] ")); \ + show; \ + write(STDERR_FILENO, RESET, LEN(RESET)); \ + _exit(1); \ + } \ + else \ + { \ + write(STDERR_FILENO, GREEN "[SUCCESS] ", LEN(GREEN "[SUCCESS] ")); \ + show; \ + write(STDERR_FILENO, RESET, LEN(RESET)); \ + } \ + } + +#endif /* BASE_TEST_H */ diff --git a/source/base/bash_hash.h b/source/base/bash_hash.h new file mode 100644 index 0000000..2c286a2 --- /dev/null +++ b/source/base/bash_hash.h @@ -0,0 +1,15 @@ +##ifndef HEADER_H +#define HEADER_H + +typedef struct hash_map hash_map; +typedef struct hash hash; + + +struct hash_map +{ + + +}; + + +#endif /* HEADER_H */ diff --git a/source/tb_db/tb_ml.c b/source/tb_db/tb_ml.c new file mode 100644 index 0000000..a86303d --- /dev/null +++ b/source/tb_db/tb_ml.c @@ -0,0 +1,9 @@ +#define BASE_UNITY +#include "../base/base_include.h" + +int main(int c, char **v) +{ + + + return 0; +} -- cgit v1.3