30 flib_teamlist *flib_teamlist_create(); |
30 flib_teamlist *flib_teamlist_create(); |
31 |
31 |
32 void flib_teamlist_destroy(flib_teamlist *list); |
32 void flib_teamlist_destroy(flib_teamlist *list); |
33 |
33 |
34 /** |
34 /** |
35 * Insert a team into the list. Returns 0 on success. |
35 * Insert a team into the list. The list takes ownership of the team. Returns 0 on success. |
36 */ |
36 */ |
37 int flib_teamlist_insert(flib_teamlist *list, flib_team *team, int pos); |
37 int flib_teamlist_insert(flib_teamlist *list, flib_team *team, int pos); |
38 |
38 |
39 /** |
39 /** |
40 * Delete the item with the name [name] from the list. |
40 * Delete the team with the name [name] from the list and destroys it. |
41 * Returns 0 on success. |
41 * Returns 0 on success. |
42 */ |
42 */ |
43 int flib_teamlist_delete(flib_teamlist *list, const char *name); |
43 int flib_teamlist_delete(flib_teamlist *list, const char *name); |
44 |
44 |
45 /** |
45 /** |
46 * Returns the team with the name [name] from the list if it exists, NULL otherwise |
46 * Returns the team with the name [name] from the list if it exists, NULL otherwise |
47 */ |
47 */ |
48 flib_team *flib_teamlist_find(const flib_teamlist *list, const char *name); |
48 flib_team *flib_teamlist_find(const flib_teamlist *list, const char *name); |
49 |
49 |
50 /** |
50 /** |
51 * Removes all items from the list and frees "teams". |
51 * Removes all items from the list and destroys them. |
52 */ |
52 */ |
53 void flib_teamlist_clear(flib_teamlist *list); |
53 void flib_teamlist_clear(flib_teamlist *list); |
54 |
54 |
55 /** |
55 /** |
56 * Create a copy of the list and all the teams it contains. Weaponsets are not copied, but |
56 * Create a copy of the list and all the teams it contains. Weaponsets are not copied, but |