/* Asterisk INI to Property List File Conversion Utility -- Version 1.10 * * keywords.h * aini2plist * * Keyword dictionary * * 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. */ #include #import "globaldefs.h" // -------------------------------------------------------------------------- // Maximum length of cleartext keywords // -------------------------------------------------------------------------- #define MAX_KEYWORD_LENGTH MAXIMUM_LENGTH_FOR_IDENTIFIERS // -------------------------------------------------------------------------- // Keyword hashes // -------------------------------------------------------------------------- // section names in asterisk.conf and openpbx.conf #define KEYWORD_DIRECTORIES 0x660D972B #define KEYWORD_OPTIONS 0x238574BE // keys in asterisk.conf #define KEYWORD_ASTETCDIR 0x7F8F367B #define KEYWORD_ASTMODDIR 0x0BDB362D #define KEYWORD_ASTVARLIBDIR 0x180622ED #define KEYWORD_ASTAGIDIR 0x4B05C2EC #define KEYWORD_ASTSPOOLDIR 0x0886FEE0 #define KEYWORD_ASTRUNDIR 0x63877DE4 #define KEYWORD_ASTLOGDIR 0x0143472B // keys in openpbx.conf #define KEYWORD_OPBXETCDIR 0x472E7E30 #define KEYWORD_OPBXMODDIR 0x537A7DE2 #define KEYWORD_OPBXVARLIBDIR 0x00DDB2F8 #define KEYWORD_OPBXDBDIR 0x4ABC3718 #define KEYWORD_OPBXAGIDIR 0x12A50AA1 #define KEYWORD_OPBXSPOOLDIR 0x4013BC15 #define KEYWORD_OPBXRUNDIR 0x2B26C599 #define KEYWORD_OPBXLOGDIR 0x48E28EE0 #define KEYWORD_OPBXSOUNDSDIR 0x64B7C112 // keys in asterisk.conf and openpbx.conf #define KEYWORD_VERBOSE 0x3D465A82 #define KEYWORD_DEBUG 0x143C8453 #define KEYWORD_NOFORK 0x3B60FC03 #define KEYWORD_QUIET 0x730CCBF4 #define KEYWORD_CONSOLE 0x3D0DD257 #define KEYWORD_HIGHPRIORITY 0x32FBBA86 #define KEYWORD_INITCRYPTO 0x671AC391 #define KEYWORD_NOCOLOR 0x4A2B8C22 #define KEYWORD_DUMPCORE 0x7214F713 #define KEYWORD_CACHE_RECORD_FILES 0x676B1546 #define KEYWORD_RECORD_CACHE_DIR 0x24F92FC2 // section names in indications.conf #define KEYWORD_GENERAL 0x2E0D8148 // keys in indications.conf #define KEYWORD_COUNTRY 0x325EA6B6 #define KEYWORD_DESCRIPTION 0x6748B77C #define KEYWORD_ALIAS 0x11858430 // need to recognise misspelt "ringcadence" #define KEYWORD_RINGCADANCE 0x57326345 #define KEYWORD_RINGCADENCE 0x114DA641 #define KEYWORD_DIAL 0x60BEFED0 #define KEYWORD_BUSY 0x09AC1BD9 #define KEYWORD_CONGESTION 0x6581F047 #define KEYWORD_CALLWAITING 0x533BF3EF #define KEYWORD_DIALRECALL 0x599B4501 #define KEYWORD_RECORD 0x614258B1 #define KEYWORD_INFO 0x4BDC614E // section names in logger.conf #define KEYWORD_LOGFILES 0x6EFCA353 // keys in logger.conf #define KEYWORD_DATEFORMAT 0x5CDC1A45 #define KEYWORD_APPENDHOSTNAME 0x44C00AAD #define KEYWORD_MESSAGES 0x3AC9928C // section names in manager.conf // key "general" already defined // keys in manager.conf #define KEYWORD_ENABLED 0x47C16E21 #define KEYWORD_PORT 0x12162901 #define KEYWORD_BINDADDR 0x2680034E #define KEYWORD_SECRET 0x78DBE550 #define KEYWORD_DENY 0x5ED3C40C #define KEYWORD_PERMIT 0x6DCAB03B #define KEYWORD_READ 0x6A262B36 #define KEYWORD_WRITE 0x7F11975F // section names in modules.conf #define KEYWORD_MODULES 0x4F0BDEA7 // keys in modules.conf #define KEYWORD_AUTOLOAD 0x02D67E15 #define KEYWORD_LOAD 0x57E9E1C6 #define KEYWORD_NOLOAD 0x5278DC47 // section names in extconfig.conf #define KEYWORD_SETTINGS 0x5EF77043 // additional keys in configuration files for plugins #define KEYWORD_AGENT 0x26F835A5 #define KEYWORD_ALLOW 0x130DB629 #define KEYWORD_AUTH 0x5B264B48 #define KEYWORD_CHANNEL 0x45AF31A3 #define KEYWORD_CONF 0x35398E44 #define KEYWORD_CONTEXT 0x66B40B0F #define KEYWORD_DISALLOW 0x1382A6FB #define KEYWORD_FORMAT 0x374297D7 #define KEYWORD_GROUP 0x4341049F #define KEYWORD_INKEYS 0x6C533139 #define KEYWORD_MEMBER 0x3D34CD3A #define KEYWORD_NETWORK 0x64D5C3EE #define KEYWORD_NOTRANSFER 0x2E24514C #define KEYWORD_REGEXTEN 0x5DA3D4F6 #define KEYWORD_REGISTER 0x04B33D43 #define KEYWORD_SEARCH 0x1BCC4348 #define KEYWORD_USER 0x7CA3778B // section names in extensions.conf // key "general" already defined #define KEYWORD_GLOBALS 0x794811F0 // keys in extensions.conf #define KEYWORD_STATIC 0x17A7F4CE #define KEYWORD_WRITEPROTECT 0x4F564410 #define KEYWORD_IGNOREPAT 0x2758A291 #define KEYWORD_SWITCH 0x579D9654 #define KEYWORD_EXTEN 0x54F774AA #define KEYWORD_INCLUDE 0x7DF798E8 // -------------------------------------------------------------------------- // Keyword attribute type // -------------------------------------------------------------------------- typedef /* KeywordAtrribute */ enum { NO_ATTRIBUTE = 0, /* keep this 0 */ SECTION_NAME, UNIQUE_SECTION_NAME, TOGGLE_BOOLEAN_VALUE, MULTIPLE_ASSIGNMENTS, MULTIPLE_ASSIGNMENTS_UNIQUE_VALUES } KeywordAttribute; // -------------------------------------------------------------------------- // Keyword dictionary enumeration type // -------------------------------------------------------------------------- typedef /* KeywordDictionary */ enum { NO_DICTIONARY = 0, /* keep this 0 */ CORE_DICTIONARY, PLUGIN_DICTIONARY, DIALPLAN_DICTIONARY } KeywordDictionary; // -------------------------------------------------------------------------- // function init_keywords_with_dict(dict) // -------------------------------------------------------------------------- // // Sets the built-in keyword dictionary 'dict' to be used for keyword lookup. int init_keywords_with_dict(KeywordDictionary dict); // -------------------------------------------------------------------------- // function init_keywords_from_file(path) // -------------------------------------------------------------------------- // // FOR FUTURE USE -- NOT YET IMPLEMENTED -- Does nothing, returns zero. // int init_keywords_from_file(const char *path); // -------------------------------------------------------------------------- // function is_known_keyword(hash) // -------------------------------------------------------------------------- // // Returns true if indentifier with hash value 'hash' is a known keyword, // otherwise false. bool is_known_keyword(CARDINAL hash); // -------------------------------------------------------------------------- // function is_obsolete_keyword(section, key) // -------------------------------------------------------------------------- // // Returns true if indentifier with hash value 'key' is obsolete in section // with hash value 'section', otherwise false. bool is_obsolete_keyword(CARDINAL section, CARDINAL key); // -------------------------------------------------------------------------- // function get_translation_for_keyword(hash) // -------------------------------------------------------------------------- // // Returns a pointer to a C string with the translation of the keyword whose // hash value is 'hash'. Returns NULL if the keyword is not known or if there // is no translation for the keyword. const char *get_translation_for_keyword(CARDINAL hash); // -------------------------------------------------------------------------- // function get_attribute_for_keyword(hash) // -------------------------------------------------------------------------- // // Returns the attribute of the keyword whose hash value is 'hash'. Returns // the attribute NONE if the keyword is not known. KeywordAttribute get_attribute_for_keyword(CARDINAL hash); // -------------------------------------------------------------------------- // function get_relocation_for_keyword(hash) // -------------------------------------------------------------------------- // // Returns the hash value of a section to which the key whose hash value is // 'hash' should be relocated. Returns zero if the keyword is not known or if // there is no relocation value for the keyword. CARDINAL get_relocation_for_keyword(CARDINAL hash); // END OF FILE