This file contains 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 <stdlib.h> | |
#include "thrd_pool.h" | |
typedef struct thrd_pool_job { | |
ThrdPoolFn func; | |
void *udata; | |
struct thrd_pool_job *next; | |
} ThrdPoolJob; |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
typedef void (*Func) (void *udata); | |
typedef struct node { | |
Func func; | |
void *udata; | |
struct node *next; |
This file contains 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 <stdarg.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "str.h" | |
static int |
This file contains 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
/* | |
* fixed-size string hashmap (FNV-1) | |
*/ | |
#ifndef __CSTRMAP_H__ | |
#define __CSTRMAP_H__ | |
#include <assert.h> | |
#include <errno.h> | |
#include <stdint.h> |
This file contains 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 mem = std.mem; | |
const debug = std.debug; | |
const assert = debug.assert; | |
const dprint = debug.print; | |
pub fn MemPool(comptime T: type) type { | |
return struct { | |
allocator: mem.Allocator, |
This file contains 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 <stdarg.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <time.h> | |
struct log { | |
pthread_mutex_t mutex; |
This file contains 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
#ifndef __FSCONF_H__ | |
#define __FSCONF_H__ | |
/* A f*cking simple, error prone, and slow key-value-based file configuration | |
* | |
* File name: file.fsconf | |
* ------------------------ | |
* key0(value)\n | |
* key1(value)\n |
This file contains 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
#!/bin/sh | |
set -e | |
cc -g -Wall -Wextra moetr.c $(pkg-config --cflags gtk4 libsoup-3.0 json-glib-1.0)\ | |
$(pkg-config --libs gtk4 libsoup-3.0 json-glib-1.0) -o moetr |
This file contains 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 |
This file contains 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 { |
NewerOlder