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
bd320417
Commit
bd320417
authored
21 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Created getfilepath() function return full path of file_t reference.
parent
1acc0255
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/sbbs3/addfiles.c
+1
-4
1 addition, 4 deletions
src/sbbs3/addfiles.c
src/sbbs3/file.cpp
+12
-24
12 additions, 24 deletions
src/sbbs3/file.cpp
src/sbbs3/filedat.c
+17
-4
17 additions, 4 deletions
src/sbbs3/filedat.c
src/sbbs3/sbbs.h
+1
-0
1 addition, 0 deletions
src/sbbs3/sbbs.h
with
31 additions
and
32 deletions
src/sbbs3/addfiles.c
+
1
−
4
View file @
bd320417
...
...
@@ -629,10 +629,7 @@ void synclist(char *inpath, int dirnum)
continue
;
}
removefiledat
(
&
scfg
,
&
f
);
sprintf
(
str
,
"%s%s"
,
f
.
altpath
>
0
&&
f
.
altpath
<=
scfg
.
altpaths
?
scfg
.
altpath
[
f
.
altpath
-
1
]
:
scfg
.
dir
[
f
.
dir
]
->
path
,
fname
);
if
(
remove
(
str
))
if
(
remove
(
getfilepath
(
&
scfg
,
&
f
,
str
))
printf
(
"Error removing %s
\n
"
,
str
);
removed
++
;
printf
(
"Removed from database
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/file.cpp
+
12
−
24
View file @
bd320417
...
...
@@ -42,9 +42,10 @@
/****************************************************************************/
void
sbbs_t
::
fileinfo
(
file_t
*
f
)
{
char
fname
[
13
],
ext
[
513
];
char
ext
[
513
];
char
tmp
[
512
];
char
path
[
MAX_PATH
+
1
];
char
fpath
[
MAX_PATH
+
1
];
uint
i
,
j
;
for
(
i
=
0
;
i
<
usrlibs
;
i
++
)
...
...
@@ -54,29 +55,14 @@ void sbbs_t::fileinfo(file_t* f)
if
(
usrdir
[
i
][
j
]
==
f
->
dir
)
break
;
unpadfname
(
f
->
name
,
fname
);
sprintf
(
path
,
"%s%s"
,
f
->
altpath
>
0
&&
f
->
altpath
<=
cfg
.
altpaths
?
cfg
.
altpath
[
f
->
altpath
-
1
]
:
cfg
.
dir
[
f
->
dir
]
->
path
,
fname
);
getfilepath
(
&
cfg
,
f
,
path
);
bprintf
(
text
[
FiLib
],
i
+
1
,
cfg
.
lib
[
cfg
.
dir
[
f
->
dir
]
->
lib
]
->
lname
);
bprintf
(
text
[
FiDir
],
j
+
1
,
cfg
.
dir
[
f
->
dir
]
->
lname
);
bprintf
(
text
[
FiFilename
],
fname
);
#ifdef _WIN32
if
(
f
->
size
!=-
1
)
{
WIN32_FIND_DATA
finddata
;
HANDLE
h
=
FindFirstFile
(
path
,
&
finddata
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
if
(
stricmp
(
finddata
.
cFileName
,
fname
))
bprintf
(
text
[
FiFilename
],
finddata
.
cFileName
);
FindClose
(
h
);
}
}
#endif
bprintf
(
text
[
FiFilename
],
getfname
(
path
));
SAFECOPY
(
fpath
,
path
);
fexistcase
(
fpath
);
if
(
strcmp
(
path
,
fpath
))
/* Different "actual" filename */
bprintf
(
text
[
FiFilename
],
getfname
(
fpath
));
if
(
f
->
size
!=-
1L
)
bprintf
(
text
[
FiFileSize
],
ultoac
(
f
->
size
,
tmp
));
...
...
@@ -94,9 +80,11 @@ void sbbs_t::fileinfo(file_t* f)
if
(
f
->
altpath
)
{
if
(
f
->
altpath
<=
cfg
.
altpaths
)
{
if
(
SYSOP
)
bprintf
(
text
[
FiAlternatePath
],
cfg
.
altpath
[
f
->
altpath
-
1
]);
}
bprintf
(
text
[
FiAlternatePath
],
cfg
.
altpath
[
f
->
altpath
-
1
]);
}
else
bprintf
(
text
[
InvalidAlternatePathN
],
f
->
altpath
);
}
bprintf
(
text
[
InvalidAlternatePathN
],
f
->
altpath
);
}
CRLF
;
if
(
f
->
misc
&
FM_EXTDESC
)
{
getextdesc
(
&
cfg
,
f
->
dir
,
f
->
datoffset
,
ext
);
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/filedat.c
+
17
−
4
View file @
bd320417
...
...
@@ -44,7 +44,7 @@
/****************************************************************************/
BOOL
DLLCALL
getfiledat
(
scfg_t
*
cfg
,
file_t
*
f
)
{
char
buf
[
F_LEN
+
1
],
str
[
256
]
,
tmp
[
128
]
;
char
buf
[
F_LEN
+
1
],
str
[
256
];
int
file
;
long
length
;
...
...
@@ -73,9 +73,7 @@ BOOL DLLCALL getfiledat(scfg_t* cfg, file_t* f)
f
->
cdt
=
atol
(
str
);
if
(
!
f
->
size
)
{
/* only read disk if this is null */
sprintf
(
str
,
"%s%s"
,
f
->
altpath
>
0
&&
f
->
altpath
<=
cfg
->
altpaths
?
cfg
->
altpath
[
f
->
altpath
-
1
]
:
cfg
->
dir
[
f
->
dir
]
->
path
,
unpadfname
(
f
->
name
,
tmp
));
getfilepath
(
cfg
,
f
,
str
);
f
->
size
=
flength
(
str
);
f
->
date
=
fdate
(
str
);
/*
...
...
@@ -655,3 +653,18 @@ int DLLCALL update_uldate(scfg_t* cfg, file_t* f)
close
(
file
);
return
(
0
);
}
/****************************************************************************/
/* Returns full path to specified file */
/****************************************************************************/
char
*
DLLCALL
getfilepath
(
scfg_t
*
cfg
,
file_t
*
f
,
char
*
path
)
{
char
fname
[
MAX_PATH
+
1
];
unpadfname
(
f
->
name
,
fname
);
sprintf
(
path
,
"%s%s"
,
f
->
altpath
>
0
&&
f
->
altpath
<=
cfg
->
altpaths
?
cfg
->
altpath
[
f
->
altpath
-
1
]
:
cfg
->
dir
[
f
->
dir
]
->
path
,
fname
);
return
(
path
);
}
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.h
+
1
−
0
View file @
bd320417
...
...
@@ -782,6 +782,7 @@ extern "C" {
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
char
*
DLLCALL
getfilepath
(
scfg_t
*
cfg
,
file_t
*
f
,
char
*
path
);
DLLEXPORT
BOOL
DLLCALL
removefiledat
(
scfg_t
*
cfg
,
file_t
*
f
);
DLLEXPORT
BOOL
DLLCALL
addfiledat
(
scfg_t
*
cfg
,
file_t
*
f
);
...
...
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