coan 4.2.4
|
00001 #ifndef CANONICAL_STRING_H 00002 #define CANONICAL_STRING_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 00039 #include "bool.h" 00040 #include <stddef.h> 00041 00049 00051 typedef struct canonical_string_impl * canonical_string_h; 00052 00054 typedef struct canonical_string_impl const * canonical_string_const_h; 00055 00069 extern canonical_string_h 00070 canonical_string_new(char const *start, size_t nbytes, char const **pend); 00071 00072 struct int_spec; 00082 extern canonical_string_h 00083 canonical_numeral(struct int_spec const * int_spec); 00084 00091 extern canonical_string_h 00092 canonical_identifier(char const **cpp); 00093 00094 00096 extern canonical_string_h 00097 canonical_string_copy(canonical_string_const_h src); 00098 00100 extern void 00101 canonical_string_dispose(canonical_string_h cs); 00102 00104 extern void 00105 canonical_string_swap(canonical_string_h lhs, canonical_string_h rhs); 00106 00108 extern void 00109 canonical_string_assign(canonical_string_h dest, canonical_string_const_h src); 00110 00112 extern bool 00113 canonical_string_equal(canonical_string_const_h lhs, canonical_string_const_h rhs); 00114 00119 extern char const * 00120 canonical_string_text(canonical_string_const_h cs); 00121 00126 extern size_t 00127 canonical_string_length(canonical_string_const_h cs); 00128 00129 00140 extern int 00141 canonical_string_compare(canonical_string_const_h lhs, 00142 void const *rhs, size_t rhslen); 00143 00148 extern void 00149 canonical_string_appendc(canonical_string_h cs, char more); 00150 00157 extern void 00158 canonical_string_appends(canonical_string_h cs, canonical_string_const_h more, 00159 bool punct); 00160 00168 extern canonical_string_h 00169 canonical_string_substr(canonical_string_const_h cs, size_t start, size_t len); 00170 00177 void 00178 canonical_string_replace(canonical_string_h cs, 00179 size_t start, 00180 size_t len, 00181 canonical_string_const_h subst); 00182 00185 #endif /* EOF */