2 * tads2.c - Treaty of Babel module for Tads 2 files
\r
4 * This file depends on treaty_builder.h
\r
6 * This file is public domain, but note that any changes to this file may
\r
7 * render it noncompliant with the Treaty of Babel
\r
10 *. 04/15/2006 LRRaszewski - Separated tads2.c and tads3.c
\r
11 *. 04/08/2006 LRRaszewski - changed babel API calls to threadsafe versions
\r
12 *. 04/08/2006 MJRoberts - initial implementation
\r
15 #define FORMAT tads2
\r
16 #define HOME_PAGE "http://www.tads.org"
\r
17 #define FORMAT_EXT ".gam"
\r
20 #include "treaty_builder.h"
\r
23 #define T2_SIGNATURE "TADS2 bin\012\015\032"
\r
33 * get a story file's IFID
\r
35 static int32 get_story_file_IFID(void *story_file, int32 extent,
\r
36 char *output, int32 output_extent)
\r
38 /* use the common tads IFID extractor/generator */
\r
39 return tads_get_story_file_IFID(story_file, extent,
\r
40 output, output_extent);
\r
44 * determine if a given story file is one of ours
\r
46 static int32 claim_story_file(void *story_file, int32 extent)
\r
48 /* check our signature */
\r
49 if (tads_match_sig(story_file, extent, T2_SIGNATURE))
\r
50 return VALID_STORY_FILE_RV;
\r
52 /* not one of ours */
\r
53 return INVALID_STORY_FILE_RV;
\r
57 * Get the size of the iFiction metadata for the game
\r
59 static int32 get_story_file_metadata_extent(void *story_file, int32 extent)
\r
61 /* use the common tads iFiction synthesizer */
\r
62 return tads_get_story_file_metadata_extent(story_file, extent);
\r
66 * Get the iFiction metadata for the game
\r
68 static int32 get_story_file_metadata(void *story_file, int32 extent,
\r
69 char *buf, int32 bufsize)
\r
71 /* use the common tads iFiction synthesizer */
\r
72 return tads_get_story_file_metadata(story_file, extent, buf, bufsize);
\r
75 static int32 get_story_file_cover_extent(void *story_file, int32 story_len)
\r
77 /* use the common tads cover file extractor */
\r
78 return tads_get_story_file_cover_extent(story_file, story_len);
\r
82 * Get the format of the cover art
\r
84 static int32 get_story_file_cover_format(void *story_file, int32 story_len)
\r
86 /* use the common tads cover file extractor */
\r
87 return tads_get_story_file_cover_format(story_file, story_len);
\r
91 * Get the cover art data
\r
93 static int32 get_story_file_cover(void *story_file, int32 story_len,
\r
94 void *outbuf, int32 output_extent)
\r
96 /* use the common tads cover file extractor */
\r
97 return tads_get_story_file_cover(story_file, story_len,
\r
98 outbuf, output_extent);
\r