The function takes a file-descriptor f and repositions the offset to o and returns the offset to the last character in the first occurrence of the string m.
I think it is a quite fast and minimal implementation, free for grab if you need one.
In an UTF-8 environment with variable-width encoding a character uses one to four bytes of the system’s assigned 256 bytes for a file name. And with my Unicode example your are limited to one half, a 128 character file name.
binf@home:~/codesnippets/C$ uname -rvm
3.8.0-35-generic #52~precise1-Ubuntu SMP Thu Jan 30 17:24:40 UTC 2014 x86_64
Kelson Co. Ltd. contacted me a couple of years ago to do the sound effects and title score music for the game “Pengbears“. The Game was not a immediately success, but have now
received good reviews on Google Play and have about 10.000 – 50.000 installs.
After about 24 hours of finetuning, we had to surrender and deliver our demo.
With the file uploaded in time for soft deadline, I could finally get some sleep.
Enex (Montrêal, Canada) was CET-6 hours behind me, and when Dran had to take a break and sleep, Enex continued, and we delivered in time but with a few flaws.
After the Gathering we all had a break from the computer, and because of that we did not upload the final version before a couple of weeks ago. (Yes, that was easter 2012.)