[asterisk-dev] Use of AST_RWLIST*

Holger Wirtz wirtz at dfn.de
Fri Jun 5 04:34:13 CDT 2009


Russell,

Russell Bryant wrote:
> Holger Wirtz wrote:
>> I need a dynmaicly created in- and out-queue for "struct ast_frame*". I
>> tried to implement them with astobj2 but it seems that I haven't
>> understand how to use ao2 objects as a simple queue (for hashes ao2
>> objects working real fine).
> 
> Correct, an astobj2 container as implemented today does not fit this need.

Ok.

>> Now I am trying to use AST_RWLIST but I don't understand how to use it.
>> I tried to find some information from other code without success. So I
>> hope somebody from this list can give me some hints what I am doing
>> wrong. Also reading asterisk/include/linkedlists.h does not help to
>> recognize how to use AST_RWLIST...
>>
>> Has anyone a hint for me how to set up my queues?
> 
> Well, it would probably be easier to answer if you have a specific
> question about a problem you have.
> 
> In general, to create a queue with a list, you use the INSERT_TAIL() and
> REMOVE_HEAD() operations.

I just figured out how it works (I hope). I think I will try to write
some lines of text which may be added to the source as reference for
using AST_{RW}LIST.

My problem was that I had to create a dynamic AST_RWLIST and I had not
understand to create a struct for the entries. I thaught that I could
put ast_frames directly into the AST_RWLIST...

Thanks, Holger

-- 
#####  #### ##  ##   Holger Wirtz         Phone : (+49 30) 884299-40
##  ## ##   ### ##   DFN-Verein           Fax   : (+49 30) 884299-70
##  ## #### ######   Alexanderplatz 1     E-Mail: wirtz at dfn.de
##  ## ##   ## ###   10178 Berlin
#####  ##   ##  ##   GERMANY              WWW   : http://www.dfn.de
GPG-Fingerprint: ABFA 1F51 DD8D 503C 85DC  0C51 E961 79E2 6685 9BCF



More information about the asterisk-dev mailing list