Parsing command line arguments. More...
#include <stdio.h>#include <stdlib.h>#include <getopt.h>#include <string.h>#include "pmm_argparser.h"#include "pmm_model.h"#include "pmm_log.h"Go to the source code of this file.
Functions | |
| int | parse_slice_str (char *slice_str, struct pmm_view_options *options) |
| int | count_tokens_in_str (char *str, char *delimiters) |
| void | usage () |
| void | parse_args (struct pmm_config *cfg, int argc, char **argv) |
| void | usage_pmm_view () |
| int | parse_pmm_view_args (struct pmm_view_options *options, int argc, char **argv) |
Parsing command line arguments.
This file contains the command line argument parsing code for the pmm daemon and the pmm_view utility
Definition in file pmm_argparser.c.
| int count_tokens_in_str | ( | char * | str, |
| char * | delimiters | ||
| ) |
Count the number of tokens in a atring seperated by a delimiter
| str | pointer to the string |
| delimiters | pointer to a string listing the delimiters |
Definition at line 420 of file pmm_argparser.c.
| void parse_args | ( | struct pmm_config * | cfg, |
| int | argc, | ||
| char ** | argv | ||
| ) |
Parse arguments for pmm building daemon.
| cfg | pointer to config structure |
| argc | number of command line arguments |
| argv | pointer to command line arguments (array of character arrays) |
Definition at line 73 of file pmm_argparser.c.
| int parse_pmm_view_args | ( | struct pmm_view_options * | options, |
| int | argc, | ||
| char ** | argv | ||
| ) |
Parse arguments for pmm_view tool
| options | pointer to pmm_view options structure |
| argc | number of command line arguments |
| argv | pointer to command line arguments (array of character arrays) |
Definition at line 172 of file pmm_argparser.c.
| int parse_slice_str | ( | char * | slice_str, |
| struct pmm_view_options * | options | ||
| ) |
Parse the slice string into a arrays of parameter index and parameter value of a pmm_view_options structure.
The slice string format is a comma seperated list of pairs. Each pair is seperated by a colon. The first element of the pair describes a parameter index in the form pN, where N is a number. The second element of the pair is either min, max or a integer value, describing the value that parameter should be fixed at.
To specify a slice all but 1 or 2 parameters must have their values fixed as specified by the string. If 1 parameter is left free the model will be a 2d plot, if 2 parameters are left free the plot will be a 3d surface.
| slice_str | pointer to the slice string |
| options | pointer to the pmm_view_options structure |
Definition at line 470 of file pmm_argparser.c.
| void usage | ( | ) |
print command line usage for pmm building daemon
Definition at line 52 of file pmm_argparser.c.
| void usage_pmm_view | ( | ) |
print command line usage for pmm_view tool
Definition at line 136 of file pmm_argparser.c.
1.8.1.2