Introduce ast_parse_arg() , a generic function to parse strings
authorLuigi Rizzo <rizzo@icir.org>
Tue, 17 Jul 2007 14:32:15 +0000 (14:32 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Tue, 17 Jul 2007 14:32:15 +0000 (14:32 +0000)
commit72b99a281758ca33a329c34cfebcf374abcb5e2d
tree2199112acfa0525a24f3d518d07bdc9d8f16b515
parent35efc961efb80a419dd38ffc3e2880d7894db137
Introduce ast_parse_arg() , a generic function to parse strings
in a consistent way. This is meant to replace the custom code
which is repeated all over the place in the various files when
parsing config files, CLI entries and other string information.

Right now the code supports parsing int32, uint32 and sockaddr_in with
optional default values and bound checks. It contains minimal error
checking, but that can be easily extended as the need arises.

Being a new API i am introducing this only in trunk, though I believe
that once the interface has been ironed out it might become a
worthwhile addition to 1.4 as well - basically, the first time
we will need to fix a piece of argument parsing code, we might as
well bring in this change and use the new API instead.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/config.h
main/config.c