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
9af69f9d
Commit
9af69f9d
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Moved update_uldate() from upload.cpp to filedat.c (dll exported now).
parent
38240f1a
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/filedat.c
+47
-0
47 additions, 0 deletions
src/sbbs3/filedat.c
src/sbbs3/sbbs.h
+1
-1
1 addition, 1 deletion
src/sbbs3/sbbs.h
src/sbbs3/upload.cpp
+0
-49
0 additions, 49 deletions
src/sbbs3/upload.cpp
with
48 additions
and
50 deletions
src/sbbs3/filedat.c
+
47
−
0
View file @
9af69f9d
...
...
@@ -655,3 +655,50 @@ void DLLCALL putextdesc(scfg_t* cfg, uint dirnum, ulong datoffset, char *ext)
write
(
file
,
ext
,
F_EXBSIZE
);
close
(
file
);
}
/****************************************************************************/
/* Update the upload date for the file 'f' */
/****************************************************************************/
int
DLLCALL
update_uldate
(
scfg_t
*
cfg
,
file_t
*
f
)
{
char
str
[
256
],
fname
[
13
];
int
i
,
file
;
long
l
,
length
;
/*******************/
/* Update IXB File */
/*******************/
sprintf
(
str
,
"%s%s.ixb"
,
cfg
->
dir
[
f
->
dir
]
->
data_dir
,
cfg
->
dir
[
f
->
dir
]
->
code
);
if
((
file
=
nopen
(
str
,
O_RDWR
))
==-
1
)
return
(
errno
);
length
=
filelength
(
file
);
if
(
length
%
F_IXBSIZE
)
{
close
(
file
);
return
(
-
1
);
}
strcpy
(
fname
,
f
->
name
);
for
(
i
=
8
;
i
<
12
;
i
++
)
/* Turn FILENAME.EXT into FILENAMEEXT */
fname
[
i
]
=
fname
[
i
+
1
];
for
(
l
=
0
;
l
<
length
;
l
+=
F_IXBSIZE
)
{
read
(
file
,
str
,
F_IXBSIZE
);
/* Look for the filename in the IXB file */
str
[
11
]
=
0
;
if
(
!
strcmp
(
fname
,
str
))
break
;
}
if
(
l
>=
length
)
{
close
(
file
);
return
(
-
2
);
}
lseek
(
file
,
l
+
14
,
SEEK_SET
);
write
(
file
,
&
f
->
dateuled
,
4
);
close
(
file
);
/*******************************************/
/* Update last upload date/time stamp file */
/*******************************************/
sprintf
(
str
,
"%s%s.dab"
,
cfg
->
dir
[
f
->
dir
]
->
data_dir
,
cfg
->
dir
[
f
->
dir
]
->
code
);
if
((
file
=
nopen
(
str
,
O_WRONLY
|
O_CREAT
))
==-
1
)
return
(
errno
);
write
(
file
,
&
f
->
dateuled
,
4
);
close
(
file
);
return
(
0
);
}
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.h
+
1
−
1
View file @
9af69f9d
...
...
@@ -567,7 +567,6 @@ public:
char
sbbsfilename
[
128
],
sbbsfiledesc
[
128
];
/* env vars */
bool
upload
(
uint
dirnum
);
char
upload_lastdesc
[
LEN_FDESC
+
1
];
void
update_uldate
(
file_t
*
f
);
bool
bulkupload
(
uint
dirnum
);
/* download.cpp */
...
...
@@ -771,6 +770,7 @@ extern "C" {
DLLEXPORT
ulong
DLLCALL
getposts
(
scfg_t
*
cfg
,
uint
subnum
);
DLLEXPORT
long
DLLCALL
getfiles
(
scfg_t
*
cfg
,
uint
dirnum
);
DLLEXPORT
int
DLLCALL
update_uldate
(
scfg_t
*
cfg
,
file_t
*
f
);
/* str_util.c */
DLLEXPORT
void
DLLCALL
truncsp
(
char
*
str
);
/* Truncates white spaces off end of str */
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/upload.cpp
+
0
−
49
View file @
9af69f9d
...
...
@@ -216,55 +216,6 @@ bool sbbs_t::uploadfile(file_t *f)
return
(
true
);
}
/****************************************************************************/
/* Update the upload date for the file 'f' */
/****************************************************************************/
void
sbbs_t
::
update_uldate
(
file_t
*
f
)
{
char
str
[
256
],
fname
[
13
];
int
i
,
file
;
long
l
,
length
;
/*******************/
/* Update IXB File */
/*******************/
sprintf
(
str
,
"%s%s.ixb"
,
cfg
.
dir
[
f
->
dir
]
->
data_dir
,
cfg
.
dir
[
f
->
dir
]
->
code
);
if
((
file
=
nopen
(
str
,
O_RDWR
))
==-
1
)
{
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDWR
);
return
;
}
length
=
filelength
(
file
);
if
(
length
%
F_IXBSIZE
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_LEN
,
str
,
length
);
return
;
}
strcpy
(
fname
,
f
->
name
);
for
(
i
=
8
;
i
<
12
;
i
++
)
/* Turn FILENAME.EXT into FILENAMEEXT */
fname
[
i
]
=
fname
[
i
+
1
];
for
(
l
=
0
;
l
<
length
;
l
+=
F_IXBSIZE
)
{
read
(
file
,
str
,
F_IXBSIZE
);
/* Look for the filename in the IXB file */
str
[
11
]
=
0
;
if
(
!
strcmp
(
fname
,
str
))
break
;
}
if
(
l
>=
length
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_CHK
,
f
->
name
,
length
);
return
;
}
lseek
(
file
,
l
+
14
,
SEEK_SET
);
write
(
file
,
&
f
->
dateuled
,
4
);
close
(
file
);
/*******************************************/
/* Update last upload date/time stamp file */
/*******************************************/
sprintf
(
str
,
"%s%s.dab"
,
cfg
.
dir
[
f
->
dir
]
->
data_dir
,
cfg
.
dir
[
f
->
dir
]
->
code
);
if
((
file
=
nopen
(
str
,
O_WRONLY
|
O_CREAT
))
==-
1
)
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_WRONLY
|
O_CREAT
);
else
{
write
(
file
,
&
f
->
dateuled
,
4
);
close
(
file
);
}
}
/****************************************************************************/
/* Uploads files */
/****************************************************************************/
...
...
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