return parse_dict_variable (default_dict);
}
-/* Returns the dictionary class corresponding to a variable named
- NAME. */
-enum dict_class
-dict_class_from_id (const char *name)
-{
- assert (name != NULL);
-
- switch (name[0])
- {
- default:
- return DC_ORDINARY;
- case '$':
- return DC_SYSTEM;
- case '#':
- return DC_SCRATCH;
- }
-}
-
-/* Returns the name of dictionary class DICT_CLASS. */
-const char *
-dict_class_to_name (enum dict_class dict_class)
-{
- switch (dict_class)
- {
- case DC_ORDINARY:
- return _("ordinary");
- case DC_SYSTEM:
- return _("system");
- case DC_SCRATCH:
- return _("scratch");
- default:
- assert (0);
- abort ();
- }
-}
/* Parses a set of variables from dictionary D given options
OPTS. Resulting list of variables stored in *VAR and the
if (*nv >= *mv)
{
*mv = 2 * (*nv + 1);
- *v = xrealloc (*v, *mv * sizeof **v);
+ *v = xnrealloc (*v, *mv, sizeof **v);
}
if ((pv_opts & PV_DUPLICATE) || !included[idx])
if (mvar < nvar + (n2 - n1 + 1))
{
mvar += ROUND_UP (n2 - n1 + 1, 16);
- *names = xrealloc (*names, mvar * sizeof **names);
+ *names = xnrealloc (*names, mvar, sizeof **names);
}
for (n = n1; n <= n2; n++)
if (nvar >= mvar)
{
mvar += 16;
- *names = xrealloc (*names, mvar * sizeof **names);
+ *names = xnrealloc (*names, mvar, sizeof **names);
}
(*names)[nvar++] = xstrdup (name1);
}
if (!parse_variables (default_dict, &v, &nv, PV_NONE))
goto fail;
- *names = xrealloc (*names, (*nnames + nv) * sizeof **names);
+ *names = xnrealloc (*names, *nnames + nv, sizeof **names);
for (i = 0; i < nv; i++)
(*names)[*nnames + i] = xstrdup (v[i]->name);
free (v);