17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 */ |
18 */ |
19 |
19 |
20 /** |
20 /** |
21 * Functions for managing a list of schemes. |
21 * Functions for managing a list of schemes. |
22 * This is in here because the scheme config file of the QtFrontend (which we are staying compatble with) contains |
22 * This is in here because the scheme config file of the QtFrontend (which we are staying compatible with) contains |
23 * all the schemes at once, so we need functions to work with a list like that. |
23 * all the schemes at once, so we need functions to work with a list like that. |
24 */ |
24 */ |
25 |
25 |
26 #ifndef SCHEMELIST_H_ |
26 #ifndef SCHEMELIST_H_ |
27 #define SCHEMELIST_H_ |
27 #define SCHEMELIST_H_ |
51 flib_schemelist *flib_schemelist_create(); |
51 flib_schemelist *flib_schemelist_create(); |
52 |
52 |
53 /** |
53 /** |
54 * Insert a new scheme into the list at position pos, moving all higher schemes to make place. |
54 * Insert a new scheme into the list at position pos, moving all higher schemes to make place. |
55 * pos must be at least 0 (insert at the start) and at most list->schemeCount (insert at the end). |
55 * pos must be at least 0 (insert at the start) and at most list->schemeCount (insert at the end). |
56 * The scheme is retained automatically. |
56 * Ownership of the scheme is transferred to the list. |
57 * Returns 0 on success. |
57 * Returns 0 on success. |
58 */ |
58 */ |
59 int flib_schemelist_insert(flib_schemelist *list, flib_scheme *cfg, int pos); |
59 int flib_schemelist_insert(flib_schemelist *list, flib_scheme *cfg, int pos); |
60 |
60 |
61 /** |
61 /** |
62 * Delete a scheme from the list at position pos, moving down all higher schemes. |
62 * Delete a scheme from the list at position pos, moving down all higher schemes. |
63 * The scheme is released automatically. |
63 * The scheme is destroyed. |
64 * Returns 0 on success. |
64 * Returns 0 on success. |
65 */ |
65 */ |
66 int flib_schemelist_delete(flib_schemelist *list, int pos); |
66 int flib_schemelist_delete(flib_schemelist *list, int pos); |
67 |
67 |
68 /** |
68 /** |
69 * Find the scheme with a specific name |
69 * Find the scheme with a specific name |
70 */ |
70 */ |
71 flib_scheme *flib_schemelist_find(flib_schemelist *list, const char *name); |
71 flib_scheme *flib_schemelist_find(flib_schemelist *list, const char *name); |
72 |
72 |
73 /** |
73 /** |
74 * Free this schemelist. |
74 * Free this schemelist and all contained schemes |
75 */ |
75 */ |
76 void flib_schemelist_destroy(flib_schemelist *list); |
76 void flib_schemelist_destroy(flib_schemelist *list); |
77 |
77 |
78 |
78 |
79 #endif /* SCHEMELIST_H_ */ |
79 #endif /* SCHEMELIST_H_ */ |