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
5152448a
Commit
5152448a
authored
24 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Moved getfattr from msdirent.c to wrappers.c
parent
c94a095e
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/msdirent.c
+0
-12
0 additions, 12 deletions
src/sbbs3/msdirent.c
src/sbbs3/msdirent.h
+0
-2
0 additions, 2 deletions
src/sbbs3/msdirent.h
src/sbbs3/sbbswrap.h
+1
-0
1 addition, 0 deletions
src/sbbs3/sbbswrap.h
src/sbbs3/wrappers.c
+28
-0
28 additions, 0 deletions
src/sbbs3/wrappers.c
with
29 additions
and
14 deletions
src/sbbs3/msdirent.c
+
0
−
12
View file @
5152448a
...
...
@@ -88,15 +88,3 @@ void rewinddir(DIR* dir)
dir
->
end
=
FALSE
;
dir
->
handle
=
_findfirst
(
dir
->
filespec
,
&
dir
->
finddata
);
}
int
getfattr
(
char
*
filename
)
{
long
handle
;
struct
_finddata_t
finddata
;
if
((
handle
=
_findfirst
(
filename
,
&
finddata
))
==-
1
)
{
errno
=
ENOENT
;
return
(
-
1
);
}
_findclose
(
handle
);
return
(
finddata
.
attrib
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/sbbs3/msdirent.h
+
0
−
2
View file @
5152448a
...
...
@@ -73,8 +73,6 @@ struct dirent * readdir (DIR *__dir);
int
closedir
(
DIR
*
__dir
);
void
rewinddir
(
DIR
*
__dir
);
int
getfattr
(
char
*
filename
);
#ifdef __cplusplus
}
#endif
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbswrap.h
+
1
−
0
View file @
5152448a
...
...
@@ -119,6 +119,7 @@ DLLEXPORT char* ultoa(ulong, char*, int radix);
DLLEXPORT
BOOL
fexist
(
char
*
filespec
);
DLLEXPORT
long
flength
(
char
*
filename
);
DLLEXPORT
long
fdate
(
char
*
filename
);
DLLEXPORT
int
getfattr
(
char
*
filename
);
DLLEXPORT
ulong
getfreediskspace
(
char
*
path
);
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/wrappers.c
+
28
−
0
View file @
5152448a
...
...
@@ -55,6 +55,7 @@
#include
<stdio.h>
/* sprintf */
#include
<stdlib.h>
/* rand */
#include
<errno.h>
/* ENOENT definitions */
#include
"gen_defs.h"
/* BOOL */
#include
"sbbswrap.h"
/* verify prototypes */
...
...
@@ -131,6 +132,33 @@ long fdate(char *filename)
return
(
st
.
st_mtime
);
}
/****************************************************************************/
/* Returns the attributes (mode) for specified 'filename' */
/****************************************************************************/
int
getfattr
(
char
*
filename
)
{
#ifdef _WIN32
long
handle
;
struct
_finddata_t
finddata
;
if
((
handle
=
_findfirst
(
filename
,
&
finddata
))
==-
1
)
{
errno
=
ENOENT
;
return
(
-
1
);
}
_findclose
(
handle
);
return
(
finddata
.
attrib
);
#else
STAT
st
;
if
(
stat
(
filename
,
&
st
)
!=
0
)
{
errno
=
ENOENT
;
return
(
-
1L
);
}
return
(
st
.
st_mode
);
#endif
}
/****************************************************************************/
/* Returns the length of the file in 'fd' */
/****************************************************************************/
...
...
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