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
70211388
Commit
70211388
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Created smb_incmsg(), opposite function of smb_freemsg().
parent
c2d40022
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/smblib/smblib.c
+22
-0
22 additions, 0 deletions
src/smblib/smblib.c
src/smblib/smblib.h
+1
-0
1 addition, 0 deletions
src/smblib/smblib.h
with
23 additions
and
0 deletions
src/smblib/smblib.c
+
22
−
0
View file @
70211388
...
...
@@ -1497,6 +1497,28 @@ int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort headers)
return
(
0
);
}
/****************************************************************************/
/* Increments data allocation records (message references) by number of */
/* headers specified (usually 1) */
/* The opposite function of smb_freemsg() */
/****************************************************************************/
int
SMBCALL
smb_incmsg
(
smb_t
*
smb
,
smbmsg_t
*
msg
)
{
int
i
;
ushort
x
;
if
(
smb
->
status
.
attr
&
SMB_HYPERALLOC
)
/* Nothing to do */
return
(
0
);
for
(
x
=
0
;
x
<
msg
->
hdr
.
total_dfields
;
x
++
)
{
if
((
i
=
smb_incdat
(
smb
,
msg
->
hdr
.
offset
+
msg
->
dfield
[
x
].
offset
,
msg
->
dfield
[
x
].
length
,
1
))
!=
0
)
return
(
i
);
}
return
(
0
);
}
/****************************************************************************/
/* De-allocates blocks for header record */
/* Returns non-zero on error */
...
...
This diff is collapsed.
Click to expand it.
src/smblib/smblib.h
+
1
−
0
View file @
70211388
...
...
@@ -127,6 +127,7 @@ SMBEXPORT long SMBCALL smb_hallochdr(smb_t* smb);
SMBEXPORT
long
SMBCALL
smb_allocdat
(
smb_t
*
smb
,
ulong
length
,
ushort
headers
);
SMBEXPORT
long
SMBCALL
smb_fallocdat
(
smb_t
*
smb
,
ulong
length
,
ushort
headers
);
SMBEXPORT
long
SMBCALL
smb_hallocdat
(
smb_t
*
smb
);
SMBEXPORT
int
SMBCALL
smb_incmsg
(
smb_t
*
smb
,
smbmsg_t
*
msg
);
SMBEXPORT
int
SMBCALL
smb_incdat
(
smb_t
*
smb
,
ulong
offset
,
ulong
length
,
ushort
headers
);
SMBEXPORT
int
SMBCALL
smb_freemsg
(
smb_t
*
smb
,
smbmsg_t
*
msg
);
SMBEXPORT
int
SMBCALL
smb_freemsgdat
(
smb_t
*
smb
,
ulong
offset
,
ulong
length
,
ushort
headers
);
...
...
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