/* Asterisk INI to Property List File Conversion Utility -- Version 1.12 * * coredict.h * aini2plist * * Core dictionary (stub to be included in keywords.c) * * Author: Benjamin Kowarsch * * (C) 2006 Sunrise Telephone Systems Ltd. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * In countries and territories where the above no-warranty disclaimer is * not permissible by applicable law, the following terms apply: * * NO PERMISSION TO USE THE SOFTWARE IS GRANTED AND THE SOFTWARE MUST NOT BE * USED AT ALL IN SUCH COUNTRIES AND TERRITORIES WHERE THE ABOVE NO-WARRANTY * DISCLAIMER IS NOT PERMISSIBLE AND INVALIDATED BY APPLICABLE LAW. HOWEVER, * THE COPYRIGHT HOLDERS HEREBY WAIVE THEIR RIGHT TO PURSUE OFFENDERS AS LONG * AS THEY OTHERWISE ABIDE BY THE TERMS OF THE LICENSE AS APPLICABLE FOR USE * OF THE SOFTWARE IN COUNTRIES AND TERRITORIES WHERE THE ABOVE NO-WARRANTY * DISCLAIMER IS PERMITTED BY APPLICABLE LAW. THIS WAIVER DOES NOT CONSTITUTE * A LICENSE TO USE THE SOFTWARE IN COUNTRIES AND TERRITORIES WHERE THE ABOVE * NO-WARRANTY DISCLAIMER IS NOT PERMISSIBLE AND INVALIDATED BY APPLICABLE * LAW. ANY LIABILITY OF ANY KIND IS CATEGORICALLY RULED OUT AT ALL TIMES. */ // -------------------------------------------------------------------------- // Keyword translations // -------------------------------------------------------------------------- // translations for keywords in section "directories" of master config file DECLARE_TRANSLATION( DIRECTORIES_XLAT, "Directories" ); DECLARE_TRANSLATION( ETCDIR_XLAT, "EtcDir" ); DECLARE_TRANSLATION( SPOOLDIR_XLAT, "SpoolDir" ); DECLARE_TRANSLATION( LIBDIR_XLAT, "LibDir" ); DECLARE_TRANSLATION( LOGDIR_XLAT, "LogDir" ); DECLARE_TRANSLATION( AGIDIR_XLAT, "AGIDir" ); DECLARE_TRANSLATION( RUNDIR_XLAT, "RunDir" ); DECLARE_TRANSLATION( MODDIR_XLAT, "ModDir" ); DECLARE_TRANSLATION( TMPDIR_XLAT, "TempDir" ); // translations for keywords in section "options" of master config file DECLARE_TRANSLATION( OPTIONS_XLAT, "Options" ); DECLARE_TRANSLATION( VERBOSITY_XLAT, "ConsoleVerbosity" ); DECLARE_TRANSLATION( DEBUG_XLAT, "LaunchInDebugMode" ); DECLARE_TRANSLATION( QUIET_XLAT, "LaunchInQuietMode" ); DECLARE_TRANSLATION( HIGHPRIORITY_XLAT, "LaunchInPseudoRealtimeMode" ); DECLARE_TRANSLATION( COLOR_XLAT, "UseColorWhenInConsoleMode" ); DECLARE_TRANSLATION( DUMP_XLAT, "WriteCoreDumpOnCrash" ); DECLARE_TRANSLATION( CACHE_RECORD_XLAT, "RecordSoundsAsTempFiles" ); DECLARE_TRANSLATION( TIMESTAMP_XLAT, "TimestampFormatString" ); DECLARE_TRANSLATION( APPENDHOST_XLAT, "AppendHostToLogfiles" ); DECLARE_TRANSLATION( AUTOLOAD_XLAT, "AutoLoadModules" ); // translations for keywords in logger.conf DECLARE_TRANSLATION( LOGFILES_XLAT, "Logfiles" ); // translations for keywords in manager.conf DECLARE_TRANSLATION( MANAGER_XLAT, "MgrAPI" ); DECLARE_TRANSLATION( ENABLED_XLAT, "Enabled" ); DECLARE_TRANSLATION( PORT_XLAT, "PortNumber" ); DECLARE_TRANSLATION( BINDADDR_XLAT, "IPAddress" ); DECLARE_TRANSLATION( SECRET_XLAT, "password" ); DECLARE_TRANSLATION( LOAD_XLAT, "LoadOnLaunch" ); const static char * NOLOAD_XLAT = _LOAD_XLAT; // translations for keywords in mmodules.conf DECLARE_TRANSLATION( MODULES_XLAT, "Modules" ); // translations for keywords in indications.conf DECLARE_TRANSLATION( TONES_XLAT, "IndicationTones" ); DECLARE_TRANSLATION( COUNTRY_XLAT, "DefaultCountry" ); // -------------------------------------------------------------------------- // Relocation targets // -------------------------------------------------------------------------- #define TO_DIRECTORIES KEYWORD_DIRECTORIES #define TO_OPTIONS KEYWORD_OPTIONS #define TO_LOGFILES KEYWORD_LOGFILES #define TO_MODULES KEYWORD_MODULES // -------------------------------------------------------------------------- // Key specific value tables // -------------------------------------------------------------------------- const static ValueTableEntry _loglevels_table[] = { /* values for logfile keys in logger.conf */ { KEYWORD_NOTICE, NO_TRANSLATION }, { KEYWORD_WARNING, NO_TRANSLATION }, { KEYWORD_ERROR, NO_TRANSLATION }, { KEYWORD_DEBUG, NO_TRANSLATION }, { KEYWORD_VERBOSE, NO_TRANSLATION }, { END_OF_TABLE, NO_TRANSLATION } }; // end _loglevels_table const static ValueTableEntry _manager_permissions_table[] = { /* values for keys "read" and "write" in manager.conf */ { KEYWORD_SYSTEM, NO_TRANSLATION }, { KEYWORD_CALL, NO_TRANSLATION }, { KEYWORD_LOG, NO_TRANSLATION }, { KEYWORD_VERBOSE, NO_TRANSLATION }, { KEYWORD_COMMAND, NO_TRANSLATION }, { KEYWORD_AGENT, NO_TRANSLATION }, { KEYWORD_USER, NO_TRANSLATION }, { END_OF_TABLE, NO_TRANSLATION } }; // end _manager_permissions_table // -------------------------------------------------------------------------- // Section specific key tables // -------------------------------------------------------------------------- const static KeyTableEntry _directories_table[] = { /* keys in section "directories" of asterisk.conf */ { KEYWORD_ASTETCDIR, ETCDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_ASTSPOOLDIR, SPOOLDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_ASTVARLIBDIR, LIBDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_ASTLOGDIR, LOGDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_ASTAGIDIR, AGIDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_ASTRUNDIR, RUNDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_ASTMODDIR, MODDIR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _directories_table const static KeyTableEntry _options_table[] = { /* keys in section "options" of asterisk.conf */ { KEYWORD_VERBOSE, VERBOSITY_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_DEBUG, DEBUG_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_NOFORK, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY }, { KEYWORD_QUIET, QUIET_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_CONSOLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY }, { KEYWORD_HIGHPRIORITY, HIGHPRIORITY_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_NOCOLOR, COLOR_XLAT, NO_RELOCATION, TOGGLE_BOOLEAN, ARBITRARY }, { KEYWORD_DUMPCORE, DUMP_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_CACHE_RECORD, CACHE_RECORD_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_CACHE_DIR, TMPDIR_XLAT, TO_DIRECTORIES, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _options_table const static KeyTableEntry _logger_general_table[] = { /* keys in section "general" of logger.conf */ { KEYWORD_DATEFORMAT, TIMESTAMP_XLAT, TO_OPTIONS, SINGLE_VALUE, ARBITRARY }, { KEYWORD_APPENDHOSTNAME, APPENDHOST_XLAT, TO_OPTIONS, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _logger_general_table const static KeyTableEntry _logfiles_table[] = { /* keys in section "logfiles" of logger.conf */ { MATCH_ANY, NO_TRANSLATION, NO_RELOCATION, MULTIPLE_UNIQUE_VALUES, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _logfiles_table const static KeyTableEntry _manager_general_table[] = { /* keys in section "general" of manager.conf */ { KEYWORD_ENABLED, ENABLED_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_PORT, PORT_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_BINDADDR, BINDADDR_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _manager_general_table const static KeyTableEntry _manager_table[] = { /* keys in other sections of manager.conf */ { KEYWORD_DENY, NO_TRANSLATION, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_PERMIT, NO_TRANSLATION, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_SECRET, SECRET_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_READ, NO_TRANSLATION, NO_RELOCATION, MULTIPLE_UNIQUE_VALUES, &_manager_permissions_table }, { KEYWORD_WRITE, NO_TRANSLATION, NO_RELOCATION, MULTIPLE_UNIQUE_VALUES, &_manager_permissions_table }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _manager_table const static KeyTableEntry _modules_table[] = { /* keys in section "modules" of modules.conf */ { KEYWORD_AUTOLOAD, AUTOLOAD_XLAT, TO_OPTIONS, SINGLE_VALUE, ARBITRARY }, { KEYWORD_LOAD, LOAD_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { KEYWORD_NOLOAD, NOLOAD_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _modules_table const static KeyTableEntry _modules_global_table[] = { /* keys in section "global" of modules.conf */ { MATCH_ANY, NO_TRANSLATION, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _modules_global_table const static KeyTableEntry _extcfg_table[] = { /* keys in section "modules" of modules.conf */ { MATCH_ANY, NO_TRANSLATION, TO_MODULES, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _extcfg_table const static KeyTableEntry _tones_general_table[] = { /* keys in section "general" of indications.conf */ { KEYWORD_COUNTRY, COUNTRY_XLAT, NO_RELOCATION, SINGLE_VALUE, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _tones_general_table const static KeyTableEntry _tones_table[] = { /* keys in other sections of indications.conf */ { MATCH_ANY, NO_TRANSLATION, NO_RELOCATION, MULTIPLE_VALUES, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, NO_RELOCATION, OBSOLETE, ARBITRARY } }; // end _tones_table // -------------------------------------------------------------------------- // Master configuration file specific section table // -------------------------------------------------------------------------- const static SectionTableEntry _masterconf_table[] = { /* sections in file asterisk.conf and openpbx.conf */ { KEYWORD_DIRECTORIES, DIRECTORIES_XLAT, &_directories_table }, /* { KEYWORD_FILES, FILES_XLAT, &_files_table }, */ { KEYWORD_OPTIONS, OPTIONS_XLAT, &_options_table }, { END_OF_TABLE, NO_TRANSLATION, ARBITRARY } }; // end _masterconf_table const static SectionTableEntry _loggerconf_table[] = { /* sections in file logger.conf */ { KEYWORD_GENERAL, NO_TRANSLATION, &_logger_general_table }, { KEYWORD_LOGFILES, LOGFILES_XLAT, &_logfiles_table }, { END_OF_TABLE, NO_TRANSLATION, ARBITRARY } }; // end _loggerconf_table const static SectionTableEntry _managerconf_table[] = { /* sections in file manager.conf */ { KEYWORD_GENERAL, MANAGER_XLAT, &_manager_general_table }, { MATCH_ANY, NO_TRANSLATION, &_manager_table }, { END_OF_TABLE, NO_TRANSLATION, ARBITRARY } }; // end _managerconf_table const static SectionTableEntry _modulesconf_table[] = { /* sections in file modules.conf */ { KEYWORD_MODULES, MODULES_XLAT, &_modules_table }, { KEYWORD_GLOBAL, NO_TRANSLATION, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, ARBITRARY } }; // end _modulesconf_table const static SectionTableEntry _extcfgconf_table[] = { /* sections in file extconfig.conf */ { KEYWORD_SETTINGS, NO_TRANSLATION, ARBITRARY }, { END_OF_TABLE, NO_TRANSLATION, ARBITRARY } }; // end _extcfgconf_table const static SectionTableEntry _tonesconf_table[] = { /* sections in file indications.conf */ { KEYWORD_GENERAL, TONES_XLAT, &_tones_general_table }, { MATCH_ANY, NO_TRANSLATION, &_tones_table }, { END_OF_TABLE, NO_TRANSLATION, ARBITRARY } }; // end _tonesconf_table // -------------------------------------------------------------------------- // Master mode specific dictionary // -------------------------------------------------------------------------- const static ConfigFileTableEntry _master_dictionary[] = { { MASTERCONF, &_masterconf_table }, { LOGGERCONF, &_loggerconf_table }, { MANAGERCONF, &_managerconf_table }, { MODULESCONF, &_modulesconf_table }, { EXTCFGCONF, &_extcfgconf_table }, { TONESCONF, &_tonesconf_table }, { END_OF_TABLE, ARBITRARY } }; // end _master_dictionary // END OF FILE