Sigrid Solveig Haflínudóttirget sam -d to runc490a131 year agoHistory
78 lines · 2.0 KB · C
RawDownload
#pragma once #include <ctype.h>#include <errno.h>#include <fcntl.h>#include <inttypes.h>#include <setjmp.h>#include <stdarg.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <sys/stat.h>#include <sys/wait.h> typedef unsigned short ushort;typedef unsigned char uchar;typedef unsigned long ulong;typedef unsigned int uint;typedef signed char schar;typedef long long vlong;typedef unsigned long long uvlong;typedef intptr_t intptr;typedef uintptr_t uintptr;typedef size_t usize;typedef int32_t Rune; #define ERRMAX 256 #define OREAD O_RDONLY#define ORDWR O_RDWR#define OCEXEC O_CLOEXEC#define OWRITE O_WRONLY#define OTRUNC O_TRUNC #define USED(x) (void)(x)#define SET(x)#define nil NULL#define fprint dprintf#define print printf#define sprint sprintf#define snprint snprintf#define getwd getcwd#define seek lseek#define create(name, flags, mode) open((name), O_CREAT|(flags), (mode))#define dup(old, new) dup2(old, new)#define errstr(b, sz) strerror_r(errno, (b), (sz))#define putenv(name, value) do{ setenv((name), (value), 1); }while(0)#define mallocz(sz, z) calloc(1, (sz))#define setmalloctag(...) do{}while(0)#define exits(s) do{ exit((s) ? 1 : 0); }while(0)#define _exits exits#define exec execv#define nelem(x) (int)(sizeof(x)/sizeof((x)[0])) char *cleanname(char *); extern char *argv0;#define	ARGBEGIN \	for((argv0 ? 0 : (argv0=*argv)), argv++, argc--; argv[0] && argv[0][0]=='-' && argv[0][1]; argc--, argv++){ \		const char *_args, *_argt; \		Rune _argc; \		_args = &argv[0][1]; \		if(_args[0]=='-' && _args[1]==0){ \			argc--; \			argv++; \			break; \		}\		_argc = 0; \		while(*_args && (_args += chartorune(&_argc, _args))) \			switch(_argc)#define	ARGEND USED(_argt); USED(_argc); USED(_args);}USED(argv); USED(argc);#define	ARGF() (_argt=_args, _args="", (*_argt? _argt: argv[1]? (argc--, *++argv): 0))#define	ARGC() _argc#define	EARGF(x) (_argt=_args, _args="", (*_argt? _argt: argv[1]? (argc--, *++argv): (x, (char*)0))) #include "utf.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t