Compiling externals: strcasestr etc.

Thierry Arbellot thierry.arbellot at wanadoo.fr
Mon Mar 12 16:27:29 CDT 2007


Hi Thomas,

Here is a C function to change the case of a text.

void		myLowercaseText(
	char	*text)
{
	CFStringRef	theString;
	
	theString = CFStringCreateWithCString 
(kCFAllocatorDefault,text,kCFStringEncodingMacRoman);
	if( theString ) {
		CFStringLowercase((CFMutableStringRef)theString,NULL);
		CFStringGetCString(theString,text,strlen(text) 
+1,kCFStringEncodingMacRoman);
		CFRelease(theString);
	}

	return;
}

Hope it helps
Thierry

On 2007, Mar 12, at 08:24, Thomas Fischer wrote:

> Hello,
>
> while compiling one external using Mac OS 10.4.8, XCode 2.4.1 and  
> the "ExternalsEnvironmentV2" provided by the newsletter
> I obtained the error:
>  error: `strcasestr' undeclared (first use this function)
> Can anybody explain this? strstr works without a problem, and the  
> external compiles in an older setting of of the XCode environment too.
>
> From a related problem an additional question:
> LowercaseText has been deprecated, but the Unicode-savvy  
> alternative CFStringLowercase with a CFMutableString seems pretty  
> complicated. Does anybody know a simple method to make parameters  
> like "AND" or "even" case-insensitive in an external functions?
>
> Best regards
> Thomas Fischer





More information about the use-livecode mailing list