project_files/frontlib/model/schemelist.h
changeset 7320 e704706008d4
parent 7314 6171f0bad318
child 7464 859ab6859854
equal deleted inserted replaced
7318:a446eafcddeb 7320:e704706008d4
    24  */
    24  */
    25 
    25 
    26 #ifndef SCHEMELIST_H_
    26 #ifndef SCHEMELIST_H_
    27 #define SCHEMELIST_H_
    27 #define SCHEMELIST_H_
    28 
    28 
    29 #include "cfg.h"
    29 #include "scheme.h"
    30 
    30 
    31 typedef struct {
    31 typedef struct {
    32 	int _referenceCount;
    32 	int _referenceCount;
    33 	int schemeCount;
    33 	int schemeCount;
    34 	flib_cfg **schemes;
    34 	flib_scheme **schemes;
    35 } flib_schemelist;
    35 } flib_schemelist;
    36 
    36 
    37 /**
    37 /**
    38  * Load a list of configurations from the ini file.
    38  * Load a list of configurations from the ini file.
    39  * Returns NULL on error.
    39  * Returns NULL on error.
    40  */
    40  */
    41 flib_schemelist *flib_schemelist_from_ini(flib_cfg_meta *meta, const char *filename);
    41 flib_schemelist *flib_schemelist_from_ini(flib_metascheme *meta, const char *filename);
    42 
    42 
    43 /**
    43 /**
    44  * Store the list of configurations to an ini file.
    44  * Store the list of configurations to an ini file.
    45  * Returns NULL on error.
    45  * Returns NULL on error.
    46  */
    46  */
    55  * Insert a new scheme into the list at position pos, moving all higher schemes to make place.
    55  * Insert a new scheme into the list at position pos, moving all higher schemes to make place.
    56  * pos must be at least 0 (insert at the start) and at most list->schemeCount (insert at the end).
    56  * pos must be at least 0 (insert at the start) and at most list->schemeCount (insert at the end).
    57  * The scheme is retained automatically.
    57  * The scheme is retained automatically.
    58  * Returns 0 on success.
    58  * Returns 0 on success.
    59  */
    59  */
    60 int flib_schemelist_insert(flib_schemelist *list, flib_cfg *cfg, int pos);
    60 int flib_schemelist_insert(flib_schemelist *list, flib_scheme *cfg, int pos);
    61 
    61 
    62 /**
    62 /**
    63  * Delete a cfg from the list at position pos, moving down all higher schemes.
    63  * Delete a cfg from the list at position pos, moving down all higher schemes.
    64  * The scheme is released automatically.
    64  * The scheme is released automatically.
    65  * Returns 0 on success.
    65  * Returns 0 on success.
    67 int flib_schemelist_delete(flib_schemelist *list, int pos);
    67 int flib_schemelist_delete(flib_schemelist *list, int pos);
    68 
    68 
    69 /**
    69 /**
    70  * Find the scheme with a specific name
    70  * Find the scheme with a specific name
    71  */
    71  */
    72 flib_cfg *flib_schemelist_find(flib_schemelist *list, const char *name);
    72 flib_scheme *flib_schemelist_find(flib_schemelist *list, const char *name);
    73 
    73 
    74 /**
    74 /**
    75  * Increase the reference count of the object. Call this if you store a pointer to it somewhere.
    75  * Increase the reference count of the object. Call this if you store a pointer to it somewhere.
    76  * Returns the parameter.
    76  * Returns the parameter.
    77  */
    77  */