Skip to content

Commit

Permalink
Imported from svn tag fireworkz__2021_09_10__2_31_00
Browse files Browse the repository at this point in the history
  • Loading branch information
skswales committed Aug 21, 2022
1 parent b19a609 commit 7f48574
Show file tree
Hide file tree
Showing 56 changed files with 1,720 additions and 910 deletions.
1 change: 1 addition & 0 deletions docs/UserGuide/content/sg06v/sg6_VALUE.htm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ <h1><a name="value" id="value"></a>VALUE</h1>

<p class="csg-function-subheading">Revisions:</p>
<p>Starting with 2.24, this function can accept text strings longer than 200 characters as input.</p>
<p>Starting with 2.31, this function will also attempt to recognise date values, and numbers with currency and thousands separator characters.</p>

<div class="navfooter">
<table id="navfooter" summary="Navigation footer">
Expand Down
2 changes: 2 additions & 0 deletions docs/UserGuide/content/ug/ug99_addenda.htm
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ <h4>VALUE</h4>

<p>Starting with 2.24, this function can accept text strings longer than 200 characters as input.</p>

<p>Starting with 2.31, this function will also attempt to recognise date values, and numbers with currency and thousands separator characters.</p>

<p>See <a href="../sg06v/sg6_VALUE.htm">VALUE</a>.</p>


Expand Down
Binary file modified docs/UserGuide/firewrkz.chm
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
{S:S;F;2;36;1.29845758141598;index(b37,2,1)}
{S:S;F;2;37;0.271752585319512;index(b38,2,1)}
{S:X;X;3;3;Radius}
{S:S;F;3;5;1.4142135623731;c_radius(b6c7)}
{S:S;F;3;6;2.23606797749979;c_radius(b7c8)}
{S:S;F;3;5;1.4142135623731;c_radius(z)}
{S:S;F;3;6;2.23606797749979;c_radius(w)}
{S:S;F;3;7;3;c_radius(b8)}
{S:S;F;3;8;2.23606797749979;c_radius(b9)}
{S:S;F;3;9;3.16227766016838;c_radius(b10)}
Expand Down Expand Up @@ -152,8 +152,8 @@
{S:S;F;3;36;1.44539657665825;c_radius(b37)}
{S:S;F;3;37;1.11747002070607;c_radius(b38)}
{S:X;X;4;3;Theta}
{S:S;F;4;5;0.785398163397448;c_theta(b6c6)}
{S:S;F;4;6;-0.463647609000806;c_theta(b7c7)}
{S:S;F;4;5;0.785398163397448;c_theta(z)}
{S:S;F;4;6;-0.463647609000806;c_theta(w)}
{S:S;F;4;7;0;c_theta(b8)}
{S:S;F;4;8;2.0344439357957;c_theta(b9)}
{S:S;F;4;9;0.321750554396642;c_theta(b10)}
Expand Down
2 changes: 1 addition & 1 deletion examples/MakeRiscPkg,fd7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| MakeRiscPkg.oby - Fireworkz-Examples

Set t5$Release 20200611
Set t5$Release 20210910
| Remember to update RiscPkg.Control too

Set t5$Disc $.Temp.Fire.FzExamples_<t5$Release>
Expand Down
2 changes: 1 addition & 1 deletion examples/RiscPkg/Control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: Optional
Licence: Free
Maintainer: Colton Software <[email protected]>
Standards-Version: 0.4.0
Version: 20200611
Version: 20210910
Recommends: Fireworkz
Description: Example files for Fireworkz
Example files to demonstrate, and help with using, various Fireworkz facilities.
Expand Down
4 changes: 2 additions & 2 deletions t5/Build/!!!Boot,feb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ If "<disc_root>"="" Then IfThere HostFS:$.!Boot Then Set disc_root HostFS:$
| and not the svn:riscosfiletype property
Set svn$filetypeext ""
|
Set FIREWORKZ_TBT fireworkz__2_30__branch
Set FIREWORKZ_TBT fireworkz__2_31__branch
|et FIREWORKZ_TBT trunk
Set fireworkz_root <disc_root>.fireworkz.<FIREWORKZ_TBT>
|
URD <fireworkz_root>
|Lib &.arm.Library
Dir &.t5
Dir &
|
| Fireworkz Pro can only be built if R-Comp components are present
IfThere <disc_root>.coltsoft.<FIREWORKZ_TBT>.cs-nonfree.DataPower.DPlib.<C$Mode>.DPlib Then Set DPlib$Path <disc_root>.coltsoft.<FIREWORKZ_TBT>.cs-nonfree.DataPower.DPlib.<C$Mode>.
Expand Down
214 changes: 214 additions & 0 deletions t5/Build/Tools/CreateCFBF/CreateCFBF.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
// CreateCFBF.cpp

#include <windows.h>

#include <stdio.h>

#define SS_NORMAL 512 // As created by StgCreateDocfile()
#define SS_LARGE 4096 // Needs v4 DLL (Windows 2000)

static void
byteswap(
unsigned char * a,
unsigned char * b,
size_t n)
{
while(n != 0)
{
unsigned char tmp = *b;
*b++ = *a;
*a++ = tmp;
--n;
}
}

/*
StgCreateDocfile() creates a file containing:
File Sector Zero: Structured Storage Header
File Sector One (Data Sector[0]): Sector Allocation Table
File Sector Two (Data Sector[1]): Directory
It's more convenient to store the SAT sectors contiguously
for extension, so reorder a copy to contain:
File Sector Zero: Structured Storage Header
File Sector One (Data Sector[0]): Directory
File Sector Two (Data Sector[1]): Sector Allocation Table
*/

static int
create_storage_512(void)
{
int ok = EXIT_FAILURE;
static const WCHAR filename[MAX_PATH] = L"cfbf-512,ffd";
DWORD grfMode = STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE;
IStorage * pstgOpen = NULL;
HRESULT hr = StgCreateDocfile(filename, grfMode, 0 /*reserved*/, &pstgOpen);
if(SUCCEEDED(hr))
{
pstgOpen->Release();
ok = EXIT_SUCCESS;
}
return(ok);
}

static int
reorder_storage_512(void)
{
int ok = EXIT_FAILURE;
const char * infile = "cfbf-512,ffd";
const char * outfile = "cfbf-512ro,ffd";
const unsigned int sector_size = SS_NORMAL;
unsigned char buffer[sector_size*3];
FILE * fin;
FILE * fout;

if(0 == fopen_s(&fin, infile, "rb"))
{
if(0 == fopen_s(&fout, outfile, "wb"))
{
if (3 != fread_s(buffer, sizeof(buffer), sector_size, 3, fin))
{
fprintf_s(stderr, "Failed to read three sectors from %s\n", infile);
goto barf;
}

/* Sector Zero: Structured Storage Header */
/* Swap sector ids of SAT and Directory for reorder */
byteswap(&buffer[0*sector_size + 0x4C /*_sectFat[0]*/ /*[04CH,436]*/ /*76d..511d*/ /* the SECTs of the first 109 FAT sectors */],
&buffer[0*sector_size + 0x30 /*_sectDirStart*/ /*[030H,04]*/ /*48d*/ /* first SECT in the Directory chain */],
4);

/* Sector One: SAT */
/* Swap sector ids of SAT and Directory for reorder */
byteswap(&buffer[1*sector_size + 0],
&buffer[1*sector_size + 4],
4);

/* Sector Two: Directory */

/* Write out, reordered as Header, Directory, SAT */
if(1 != fwrite(&buffer[0*sector_size], sector_size, 1, fout))
{
fprintf_s(stderr, "Failed to write sector zero to %s\n", outfile);
goto barf;
}
if(1 != fwrite(&buffer[2*sector_size], sector_size, 1, fout))
{
fprintf_s(stderr, "Failed to write sector one to %s\n", outfile);
goto barf;
}
if(1 != fwrite(&buffer[1*sector_size], sector_size, 1, fout))
{
fprintf_s(stderr, "Failed to write sector two to %s\n", outfile);
goto barf;
}

ok = EXIT_SUCCESS;

barf:;

(void) fclose(fout);
}
(void) fclose(fin);
}

return(ok);
}

static int
create_storage_4096(void)
{
int ok = EXIT_FAILURE;
static const WCHAR filename[MAX_PATH] = L"cfbf-4096,ffd";
DWORD grfMode = STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE;
STGFMT stgfmt = STGFMT_DOCFILE;
DWORD grfAttrs = 0;
STGOPTIONS stgoptions = { 1 /*usVersion*/, 0 /*usPadding*/, SS_LARGE /*ulSectorSize*/ };
IStorage * pstgOpen = NULL;
HRESULT hr = StgCreateStorageEx(filename, grfMode, stgfmt, grfAttrs, &stgoptions, NULL /*pSecurityDescriptor*/, IID_IStorage, reinterpret_cast<void**>(&pstgOpen));
if(SUCCEEDED(hr))
{
pstgOpen->Release();
ok = EXIT_SUCCESS;
}
return(ok);
}

static int
reorder_storage_4096(void)
{
int ok = EXIT_FAILURE;
const char * infile = "cfbf-4096,ffd";
const char * outfile = "cfbf-4096ro,ffd";
const unsigned int sector_size = SS_LARGE;
unsigned char buffer[sector_size*3];
FILE * fin;
FILE * fout;

if(0 == fopen_s(&fin, infile, "rb"))
{
if(0 == fopen_s(&fout, outfile, "wb"))
{
if (3 != fread_s(buffer, sizeof(buffer), sector_size, 3, fin))
{
fprintf_s(stderr, "Failed to read three sectors from %s\n", infile);
goto barf;
}

/* Sector Zero: Structured Storage Header */
/* Swap sector ids of SAT and Directory for reorder */
byteswap(&buffer[0*sector_size + 0x4C /*_sectFat[0]*/ /*[04CH,436]*/ /*76d..511d*/ /* the SECTs of the first 109 FAT sectors */],
&buffer[0*sector_size + 0x30 /*_sectDirStart*/ /*[030H,04]*/ /*48d*/ /* first SECT in the Directory chain */],
4);

/* Sector One: SAT */
/* Swap sector ids of SAT and Directory for reorder */
byteswap(&buffer[1*sector_size + 0],
&buffer[1*sector_size + 4],
4);

/* Sector Two: Directory */

/* Write out, reordered as Header, Directory, SAT */
if(1 != fwrite(&buffer[0*sector_size], sector_size, 1, fout))
{
fprintf_s(stderr, "Failed to write sector zero to %s\n", outfile);
goto barf;
}
if(1 != fwrite(&buffer[2*sector_size], sector_size, 1, fout))
{
fprintf_s(stderr, "Failed to write sector one to %s\n", outfile);
goto barf;
}
if(1 != fwrite(&buffer[1*sector_size], sector_size, 1, fout))
{
fprintf_s(stderr, "Failed to write sector two to %s\n", outfile);
goto barf;
}

ok = EXIT_SUCCESS;

barf:;

(void) fclose(fout);
}
(void) fclose(fin);
}

return(ok);
}

int main()
{
int ok;

if(EXIT_SUCCESS != (ok = create_storage_512())) return(ok);
if(EXIT_SUCCESS != (ok = reorder_storage_512())) return(ok);

if(EXIT_SUCCESS != (ok = create_storage_4096())) return(ok);
if(EXIT_SUCCESS != (ok = reorder_storage_4096())) return(ok);

return(EXIT_SUCCESS);
}

// end of CreateCFBF.cpp
31 changes: 31 additions & 0 deletions t5/Build/Tools/CreateCFBF/CreateCFBF.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1622
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CreateCFBF", "CreateCFBF.vcxproj", "{6994EFAE-7999-4963-8037-86EAF6657CE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Debug|x64.ActiveCfg = Debug|x64
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Debug|x64.Build.0 = Debug|x64
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Debug|x86.ActiveCfg = Debug|Win32
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Debug|x86.Build.0 = Debug|Win32
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Release|x64.ActiveCfg = Release|x64
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Release|x64.Build.0 = Release|x64
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Release|x86.ActiveCfg = Release|Win32
{6994EFAE-7999-4963-8037-86EAF6657CE4}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2B833A1C-D5BF-4C5F-91BE-ADC7106939A8}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 7f48574

Please sign in to comment.