diff --git a/cinera/cinera.c b/cinera/cinera.c index 53252cf..e28f15d 100644 --- a/cinera/cinera.c +++ b/cinera/cinera.c @@ -14,7 +14,7 @@ typedef struct version CINERA_APP_VERSION = { .Major = 0, .Minor = 5, - .Patch = 22 + .Patch = 23 }; // TODO(matt): Copy in the DB 3 stuff from cinera_working.c @@ -122,7 +122,6 @@ typedef struct buffer IncludesIndex; buffer Search; buffer Index; // NOTE(matt): This buffer is malloc'd separately, rather than claimed from the memory_arena - buffer ScriptIndex; buffer IncludesPlayer; buffer Menus; buffer Player; @@ -2220,7 +2219,6 @@ HMMLToBuffers(buffers *CollationBuffers, template **BespokeTemplate, char *Filen RewindBuffer(&CollationBuffers->Player); RewindBuffer(&CollationBuffers->ScriptPlayer); RewindBuffer(&CollationBuffers->IncludesIndex); - RewindBuffer(&CollationBuffers->ScriptIndex); *CollationBuffers->Title = '\0'; *CollationBuffers->ProjectName = '\0'; @@ -2395,14 +2393,14 @@ HMMLToBuffers(buffers *CollationBuffers, template **BespokeTemplate, char *Filen int UniqueRefs = 0; CopyStringToBuffer(&CollationBuffers->Menus, - "
\n" + "
\n" " ", StringsDiffer(Config.Theme, "") ? Config.Theme : HMML.metadata.project); CopyStringToBufferHTMLSafe(&CollationBuffers->Menus, HMML.metadata.title); CopyStringToBuffer(&CollationBuffers->Menus, "\n" " ⚠ Click here to regain focus ⚠\n"); CopyStringToBuffer(&CollationBuffers->Player, - "
\n" + "
\n" "
\n" "
\n", HMML.metadata.id, StringsDiffer(Config.Theme, "") ? Config.Theme : HMML.metadata.project); @@ -3014,7 +3012,7 @@ AppendedIdentifier: if(HasFilterMenu) { - CopyStringToBuffer(&FilterState, "\n"); + " "); buffer URLPrefix; ClaimBuffer(&URLPrefix, "URLPrefix", 1024); @@ -3483,11 +3481,11 @@ AppendedIdentifier: ConstructURLPrefix(&URLPrefix, INCLUDE_JS, PAGE_PLAYER); CopyStringToBuffer(&CollationBuffers->IncludesPlayer, - " \n", + " ", URLPrefix.Location); CopyStringToBuffer(&CollationBuffers->ScriptPlayer, - " \n", + "", URLPrefix.Location); DeclaimBuffer(&URLPrefix); @@ -3669,20 +3667,24 @@ BuffersToHTML(buffers *CollationBuffers, template *Template, char *OutputPath, i CopyStringToBuffer(&Master, "\n" - " \n"); + " \n" + " "); CopyBuffer(&Master, PageType == PAGE_PLAYER ? &CollationBuffers->IncludesPlayer : &CollationBuffers->IncludesIndex); CopyStringToBuffer(&Master, "\n"); CopyStringToBuffer(&Master, " \n" - " \n"); + " \n" + " "); if(PageType == PAGE_PLAYER) { CopyBuffer(&Master, &CollationBuffers->Menus); - CopyStringToBuffer(&Master, "\n"); + CopyStringToBuffer(&Master, "\n" + " "); CopyBuffer(&Master, &CollationBuffers->Player); - CopyStringToBuffer(&Master, "\n"); + CopyStringToBuffer(&Master, "\n" + " "); CopyBuffer(&Master, &CollationBuffers->ScriptPlayer); CopyStringToBuffer(&Master, "\n"); } @@ -3899,31 +3901,6 @@ InsertIntoIndex(buffers *CollationBuffers, template **BespokeTemplate, char *Bas break; } - // TODO(matt): Remove this little scope after 0.5.22 has been run once and all the searches are working correctly - if(IndexMetadataFileReadCode == RC_SUCCESS) - { - Index.Header = *(index_header *)Index.Metadata.Buffer.Ptr; - - if(Index.Header.AppVersion.Major < 0 || - Index.Header.AppVersion.Minor < 5 || - Index.Header.AppVersion.Patch < 22) - { - CopyString(Index.File.Path, "%s/%s.index", Config.BaseDir, Config.ProjectID); - fprintf(stderr, "\e[1;31mRemoving %s and %s generated by Cinera version %d.%d.%d\n" - "prior to the index reinsertion fix implemented in version 0.5.22\e[0m\n", - Index.Metadata.Path, Index.File.Path, - Index.Header.AppVersion.Major, - Index.Header.AppVersion.Minor, - Index.Header.AppVersion.Patch); - - FreeBuffer(&Index.Metadata.Buffer); - IndexMetadataFileReadCode = RC_ERROR_FILE; - remove(Index.Metadata.Path); - remove(Index.File.Path); - } - } - // - Index.File.Buffer.ID = "IndexFile"; CopyString(Index.File.Path, "%s/%s.index", Config.BaseDir, Config.ProjectID); @@ -5114,7 +5091,6 @@ main(int ArgC, char **Args) if(ClaimBuffer(&CollationBuffers.IncludesIndex, "IncludesIndex", Kilobytes(1)) == RC_ARENA_FULL) { goto RIP; }; if(ClaimBuffer(&CollationBuffers.Search, "Search", Kilobytes(32)) == RC_ARENA_FULL) { goto RIP; }; - if(ClaimBuffer(&CollationBuffers.ScriptIndex, "ScriptIndex", 256) == RC_ARENA_FULL) { goto RIP; }; // NOTE(matt): Templating // @@ -5325,7 +5301,6 @@ NextFile: DeclaimTemplate(IndexTemplate); } - DeclaimBuffer(&CollationBuffers.ScriptIndex); DeclaimBuffer(&CollationBuffers.Search); DeclaimBuffer(&CollationBuffers.IncludesIndex);