This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-2.0-only | |
/* ExMail (WIP) | |
* An --ex-- extreme mail server without including any external library | |
* (for linux x86_64 only). | |
* | |
* This simple mail-server aims to implements some of these RFCs: | |
* SMTP: https://datatracker.ietf.org/doc/html/rfc2821 | |
* POP3: https://datatracker.ietf.org/doc/html/rfc1939 | |
* | |
* ---------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
* Slots | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include "mempool.h" | |
int | |
mempool_init(MemPool *m, size_t nmemb, size_t size) | |
{ | |
m->nmemb = nmemb; | |
m->head = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <threads.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
typedef struct _Node { | |
struct _Node *prev; | |
struct _Node *next; | |
} Node; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import struct | |
""" | |
c-struct | |
typedef struct { | |
uint64_t fsize; // offset: 0 | |
uint8_t fname_len; // offset: 8 | |
char fname[255]; // offset: 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
I F*CKING HATE THE EXCEPTION!!! | |
""" | |
import os | |
import socket | |
import signal | |
import ctypes | |
import struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const assert = std.debug.assert; | |
const fmt = std.fmt; | |
const heap = std.heap; | |
const mem = std.mem; | |
const log = std.log; | |
const os = std.os; | |
const io = std.io; | |
const net = std.net; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const fmt = std.fmt; | |
const io = std.io; | |
const mem = std.mem; | |
const net = std.net; | |
const os = std.os; | |
const dprint = std.debug.print; | |
// caller owns the returned memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const debug = std.debug; | |
const mem = std.mem; | |
const net = std.net; | |
const time = std.time; | |
const dprint = debug.print; | |
const assert = debug.assert; | |
pub fn Lru(comptime T: type, comptime key_size: u16) type { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the |