1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-18 15:04:25 +03:00
inform7/inbuild/inbuild-module/Chapter 2/Editions.w
2020-02-20 00:39:36 +00:00

41 lines
1.1 KiB
OpenEdge ABL

[Editions::] Editions.
An edition is numbered version of a work.
@h Editions.
An "edition" of a work is a particular version numbered form of it. For
example, release 7 of Bronze by Emily Short would be an edition of Bronze.
=
typedef struct inbuild_edition {
struct inbuild_work *work;
struct semantic_version_number version;
struct compatibility_specification *compatibility;
MEMORY_MANAGEMENT
} inbuild_edition;
inbuild_edition *Editions::new(inbuild_work *work, semantic_version_number version) {
inbuild_edition *edition = CREATE(inbuild_edition);
edition->work = work;
edition->version = version;
edition->compatibility = Compatibility::all();
return edition;
}
void Editions::write(OUTPUT_STREAM, inbuild_edition *E) {
Works::write(OUT, E->work);
semantic_version_number V = E->version;
if (VersionNumbers::is_null(V) == FALSE) {
WRITE(" v%v", &V);
}
}
void Editions::inspect(OUTPUT_STREAM, inbuild_edition *E) {
Editions::write(OUT, E);
if (Compatibility::universal(E->compatibility) == FALSE) {
WRITE(" (");
Compatibility::write(OUT, E->compatibility);
WRITE(")");
}
}