[Asterisk-Dev] Misbehaviour in ast_variable_browse

Luis Vazquez luis at teledata.com.uy
Tue Feb 22 07:22:14 MST 2005


Hello Kevin,
you are totally right "it would be logical"; and as said in my first 
mail, in order to not to break all current uses of the API, my 
suggestion was to give a little new function called 
ast_variable_next(cfg,cat,var) or ast_variable_walk(cfg,cat,var) to 
allow an API user walk through the variable list without messing with 
the internals of the list, that's the idea behind all the config.h stuff.
But nevermind, just something It would be nice to take into account in 
asterisk 2.0

Best regards,
Luis


Kevin P. Fleming wrote:

> Luis Vazquez wrote:
>
>> cat = ast_category_browse(cfg);
>> while(cat) {
>>   /* do our thinng */
>>   cat = cat->next;
>> }
>
>
> It is not done this way, because "struct ast_category" is an opaque 
> type outside of config.c; no users of the config API can see inside it.
>
> "struct ast_variable", on the other hand, is not opaque, and users can 
> follow the links to walk through the variable list. While it would be 
> logical to change that, it would break all existing users of the API 
> (including the out-of-tree ones, which is nasty) and for very little 
> gain.
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>




More information about the asterisk-dev mailing list