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
c6d29173
Commit
c6d29173
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
FIXSMB now supports multiple message bases on the command-line, including
wildcards (e.g. "*.SHD").
parent
2e1cf3dc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/Makefile
+1
-1
1 addition, 1 deletion
src/sbbs3/Makefile
src/sbbs3/fixsmb.c
+42
-25
42 additions, 25 deletions
src/sbbs3/fixsmb.c
with
43 additions
and
26 deletions
src/sbbs3/Makefile
+
1
−
1
View file @
c6d29173
...
...
@@ -172,7 +172,7 @@ $(FIXSMB): fixsmb.c \
$(LIBODIR)
\s
tr_util.obj
\
$(LIBODIR)
\d
irwrap.obj
@
echo
Creating
$@
$(
QUIET
)$(
CC
)
$(
CFLAGS
)
-n
$(
EXEODIR
)
$*
*
$(
QUIET
)$(
CC
)
$(
CFLAGS
)
-n
$(
EXEODIR
)
$*
*
$(
WILDARGS
)
# CHKSMB Utility
$(CHKSMB)
:
chksmb.c
\
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/fixsmb.c
+
42
−
25
View file @
c6d29173
...
...
@@ -42,7 +42,9 @@
#include
"sbbs.h"
smb_t
smb
;
smb_t
smb
;
BOOL
renumber
=
FALSE
;
char
*
usage
=
"usage: fixsmb [-renumber] <smb_file> [[smb_file] [...]]
\n
"
;
int
compare_index
(
const
idxrec_t
*
idx1
,
const
idxrec_t
*
idx2
)
{
...
...
@@ -88,45 +90,27 @@ void sort_index(smb_t* smb)
void
unlock_msgbase
(
void
)
{
int
i
;
if
((
i
=
smb_unlock
(
&
smb
))
!=
0
)
if
(
smb_islocked
(
&
smb
)
&&
(
i
=
smb_unlock
(
&
smb
))
!=
0
)
printf
(
"smb_unlock returned %d: %s
\n
"
,
i
,
smb
.
last_error
);
}
char
*
usage
=
"usage: fixsmb [-renumber] <smb_file>
\n
"
;
int
main
(
int
argc
,
char
**
argv
)
int
fixsmb
(
char
*
sub
)
{
char
*
p
;
char
*
text
;
char
str
[
MAX_PATH
+
1
],
c
;
char
revision
[
16
];
int
i
,
w
;
ulong
l
,
length
,
size
,
n
;
BOOL
renumber
=
FALSE
;
smbmsg_t
msg
;
sscanf
(
"$Revision$"
,
"%*s %s"
,
revision
);
printf
(
"
\n
FIXSMB v2.10-%s (rev %s) SMBLIB %s - Rebuild Synchronet Message Base
\n\n
"
,
PLATFORM_DESC
,
revision
,
smb_lib_ver
());
memset
(
&
smb
,
0
,
sizeof
(
smb
));
smb
.
file
[
0
]
=
0
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
stricmp
(
argv
[
i
],
"-renumber"
))
renumber
=
TRUE
;
else
SAFECOPY
(
smb
.
file
,
argv
[
i
]);
}
SAFECOPY
(
smb
.
file
,
sub
);
if
((
p
=
getfext
(
smb
.
file
))
!=
NULL
&&
stricmp
(
p
,
".shd"
)
==
0
)
*
p
=
0
;
/* Chop off .shd extension, if supplied on command-line */
if
(
!
smb
.
file
[
0
])
{
printf
(
usage
);
exit
(
1
);
}
printf
(
"Opening %s
\n
"
,
smb
.
file
);
if
((
i
=
smb_open
(
&
smb
))
!=
0
)
{
printf
(
"smb_open returned %d: %s
\n
"
,
i
,
smb
.
last_error
);
...
...
@@ -138,8 +122,6 @@ int main(int argc, char **argv)
exit
(
1
);
}
atexit
(
unlock_msgbase
);
if
((
i
=
smb_locksmbhdr
(
&
smb
))
!=
0
)
{
smb_close
(
&
smb
);
printf
(
"smb_locksmbhdr returned %d: %s
\n
"
,
i
,
smb
.
last_error
);
...
...
@@ -289,6 +271,41 @@ int main(int argc, char **argv)
smb_unlocksmbhdr
(
&
smb
);
printf
(
"Closing message base.
\n
"
);
smb_close
(
&
smb
);
unlock_msgbase
();
printf
(
"Done.
\n
"
);
return
(
0
);
}
int
main
(
int
argc
,
char
**
argv
)
{
char
revision
[
16
];
int
i
;
str_list_t
list
;
sscanf
(
"$Revision$"
,
"%*s %s"
,
revision
);
printf
(
"
\n
FIXSMB v2.10-%s (rev %s) SMBLIB %s - Rebuild Synchronet Message Base
\n\n
"
,
PLATFORM_DESC
,
revision
,
smb_lib_ver
());
list
=
strListInit
();
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
argv
[
i
][
0
]
==
'-'
)
{
if
(
!
stricmp
(
argv
[
i
],
"-renumber"
))
renumber
=
TRUE
;
}
else
strListPush
(
&
list
,
argv
[
i
]);
}
if
(
!
strListCount
(
list
))
{
printf
(
usage
);
exit
(
1
);
}
atexit
(
unlock_msgbase
);
for
(
i
=
0
;
list
[
i
]
!=
NULL
;
i
++
)
fixsmb
(
list
[
i
]);
return
(
0
);
}
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