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
04d88fd6
Commit
04d88fd6
authored
19 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
semfile module moved to xpdev.
parent
7279696d
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/objects.mk
+0
-1
0 additions, 1 deletion
src/sbbs3/objects.mk
src/sbbs3/sbbs.dsp
+0
-4
0 additions, 4 deletions
src/sbbs3/sbbs.dsp
src/sbbs3/sbbs.h
+1
-11
1 addition, 11 deletions
src/sbbs3/sbbs.h
src/sbbs3/semfile.c
+0
-131
0 additions, 131 deletions
src/sbbs3/semfile.c
with
1 addition
and
147 deletions
src/sbbs3/objects.mk
+
0
−
1
View file @
04d88fd6
...
...
@@ -86,7 +86,6 @@ OBJS = $(MTOBJODIR)$(DIRSEP)ansiterm$(OFILE) \
$(
MTOBJODIR
)$(
DIRSEP
)
scfglib1
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
scfglib2
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
scfgsave
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
semfile
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
sockopts
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
sortdir
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
str
$(
OFILE
)
\
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.dsp
+
0
−
4
View file @
04d88fd6
...
...
@@ -411,10 +411,6 @@ SOURCE=.\scfgsave.c
# End Source File
# Begin Source File
SOURCE=.\semfile.c
# End Source File
# Begin Source File
SOURCE=.\sockopts.c
# End Source File
# Begin Source File
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.h
+
1
−
11
View file @
04d88fd6
...
...
@@ -119,6 +119,7 @@
#define LINK_LIST_THREADSAFE
#endif
#include
"genwrap.h"
#include
"semfile.h"
#include
"dirwrap.h"
#include
"filewrap.h"
#include
"sockwrap.h"
...
...
@@ -884,17 +885,6 @@ extern "C" {
DLLEXPORT
char
*
DLLCALL
cmdstr
(
scfg_t
*
cfg
,
user_t
*
user
,
const
char
*
instr
,
const
char
*
fpath
,
const
char
*
fspec
,
char
*
cmd
);
/* semfile.c */
DLLEXPORT
BOOL
DLLCALL
semfile_signal
(
const
char
*
fname
,
const
char
*
text
);
DLLEXPORT
BOOL
DLLCALL
semfile_check
(
time_t
*
t
,
const
char
*
fname
);
DLLEXPORT
char
*
DLLCALL
semfile_list_check
(
time_t
*
t
,
str_list_t
filelist
);
DLLEXPORT
str_list_t
DLLCALL
semfile_list_init
(
const
char
*
parent
,
const
char
*
action
,
const
char
*
service
);
DLLEXPORT
void
DLLCALL
semfile_list_add
(
str_list_t
*
filelist
,
const
char
*
fname
);
DLLEXPORT
void
DLLCALL
semfile_list_free
(
str_list_t
*
filelist
);
#ifdef JAVASCRIPT
typedef
struct
{
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/semfile.c
deleted
100644 → 0
+
0
−
131
View file @
7279696d
/* semfile.c */
/* $Id$ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include
"sbbs.h"
/****************************************************************************/
/* This function compares a single semaphore file's */
/* date/time stamp (if the file exists) against the passed time stamp (t) */
/* updating the time stamp to the latest dated semaphore file and returning */
/* TRUE if any where newer than the initial value. */
/****************************************************************************/
BOOL
DLLCALL
semfile_check
(
time_t
*
t
,
const
char
*
fname
)
{
time_t
ft
;
if
(
*
t
==
0
)
/* uninitialized */
*
t
=
time
(
NULL
);
if
((
ft
=
fdate
(
fname
))
==-
1
||
ft
<=*
t
)
return
(
FALSE
);
*
t
=
ft
;
return
(
TRUE
);
}
/****************************************************************************/
/* This function goes through a list of semaphore files, comparing the file */
/* date/time stamp (if the file exists) against the passed time stamp (t) */
/* updating the time stamp to the latest dated semaphore file and returning */
/* a pointer to the filename if any where newer than the initial timestamp. */
/****************************************************************************/
char
*
DLLCALL
semfile_list_check
(
time_t
*
t
,
str_list_t
filelist
)
{
char
*
signaled
=
NULL
;
size_t
i
;
for
(
i
=
0
;
filelist
[
i
]
!=
NULL
;
i
++
)
if
(
semfile_check
(
t
,
filelist
[
i
]))
signaled
=
filelist
[
i
];
return
(
signaled
);
}
str_list_t
DLLCALL
semfile_list_init
(
const
char
*
parent
,
const
char
*
action
,
const
char
*
service
)
{
char
path
[
MAX_PATH
+
1
];
char
hostname
[
128
];
char
*
p
;
str_list_t
list
;
if
((
list
=
strListInit
())
==
NULL
)
return
(
NULL
);
SAFEPRINTF2
(
path
,
"%s%s"
,
parent
,
action
);
strListPush
(
&
list
,
path
);
SAFEPRINTF3
(
path
,
"%s%s.%s"
,
parent
,
action
,
service
);
strListPush
(
&
list
,
path
);
if
(
gethostname
(
hostname
,
sizeof
(
hostname
))
==
0
)
{
SAFEPRINTF3
(
path
,
"%s%s.%s"
,
parent
,
action
,
hostname
);
strListPush
(
&
list
,
path
);
SAFEPRINTF4
(
path
,
"%s%s.%s.%s"
,
parent
,
action
,
hostname
,
service
);
strListPush
(
&
list
,
path
);
if
((
p
=
strchr
(
hostname
,
'.'
))
!=
NULL
)
{
*
p
=
0
;
SAFEPRINTF3
(
path
,
"%s%s.%s"
,
parent
,
action
,
hostname
);
strListPush
(
&
list
,
path
);
SAFEPRINTF4
(
path
,
"%s%s.%s.%s"
,
parent
,
action
,
hostname
,
service
);
strListPush
(
&
list
,
path
);
}
}
return
(
list
);
}
void
DLLCALL
semfile_list_add
(
str_list_t
*
filelist
,
const
char
*
path
)
{
strListPush
(
filelist
,
path
);
}
void
DLLCALL
semfile_list_free
(
str_list_t
*
filelist
)
{
strListFree
(
filelist
);
}
BOOL
DLLCALL
semfile_signal
(
const
char
*
fname
,
const
char
*
text
)
{
int
file
;
char
hostname
[
128
];
if
((
file
=
nopen
(
fname
,
O_CREAT
|
O_WRONLY
))
<
0
)
return
(
FALSE
);
if
(
text
==
NULL
&&
gethostname
(
hostname
,
sizeof
(
hostname
))
==
0
)
text
=
hostname
;
if
(
text
!=
NULL
)
write
(
file
,
text
,
strlen
(
text
));
/* use utime() for force the time-stamp to that of the local system? */
close
(
file
);
return
(
TRUE
);
}
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