[Freeswitch-dev] apr_ vs. switch_ namespace questions
Michael Jerris
mike at jerris.com
Fri Nov 9 05:09:54 EST 2007
The general rule is, that the apr_ namespace is unavailable, except to a
select few files in the core. Modules can not use the apr_ namespace. The
one exception to this is mod_openmrcp, where it gets access to the
apr_namespace via the openmrcp libraries, as apr is used natively in that
library. Further, in the core, we should only be using the apr_ namespace
for those functions that we have chosen not to wrap and expose out of the
core. The reasons for this are, more or less as stated. We have already
had several occasions where we have used the wrapper functions to correct
bugs in apr, or to modify the behavior of functions, as we recently did with
some of the socket code.
Mike
On 11/9/07, Michael Collins <mcollins at fcnetwork.com> wrote:
>
> > Best policy is to use switch_ and not use the lazy apr_.
>
> I tend to agree, at least from the standpoint of a non-coder who wants
> (or needs) to read the source code.
>
> > I cannot think of a good reason, maybe others can -- but,
>
> I can't either. To preserve modularity, and to make it easier to
> migrate away from apr if that need should arise, a clean and consistent
> namespace seems appropriate.
>
> > If you find occurrences of non-conformance, patches are welcome!
>
> Sounds good. I'm studying up on apr (and thusly switch_xxx) and if/when
> I'm comfortable submitting patches I will most definitely do so.
>
> -MC
>
>
> >
> > m
> >
> >
> >
> > On Thu, 8 Nov 2007, Michael Collins wrote:
> >
> > > Guys,
> > >
> > >
> > >
> > > bkw gave me some homework and now I have a few questions. I notice
> that
> > > in switch-types.h there are all sorts of typedef struct statements
> that
> > > create a switch_ version of the corresponding apr_ type. However,
> I've
> > > also noticed that scattered throughout the source that there are
> > > numerous occasions where the apr_ namespace is used even when there
> is a
> > > switch_ equivalent available. Example: using apr_pool_t instead of
> > > switch_memory_pool_t in mod_openmrcp.c.
> > >
> > >
> > >
> > > Questions: Is it FS standard policy/best practices always to use
> the
> > > switch_ namespace? Are there legitimate situations where one would
> > > prefer apr_ instead of switch_?
> > >
> > >
> > >
> > > Thanks,
> > >
> > > MC
> > >
> > >
> > >
> > > P.S. - If there are cases where apr_ is used when there are switch_
> > > equivalents, does that mean there is an impending codebase cleanup
> > > project to make everything consistent?
> > >
> > >
> >
> > _______________________________________________
> > Freeswitch-dev mailing list
> > Freeswitch-dev at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> > http://www.freeswitch.org
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20071109/8d10d7c4/attachment.html
More information about the Freeswitch-dev
mailing list