coan 4.2.4
symbol.h
Go to the documentation of this file.
00001 #ifndef SYMBOL_H
00002 #define SYMBOL_H
00003 /***************************************************************************
00004  *   Copyright (C) 2007-2011 Mike Kinghan, imk@strudl.org                  *
00005  *   All rights reserved.                                                  *
00006  *                                                                         *
00007  *   Contributed originally by Mike Kinghan, imk@strudl.org                *
00008  *                                                                         *
00009  *   Redistribution and use in source and binary forms, with or without    *
00010  *   modification, are permitted provided that the following conditions    *
00011  *   are met:                                                              *
00012  *                                                                         *
00013  *   Redistributions of source code must retain the above copyright        *
00014  *   notice, this list of conditions and the following disclaimer.         *
00015  *                                                                         *
00016  *   Redistributions in binary form must reproduce the above copyright     *
00017  *   notice, this list of conditions and the following disclaimer in the   *
00018  *   documentation and/or other materials provided with the distribution.  *
00019  *                                                                         *
00020  *   Neither the name of Symbian Software Ltd. nor the names of its        *
00021  *   contributors may be used to endorse or promote products derived from  *
00022  *   this software without specific prior written permission.              *
00023  *                                                                         *
00024  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   *
00025  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     *
00026  *   LIMITED TO, THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS    *
00027  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE        *
00028  *   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,   *
00029  *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,  *
00030  *   BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
00031  *   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    *
00032  *   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
00033  *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
00034  *   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  *
00035  *   DAMAGE.                                                               *
00036  *                                                                         *
00037  **************************************************************************/
00038 #include "bool.h"
00039 #include "canonical_string.h"
00040 #include "eval_result.h"
00041 #include "ptr_vector.h"
00042 #include <math.h>
00043 #include <stddef.h>
00044 #include <ctype.h>
00045 
00053 
00055 typedef struct eval_result * symbol_h;
00056 
00058 typedef struct eval_result const * symbol_const_h;
00059 
00066 extern symbol_h
00067 symbol_new(char const *name, size_t namelen);
00068 
00072 extern void
00073 symbol_dispose(symbol_h sym);
00074 
00079 extern symbol_h
00080 symbol_copy(symbol_const_h src);
00081 
00083 extern void
00084 symbol_swap(symbol_h lhs, symbol_h rhs);
00085 
00090 extern void
00091 symbol_assign(symbol_h dest, symbol_const_h src);
00092 
00099 extern bool
00100 symbol_equal(symbol_const_h lhs,symbol_const_h rhs);
00101 
00102 
00111 extern line_type_t
00112 symbol_define(symbol_h sym, char const *tail, char const **pend);
00113 
00123 extern line_type_t
00124 symbol_undefine(symbol_h sym, char const *tail, char const **pend);
00125 
00126 
00131 extern char const *
00132 symbol_name(symbol_const_h sym);
00133 
00139 extern canonical_string_const_h
00140 symbol_definition(symbol_const_h sym);
00141 
00142 
00152 extern int
00153 symbol_compare(symbol_const_h lhs, void const * rhs, size_t namelen);
00154 
00160 extern bool
00161 symbol_is_legal(char const *tok, size_t toklen);
00162 
00167 extern bool
00168 symbol_is_configured(symbol_const_h sym);
00169 
00176 bool
00177 symbol_is_global(symbol_const_h sym);
00178 
00182 extern bool
00183 is_symbol_start_char(char cp);
00184 
00188 extern bool
00189 is_symbol_inner_char(char cp);
00190 
00220 extern canonical_string_const_h
00221 symbol_resolve(symbol_h sym, ptr_vector_h history);
00222 
00224 extern bool
00225 symbol_reported(symbol_const_h sym);
00226 
00261 line_type_t
00262 symbol_evaluate_status(bool define, char const *symstart, const char *tail, const char **pend);
00263 
00264 
00265 
00268 #endif /* EOF*/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines