Add model information to the hash */
| 286 | |
| 287 | /* Add model information to the hash */ |
| 288 | static void hash_add_model(int id, |
| 289 | const char *mfg_name, |
| 290 | const char *model_name, |
| 291 | const char *version, |
| 292 | const char *status, |
| 293 | const char *macro_name) |
| 294 | { |
| 295 | struct mod_lst *s; |
| 296 | |
| 297 | s = (struct mod_lst *)calloc(1, sizeof(struct mod_lst)); |
| 298 | |
| 299 | s->id = id; |
| 300 | SNPRINTF(s->mfg_name, sizeof(s->mfg_name), "%s", mfg_name); |
| 301 | SNPRINTF(s->model_name, sizeof(s->model_name), "%s", model_name); |
| 302 | SNPRINTF(s->version, sizeof(s->version), "%s", version); |
| 303 | SNPRINTF(s->status, sizeof(s->status), "%s", status); |
| 304 | SNPRINTF(s->macro_name, sizeof(s->macro_name), "%s", macro_name); |
| 305 | |
| 306 | HASH_ADD_INT(models, id, s); /* id: name of key field */ |
| 307 | } |
| 308 | |
| 309 | |
| 310 | /* Hash sorting functions */ |