Sigrid Solveig Haflínudóttirnpe: add getopt and getopt_long (based on parg)3abef693 years agoHistory
25 lines · 425 B · C
RawDownload
#include <unistd.h>#include "_parg.h" char *optarg;int optind, opterr, optopt; static struct parg_state npe_ps;static int npe_ps_init; intgetopt(int argc, char *argv[], char *optstring){	int r; 	if(npe_ps_init == 0){		npe_parg_init(&npe_ps);		npe_ps_init = 1;	}	r = npe_parg_getopt(&npe_ps, argc, argv, optstring);	optarg = (char*)npe_ps.optarg;	optind = npe_ps.optind;	optopt = npe_ps.optopt; 	return r;}

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