File: stack.h

package info (click to toggle)
conntrack-tools 1%3A1.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,580 kB
  • sloc: ansic: 20,447; sh: 6,209; yacc: 1,480; makefile: 194; lex: 181; python: 176
file content (28 lines) | stat: -rw-r--r-- 532 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _STACK_H_
#define _STACK_H_

#include "linux_list.h"

struct stack {
	struct list_head	list;
	int			items;
};

static inline void stack_init(struct stack *s)
{
	INIT_LIST_HEAD(&s->list);
}

struct stack_item {
	struct list_head	head;
	int			type;
	int			data_len;
	char			data[0];
};

struct stack_item *stack_item_alloc(int type, size_t data_len);
void stack_item_free(struct stack_item *e);
void stack_item_push(struct stack *s, struct stack_item *e);
struct stack_item *stack_item_pop(struct stack *s, int type);

#endif