Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis12/src/include/Diderot/options.h
ViewVC logotype

View of /branches/vis12/src/include/Diderot/options.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1721 - (download) (as text) (annotate)
Mon Mar 12 20:19:29 2012 UTC (7 years, 7 months ago) by jhr
File size: 2232 byte(s)
  Working on library support
/*! \file options.h
 *
 * \author John Reppy, Gordon Kindlmann
 */

/*
 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 */

#ifndef _DIDEROT_OPTIONS_H_
#define _DIDEROT_OPTIONS_H_

/* 
** "Options" refers to input variables or parameters to a Diderot program,
** which have been called "options" based on the fact that the first means
** of setting them is via command-line options.
*/

/*! \brief abstract struct for holding command-line options */
typedef struct Diderot_struct_options Diderot_Options_t;

/* Command-line parsing implementation is in src/lib/common/input.c */
Diderot_Options_t *Diderot_OptNew ();
void Diderot_OptFree (Diderot_Options_t *dopts);

void Diderot_OptSetProgramInfo (Diderot_Options_t *dopts, const char *progInfo);

void Diderot_OptAddFlag (Diderot_Options_t *dopts, const char *name, const char *desc, bool *flg);
void Diderot_OptAddBool (Diderot_Options_t *dopts, const char *name, const char *desc, bool *v, bool hasDflt);
void Diderot_OptAddInt (Diderot_Options_t *dopts, const char *name, const char *desc, Diderot_int_t *v, bool hasDflt);
void Diderot_OptAddReal (Diderot_Options_t *dopts, const char *name, const char *desc, Diderot_real_t *v, bool hasDflt);
void Diderot_OptAddReal2 (Diderot_Options_t *dopts, const char *name, const char *desc, Diderot_vec2_t *v, bool hasDflt);
void Diderot_OptAddReal3 (Diderot_Options_t *dopts, const char *name, const char *desc, Diderot_vec3_t *v, bool hasDflt);
void Diderot_OptAddReal4 (Diderot_Options_t *dopts, const char *name, const char *desc, Diderot_vec4_t *v, bool hasDflt);
void Diderot_OptAddString (Diderot_Options_t *dopts, const char *name, const char *desc, char **v, bool hasDflt);

void Diderot_OptProcess (Diderot_Options_t *dopts, int argc, const char **argv);

//! function generated by the compiler for registering the options used to initialize globals
void Diderot_RegisterGlobalOpts (Diderot_Options_t *dopts);

// standard options
extern bool     VerboseFlg;     //! true if running in verbose mode
extern bool     TimingFlg;      //! true if timing computation
extern bool     NrrdOutputFlg;  //! true if output is in Nrrd format

#endif /* !_DIDEROT_OPTIONS_H_ */

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0