fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
at master 48 lines 2.0 kB view raw
1/***************************************************************************** 2 * pce * 3 *****************************************************************************/ 4 5/***************************************************************************** 6 * File name: src/lib/getopt.h * 7 * Created: 2009-10-21 by Hampa Hug <hampa@hampa.ch> * 8 * Copyright: (C) 2009-2020 Hampa Hug <hampa@hampa.ch> * 9 *****************************************************************************/ 10 11/***************************************************************************** 12 * This program is free software. You can redistribute it and / or modify it * 13 * under the terms of the GNU General Public License version 2 as published * 14 * by the Free Software Foundation. * 15 * * 16 * This program is distributed in the hope that it will be useful, but * 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 * Public License for more details. * 20 *****************************************************************************/ 21 22 23#ifndef PCE_LIB_GETOPT_H 24#define PCE_LIB_GETOPT_H 1 25 26 27#define GETOPT_DONE -1 28#define GETOPT_UNKNOWN -2 29#define GETOPT_MISSING -3 30 31 32typedef struct { 33 short name1; 34 unsigned short argcnt; 35 const char *name2; 36 const char *argdesc; 37 const char *optdesc; 38} pce_option_t; 39 40 41void pce_getopt_help (const char *tag, const char *usage, pce_option_t *opt); 42 43int pce_getoptarg (int argc, char **argv, char ***optarg, unsigned cnt); 44 45int pce_getopt (int argc, char **argv, char ***arg, pce_option_t *opt); 46 47 48#endif