Split clkoff initialization

This commit is contained in:
Rodrigo Arias 2023-01-20 15:36:40 +01:00 committed by Rodrigo Arias Mallo
parent b4d5e33d6c
commit d6f9ed7125
2 changed files with 10 additions and 5 deletions

View File

@ -106,19 +106,23 @@ cindex(struct clkoff *table)
return 0; return 0;
} }
int void
clkoff_init(struct clkoff *table, FILE *file) clkoff_init(struct clkoff *table)
{ {
memset(table, 0, sizeof(struct clkoff)); memset(table, 0, sizeof(struct clkoff));
}
int
clkoff_load(struct clkoff *table, FILE *file)
{
if (cparse(table, file) != 0) { if (cparse(table, file) != 0) {
err("clkoff_init: failed parsing clock table\n"); err("clkoff_load: failed parsing clock table\n");
return -1; return -1;
} }
/* Create index array */ /* Create index array */
if (cindex(table) != 0) { if (cindex(table) != 0) {
err("clkoff_init: failed indexing table\n"); err("clkoff_load: failed indexing table\n");
return -1; return -1;
} }

View File

@ -24,7 +24,8 @@ struct clkoff {
struct clkoff_entry **index; struct clkoff_entry **index;
}; };
int clkoff_init(struct clkoff *table, FILE *file); void clkoff_init(struct clkoff *table);
int clkoff_load(struct clkoff *table, FILE *file);
int clkoff_count(struct clkoff *table); int clkoff_count(struct clkoff *table);
struct clkoff_entry *clkoff_get(struct clkoff *table, int i); struct clkoff_entry *clkoff_get(struct clkoff *table, int i);