coan 4.2.4
|
00001 /*************************************************************************** 00002 * Copyright (C) 2007-2011 Mike Kinghan, imk@strudl.org * 00003 * All rights reserved. * 00004 * * 00005 * Contributed originally by Mike Kinghan, imk@strudl.org * 00006 * * 00007 * Redistribution and use in source and binary forms, with or without * 00008 * modification, are permitted provided that the following conditions * 00009 * are met: * 00010 * * 00011 * Redistributions of source code must retain the above copyright * 00012 * notice, this list of conditions and the following disclaimer. * 00013 * * 00014 * Redistributions in binary form must reproduce the above copyright * 00015 * notice, this list of conditions and the following disclaimer in the * 00016 * documentation and/or other materials provided with the distribution. * 00017 * * 00018 * Neither the name of Symbian Software Ltd. nor the names of its * 00019 * contributors may be used to endorse or promote products derived from * 00020 * this software without specific prior written permission. * 00021 * * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * 00023 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * 00025 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * 00026 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * 00027 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * 00028 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * 00029 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * 00030 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* 00031 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * 00032 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * 00033 * DAMAGE. * 00034 * * 00035 **************************************************************************/ 00036 #include "unconfigured_symbols.h" 00037 #include "report.h" 00038 00039 00048 NO_PRIVATE_STATE(unconfigured_symbols); 00053 IMPLEMENT(unconfigured_symbols,USER_INITABLE); 00054 00055 DEFINE_USER_INIT(unconfigured_symbols)(STATE_T(unconfigured_symbols) * st_state) 00056 { 00057 st_state->sym_tab = ptr_set_new((comparator_t)symbol_compare, 00058 (dtor_t)symbol_dispose, 00059 (cloner_t)symbol_copy); 00060 } 00061 00062 DEFINE_USER_FINIS(unconfigured_symbols)(STATE_T(unconfigured_symbols) * 00063 st_state) 00064 { 00065 ptr_set_dispose(st_state->sym_tab); 00066 } 00069 /* API *********************************************************************/ 00070 00071 void 00072 unconfigured_symbol_tally(char const *name, size_t namelen) 00073 { 00074 symbol_h sym = ptr_set_search( GET_PUBLIC(unconfigured_symbols,sym_tab), 00075 name,namelen); 00076 if (!sym) { 00077 sym = symbol_new(name,namelen); 00078 ptr_set_insert( GET_PUBLIC(unconfigured_symbols,sym_tab),sym); 00079 } 00080 report_symbol(sym); 00081 } 00082 00083 00084 /* EOF*/