John, ?? Sorry, my mistake: it is a doubly linked list. I forgot about the prev member in PJ_DECL_LIST_MEMBER. --- On Mon, 2/14/11, john smith <pyroflares at gmail.com> wrote: From: john smith <pyroflares@xxxxxxxxx> Subject: Fwd: Problems Understanding the code To: "peteryzwei" <peteryzwei at yahoo.com> Cc: "pjsip list" <pjsip at lists.pjsip.org> Date: Monday, February 14, 2011, 1:09 AM Hi Peter, Thanks for the reply.but if u think that the linklist employed singular linked circular linked list then why does the link in the pjsip website say that its is doubly linked list. check out the website. http://www.pjsip.org/pjlib/docs/html/group__PJ__LIST.htm and if we assume that it is just a doubly linked list then how can we insert the line hdr = rdata->msg_info.msg->hdr.next; ?? while (hdr != &rdata->msg_info.msg->hdr) { because this line tells me that it should be circular linked list implementation. I will appreciate a reply. Thanks in advance. Cheers..!!! ---------- Forwarded message ---------- From: peteryzwei <peteryzwei@xxxxxxxxx> Date: Fri, Feb 11, 2011 at 8:37 PM Subject: Re: Problems Understanding the code To: pjsip list <pjsip at lists.pjsip.org> John, ? look at sip_msg.h and list.h for the SIP headers structures. Macros are used to define standard members of structures. Yes the linked list type is singular linked circular lists. I use grep or Visual Studio for finding symbols not defined in the current file. Pjsip does some quirky things like defining structures in .c files instead of .h files. I sometimes move them into .h file when I need access to those structs in another .c file. --- On Sun, 2/6/11, john smith <pyroflares at gmail.com> wrote: From: john smith <pyroflares@xxxxxxxxx> Subject: Problems Understanding the code To: "pjsip list" <pjsip at lists.pjsip.org> Date: Sunday, February 6, 2011, 8:37 AM Hi, I was going through the pjsip code and found that a lot of linked list is used? throughout the code to add new headers,remove and manupulate them. but ,what i am unsure at the moment is the type of linked list used for it (i guess we are using circular linked liist but i am not sure) how i guessed it... ?in this function of pjsip? pjsip_auth_clt_reinit_req the line? hdr = rdata->msg_info.msg->hdr.next; ?? while (hdr != &rdata->msg_info.msg->hdr) { tells me that hdr is pointing to the next instance and with the help of hdr ponter we are traversing the entire linked list until we reach the same position from where we started. i would be really great? if someone could point out the type of linked list employed. Also,in the same functon i find this line.. ?cached_auth->is_proxy = (hchal->type == PJSIP_H_PROXY_AUTHENTICATE); i tried to find? (const pjsip_www_authenticate_hdr *hchal;) hcal->type i.e to be precise type is the member i tried to find but to no avail,also besides type? i see many extensions such as slen and next which are not part of the structure and are throughly used throughout the code. I am a beginner so please,overlook my silly questions and help me in understanding the flow. Thanks in Advance. John. -----Inline Attachment Follows----- _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip at lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip at lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110214/51be5984/attachment-0001.html>