[FFmpeg-devel] [PATCH] Add av_stristr() function

Måns Rullgård mans
Mon Mar 8 23:33:56 CET 2010


Michael Niedermayer <michaelni at gmx.at> writes:

> On Mon, Mar 08, 2010 at 10:10:07PM +0000, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>> 
>> > On Sat, Mar 06, 2010 at 01:29:57PM +0000, Mans Rullgard wrote:
>> >> This is a case-insensitive version of strstr().
>> > [...]
>> >>  
>> >>  /**
>> >> + * Locate the first case-independent occurrence in the string s1 of
>> >> + * the string s2.  A zero-length string s2 is considered to match at
>> >> + * the start of s1.
>> >> + *
>> >> + * This function is a case-insensitive version of the standard strstr().
>> >> + *
>> >> + * @param s1 string to search in
>> >> + * @param s2 string to search for
>> >> + * @return pointer to the located match within s1 or a null pointer if no match
>> >> + */
>> >
>> > id replace s1/s2 with needle and haystack 
>> 
>> I used the same names as the standard definition of strstr(), but I
>> can of course change them.
>
> i would prefer some "colorfull" names over s1 and s2, well basically i gues
> i would be happy with any names that are semantically correct but would be
> semantically wrong if exchanged. s1,s2 as well as s2,s1 both are equally
> correct, thats bad because the variable then say nothing about them at all

Renamed.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list