/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/utils/eh_opt_context.c File Reference

#include <eh_utils.h>

Go to the source code of this file.

Classes

struct  Print_opt_padded_st

Functions

 CLASS (Eh_opt_context)
gboolean add_new_value (const gchar *option_name, const gchar *value, gpointer data, GError **error)
gssize get_n_entries (Eh_opt_entry *entries)
GOptionEntry convert_eh_option_entry_to_g_option_entry (Eh_opt_entry entry)
Eh_symbol_table set_default_values (const char *name, Eh_opt_entry *entries, Eh_symbol_table tab)
Eh_opt_context eh_opt_create_context (const gchar *name, const gchar *description, const gchar *help_description)
Eh_opt_context eh_destroy_context (Eh_opt_context context)
Eh_opt_context eh_opt_set_context (Eh_opt_context context, Eh_opt_entry *entries)
gboolean eh_opt_parse_context (Eh_opt_context context, gint *argc, gchar ***argv, GError **error)
void eh_opt_print_label_value (Eh_opt_context context, char *label)
char * eh_opt_value (Eh_opt_context context, char *label)
char * eh_opt_str_value (Eh_opt_context c, char *label)
gboolean eh_opt_bool_value (Eh_opt_context c, char *label)
int eh_opt_key_value (Eh_opt_context c, char *label, char *keys[])
gint eh_opt_int_value (Eh_opt_context c, char *label)
double eh_opt_dbl_value (Eh_opt_context c, char *label)
void eh_opt_print_label_value_helper (gchar *label, gchar *value, gpointer fp)
void eh_opt_print_key_file (Eh_opt_context c, FILE *fp)
void eh_opt_print_opt_padded (char *key, char *unused, Print_opt_padded_st *user_data)
void eh_opt_get_max_label_length (char *key, char *value, Print_opt_padded_st *user_data)
void eh_opt_print_all_opts (Eh_opt_context c, FILE *fp)


Function Documentation

gboolean add_new_value ( const gchar *  option_name,
const gchar *  value,
gpointer  data,
GError **  error 
)

Definition at line 36 of file eh_opt_context.c.

References eh_require_not_reached, and eh_symbol_table_replace().

Referenced by convert_eh_option_entry_to_g_option_entry().

CLASS ( Eh_opt_context   ) 

Definition at line 23 of file eh_opt_context.c.

GOptionEntry convert_eh_option_entry_to_g_option_entry ( Eh_opt_entry  entry  ) 

Definition at line 64 of file eh_opt_context.c.

References add_new_value(), Eh_opt_entry::arg_description, Eh_opt_entry::description, Eh_opt_entry::long_name, and Eh_opt_entry::short_name.

Referenced by eh_opt_set_context().

Eh_opt_context eh_destroy_context ( Eh_opt_context  context  ) 

Definition at line 153 of file eh_opt_context.c.

References eh_free, and eh_symbol_table_destroy().

Referenced by main().

gboolean eh_opt_bool_value ( Eh_opt_context  c,
char *  label 
)

Definition at line 247 of file eh_opt_context.c.

References eh_opt_value(), and eh_str_to_boolean().

Referenced by main().

Eh_opt_context eh_opt_create_context ( const gchar *  name,
const gchar *  description,
const gchar *  help_description 
)

Definition at line 136 of file eh_opt_context.c.

References eh_symbol_table_new(), and NEW_OBJECT.

Referenced by main().

double eh_opt_dbl_value ( Eh_opt_context  c,
char *  label 
)

Definition at line 304 of file eh_opt_context.c.

References eh_opt_value().

Referenced by main().

void eh_opt_get_max_label_length ( char *  key,
char *  value,
Print_opt_padded_st user_data 
)

Definition at line 385 of file eh_opt_context.c.

References Print_opt_padded_st::max_key_len, and Print_opt_padded_st::max_value_len.

Referenced by eh_opt_print_all_opts().

gint eh_opt_int_value ( Eh_opt_context  c,
char *  label 
)

Definition at line 293 of file eh_opt_context.c.

References eh_opt_value().

Referenced by main().

int eh_opt_key_value ( Eh_opt_context  c,
char *  label,
char *  keys[] 
)

Definition at line 258 of file eh_opt_context.c.

References eh_exit(), and eh_opt_value().

gboolean eh_opt_parse_context ( Eh_opt_context  context,
gint *  argc,
gchar ***  argv,
GError **  error 
)

Definition at line 213 of file eh_opt_context.c.

Referenced by main().

void eh_opt_print_all_opts ( Eh_opt_context  c,
FILE *  fp 
)

Definition at line 344 of file eh_opt_context.c.

References Print_opt_padded_st::context, eh_opt_get_max_label_length(), eh_opt_print_opt_padded(), eh_symbol_table_foreach(), Print_opt_padded_st::max_key_len, and Print_opt_padded_st::max_value_len.

void eh_opt_print_key_file ( Eh_opt_context  c,
FILE *  fp 
)

Definition at line 320 of file eh_opt_context.c.

References eh_opt_print_label_value_helper(), and eh_symbol_table_foreach().

Referenced by main().

void eh_opt_print_label_value ( Eh_opt_context  context,
char *  label 
)

Definition at line 221 of file eh_opt_context.c.

References eh_opt_value().

void eh_opt_print_label_value_helper ( gchar *  label,
gchar *  value,
gpointer  fp 
)

Definition at line 315 of file eh_opt_context.c.

Referenced by eh_opt_print_key_file().

void eh_opt_print_opt_padded ( char *  key,
char *  unused,
Print_opt_padded_st user_data 
)

Definition at line 365 of file eh_opt_context.c.

References Print_opt_padded_st::context, E_NOVAL, eh_free, eh_opt_value(), Print_opt_padded_st::max_key_len, and Print_opt_padded_st::max_value_len.

Referenced by eh_opt_print_all_opts().

Eh_opt_context eh_opt_set_context ( Eh_opt_context  context,
Eh_opt_entry entries 
)

Definition at line 172 of file eh_opt_context.c.

References convert_eh_option_entry_to_g_option_entry(), get_n_entries(), and set_default_values().

Referenced by main().

char* eh_opt_str_value ( Eh_opt_context  c,
char *  label 
)

Definition at line 235 of file eh_opt_context.c.

References eh_opt_value().

char* eh_opt_value ( Eh_opt_context  context,
char *  label 
)

Definition at line 226 of file eh_opt_context.c.

References eh_symbol_table_lookup().

Referenced by eh_opt_bool_value(), eh_opt_dbl_value(), eh_opt_int_value(), eh_opt_key_value(), eh_opt_print_label_value(), eh_opt_print_opt_padded(), eh_opt_str_value(), and main().

gssize get_n_entries ( Eh_opt_entry entries  ) 

Definition at line 55 of file eh_opt_context.c.

References Eh_opt_entry::long_name.

Referenced by eh_opt_set_context(), and set_default_values().

Eh_symbol_table set_default_values ( const char *  name,
Eh_opt_entry entries,
Eh_symbol_table  tab 
)

Definition at line 81 of file eh_opt_context.c.

References eh_free, eh_is_readable_file(), eh_key_file_scan_for(), eh_symbol_table_insert(), eh_symbol_table_new(), and get_n_entries().

Referenced by eh_opt_set_context().


Generated on Fri Jan 4 18:04:18 2008 for sedflux by  doxygen 1.5.2