qse/ase/utl/getopt.h

43 lines
688 B
C
Raw Normal View History

2008-03-18 06:23:56 +00:00
/*
2008-03-18 06:35:02 +00:00
* $Id: getopt.h 137 2008-03-17 12:35:02Z baconevi $
2008-03-18 06:23:56 +00:00
*
* {License}
*/
#ifndef _ASE_UTL_GETOPT_H_
#define _ASE_UTL_GETOPT_H_
#include <ase/cmn/types.h>
#include <ase/cmn/macros.h>
typedef struct ase_opt_t ase_opt_t;
struct ase_opt_t
{
/* input */
const ase_char_t* str;
/* output */
ase_cint_t opt; /* character checked for validity */
ase_char_t* arg; /* argument associated with an option */
int err;
/* input + output */
int ind; /* index into parent argv vector */
2008-03-18 06:35:02 +00:00
/* internal */
ase_char_t* cur;
2008-03-18 06:23:56 +00:00
};
#ifdef __cplusplus
extern "C" {
#endif
2008-03-18 06:35:02 +00:00
ase_cint_t ase_getopt (int argc, ase_char_t* const* argv, ase_opt_t* opt);
2008-03-18 06:23:56 +00:00
#ifdef __cplusplus
}
#endif
#endif