Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some MACROS LIKE LL_REVERSE() to support reverse the list #263

Closed
govc opened this issue Aug 21, 2024 · 1 comment
Closed

Add some MACROS LIKE LL_REVERSE() to support reverse the list #263

govc opened this issue Aug 21, 2024 · 1 comment

Comments

@govc
Copy link

govc commented Aug 21, 2024

Please Add some macros to support reverse the list.
`
struct item{
int id;
struct item*next;
};

struct itemhead = NULL;
void additem(int id)
{
struct item
i = malloc(sizeof(*i));
i->id = id;
LL_PREPEND(head, i);
}

void add()
{
for(int i=0; i<1000000; i++)
additem(i);
}

int main(){
add();
LL_REVERSE(head);
return 0;
}

`

@Quuxplusone
Copy link
Collaborator

Closing as a duplicate of #197. I'm still amenable to such an addition; I just haven't had time or inclination to work on it specifically. Patches are still welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants