Skip to content

Instantly share code, notes, and snippets.

@vtorri
vtorri / gist:0d8b29b8158a9e2e0a75d8a284a8f95b
Created August 8, 2023 05:27
cross platform windowing system, proof of concept
#include <system_error>
#include <string>
#include <cstring>
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
#else
/* gcc -g -Wall -Wextra -o winlist winlist.c `pkg-config --cflags --libs elementary` */
#include <stdio.h>
#include <Elementary.h>
typedef struct
{
Elm_Genlist_Item_Class *itc1;
} api_data;
@vtorri
vtorri / io.c
Created December 9, 2022 10:54
CreateProcess() and environment variable
#include <stdio.h>
#include <windows.h>
#define STRSAFE_NO_CB_FUNCTIONS
#include <strsafe.h>
#define DBG(s) \
do { \
printf("%s failed: %ld %s\n", (s), GetLastError(), win32_error()); \
} while (0)
@vtorri
vtorri / openindiana-samurai.md
Last active October 13, 2022 04:02
OpenIndiana: create a package with oi-userland

Creating Samurai package for OpenIndiana

Samurai is a C99 implementation of ninja, with no dependency. This document tries to explain, step by step, how to create an OpenIndiana package for Samurai.

This document is based on this OpenIndiana documentation, and my own experimentation, with the help of developpers on IRC (channel #openindianaon libera.chat).

OpenIndiana provides a git repository, named oi-userland, on github to make such creation easier.

Before creating the package, user rbac role should be set, as well as common build tools: