mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-13 17:44:54 +00:00
libsepol/cil: Add function to get number of items in a stack
Add the function, cil_stack_number_of_items(), to return the number of items in the stack. Signed-off-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
c304156133
commit
d0b5ba03ba
@ -67,6 +67,11 @@ int cil_stack_is_empty(struct cil_stack *stack)
|
||||
return (stack->pos == -1);
|
||||
}
|
||||
|
||||
int cil_stack_number_of_items(struct cil_stack *stack)
|
||||
{
|
||||
return stack->pos + 1;
|
||||
}
|
||||
|
||||
void cil_stack_push(struct cil_stack *stack, enum cil_flavor flavor, void *data)
|
||||
{
|
||||
stack->pos++;
|
||||
|
@ -52,6 +52,7 @@ void cil_stack_destroy(struct cil_stack **stack);
|
||||
|
||||
void cil_stack_empty(struct cil_stack *stack);
|
||||
int cil_stack_is_empty(struct cil_stack *stack);
|
||||
int cil_stack_number_of_items(struct cil_stack *stack);
|
||||
|
||||
void cil_stack_push(struct cil_stack *stack, enum cil_flavor flavor, void *data);
|
||||
struct cil_stack_item *cil_stack_pop(struct cil_stack *stack);
|
||||
|
Loading…
Reference in New Issue
Block a user