#ifndef __CMDLINE_H
#define __CMDLINE_H

#include "symbol.h"

typedef struct cmd_opt_env_t {
  int i;												// index of opt currently being processed (init zero)
  int argc;											// cmd line param count
  char **argv;									// cmd line params
  SYMBOL_TABLE *sym_tab;				// symbol table
  int bsp_only_p;								// bsp only (default off)
  char *doc_template_file_name;	// document template file name (default NULL)
  char *out_file_name;					// output file name (default NULL for stdout)
  int skip_stdin_p;							// true for options where processing stdin makes no sense
} CMD_LINE_OPT_ENV;

void usage(int exit_code);

// process argv[1..argc-1] to fill in env and prepare it for wrapping
void process_global_options(CMD_LINE_OPT_ENV *env, int argc, char **argv, SYMBOL_TABLE *sym_tab);

// advance the environment initialized above until the next filename has been found
// return a pointer to the name or NULL if there is none
char *advance_to_next_file_name(CMD_LINE_OPT_ENV *env);

#endif
