1 line
3.3 KiB
Plaintext
Executable File
1 line
3.3 KiB
Plaintext
Executable File
$hfile = ":include:prefdefs.h";
|
|
$rfile = "PrefDefs.strn";
|
|
$cfile = "preflimits.c";
|
|
$dfile = "prefenable.c";
|
|
$efile = "$ARGV[0].extras";
|
|
$afile = "prefs.acap";
|
|
$xsfile = "prefs.xset";
|
|
$aufile = "prefaudit.c";
|
|
|
|
$idBase = 1000;
|
|
|
|
open(CFILE,">$cfile") || die;
|
|
open(DFILE,">$dfile") || die;
|
|
open(HFILE,">$hfile") || die;
|
|
open(RFILE,">$rfile") || die;
|
|
open(EFILE,"<$efile") || die;
|
|
open(AFILE,">$afile") || die;
|
|
open(XSFILE,">$xsfile") || die;
|
|
open(AUFILE,">$aufile") || die;
|
|
|
|
print CFILE <<'EOF';
|
|
#include <Types.h>
|
|
#include "PrefDefs.h"
|
|
#include "StringDefs.h"
|
|
Boolean PrefBounds(short prefN,long *lower,long *upper)
|
|
{
|
|
#ifdef LIGHT
|
|
Boolean Light = true;
|
|
#else
|
|
Boolean Light = false;
|
|
#endif
|
|
|
|
long l,u;
|
|
switch (prefN)
|
|
{
|
|
EOF
|
|
|
|
print DFILE <<'EOF';
|
|
#include <Types.h>
|
|
#include "PrefDefs.h"
|
|
#include "StringDefs.h"
|
|
PersHandle SettingsPers(void);
|
|
#define ICCRAP SettingsPers()!=PersList||!ReadIC||WriteIC
|
|
Boolean PrefEnabled(short prefN)
|
|
{
|
|
#ifdef LIGHT
|
|
Boolean Light = true;
|
|
#else
|
|
Boolean Light = false;
|
|
#endif
|
|
|
|
switch (ABS(prefN))
|
|
{
|
|
EOF
|
|
|
|
print HFILE <<'EOF';
|
|
#ifndef PREFDEFS_H
|
|
#define PREFDEFS_H
|
|
|
|
Boolean PrefBounds(short prefN,long *lower,long *upper);
|
|
Boolean PrefAudit(short prefN);
|
|
typedef enum {
|
|
PREF_0,
|
|
EOF
|
|
|
|
print RFILE <<'EOF';
|
|
resource 'STH#' (1000,purgeable) {{
|
|
EOF
|
|
|
|
print AUFILE <<'EOF';
|
|
#include <Types.h>
|
|
#include "PrefDefs.h"
|
|
#define Audit true
|
|
Boolean PrefAudit(short prefN)
|
|
{
|
|
switch (ABS(prefN))
|
|
{
|
|
EOF
|
|
|
|
#
|
|
# read the extra file
|
|
while (<EFILE>)
|
|
{
|
|
chop;
|
|
if ($_ ne "" && !/^#/)
|
|
{
|
|
split('\t');
|
|
if (!/^-/)
|
|
{
|
|
$Extras{$_[0]} = $_[3];
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
$cnt = 0;
|
|
while (<>)
|
|
{
|
|
chop;
|
|
if ($_ ne "" && !/^#/)
|
|
{
|
|
split('\t');
|
|
if (/^-/)
|
|
{
|
|
$name = $_[0];
|
|
$name =~ s/.//;
|
|
$acap = $func = "";
|
|
}
|
|
else
|
|
{
|
|
($name,$acap,$func) = split('¥',$_[0]);
|
|
$cnt++;
|
|
($help,$geek) = split('©©',$_[4]);
|
|
if ($geek ne "") {$geekList .= "resource 'GSTR' (" . ($idBase+$cnt%100) . ",purgeable) {\"$geek\"};\n";}
|
|
|
|
if ($Extras{$name} ne "") {$help = $Extras{$name};}
|
|
|
|
if ($_[4] ne "" && !($_[4] =~ /don.t touch/i))
|
|
{
|
|
print XSFILE "<x-eudora-setting:$cnt> $_[4]\n";
|
|
}
|
|
print HFILE "/*$cnt*/\t$name,\n";
|
|
print RFILE "/*$cnt $name*/\t\042$help\042,\n";
|
|
if ($cnt == 100) {&newresource; next;}
|
|
if ($cnt == 200) {&newresource2; next;}
|
|
if ($cnt == 300) {&newresource3; next;}
|
|
}
|
|
if ($_[3] ne "")
|
|
{
|
|
print AUFILE " case $name: return($_[3]);\n";
|
|
}
|
|
if ($_[2] ne "")
|
|
{
|
|
@lims = split(/,/,$_[2]);
|
|
print CFILE " case $name: l=$lims[0]; u=$lims[1]; break;\n";
|
|
}
|
|
if ($_[1] ne "")
|
|
{
|
|
print DFILE " case $name: return($_[1]);\n";
|
|
}
|
|
if ($acap ne "")
|
|
{
|
|
print AFILE "$cnt\t$acap\t$func\n";
|
|
}
|
|
}
|
|
}
|
|
|
|
&finishresource;
|
|
print CFILE <<'EOF';
|
|
default: return(0);
|
|
}
|
|
*lower = l;
|
|
*upper = u;
|
|
return(-1);
|
|
}
|
|
EOF
|
|
print DFILE <<'EOF';
|
|
default: return(True);
|
|
}
|
|
}
|
|
EOF
|
|
print HFILE <<'EOF';
|
|
PREF_STRN_LIMIT
|
|
} PrefStrnEnum;
|
|
|
|
#endif
|
|
EOF
|
|
|
|
print AUFILE <<'EOF';
|
|
default: return(false);
|
|
}
|
|
}
|
|
EOF
|
|
|
|
if ($geekList ne "") {print RFILE $geekList;}
|
|
|
|
sub newresource
|
|
{
|
|
&finishresource;
|
|
print RFILE <<'EOF';
|
|
resource 'STH#' (900,purgeable) {{
|
|
EOF
|
|
$idBase = 900;
|
|
}
|
|
|
|
sub newresource2
|
|
{
|
|
&finishresource;
|
|
print RFILE <<'EOF';
|
|
resource 'STH#' (700,purgeable) {{
|
|
EOF
|
|
$idBase = 700;
|
|
}
|
|
|
|
sub newresource3
|
|
{
|
|
&finishresource;
|
|
print RFILE <<'EOF';
|
|
resource 'STH#' (20100,purgeable) {{
|
|
EOF
|
|
$idBase = 20100;
|
|
}
|
|
|
|
sub finishresource
|
|
{
|
|
print RFILE "}};\n\n";
|
|
} |