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
c2248d9d
Commit
c2248d9d
authored
7 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Convert from legacy brace style (sorry, IHA).
parent
664b1672
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/scfg/scfgxfr1.c
+159
-77
159 additions, 77 deletions
src/sbbs3/scfg/scfgxfr1.c
with
159 additions
and
77 deletions
src/sbbs3/scfg/scfgxfr1.c
+
159
−
77
View file @
c2248d9d
/* scfgxfr1.c */
/* $Id$ */
/* $Id$ */
/****************************************************************************
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* *
* Copyright
2003
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html
*
* *
* *
* This program is free software; you can redistribute it and/or *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* modify it under the terms of the GNU General Public License *
...
@@ -259,9 +257,11 @@ uifc.helpbuf=
...
@@ -259,9 +257,11 @@ uifc.helpbuf=
cfg
.
total_fviews
--
;
cfg
.
total_fviews
--
;
while
(
i
<
cfg
.
total_fviews
)
{
while
(
i
<
cfg
.
total_fviews
)
{
cfg
.
fview
[
i
]
=
cfg
.
fview
[
i
+
1
];
cfg
.
fview
[
i
]
=
cfg
.
fview
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
fview
=
(
fview_t
**
)
realloc
(
cfg
.
fview
if
((
cfg
.
fview
=
(
fview_t
**
)
realloc
(
cfg
.
fview
...
@@ -269,39 +269,47 @@ uifc.helpbuf=
...
@@ -269,39 +269,47 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_fviews
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_fviews
+
1
);
cfg
.
total_fviews
=
0
;
cfg
.
total_fviews
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
total_fviews
)
{
if
(
!
cfg
.
total_fviews
)
{
if
((
cfg
.
fview
[
0
]
=
(
fview_t
*
)
malloc
(
if
((
cfg
.
fview
[
0
]
=
(
fview_t
*
)
malloc
(
sizeof
(
fview_t
)))
==
NULL
)
{
sizeof
(
fview_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fview_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fview_t
));
continue
;
}
continue
;
}
memset
(
cfg
.
fview
[
0
],
0
,
sizeof
(
fview_t
));
memset
(
cfg
.
fview
[
0
],
0
,
sizeof
(
fview_t
));
strcpy
(
cfg
.
fview
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
fview
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
fview
[
0
]
->
cmd
,
"%@unzip -vq %s"
);
}
strcpy
(
cfg
.
fview
[
0
]
->
cmd
,
"%@unzip -vq %s"
);
}
else
{
else
{
for
(
j
=
cfg
.
total_fviews
;
j
>
i
;
j
--
)
for
(
j
=
cfg
.
total_fviews
;
j
>
i
;
j
--
)
cfg
.
fview
[
j
]
=
cfg
.
fview
[
j
-
1
];
cfg
.
fview
[
j
]
=
cfg
.
fview
[
j
-
1
];
if
((
cfg
.
fview
[
i
]
=
(
fview_t
*
)
malloc
(
if
((
cfg
.
fview
[
i
]
=
(
fview_t
*
)
malloc
(
sizeof
(
fview_t
)))
==
NULL
)
{
sizeof
(
fview_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fview_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fview_t
));
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
total_fviews
)
if
(
i
>=
cfg
.
total_fviews
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
*
cfg
.
fview
[
i
]
=*
cfg
.
fview
[
j
];
}
*
cfg
.
fview
[
i
]
=*
cfg
.
fview
[
j
];
}
cfg
.
total_fviews
++
;
cfg
.
total_fviews
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
savfview
=*
cfg
.
fview
[
i
];
savfview
=*
cfg
.
fview
[
i
];
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
*
cfg
.
fview
[
i
]
=
savfview
;
*
cfg
.
fview
[
i
]
=
savfview
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
done
=
0
;
done
=
0
;
while
(
!
done
)
{
while
(
!
done
)
{
j
=
0
;
j
=
0
;
...
@@ -331,7 +339,10 @@ uifc.helpbuf=
...
@@ -331,7 +339,10 @@ uifc.helpbuf=
sprintf
(
str
,
"Viewable File Type %s"
sprintf
(
str
,
"Viewable File Type %s"
,
cfg
.
fview
[
i
]
->
ext
);
,
cfg
.
fview
[
i
]
->
ext
);
getar
(
str
,
cfg
.
fview
[
i
]
->
arstr
);
getar
(
str
,
cfg
.
fview
[
i
]
->
arstr
);
break
;
}
}
}
break
;
}
}
}
break
;
break
;
case
9
:
/* Testable file types */
case
9
:
/* Testable file types */
while
(
1
)
{
while
(
1
)
{
...
@@ -370,9 +381,11 @@ uifc.helpbuf=
...
@@ -370,9 +381,11 @@ uifc.helpbuf=
cfg
.
total_ftests
--
;
cfg
.
total_ftests
--
;
while
(
i
<
cfg
.
total_ftests
)
{
while
(
i
<
cfg
.
total_ftests
)
{
cfg
.
ftest
[
i
]
=
cfg
.
ftest
[
i
+
1
];
cfg
.
ftest
[
i
]
=
cfg
.
ftest
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
ftest
=
(
ftest_t
**
)
realloc
(
cfg
.
ftest
if
((
cfg
.
ftest
=
(
ftest_t
**
)
realloc
(
cfg
.
ftest
...
@@ -380,16 +393,19 @@ uifc.helpbuf=
...
@@ -380,16 +393,19 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_ftests
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_ftests
+
1
);
cfg
.
total_ftests
=
0
;
cfg
.
total_ftests
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
total_ftests
)
{
if
(
!
cfg
.
total_ftests
)
{
if
((
cfg
.
ftest
[
0
]
=
(
ftest_t
*
)
malloc
(
if
((
cfg
.
ftest
[
0
]
=
(
ftest_t
*
)
malloc
(
sizeof
(
ftest_t
)))
==
NULL
)
{
sizeof
(
ftest_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
ftest_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
ftest_t
));
continue
;
}
continue
;
}
memset
(
cfg
.
ftest
[
0
],
0
,
sizeof
(
ftest_t
));
memset
(
cfg
.
ftest
[
0
],
0
,
sizeof
(
ftest_t
));
strcpy
(
cfg
.
ftest
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
ftest
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
ftest
[
0
]
->
cmd
,
"%@unzip -tqq %f"
);
strcpy
(
cfg
.
ftest
[
0
]
->
cmd
,
"%@unzip -tqq %f"
);
strcpy
(
cfg
.
ftest
[
0
]
->
workstr
,
"Testing ZIP Integrity..."
);
}
strcpy
(
cfg
.
ftest
[
0
]
->
workstr
,
"Testing ZIP Integrity..."
);
}
else
{
else
{
for
(
j
=
cfg
.
total_ftests
;
j
>
i
;
j
--
)
for
(
j
=
cfg
.
total_ftests
;
j
>
i
;
j
--
)
...
@@ -397,24 +413,29 @@ uifc.helpbuf=
...
@@ -397,24 +413,29 @@ uifc.helpbuf=
if
((
cfg
.
ftest
[
i
]
=
(
ftest_t
*
)
malloc
(
if
((
cfg
.
ftest
[
i
]
=
(
ftest_t
*
)
malloc
(
sizeof
(
ftest_t
)))
==
NULL
)
{
sizeof
(
ftest_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
ftest_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
ftest_t
));
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
total_ftests
)
if
(
i
>=
cfg
.
total_ftests
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
*
cfg
.
ftest
[
i
]
=*
cfg
.
ftest
[
j
];
}
*
cfg
.
ftest
[
i
]
=*
cfg
.
ftest
[
j
];
}
cfg
.
total_ftests
++
;
cfg
.
total_ftests
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
savftest
=*
cfg
.
ftest
[
i
];
savftest
=*
cfg
.
ftest
[
i
];
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
*
cfg
.
ftest
[
i
]
=
savftest
;
*
cfg
.
ftest
[
i
]
=
savftest
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
done
=
0
;
done
=
0
;
while
(
!
done
)
{
while
(
!
done
)
{
j
=
0
;
j
=
0
;
...
@@ -450,7 +471,10 @@ uifc.helpbuf=
...
@@ -450,7 +471,10 @@ uifc.helpbuf=
case
3
:
case
3
:
sprintf
(
str
,
"Testable File Type %s"
,
cfg
.
ftest
[
i
]
->
ext
);
sprintf
(
str
,
"Testable File Type %s"
,
cfg
.
ftest
[
i
]
->
ext
);
getar
(
str
,
cfg
.
ftest
[
i
]
->
arstr
);
getar
(
str
,
cfg
.
ftest
[
i
]
->
arstr
);
break
;
}
}
}
break
;
}
}
}
break
;
break
;
case
10
:
/* Download Events */
case
10
:
/* Download Events */
while
(
1
)
{
while
(
1
)
{
...
@@ -488,9 +512,11 @@ uifc.helpbuf=
...
@@ -488,9 +512,11 @@ uifc.helpbuf=
cfg
.
total_dlevents
--
;
cfg
.
total_dlevents
--
;
while
(
i
<
cfg
.
total_dlevents
)
{
while
(
i
<
cfg
.
total_dlevents
)
{
cfg
.
dlevent
[
i
]
=
cfg
.
dlevent
[
i
+
1
];
cfg
.
dlevent
[
i
]
=
cfg
.
dlevent
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
dlevent
=
(
dlevent_t
**
)
realloc
(
cfg
.
dlevent
if
((
cfg
.
dlevent
=
(
dlevent_t
**
)
realloc
(
cfg
.
dlevent
...
@@ -498,16 +524,19 @@ uifc.helpbuf=
...
@@ -498,16 +524,19 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_dlevents
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_dlevents
+
1
);
cfg
.
total_dlevents
=
0
;
cfg
.
total_dlevents
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
total_dlevents
)
{
if
(
!
cfg
.
total_dlevents
)
{
if
((
cfg
.
dlevent
[
0
]
=
(
dlevent_t
*
)
malloc
(
if
((
cfg
.
dlevent
[
0
]
=
(
dlevent_t
*
)
malloc
(
sizeof
(
dlevent_t
)))
==
NULL
)
{
sizeof
(
dlevent_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
dlevent_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
dlevent_t
));
continue
;
}
continue
;
}
memset
(
cfg
.
dlevent
[
0
],
0
,
sizeof
(
dlevent_t
));
memset
(
cfg
.
dlevent
[
0
],
0
,
sizeof
(
dlevent_t
));
strcpy
(
cfg
.
dlevent
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
dlevent
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
dlevent
[
0
]
->
cmd
,
"%@zip -z %f < %zzipmsg.txt"
);
strcpy
(
cfg
.
dlevent
[
0
]
->
cmd
,
"%@zip -z %f < %zzipmsg.txt"
);
strcpy
(
cfg
.
dlevent
[
0
]
->
workstr
,
"Adding ZIP Comment..."
);
}
strcpy
(
cfg
.
dlevent
[
0
]
->
workstr
,
"Adding ZIP Comment..."
);
}
else
{
else
{
for
(
j
=
cfg
.
total_dlevents
;
j
>
i
;
j
--
)
for
(
j
=
cfg
.
total_dlevents
;
j
>
i
;
j
--
)
...
@@ -515,24 +544,29 @@ uifc.helpbuf=
...
@@ -515,24 +544,29 @@ uifc.helpbuf=
if
((
cfg
.
dlevent
[
i
]
=
(
dlevent_t
*
)
malloc
(
if
((
cfg
.
dlevent
[
i
]
=
(
dlevent_t
*
)
malloc
(
sizeof
(
dlevent_t
)))
==
NULL
)
{
sizeof
(
dlevent_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
dlevent_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
dlevent_t
));
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
total_dlevents
)
if
(
i
>=
cfg
.
total_dlevents
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
*
cfg
.
dlevent
[
i
]
=*
cfg
.
dlevent
[
j
];
}
*
cfg
.
dlevent
[
i
]
=*
cfg
.
dlevent
[
j
];
}
cfg
.
total_dlevents
++
;
cfg
.
total_dlevents
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
savdlevent
=*
cfg
.
dlevent
[
i
];
savdlevent
=*
cfg
.
dlevent
[
i
];
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
*
cfg
.
dlevent
[
i
]
=
savdlevent
;
*
cfg
.
dlevent
[
i
]
=
savdlevent
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
done
=
0
;
done
=
0
;
while
(
!
done
)
{
while
(
!
done
)
{
j
=
0
;
j
=
0
;
...
@@ -568,7 +602,10 @@ uifc.helpbuf=
...
@@ -568,7 +602,10 @@ uifc.helpbuf=
case
3
:
case
3
:
sprintf
(
str
,
"Download Event %s"
,
cfg
.
dlevent
[
i
]
->
ext
);
sprintf
(
str
,
"Download Event %s"
,
cfg
.
dlevent
[
i
]
->
ext
);
getar
(
str
,
cfg
.
dlevent
[
i
]
->
arstr
);
getar
(
str
,
cfg
.
dlevent
[
i
]
->
arstr
);
break
;
}
}
}
break
;
}
}
}
break
;
break
;
case
11
:
/* Extractable file types */
case
11
:
/* Extractable file types */
while
(
1
)
{
while
(
1
)
{
...
@@ -600,9 +637,11 @@ uifc.helpbuf=
...
@@ -600,9 +637,11 @@ uifc.helpbuf=
cfg
.
total_fextrs
--
;
cfg
.
total_fextrs
--
;
while
(
i
<
cfg
.
total_fextrs
)
{
while
(
i
<
cfg
.
total_fextrs
)
{
cfg
.
fextr
[
i
]
=
cfg
.
fextr
[
i
+
1
];
cfg
.
fextr
[
i
]
=
cfg
.
fextr
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
fextr
=
(
fextr_t
**
)
realloc
(
cfg
.
fextr
if
((
cfg
.
fextr
=
(
fextr_t
**
)
realloc
(
cfg
.
fextr
...
@@ -610,15 +649,18 @@ uifc.helpbuf=
...
@@ -610,15 +649,18 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_fextrs
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_fextrs
+
1
);
cfg
.
total_fextrs
=
0
;
cfg
.
total_fextrs
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
total_fextrs
)
{
if
(
!
cfg
.
total_fextrs
)
{
if
((
cfg
.
fextr
[
0
]
=
(
fextr_t
*
)
malloc
(
if
((
cfg
.
fextr
[
0
]
=
(
fextr_t
*
)
malloc
(
sizeof
(
fextr_t
)))
==
NULL
)
{
sizeof
(
fextr_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fextr_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fextr_t
));
continue
;
}
continue
;
}
memset
(
cfg
.
fextr
[
0
],
0
,
sizeof
(
fextr_t
));
memset
(
cfg
.
fextr
[
0
],
0
,
sizeof
(
fextr_t
));
strcpy
(
cfg
.
fextr
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
fextr
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
fextr
[
0
]
->
cmd
,
"%@unzip -Cojqq %f %s -d %g"
);
}
strcpy
(
cfg
.
fextr
[
0
]
->
cmd
,
"%@unzip -Cojqq %f %s -d %g"
);
}
else
{
else
{
for
(
j
=
cfg
.
total_fextrs
;
j
>
i
;
j
--
)
for
(
j
=
cfg
.
total_fextrs
;
j
>
i
;
j
--
)
...
@@ -626,24 +668,29 @@ uifc.helpbuf=
...
@@ -626,24 +668,29 @@ uifc.helpbuf=
if
((
cfg
.
fextr
[
i
]
=
(
fextr_t
*
)
malloc
(
if
((
cfg
.
fextr
[
i
]
=
(
fextr_t
*
)
malloc
(
sizeof
(
fextr_t
)))
==
NULL
)
{
sizeof
(
fextr_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fextr_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fextr_t
));
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
total_fextrs
)
if
(
i
>=
cfg
.
total_fextrs
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
*
cfg
.
fextr
[
i
]
=*
cfg
.
fextr
[
j
];
}
*
cfg
.
fextr
[
i
]
=*
cfg
.
fextr
[
j
];
}
cfg
.
total_fextrs
++
;
cfg
.
total_fextrs
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
savfextr
=*
cfg
.
fextr
[
i
];
savfextr
=*
cfg
.
fextr
[
i
];
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
*
cfg
.
fextr
[
i
]
=
savfextr
;
*
cfg
.
fextr
[
i
]
=
savfextr
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
done
=
0
;
done
=
0
;
while
(
!
done
)
{
while
(
!
done
)
{
j
=
0
;
j
=
0
;
...
@@ -673,7 +720,10 @@ uifc.helpbuf=
...
@@ -673,7 +720,10 @@ uifc.helpbuf=
sprintf
(
str
,
"Extractable File Type %s"
sprintf
(
str
,
"Extractable File Type %s"
,
cfg
.
fextr
[
i
]
->
ext
);
,
cfg
.
fextr
[
i
]
->
ext
);
getar
(
str
,
cfg
.
fextr
[
i
]
->
arstr
);
getar
(
str
,
cfg
.
fextr
[
i
]
->
arstr
);
break
;
}
}
}
break
;
}
}
}
break
;
break
;
case
12
:
/* Compressable file types */
case
12
:
/* Compressable file types */
while
(
1
)
{
while
(
1
)
{
...
@@ -703,9 +753,11 @@ uifc.helpbuf=
...
@@ -703,9 +753,11 @@ uifc.helpbuf=
cfg
.
total_fcomps
--
;
cfg
.
total_fcomps
--
;
while
(
i
<
cfg
.
total_fcomps
)
{
while
(
i
<
cfg
.
total_fcomps
)
{
cfg
.
fcomp
[
i
]
=
cfg
.
fcomp
[
i
+
1
];
cfg
.
fcomp
[
i
]
=
cfg
.
fcomp
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
fcomp
=
(
fcomp_t
**
)
realloc
(
cfg
.
fcomp
if
((
cfg
.
fcomp
=
(
fcomp_t
**
)
realloc
(
cfg
.
fcomp
...
@@ -713,39 +765,47 @@ uifc.helpbuf=
...
@@ -713,39 +765,47 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_fcomps
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_fcomps
+
1
);
cfg
.
total_fcomps
=
0
;
cfg
.
total_fcomps
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
total_fcomps
)
{
if
(
!
cfg
.
total_fcomps
)
{
if
((
cfg
.
fcomp
[
0
]
=
(
fcomp_t
*
)
malloc
(
if
((
cfg
.
fcomp
[
0
]
=
(
fcomp_t
*
)
malloc
(
sizeof
(
fcomp_t
)))
==
NULL
)
{
sizeof
(
fcomp_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fcomp_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fcomp_t
));
continue
;
}
continue
;
}
memset
(
cfg
.
fcomp
[
0
],
0
,
sizeof
(
fcomp_t
));
memset
(
cfg
.
fcomp
[
0
],
0
,
sizeof
(
fcomp_t
));
strcpy
(
cfg
.
fcomp
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
fcomp
[
0
]
->
ext
,
"ZIP"
);
strcpy
(
cfg
.
fcomp
[
0
]
->
cmd
,
"%@zip -jD %f %s"
);
}
strcpy
(
cfg
.
fcomp
[
0
]
->
cmd
,
"%@zip -jD %f %s"
);
}
else
{
else
{
for
(
j
=
cfg
.
total_fcomps
;
j
>
i
;
j
--
)
for
(
j
=
cfg
.
total_fcomps
;
j
>
i
;
j
--
)
cfg
.
fcomp
[
j
]
=
cfg
.
fcomp
[
j
-
1
];
cfg
.
fcomp
[
j
]
=
cfg
.
fcomp
[
j
-
1
];
if
((
cfg
.
fcomp
[
i
]
=
(
fcomp_t
*
)
malloc
(
if
((
cfg
.
fcomp
[
i
]
=
(
fcomp_t
*
)
malloc
(
sizeof
(
fcomp_t
)))
==
NULL
)
{
sizeof
(
fcomp_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fcomp_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
fcomp_t
));
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
total_fcomps
)
if
(
i
>=
cfg
.
total_fcomps
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
*
cfg
.
fcomp
[
i
]
=*
cfg
.
fcomp
[
j
];
}
*
cfg
.
fcomp
[
i
]
=*
cfg
.
fcomp
[
j
];
}
cfg
.
total_fcomps
++
;
cfg
.
total_fcomps
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
savfcomp
=*
cfg
.
fcomp
[
i
];
savfcomp
=*
cfg
.
fcomp
[
i
];
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
*
cfg
.
fcomp
[
i
]
=
savfcomp
;
*
cfg
.
fcomp
[
i
]
=
savfcomp
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
done
=
0
;
done
=
0
;
while
(
!
done
)
{
while
(
!
done
)
{
j
=
0
;
j
=
0
;
...
@@ -775,7 +835,10 @@ uifc.helpbuf=
...
@@ -775,7 +835,10 @@ uifc.helpbuf=
sprintf
(
str
,
"Compressable File Type %s"
sprintf
(
str
,
"Compressable File Type %s"
,
cfg
.
fcomp
[
i
]
->
ext
);
,
cfg
.
fcomp
[
i
]
->
ext
);
getar
(
str
,
cfg
.
fcomp
[
i
]
->
arstr
);
getar
(
str
,
cfg
.
fcomp
[
i
]
->
arstr
);
break
;
}
}
}
break
;
}
}
}
break
;
break
;
case
13
:
/* Transfer protocols */
case
13
:
/* Transfer protocols */
while
(
1
)
{
while
(
1
)
{
...
@@ -813,9 +876,11 @@ uifc.helpbuf=
...
@@ -813,9 +876,11 @@ uifc.helpbuf=
cfg
.
total_prots
--
;
cfg
.
total_prots
--
;
while
(
i
<
cfg
.
total_prots
)
{
while
(
i
<
cfg
.
total_prots
)
{
cfg
.
prot
[
i
]
=
cfg
.
prot
[
i
+
1
];
cfg
.
prot
[
i
]
=
cfg
.
prot
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
prot
=
(
prot_t
**
)
realloc
(
cfg
.
prot
if
((
cfg
.
prot
=
(
prot_t
**
)
realloc
(
cfg
.
prot
...
@@ -823,12 +888,14 @@ uifc.helpbuf=
...
@@ -823,12 +888,14 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_prots
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
total_prots
+
1
);
cfg
.
total_prots
=
0
;
cfg
.
total_prots
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
total_prots
)
{
if
(
!
cfg
.
total_prots
)
{
if
((
cfg
.
prot
[
0
]
=
(
prot_t
*
)
malloc
(
if
((
cfg
.
prot
[
0
]
=
(
prot_t
*
)
malloc
(
sizeof
(
prot_t
)))
==
NULL
)
{
sizeof
(
prot_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
prot_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
prot_t
));
continue
;
}
continue
;
}
memset
(
cfg
.
prot
[
0
],
0
,
sizeof
(
prot_t
));
memset
(
cfg
.
prot
[
0
],
0
,
sizeof
(
prot_t
));
cfg
.
prot
[
0
]
->
mnemonic
=
'?'
;
cfg
.
prot
[
0
]
->
mnemonic
=
'?'
;
}
else
{
}
else
{
...
@@ -837,24 +904,29 @@ uifc.helpbuf=
...
@@ -837,24 +904,29 @@ uifc.helpbuf=
if
((
cfg
.
prot
[
i
]
=
(
prot_t
*
)
malloc
(
if
((
cfg
.
prot
[
i
]
=
(
prot_t
*
)
malloc
(
sizeof
(
prot_t
)))
==
NULL
)
{
sizeof
(
prot_t
)))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
prot_t
));
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
sizeof
(
prot_t
));
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
total_prots
)
if
(
i
>=
cfg
.
total_prots
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
*
cfg
.
prot
[
i
]
=*
cfg
.
prot
[
j
];
}
*
cfg
.
prot
[
i
]
=*
cfg
.
prot
[
j
];
}
cfg
.
total_prots
++
;
cfg
.
total_prots
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
savprot
=*
cfg
.
prot
[
i
];
savprot
=*
cfg
.
prot
[
i
];
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
*
cfg
.
prot
[
i
]
=
savprot
;
*
cfg
.
prot
[
i
]
=
savprot
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
done
=
0
;
done
=
0
;
while
(
!
done
)
{
while
(
!
done
)
{
j
=
0
;
j
=
0
;
...
@@ -1002,9 +1074,11 @@ uifc.helpbuf=
...
@@ -1002,9 +1074,11 @@ uifc.helpbuf=
cfg
.
altpaths
--
;
cfg
.
altpaths
--
;
while
(
i
<
cfg
.
altpaths
)
{
while
(
i
<
cfg
.
altpaths
)
{
cfg
.
altpath
[
i
]
=
cfg
.
altpath
[
i
+
1
];
cfg
.
altpath
[
i
]
=
cfg
.
altpath
[
i
+
1
];
i
++
;
}
i
++
;
}
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
if
((
i
&
MSK_ON
)
==
MSK_INS
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
if
((
cfg
.
altpath
=
(
char
**
)
realloc
(
cfg
.
altpath
if
((
cfg
.
altpath
=
(
char
**
)
realloc
(
cfg
.
altpath
...
@@ -1012,35 +1086,43 @@ uifc.helpbuf=
...
@@ -1012,35 +1086,43 @@ uifc.helpbuf=
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
altpaths
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
cfg
.
altpaths
+
1
);
cfg
.
altpaths
=
0
;
cfg
.
altpaths
=
0
;
bail
(
1
);
bail
(
1
);
continue
;
}
continue
;
}
if
(
!
cfg
.
altpaths
)
{
if
(
!
cfg
.
altpaths
)
{
if
((
cfg
.
altpath
[
0
]
=
(
char
*
)
malloc
(
LEN_DIR
+
1
))
==
NULL
)
{
if
((
cfg
.
altpath
[
0
]
=
(
char
*
)
malloc
(
LEN_DIR
+
1
))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
LEN_DIR
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
LEN_DIR
+
1
);
continue
;
}
continue
;
memset
(
cfg
.
altpath
[
0
],
0
,
LEN_DIR
+
1
);
}
}
memset
(
cfg
.
altpath
[
0
],
0
,
LEN_DIR
+
1
);
}
else
{
else
{
for
(
j
=
cfg
.
altpaths
;
j
>
i
;
j
--
)
for
(
j
=
cfg
.
altpaths
;
j
>
i
;
j
--
)
cfg
.
altpath
[
j
]
=
cfg
.
altpath
[
j
-
1
];
cfg
.
altpath
[
j
]
=
cfg
.
altpath
[
j
-
1
];
if
((
cfg
.
altpath
[
i
]
=
(
char
*
)
malloc
(
LEN_DIR
+
1
))
==
NULL
)
{
if
((
cfg
.
altpath
[
i
]
=
(
char
*
)
malloc
(
LEN_DIR
+
1
))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
LEN_DIR
+
1
);
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
LEN_DIR
+
1
);
continue
;
}
continue
;
}
if
(
i
>=
cfg
.
altpaths
)
if
(
i
>=
cfg
.
altpaths
)
j
=
i
-
1
;
j
=
i
-
1
;
else
else
j
=
i
+
1
;
j
=
i
+
1
;
memcpy
(
cfg
.
altpath
[
i
],
cfg
.
altpath
[
j
],
LEN_DIR
+
1
);
}
memcpy
(
cfg
.
altpath
[
i
],
cfg
.
altpath
[
j
],
LEN_DIR
+
1
);
}
cfg
.
altpaths
++
;
cfg
.
altpaths
++
;
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
if
((
i
&
MSK_ON
)
==
MSK_GET
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
memcpy
(
savaltpath
,
cfg
.
altpath
[
i
],
LEN_DIR
+
1
);
memcpy
(
savaltpath
,
cfg
.
altpath
[
i
],
LEN_DIR
+
1
);
continue
;
}
continue
;
}
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
if
((
i
&
MSK_ON
)
==
MSK_PUT
)
{
i
&=
MSK_OFF
;
i
&=
MSK_OFF
;
memcpy
(
cfg
.
altpath
[
i
],
savaltpath
,
LEN_DIR
+
1
);
memcpy
(
cfg
.
altpath
[
i
],
savaltpath
,
LEN_DIR
+
1
);
uifc
.
changes
=
1
;
uifc
.
changes
=
1
;
continue
;
}
continue
;
}
sprintf
(
str
,
"Path %d"
,
i
+
1
);
sprintf
(
str
,
"Path %d"
,
i
+
1
);
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
str
,
cfg
.
altpath
[
i
],
LEN_DIR
,
K_EDIT
);
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
str
,
cfg
.
altpath
[
i
],
LEN_DIR
,
K_EDIT
);
}
}
...
...
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