strings.h

Go to the documentation of this file.
00001 
00002 /*  $Id: strings.h 1355 2006-05-05 14:07:46Z sethdill $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #ifndef stringsinclude
00029 #define stringsinclude
00030 
00031 
00032 #ifndef memoryinclude
00033     #include "memory.h"
00034 #endif
00035 
00036 #ifdef PASCALSTRINGVERSION
00037     #define nullterminate(s) do {s [stringlength(s) + 1] = '\0';} while (0)
00038 #else
00039     #define nullterminate(s) ((void *) 0)
00040 #endif
00041 
00042 /*global empty string*/
00043 
00044 extern byte zerostring [];
00045 
00046 extern unsigned char lowercasetable[256];
00047 
00048 /*prototypes*/
00049 
00050 extern short getstringlength (bigstring);
00051 
00052 /*extern unsigned char getlower (unsigned char c);*/
00053 #define getlower(c) (lowercasetable[(unsigned char)c])
00054 
00055 extern boolean equaltextidentifiers (byte * string1, byte * string2, short len);
00056 
00057 extern boolean equalstrings (const bigstring, const bigstring);
00058 
00059 extern boolean equalidentifiers (const bigstring, const bigstring);
00060 
00061 extern short comparestrings (bigstring, bigstring);
00062 
00063 extern short compareidentifiers (bigstring, bigstring);
00064 
00065 extern boolean stringlessthan (bigstring, bigstring);
00066 
00067 extern boolean pushstring (bigstring, bigstring);
00068 
00069 extern boolean deletestring (bigstring, short, short);
00070 
00071 extern boolean deletefirstchar (bigstring);
00072 
00073 extern short popleadingchars (bigstring, byte);
00074 
00075 extern short poptrailingchars (bigstring, byte);
00076 
00077 extern boolean pushspace (bigstring);
00078 
00079 extern boolean pushlong (long, bigstring);
00080 
00081 extern boolean pushint (short, bigstring);
00082 
00083 extern boolean pushboolean (boolean, bigstring);
00084 
00085 extern boolean insertchar (byte, bigstring);
00086 
00087 extern boolean pushchar (byte, bigstring);
00088 
00089 extern boolean pushstringresource (short, short, bigstring);
00090 
00091 extern boolean insertstring (bigstring, bigstring);
00092 
00093 extern void midstring (bigstring, short, short, bigstring);
00094 
00095 extern boolean textfindreplace (Handle, Handle, Handle, boolean, boolean);
00096 
00097 extern boolean stringfindreplace (bigstring, bigstring, Handle, boolean, boolean);
00098 
00099 extern boolean dropnonalphas (bigstring);
00100 
00101 extern boolean streamdropnonalphas (handlestream *);
00102 
00103 extern boolean scanstring (byte, bigstring, short *);
00104 
00105 extern boolean stringfindchar (byte, bigstring);
00106 
00107 extern boolean stringreplaceall (char, char, bigstring);
00108 
00109 extern boolean textlastword (ptrbyte, long, byte, bigstring);
00110 
00111 extern boolean textfirstword (ptrbyte, long, byte, bigstring);
00112 
00113 extern boolean textnthword (ptrbyte, long, long, byte, boolean, long *, long *);
00114 
00115 extern long textcountwords (ptrbyte, long, byte, boolean);
00116 
00117 extern boolean lastword (bigstring, byte, bigstring);
00118 
00119 extern void poplastword (bigstring, byte);
00120 
00121 extern boolean firstword (bigstring, byte, bigstring);
00122 
00123 extern boolean nthword (bigstring, short, byte, bigstring);
00124 
00125 extern boolean nthfield (bigstring, short, byte, bigstring);
00126 
00127 extern short countwords (bigstring, byte);
00128 
00129 extern boolean textcommentdelete (Handle);
00130 
00131 extern long langcommentdelete (byte, byte *, long);
00132 
00133 extern void commentdelete (byte, bigstring);
00134 
00135 extern boolean whitespacechar (byte);
00136 
00137 extern boolean poptrailingwhitespace (bigstring);
00138 
00139 extern boolean firstsentence (bigstring);
00140 
00141 extern void uppertext (ptrbyte, long);
00142 
00143 extern void lowertext (ptrbyte, long);
00144 
00145 extern void allupper (bigstring);
00146 
00147 extern void alllower (bigstring);
00148 
00149 extern boolean capitalizefirstchar (bigstring);
00150 
00151 extern boolean isallnumeric (bigstring);
00152 
00153 extern void filledstring (byte, short, bigstring);
00154 
00155 extern void padwithzeros (bigstring, short);
00156 
00157 extern void copystring (const bigstring, bigstring);
00158 
00159 extern void copyptocstring (const bigstring, char *);
00160 
00161 extern void copyctopstring (const char *, bigstring);
00162 
00163 #ifdef WIN95VERSION
00164 extern boolean copyWideToPString (const wchar_t *, bigstring);
00165 extern boolean copyPStringToWide (bigstring, long *, wchar_t *);
00166 extern void copyrezstring (const bigstring, bigstring);
00167 #endif
00168 
00169 #ifdef WIN95VERSION
00170     #ifdef __MWERKS__
00171         extern ULONG wcslen(const unsigned short*); // JES 12/04/2002: Make strings.c compile in CW8
00172     #endif                                          // AR 10/17/2004: ...but don't break the MS VC6 build
00173 #endif
00174 
00175 #ifdef MACVERSION
00176 #define copyrezstring(a,b) copystring(a,b)
00177 #endif
00178 
00179 extern void copyheapstring (hdlstring, bigstring);
00180 
00181 extern boolean pushheapstring (hdlstring, bigstring);
00182 
00183 extern void timedatestring (long, bigstring);
00184 
00185 extern void ellipsize (bigstring, short);
00186 
00187 extern void parsedialogstring (const bigstring, ptrstring, ptrstring, ptrstring, ptrstring, bigstring);
00188 
00189 extern boolean parsedialoghandle (Handle hsource, Handle h0, Handle h1, Handle h2, Handle h3);
00190 
00191 extern boolean setparseparams (bigstring, bigstring, bigstring, bigstring);
00192 
00193 extern void parseparamstring (bigstring);
00194 
00195 extern void getstringresource (short, bigstring);
00196 
00197 extern void parsenumberstring (short, short, long, bigstring);
00198 
00199 extern void convertpstring (bigstring);
00200 
00201 extern void convertcstring (bigstring);
00202 
00203 extern long textpatternmatch (byte *ptext, long lentext, bigstring bsfind, boolean flunicase);
00204 
00205 extern short patternmatch (bigstring, bigstring);
00206 
00207 extern boolean addstrings (bigstring, bigstring, bigstring);
00208 
00209 extern boolean subtractstrings (bigstring, bigstring, bigstring);
00210 
00211 extern void ostypetostring (OSType, bigstring);
00212 
00213 extern boolean stringtoostype (bigstring, OSType *);
00214 
00215 extern boolean hexstringtonumber (bigstring, long *);
00216 
00217 extern void bytestohexstring (ptrvoid, long, bigstring);
00218 
00219 extern boolean bytestohex (Handle, Handle *);
00220 
00221 extern boolean hextobytes (Handle, Handle *);
00222 
00223 extern void numbertohexstring (long, bigstring);
00224 
00225 extern void kstring (long, bigstring);
00226 
00227 extern void dirtostring (tydirection, bigstring);
00228 
00229 extern boolean stringtodir (bigstring, tydirection *);
00230 
00231 extern boolean midinsertstring (bigstring, bigstring, short);
00232 
00233 extern boolean replacestring (bigstring, short, short, bigstring);
00234 
00235 extern boolean stringaddcommas (bigstring);
00236 
00237 extern boolean stringdeletechars (bigstring, char);
00238 
00239 extern boolean assurelastchariscolon (bigstring);
00240 
00241 extern boolean utf16toansi (Handle, Handle); /*7.0b42 PBS*/
00242 
00243 extern boolean utf8toansi (Handle, Handle); /*7.0b42 PBS*/
00244 
00245 extern boolean ansitoutf8 (Handle, Handle); /*7.0b42 PBS*/
00246 
00247 extern boolean ansitoutf16 (Handle, Handle); /*7.0b42 PBS*/
00248 
00249 extern boolean pullstringsuffix (bigstring, bigstring, unsigned char); /*7.0.2b1 Radio PBS*/
00250 
00251 
00252 extern void initstrings (void);
00253 
00254 
00255 extern boolean stringinitverbs (void); /*stringverbs.c*/
00256 
00257 extern long countleadingchars (Handle, byte);
00258 
00259 extern void handlepopleadingchars (Handle htext, byte ch);
00260 
00261 extern void handlepoptrailingchars (Handle htext, byte ch);
00262 
00263 extern void latintomac (Handle h); /*7.0b28 PBS*/
00264 
00265 extern void mactolatin (Handle h); /*7.0b41 PBS*/
00266 
00267 extern boolean macromantoutf8 (Handle, Handle); /* 2006-02-25 creedon */
00268 
00269 extern boolean utf8tomacroman (Handle, Handle); /* 2006-02-25 creedon */
00270 
00271 extern boolean convertCharset( Handle, Handle, bigstring, bigstring );
00272 
00273 extern boolean isTextEncodingAvailable( bigstring ); /* 2006-04-23 smd */
00274 
00275 #endif
00276 

Generated on Wed May 31 18:20:02 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6