2020-02-09 01:28:32 +02:00
|
|
|
[Templates::] Template Services.
|
|
|
|
|
2020-03-31 02:17:21 +03:00
|
|
|
Behaviour specific to copies of the template genre.
|
2020-02-09 01:28:32 +02:00
|
|
|
|
2020-05-05 01:34:55 +03:00
|
|
|
@h Scanning metadata.
|
|
|
|
Metadata for website templates -- or rather, the complete lack of same -- is
|
|
|
|
stored in the following structure.
|
|
|
|
|
|
|
|
=
|
2020-02-09 01:28:32 +02:00
|
|
|
typedef struct inform_template {
|
|
|
|
struct inbuild_copy *as_copy;
|
2020-02-19 22:48:30 +02:00
|
|
|
struct semantic_version_number version;
|
2020-05-09 15:07:39 +03:00
|
|
|
CLASS_DEFINITION
|
2020-02-09 01:28:32 +02:00
|
|
|
} inform_template;
|
|
|
|
|
2020-05-05 01:34:55 +03:00
|
|
|
@ This is called as soon as a new copy |C| of the language genre is created.
|
|
|
|
|
|
|
|
=
|
|
|
|
void Templates::scan(inbuild_copy *C) {
|
2020-02-09 01:28:32 +02:00
|
|
|
inform_template *T = CREATE(inform_template);
|
2020-05-05 01:34:55 +03:00
|
|
|
T->as_copy = C;
|
2020-02-09 01:28:32 +02:00
|
|
|
T->version = VersionNumbers::null();
|
2020-05-05 01:34:55 +03:00
|
|
|
if (C == NULL) internal_error("no copy to scan");
|
|
|
|
Copies::set_metadata(C, STORE_POINTER_inform_template(T));
|
2020-02-09 01:28:32 +02:00
|
|
|
}
|