Skip to content

Instantly share code, notes, and snippets.

@ytomino
ytomino / c-bsm-audit.ads
Last active November 4, 2020 20:39
i686-pc-freebsd9
-- This file is translated by "headmaster" version 0.30-18d0286 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.sys.types;
package C.bsm.audit is
pragma Preelaborate;
subtype au_id_t is sys.types.uid_t;
subtype au_id_t_ptr is sys.types.uid_t_ptr;
@ytomino
ytomino / c-bsm-audit.ads
Last active November 4, 2020 20:38
x86_64-pc-freebsd9
-- This file is translated by "headmaster" version 0.30-18d0286 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.sys.types;
package C.bsm.audit is
pragma Preelaborate;
subtype au_id_t is sys.types.uid_t;
subtype au_id_t_ptr is sys.types.uid_t_ptr;
@ytomino
ytomino / c-bsm-audit.ads
Last active November 4, 2020 20:36
i686-pc-freebsd8
-- This file is translated by "headmaster" version 0.30-886eb78 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.sys.types;
package C.bsm.audit is
pragma Preelaborate;
subtype au_id_t is sys.types.uid_t;
subtype au_id_t_ptr is sys.types.uid_t_ptr;
@ytomino
ytomino / c-bsm-audit.ads
Last active November 4, 2020 20:35
x86_64-pc-freebsd8
-- This file is translated by "headmaster" version 0.30-886eb78 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.sys.types;
package C.bsm.audit is
pragma Preelaborate;
subtype au_id_t is sys.types.uid_t;
subtype au_id_t_ptr is sys.types.uid_t_ptr;
@ytomino
ytomino / c-alloca.ads
Last active November 4, 2020 19:27
**experimental** x32 ABI on x86_64-pc-linux-gnu
-- This file is translated by "headmaster" version 0.30-886eb78 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.stddef;
package C.alloca is
pragma Preelaborate;
function alloca (size : stddef.size_t) return void_ptr;
pragma Import (C, alloca, "alloca");
@ytomino
ytomino / c-alloca.ads
Last active November 4, 2020 19:27
i686-pc-linux-gnu
-- This file is translated by "headmaster" version 0.30-886eb78 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.stddef;
package C.alloca is
pragma Preelaborate;
function alloca (size : stddef.size_t) return void_ptr;
pragma Import (C, alloca, "alloca");
@ytomino
ytomino / c-alloca.ads
Last active November 4, 2020 19:26
x86_64-pc-linux-gnu
-- This file is translated by "headmaster" version 0.30-886eb78 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.stddef;
package C.alloca is
pragma Preelaborate;
function alloca (size : stddef.size_t) return void_ptr;
pragma Import (C, alloca, "alloca");
type token = T_w | T_W | T_v | EOF;;
let rec scan s i = (
let length = String.length s in
if i >= length then length, EOF else
match s.[i] with
| 'W' -> i + 1, T_W
| 'w' -> i + 1, T_w
| 'v' -> i + 1, T_v
| '\xef' -> (* W : EF BC B7, v : EF BD 96, w : EF BD 97 *)
@ytomino
ytomino / bing-daily-wallpaper
Last active October 8, 2019 10:16
Use "bing Wallpaper" on macOS
#!/bin/bash
# Thanks to https://ubuntuforums.org/showthread.php?t=2074098
[[ -z "$HOME" ]] && exit 1
[[ -z "$TMPDIR" ]] && exit 1
# $bing is needed to form the fully qualified URL for
# the Bing pic of the day
bing="www.bing.com"
@ytomino
ytomino / darwin.shrc
Last active September 24, 2019 21:56
cd to the result of mdfind (Spotlight) / baloosearch
function mdcd {
local OPTARG OPTIND REPLY
local opt list dryrun query a s len home i ilen ihome
# switches
list=
dryrun=
OPTIND=
while getopts "ln" opt; do
case $opt in
l) list=1 ;;