Newer
Older
/*
** option.h for 42sh
**
** Made by Seblu
** Login <seblu@epita.fr>
**
** Started on Tue Mar 21 18:50:03 2006 Seblu
*/
#ifndef OPTION_H_
# define OPTION_H_
#define NBR_OPTION 8
#define DEBUG_OPTION 0
/*
** ==============
** FILE: option.c
** ==============
*/
/*!
** Create a new options structure
**
** @return A new options structure
*/
/*!
** Set a shell option
**
** @param shopt structure to apply
** @param name name of the option to set
**
** @return 0 on failure, else 1
*/
int option_set(s_options *shopt, const char *name);
/*!
** Unset a shell option
**
** @param shopt structure to apply
** @param name name of the option to unset
**
** @return 0 on failure, else 1
*/
int option_unset(s_options *shopt, const char *name);
/*!
** Tell if an option is set. if option nane is not set return -1
**
** @param shopt structure where find
** @param name name to find
**
** @return 0 if unset, 1 if set and -1 if not exist
*/
int option_isset(const s_options *shopt, const char *name);
/*!
** Return a list of know opt
**
** @return list of opt
*/
const char **opt_get();
/*
** =====================
**
** @param opt shell opt structure to set with options
** @param argc program argc
** @param argv program argv
*/
void getoptions(s_options *opt, int argc, char **argv);