summaryrefslogtreecommitdiff
path: root/src/string_list.h
blob: 8dfe0b83939c275a534cb6b8225759517d355bc4 (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
#pragma once

#include "sglib.h"
#include "angband.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * String list.
 */
typedef struct string_list string_list;
struct string_list {
	/* The string list owns the string */
	char *s;
	/* Next */
	string_list *next;
};

int compare_string_list(string_list *a, string_list *b);
SGLIB_DEFINE_LIST_PROTOTYPES(string_list, compare_string, next);

void string_list_init(string_list *sl, cptr s); /* Initialize element; copies string */
void string_list_destroy(string_list *sl);      /* Destroy element */
void string_list_append(string_list **slist, cptr s); /* Append string */

#ifdef __cplusplus
} // extern "C"
#endif