libftsh
A Fast Transform for Spherical Harmonics
 All Data Structures Files Functions Variables Defines
Functions
getoption.c File Reference

Retrieve command line options. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Functions

char * getoption (const char *flag, int argc, char **argv)

Detailed Description

Retrieve command line options.


Function Documentation

char* getoption ( const char *  flag,
int  argc,
char **  argv 
)

This routine allows command line options, usually of the form: program -d 256. Normal usage in the program is:

if(getoption("-d",argc,argv)!=NULL) 
   degree=atoi(getoption("-d",argc,argv));

The first call makes sure the option flag was indeed used. If it was, we call again to get the value as a string, then convert it using ato_ .