[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generic stack I can use in C core?
From: |
Yuan Fu |
Subject: |
Re: Generic stack I can use in C core? |
Date: |
Fri, 23 Sep 2022 14:56:23 -0700 |
> On Sep 23, 2022, at 1:12 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Fri, 23 Sep 2022 12:24:45 -0700
>>
>>
>>
>>> On Sep 23, 2022, at 12:20 PM, Yuan Fu <casouri@gmail.com> wrote:
>>>
>>> Is there a generic stack data structure that I use in the C core? Something
>>> that automatically grows and shrinks?
>>
>> *Something that allocates a chunk of memory to store the nodes and
>> automatically grows and shrinks and copies stuff over.
>
> What kind of stuff do you want to store there?
I want to traverse a tree depth-first using stacks. If there is a generic stack
I’ll use that, if not I’ll just use
struct stack_node {
TSNode node;
TSNode *next;
};
Yuan