/* [@$og{filename}@].h */

/* File autogenerated by [@$og{name}@] version [@$OptGenVersion@] */

#ifndef [@$og{filename}@]_h
#define [@$og{filename}@]_h

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/* Don't define PACKAGE and VERSION if we use automake.  */
#if defined PACKAGE
#  undef PACKAGE
#endif
#define PACKAGE "[@$og{package}@]"
#if defined VERSION
#  undef VERSION
#endif
#define VERSION "[@$og{version}@]"

struct [@$og{structname}@] {
  [@
   ## -- option-value declarations
   $OUT .= join("\n  ",
		map {
		  my $opt = $og{opth}{$_};
		  (defined($opt) && defined($opt->{ctype}) && defined($opt->{cname})
		   ? ("$opt->{ctype} $opt->{cname}\;\t"
		      ." /* $opt->{descr} (default=$opt->{default}). */")
		   : qw())
		} @{$og{optl}});
  @]

  [@
   join("\n  ",
	map {
          my $opt = $og{opth}{$_};
	  my $optname = (defined($opt->{long}) ? $opt->{long} : "'-$opt->{short}'");
	  "int $opt->{cgiven}\;\t /* Whether $optname was given */"
	} @{$og{optl}});

  @]
  [@
   ($og{unnamed} ? '
  char **inputs;         /* unnamed arguments */
  unsigned inputs_num;   /* number of unnamed arguments */'
    : '')
  @]
};

int [@$og{funcname}@] (int argc, char *const *argv, struct [@$og{structname}@] *args_info);

void [@$og{funcname}@]_print_help(void);
void [@$og{funcname}@]_print_version(void);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* [@$og{filename}@]_h */
