summaryrefslogtreecommitdiff
path: root/render/list.h
blob: f168bd043efaf3c8f801a91c98772a418699a957 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
/*
 * This file is part of NetSurf, http://netsurf.sourceforge.net/
 * Licensed under the GNU General Public License,
 *                http://www.opensource.org/licenses/gpl-license
 * Copyright 2005 Richard Wilson <info@tinct.net>
 */

/** \file
 * HTML lists (interface).
 */

#ifndef _NETSURF_RENDER_LIST_H_
#define _NETSURF_RENDER_LIST_H_

#include <stdbool.h>

struct list_counter {
  	char *name;				/** Counter name */
  	struct list_counter_state *first;	/** First counter state */
  	struct list_counter_state *state;	/** Current counter state */
	struct list_counter *next;		/** Next counter */
};

struct list_counter_state {
	int count;				/** Current count */
	struct list_counter_state *parent;	/** Parent counter, or NULL */
	struct list_counter_state *next;	/** Next counter, or NULL */
};


void render_list_destroy_counters(void);
bool render_list_counter_reset(const char *name, int value);
bool render_list_counter_increment(const char *name, int value);
bool render_list_counter_end_scope(const char *name);
char *render_list_counter(struct css_counter *css_counter);

void render_list_test(void);

#endif