Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
1d51077f
Commit
1d51077f
authored
7 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Add support for standard European timezones with DST: WET/WEST, CET/CEST, and
EET/EEST.
parent
565339dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/scfg/scfgsys.c
+49
-41
49 additions, 41 deletions
src/sbbs3/scfg/scfgsys.c
with
49 additions
and
41 deletions
src/sbbs3/scfg/scfgsys.c
+
49
−
41
View file @
1d51077f
...
...
@@ -35,6 +35,43 @@
#include
"scfg.h"
static
void
configure_dst
(
void
)
{
strcpy
(
opt
[
0
],
"Yes"
);
strcpy
(
opt
[
1
],
"No"
);
strcpy
(
opt
[
2
],
"Automatic"
);
opt
[
3
][
0
]
=
0
;
int
i
=
1
;
uifc
.
helpbuf
=
"`Daylight Saving Time (DST):`
\n
"
"
\n
"
"If your system is using a U.S. standard time zone, and you would like
\n
"
"to have the daylight saving time `flag` automatically toggled for you,
\n
"
"set this option to ~Automatic~ (recommended).
\n
"
"
\n
"
"The ~DST~ `flag` is used for display purposes only (e.g. to display
\"
PDT
\"\n
"
"instead of
\"
PST
\"
and calculate the correct offset from UTC), it does not
\n
"
"actually change the time on your computer system(s) for you.
\n
"
;
i
=
uifc
.
list
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
0
,
&
i
,
0
,
"Daylight Saving Time (DST)"
,
opt
);
if
(
i
==-
1
)
return
;
cfg
.
sys_misc
&=~
SM_AUTO_DST
;
switch
(
i
)
{
case
0
:
cfg
.
sys_timezone
|=
DAYLIGHT
;
break
;
case
1
:
cfg
.
sys_timezone
&=~
DAYLIGHT
;
break
;
case
2
:
cfg
.
sys_misc
|=
SM_AUTO_DST
;
sys_timezone
(
&
cfg
);
break
;
}
}
void
sys_cfg
(
void
)
{
static
int
sys_dflt
,
adv_dflt
,
tog_dflt
,
new_dflt
;
...
...
@@ -47,7 +84,7 @@ while(1) {
sprintf
(
opt
[
i
++
],
"%-33.33s%s"
,
"Location"
,
cfg
.
sys_location
);
sprintf
(
opt
[
i
++
],
"%-33.33s%s %s"
,
"Local Time Zone"
,
smb_zonestr
(
cfg
.
sys_timezone
,
NULL
)
,
!
OTHER_ZONE
(
cfg
.
sys_timezone
)
&&
cfg
.
sys_timezone
&
US_ZONE
&&
cfg
.
sys_misc
&
SM_AUTO_DST
?
"(Auto-DST)"
:
""
);
,
SMB_TZ_HAS_DST
(
cfg
.
sys_timezone
)
&&
cfg
.
sys_misc
&
SM_AUTO_DST
?
"(Auto-DST)"
:
""
);
sprintf
(
opt
[
i
++
],
"%-33.33s%s"
,
"Operator"
,
cfg
.
sys_op
);
sprintf
(
opt
[
i
++
],
"%-33.33s%s"
,
"Password"
,
"**********"
);
...
...
@@ -173,39 +210,7 @@ while(1) {
cfg
.
sys_timezone
=
BST
;
break
;
}
strcpy
(
opt
[
0
],
"Yes"
);
strcpy
(
opt
[
1
],
"No"
);
strcpy
(
opt
[
2
],
"Automatic"
);
opt
[
3
][
0
]
=
0
;
i
=
1
;
uifc
.
helpbuf
=
"`Daylight Saving Time (DST):`
\n
"
"
\n
"
"If your system is using a U.S. standard time zone, and you would like
\n
"
"to have the daylight saving time `flag` automatically toggled for you,
\n
"
"set this option to ~Automatic~ (recommended).
\n
"
"
\n
"
"The ~DST~ `flag` is used for display purposes only (e.g. to display
\"
PDT
\"\n
"
"instead of
\"
PST
\"
and calculate the correct offset from UTC), it does not
\n
"
"actually change the time on your computer system(s) for you.
\n
"
;
i
=
uifc
.
list
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
0
,
&
i
,
0
,
"Daylight Saving Time (DST)"
,
opt
);
if
(
i
==-
1
)
break
;
cfg
.
sys_misc
&=~
SM_AUTO_DST
;
switch
(
i
)
{
case
0
:
cfg
.
sys_timezone
|=
DAYLIGHT
;
break
;
case
1
:
cfg
.
sys_timezone
&=~
DAYLIGHT
;
break
;
case
2
:
cfg
.
sys_misc
|=
SM_AUTO_DST
;
sys_timezone
(
&
cfg
);
break
;
}
configure_dst
();
break
;
}
i
=
0
;
...
...
@@ -218,9 +223,9 @@ while(1) {
strcpy
(
opt
[
i
++
],
"Rio de Janeiro"
);
strcpy
(
opt
[
i
++
],
"Fernando de Noronha"
);
strcpy
(
opt
[
i
++
],
"Azores"
);
strcpy
(
opt
[
i
++
],
"
London
"
);
strcpy
(
opt
[
i
++
],
"
Berlin
"
);
strcpy
(
opt
[
i
++
],
"
Athens
"
);
strcpy
(
opt
[
i
++
],
"
Western Europe (WET)
"
);
strcpy
(
opt
[
i
++
],
"
Central Europe (CET)
"
);
strcpy
(
opt
[
i
++
],
"
Eastern Europe (EET)
"
);
strcpy
(
opt
[
i
++
],
"Moscow"
);
strcpy
(
opt
[
i
++
],
"Dubai"
);
strcpy
(
opt
[
i
++
],
"Kabul"
);
...
...
@@ -279,13 +284,16 @@ while(1) {
cfg
.
sys_timezone
=
AZO
;
break
;
case
9
:
cfg
.
sys_timezone
=
LON
;
cfg
.
sys_timezone
=
WET
;
configure_dst
();
break
;
case
10
:
cfg
.
sys_timezone
=
BER
;
cfg
.
sys_timezone
=
CET
;
configure_dst
();
break
;
case
11
:
cfg
.
sys_timezone
=
ATH
;
cfg
.
sys_timezone
=
EET
;
configure_dst
();
break
;
case
12
:
cfg
.
sys_timezone
=
MOS
;
...
...
@@ -354,7 +362,7 @@ while(1) {
cfg
.
sys_timezone
+=
atoi
(
p
+
1
);
}
break
;
}
}
break
;
case
3
:
uifc
.
helpbuf
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment