Re: REMOVE_FROM_LIST

From: Patrick Dughi (dughi@imaxx.net)
Date: 08/17/00


> I have been implementing a party system into my circlemud, basically
> because i dislike the grouping system. I have ran into one dilemma .. I
> cannot quite understand the REMOVE_FROM_LIST macro ..
>
> struct party_type {
>    struct char_data *member;
>    struct follow_type *next;
> };
>
> struct char_data {
>     ...
>    char party_name;                    /* Party name */
>    struct char_data *party_leader;     /* Party leader */
>    struct party_type *party;           /* Party list */
> };
>
> i wuz thinking something on the line of:
>
> REMOVE_FROM_LIST(ch, ch->party_leader.party, next);
>
> but i don't think it did the correct result .. any info would be
> helpful, thanx =)
>

REMOVE_FROM_LIST takes three arugments; The data item to remove, the list
containing the data item to remove, and the name of the pointer to the
next structure in the list.

        In your case, you'd want (ch,ch->party,next);


                                                PjD


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT