1 /* magscrolls.c Treaty of Babel module for Z-code files
\r
2 * 2006 By L. Ross Raszewski
\r
4 * This file depends on treaty_builder.h
\r
6 * This file is public domain, but note that any changes to this file
\r
7 * may render it noncompliant with the Treaty of Babel
\r
10 #define FORMAT magscrolls
\r
11 #define HOME_PAGE "http://www.if-legends.org/~msmemorial/memorial.htm"
\r
12 #define FORMAT_EXT ".mag"
\r
16 #include "treaty_builder.h"
\r
33 static struct maginfo manifest[] = {
\r
34 { 0, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
\r
41 { 1, "\000\004\000\001\007\370\000\000\340\000\000\000\041\064\000\000\040\160\000\000",
\r
48 { 2, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
\r
53 "Georgina Sinclair and Michael Bywater",
\r
55 { 4, "\000\004\000\001\045\140\000\001\000\000\000\000\161\017\000\000\035\210\000\001",
\r
60 "Rob Steggles and Hugh Steers",
\r
62 { 4, "\000\004\000\001\044\304\000\001\000\000\000\000\134\137\000\000\040\230\000\001",
\r
67 "John Molloy, Pete Kemp, Phil South, Rob Steggles",
\r
69 { 4, "\000\003\000\000\377\000\000\000\340\000\000\000\221\000\000\000\036\000\000\001",
\r
74 "Rob Steggles and Hugh Steers",
\r
76 { 4, "\000\003\000\001\000\000\000\000\340\000\000\000\175\000\000\000\037\000\000\001",
\r
81 "John Molloy, Pete Kemp, Phil South, Rob Steggles",
\r
83 { 4, "\000\003\000\000\335\000\000\000\140\000\000\000\064\000\000\000\023\000\000\000",
\r
90 { 4, "\000\004\000\001\122\074\000\001\000\000\000\000\114\146\000\000\057\240\000\001",
\r
97 { 0, "0", NULL, 0, 0, NULL, NULL }
\r
100 static int32 get_story_file_IFID(void *story_file, int32 extent, char *output, int32 output_extent)
\r
103 unsigned char *sf=(unsigned char *)story_file;
\r
104 if (extent < 42) return INVALID_STORY_FILE_RV;
\r
106 for(i=0;manifest[i].title;i++)
\r
107 if ((sf[13]<3 && manifest[i].gv==sf[13]) || memcmp(manifest[i].header,sf+12,20)==0)
\r
109 ASSERT_OUTPUT_SIZE(((int32) strlen(manifest[i].ifid)+1));
\r
110 strcpy(output,manifest[i].ifid);
\r
113 strcpy(output,"MAGNETIC-");
\r
114 return INCOMPLETE_REPLY_RV;
\r
117 static int32 claim_story_file(void *story_file, int32 extent)
\r
120 memcmp(story_file,"MaSc",4)
\r
121 ) return INVALID_STORY_FILE_RV;
\r
122 return VALID_STORY_FILE_RV;
\r