[FFmpeg-devel] [PATCH] lavu: add av_strtok_r()

Stefano Sabatini stefasab at gmail.com
Sun Oct 16 01:03:37 CEST 2011


On date Saturday 2011-10-15 21:01:27 +0200, Stefano Sabatini encoded:
> On date Saturday 2011-10-15 15:45:02 +0200, Michael Niedermayer encoded:
> > On Sat, Oct 15, 2011 at 12:50:11PM +0200, Stefano Sabatini wrote:
> > > The function strtok_r() is part of the POSIX.1 specification, but is not
> > > available on some platforms. We provide an internal implementation, so we
> > > do not need to rely on a platform implementation.
> > > 
> > > The code is based on the OpenBSD libc strtok_r() implementation.
> > 
> > LGTM and great idea
> 
> I rewrote the function from scratch, which reads more readable to my
> eyes (also I was missing the original copyright notice, which should
> not be anymore required).
> 
> I also changed the docs, to make the doxy more compliant with the
> official POSIX.1 strtok_r() definition, which is explicitely referenced.
> 
> I'll push it in a day or so if I read no more comments.

> From caee55b975bd465139e40cb76713d6cc7e65d50f Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Sat, 15 Oct 2011 00:14:37 +0200
> Subject: [PATCH] lavu: add av_strtok_r()
> 
> The function strtok_r() is part of the POSIX.1 specification, but is not
> available on some platforms. We provide an internal implementation, so we
> do not need to rely on a platform implementation.

Bikeshed time!

What do people prefer between av_strtok (shorter, more consistent with
ffmpeg naming scheme, but confusing as strtok() is a function with a
different semantics), and av_strtok_r (more similar to the POSIX.1
function from which borrows its semantics)?

My guts tell me that av_strtok_r() will cause less overall confusion,
so I'd stick with that if I read no arguments in favor of av_strtok().


More information about the ffmpeg-devel mailing list