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
2a525720
Commit
2a525720
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
get/putextdesc functions converted from C++ to C (for DLL exportability)
parent
f653d78c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sbbs3/file.cpp
+1
-32
1 addition, 32 deletions
src/sbbs3/file.cpp
src/sbbs3/filedat.c
+30
-0
30 additions, 0 deletions
src/sbbs3/filedat.c
src/sbbs3/sbbs.h
+3
-2
3 additions, 2 deletions
src/sbbs3/sbbs.h
with
34 additions
and
34 deletions
src/sbbs3/file.cpp
+
1
−
32
View file @
2a525720
...
...
@@ -37,37 +37,6 @@
#include
"sbbs.h"
void
sbbs_t
::
getextdesc
(
uint
dirnum
,
ulong
datoffset
,
char
*
ext
)
{
char
str
[
256
];
int
file
;
memset
(
ext
,
0
,
513
);
sprintf
(
str
,
"%s%s.exb"
,
cfg
.
dir
[
dirnum
]
->
data_dir
,
cfg
.
dir
[
dirnum
]
->
code
);
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
return
;
lseek
(
file
,(
datoffset
/
F_LEN
)
*
512L
,
SEEK_SET
);
read
(
file
,
ext
,
512
);
close
(
file
);
}
void
sbbs_t
::
putextdesc
(
uint
dirnum
,
ulong
datoffset
,
char
*
ext
)
{
char
str
[
256
],
nulbuf
[
512
];
int
file
;
memset
(
nulbuf
,
0
,
512
);
sprintf
(
str
,
"%s%s.exb"
,
cfg
.
dir
[
dirnum
]
->
data_dir
,
cfg
.
dir
[
dirnum
]
->
code
);
if
((
file
=
nopen
(
str
,
O_WRONLY
|
O_CREAT
))
==-
1
)
return
;
lseek
(
file
,
0L
,
SEEK_END
);
while
(
filelength
(
file
)
<
(
long
)(
datoffset
/
F_LEN
)
*
512L
)
write
(
file
,
nulbuf
,
512
);
lseek
(
file
,(
datoffset
/
F_LEN
)
*
512L
,
SEEK_SET
);
write
(
file
,
ext
,
512
);
close
(
file
);
}
/****************************************************************************/
/* Prints all information of file in file_t structure 'f' */
/****************************************************************************/
...
...
@@ -108,7 +77,7 @@ void sbbs_t::fileinfo(file_t* f)
bprintf
(
text
[
InvalidAlternatePathN
],
f
->
altpath
);
}
CRLF
;
if
(
f
->
misc
&
FM_EXTDESC
)
{
getextdesc
(
f
->
dir
,
f
->
datoffset
,
ext
);
getextdesc
(
&
cfg
,
f
->
dir
,
f
->
datoffset
,
ext
);
CRLF
;
putmsg
(
ext
,
P_NOATCODES
);
CRLF
;
}
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/filedat.c
+
30
−
0
View file @
2a525720
...
...
@@ -637,3 +637,33 @@ BOOL DLLCALL rmuserxfers(scfg_t* cfg, int fromuser, int destuser, char *fname)
return
(
TRUE
);
}
void
DLLCALL
getextdesc
(
scfg_t
*
cfg
,
uint
dirnum
,
ulong
datoffset
,
char
*
ext
)
{
char
str
[
256
];
int
file
;
memset
(
ext
,
0
,
513
);
sprintf
(
str
,
"%s%s.exb"
,
cfg
->
dir
[
dirnum
]
->
data_dir
,
cfg
->
dir
[
dirnum
]
->
code
);
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
return
;
lseek
(
file
,(
datoffset
/
F_LEN
)
*
512L
,
SEEK_SET
);
read
(
file
,
ext
,
512
);
close
(
file
);
}
void
DLLCALL
putextdesc
(
scfg_t
*
cfg
,
uint
dirnum
,
ulong
datoffset
,
char
*
ext
)
{
char
str
[
256
],
nulbuf
[
512
];
int
file
;
memset
(
nulbuf
,
0
,
sizeof
(
nulbuf
));
sprintf
(
str
,
"%s%s.exb"
,
cfg
->
dir
[
dirnum
]
->
data_dir
,
cfg
->
dir
[
dirnum
]
->
code
);
if
((
file
=
nopen
(
str
,
O_WRONLY
|
O_CREAT
))
==-
1
)
return
;
lseek
(
file
,
0L
,
SEEK_END
);
while
(
filelength
(
file
)
<
(
long
)(
datoffset
/
F_LEN
)
*
512L
)
write
(
file
,
nulbuf
,
512
);
lseek
(
file
,(
datoffset
/
F_LEN
)
*
512L
,
SEEK_SET
);
write
(
file
,
ext
,
512
);
close
(
file
);
}
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.h
+
3
−
2
View file @
2a525720
...
...
@@ -548,8 +548,6 @@ public:
void
fileinfo
(
file_t
*
f
);
void
openfile
(
file_t
*
f
);
void
closefile
(
file_t
*
f
);
void
putextdesc
(
uint
dirnum
,
ulong
datoffset
,
char
*
ext
);
void
getextdesc
(
uint
dirnum
,
ulong
datoffset
,
char
*
ext
);
bool
removefcdt
(
file_t
*
f
);
bool
movefile
(
file_t
*
f
,
int
newdir
);
char
*
getfilespec
(
char
*
str
);
...
...
@@ -729,6 +727,9 @@ extern "C" {
DLLEXPORT
BOOL
DLLCALL
getfileixb
(
scfg_t
*
cfg
,
file_t
*
f
);
DLLEXPORT
BOOL
DLLCALL
getfiledat
(
scfg_t
*
cfg
,
file_t
*
f
);
DLLEXPORT
BOOL
DLLCALL
putfiledat
(
scfg_t
*
cfg
,
file_t
*
f
);
DLLEXPORT
void
DLLCALL
putextdesc
(
scfg_t
*
cfg
,
uint
dirnum
,
ulong
datoffset
,
char
*
ext
);
DLLEXPORT
void
DLLCALL
getextdesc
(
scfg_t
*
cfg
,
uint
dirnum
,
ulong
datoffset
,
char
*
ext
);
DLLEXPORT
BOOL
DLLCALL
removefiledat
(
scfg_t
*
cfg
,
file_t
*
f
);
DLLEXPORT
BOOL
DLLCALL
addfiledat
(
scfg_t
*
cfg
,
file_t
*
f
);
DLLEXPORT
BOOL
DLLCALL
findfile
(
scfg_t
*
cfg
,
uint
dirnum
,
char
*
filename
);
...
...
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