Logo Search packages:      
Sourcecode: dahdi-tools version File versions  Download package

Classes | Defines | Enumerations | Functions | Variables

menuselect.c File Reference

A menu-driven system for Asterisk module selection. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <getopt.h>
#include "autoconfig.h"
#include "mxml/mxml.h"
#include "linkedlists.h"
#include "menuselect.h"
Include dependency graph for menuselect.c:

Go to the source code of this file.

Classes

struct  dep_file
struct  tree

Defines

#define print_debug(f,...)   __print_debug(__LINE__, f, ## __VA_ARGS__)

Enumerations

enum  dep_file_state { DEP_FILE_UNKNOWN = -2, DEP_FILE_DISABLED = -1, DEP_FILE_UNMET = 0, DEP_FILE_MET = 1 }

Functions

static void __attribute__ ((format(printf, 2, 3)))
static struct categoryadd_category (struct category *cat)
 Add a category to the category list, ensuring that there are no duplicates.
static int add_member (struct member *mem, struct category *cat)
 Add a member to the member list of a category, ensuring that there are no duplicates.
static AST_LIST_HEAD_NOLOCK_STATIC (trees, tree)
 AST_LIST_HEAD_NOLOCK_STATIC (deps_file, dep_file)
static int build_member_list (void)
 Iterate through all of the input tree files and call the parse function on them.
static unsigned int calc_conflict_failures (int interactive, int pre_confload)
static unsigned int calc_dep_failures (int interactive, int pre_confload)
void clear_enabled (struct category *cat, int index)
 Set a member of a category at the specified index to not enabled.
static void clear_member_enabled (struct member *mem)
static void close_debug (void)
int count_categories (void)
int count_members (struct category *cat)
static void dump_member_list (void)
 Print out all of the information contained in our tree.
unsigned int enable_member (struct member *mem)
struct categoryfind_category (const char *name)
struct memberfind_member (const char *name)
static void free_deps_file (void)
static void free_member (struct member *mem)
 Free a member structure and all of its members.
static void free_member_list (void)
 Free all categories and their members.
static void free_trees (void)
 Free all of the XML trees.
static int generate_makedeps_file (void)
 Create the output dependencies file.
static int generate_makeopts_file (void)
 Create the output makeopts file that results from the user's selections.
int main (int argc, char *argv[])
static void mark_as_present (const char *member, const char *category)
 Given the string representation of a member and category, mark it as present in a given input file.
static int match_member_relations (void)
static int open_debug (void)
static int parse_existing_config (const char *infile)
 Parse an existing output makeopts file and enable members previously selected.
static int parse_tree (const char *tree_file)
 Parse an input makeopts file.
static void print_sanity_dep_header (struct dep_file *dep_file, unsigned int *flag)
static void process_defaults (void)
static int process_deps (void)
 Process dependencies against the input dependencies file.
static void process_prev_failed_deps (char *buf)
 Process a previously failed dependency.
static int sanity_check (void)
 Make sure an existing menuselect.makeopts disabled everything it should have.
void set_all (struct category *cat, int val)
 Enable/Disable all members of a category as long as dependencies have been met and no conflicts are found.
void set_enabled (struct category *cat, int index)
 Set a member of a category at the specified index to enabled.
static void set_member_enabled (struct member *mem)
static char * skip_blanks (char *str)
 return a pointer to the first non-whitespace character
void toggle_enabled (struct member *mem)
void toggle_enabled_index (struct category *cat, int index)
 Toggle a member of a category at the specified index to enabled/disabled.
static int usage (const char *argv0)

Variables

struct categories categories = AST_LIST_HEAD_NOLOCK_INIT_VALUE
int changes_made = 0
static int check_deps = 0
static int existing_config = 0
static int list_groups = 0
static int list_options = 0
const char * menu_name = "Menuselect"
static char * output_makedeps = OUTPUT_MAKEDEPS_DEFAULT
static char * output_makeopts = OUTPUT_MAKEOPTS_DEFAULT
static const char *const tree_files []

Detailed Description

A menu-driven system for Asterisk module selection.

Author:
Russell Bryant <russell@digium.com>

Definition in file menuselect.c.


Generated by  Doxygen 1.6.0   Back to index