mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 03:09:33 -06:00
constant time and space grammar embedding
This commit is contained in:
@@ -100,6 +100,8 @@ public:
|
||||
|
||||
PGF_INTERNAL_DECL static txn_t get_txn_id();
|
||||
|
||||
PGF_INTERNAL_DECL const char *get_file_path() { return filepath; };
|
||||
|
||||
template<class A>
|
||||
static ref<A> malloc(size_t extra_bytes=0) {
|
||||
return current_db->malloc_internal(sizeof(A)+extra_bytes);
|
||||
|
||||
@@ -265,7 +265,13 @@ end:
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
PGF_API_DECL
|
||||
PGF_API
|
||||
const char *pgf_file_path(PgfDB *db)
|
||||
{
|
||||
return db->get_file_path();
|
||||
}
|
||||
|
||||
PGF_API
|
||||
void pgf_free_revision(PgfDB *db, PgfRevision revision)
|
||||
{
|
||||
try {
|
||||
@@ -281,7 +287,7 @@ void pgf_free_revision(PgfDB *db, PgfRevision revision)
|
||||
delete db;
|
||||
}
|
||||
|
||||
PGF_API_DECL
|
||||
PGF_API
|
||||
void pgf_free_concr_revision(PgfDB *db, PgfConcrRevision revision)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -267,7 +267,7 @@ PgfDB *pgf_new_ngf(PgfText *abstract_name,
|
||||
PgfRevision *revision,
|
||||
PgfExn* err);
|
||||
|
||||
PGF_API
|
||||
PGF_API_DECL
|
||||
void pgf_merge_pgf(PgfDB *db, PgfRevision revision,
|
||||
const char* fpath,
|
||||
PgfExn* err);
|
||||
@@ -277,6 +277,9 @@ void pgf_write_pgf(const char* fpath,
|
||||
PgfDB *db, PgfRevision revision,
|
||||
PgfExn* err);
|
||||
|
||||
PGF_API_DECL
|
||||
const char *pgf_file_path(PgfDB *db);
|
||||
|
||||
/* Release a revision. If this is the last revision for the given
|
||||
* database, then the database is released as well. */
|
||||
PGF_API_DECL
|
||||
|
||||
Reference in New Issue
Block a user