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
-- struct.lua | |
-- Tiny binary writer and reader in Lua. | |
-- version: 1.3 | |
-- author: Martin 'Halt' Cohen | |
-- url: https://twitter.com/martin_cohen | |
-- license: MIT | |
-- changes: at the end of this file | |
-- dependencies: | |
-- http://bitop.luajit.org |
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
local function read_uint16_le(bytes, offset) | |
local a, b = bytes:byte(offset + 1, offset + 2) | |
return a + b * 0x100 | |
end | |
local function read_uint16_be(bytes, offset) | |
local a, b = bytes:byte(offset + 1, offset + 2) | |
return a * 0x100 + b | |
end |
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 <co-rune.h> | |
void | |
corune_data_test_grapheme_break_property() | |
{ | |
COASSERT(corune_get_grapheme_break_property(0x0e1000) == 0); | |
for (int i = 0x000600; i <= 0x000605; ++i) { | |
COASSERT(corune_get_grapheme_break_property(i) == 12); | |
} | |
for (int i = 0x0006dd; i <= 0x0006dd; ++i) { |
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
#pragma once | |
// 1. co-rune-grapheme-break + state machine | |
// 2. co-rune-general-category | |
// 3. co-rune-case-mapping | |
#define CO_RUNE_DATA_LZ_SIZE_UNPACKED 15120 | |
uint8_t CO_RUNE_DATA_LZ[6526] = | |
{ |
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
/***************************************************************************** | |
* directsound.c: DirectSound audio output plugin for VLC | |
***************************************************************************** | |
* Copyright (C) 2001-2009 VLC authors and VideoLAN | |
* $Id: 2f5b9f46d3739e513d875b950eaf4d2df641f9dc $ | |
* | |
* Authors: Gildas Bazin <[email protected]> | |
* | |
* This program is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU Lesser General Public License as published by |
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
// Reformatted version from here: | |
// https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4422&lngWId=3 | |
#include <windows.h> | |
#include <mmsystem.h> | |
#include <stdio.h> | |
/* | |
* some good values for block size and count | |
*/ | |
#define BLOCK_SIZE 8192 |
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
typedef struct UITextEditor | |
{ | |
int text_capacity; | |
int text_length; | |
char *text; | |
int cursor; | |
} | |
UITextEditor; | |
void |
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 PCX_H | |
#define PCX_H | |
#include <assert.h> | |
#include "common.h" | |
typedef struct PCXHeader | |
{ | |
u8 id; |
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
struct ScratchMemory { | |
void *base; | |
memi capacity; | |
}; | |
void child(ScratchMemory *memory,...) { | |
// do things to memory | |
} | |
void parent(ScratchMemory *memory,...) { |