further extend the API of the C runtime

This commit is contained in:
Krasimir Angelov
2017-10-04 09:45:56 +02:00
parent e426e87cf8
commit e3aa392e63
8 changed files with 92 additions and 30 deletions

View File

@@ -152,6 +152,17 @@ pgf_category_context(PgfPGF *gr, PgfCId catname)
return abscat->context;
}
PGF_API prob_t
pgf_category_prob(PgfPGF* pgf, PgfCId catname)
{
PgfAbsCat* abscat =
gu_seq_binsearch(pgf->abstract.cats, pgf_abscat_order, PgfAbsCat, catname);
if (abscat == NULL)
return INFINITY;
return abscat->prob;
}
PGF_API GuString
pgf_language_code(PgfConcr* concr)
{
@@ -221,7 +232,7 @@ pgf_function_is_constructor(PgfPGF* pgf, PgfCId funname)
return (absfun->defns == NULL);
}
PGF_API double
PGF_API prob_t
pgf_function_prob(PgfPGF* pgf, PgfCId funname)
{
PgfAbsFun* absfun =