Mercurial > hg > th-libs
view th_args.h @ 132:11fa2bf90251
Network API changes due to preparation for fixes in proxy support.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 04 Jul 2014 02:18:26 +0300 |
parents | aa2d608fb3f3 |
children | 286b2249c5d2 |
line wrap: on
line source
/* * Simple commandline argument processing function * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2002-2012 Tecnic Software productions (TNSP) * * Please read file 'COPYING' for information on license and distribution. */ #ifndef TH_ARGS #define TH_ARGS #include "th_util.h" #include <stdio.h> #ifdef __cplusplus extern "C" { #endif /* Option flags */ #define OPT_NONE (0) // Simple option with no arguments #define OPT_ARGREQ (1) // Option's argument is required #define OPT_ARGOPT (3) // Option's argument is optional #define OPT_ARGMASK (3) // Mask for option argument flags #define OPT_REQUIRED (4) // This option is required to be given typedef struct { int id; char optShort; char *optLong; char *desc; int flags; } optarg_t; BOOL th_args_process(int argc, char *argv[], optarg_t argList[], int argListN, BOOL (*handleOpt)(int, char *, char *), BOOL (*handleFile)(char *), BOOL); void th_args_help(FILE *, optarg_t optList[], int optListN); #ifdef __cplusplus } #endif #endif // TH_ARGS