o __P removal.
o Use new prototypes and function definitions only.
This commit is contained in:
parent
2fb080722f
commit
78ad378ae1
@ -59,8 +59,7 @@ char *X10cmdnames[] = {
|
||||
*/
|
||||
|
||||
void
|
||||
logpacket(p)
|
||||
unsigned char *p;
|
||||
logpacket(unsigned char *p)
|
||||
{
|
||||
fprintf(Log, "%s: %s %s ", thedate(),
|
||||
X10housenames[p[1]], X10cmdnames[p[2]]);
|
||||
@ -77,8 +76,7 @@ unsigned char *p;
|
||||
*/
|
||||
|
||||
void
|
||||
processpacket(p)
|
||||
unsigned char *p;
|
||||
processpacket(unsigned char *p)
|
||||
{
|
||||
int i, j, h, k;
|
||||
STATUS *s;
|
||||
|
@ -42,14 +42,14 @@ static const char rcsid[] =
|
||||
#include "xten.h"
|
||||
#include "paths.h"
|
||||
|
||||
void printstatus __P((FILE *, STATUS *));
|
||||
void printstatus(FILE *, STATUS *);
|
||||
|
||||
/*
|
||||
* Initialize the status table from the status files
|
||||
*/
|
||||
|
||||
void
|
||||
initstatus()
|
||||
initstatus(void)
|
||||
{
|
||||
if(lseek(status, 0, SEEK_SET) != 0) {
|
||||
fprintf(Log, "%s: Seek error on status file\n", thedate());
|
||||
@ -67,7 +67,7 @@ initstatus()
|
||||
*/
|
||||
|
||||
void
|
||||
checkpoint_status()
|
||||
checkpoint_status(void)
|
||||
{
|
||||
int h, i, k, offset;
|
||||
|
||||
@ -108,7 +108,8 @@ checkpoint_status()
|
||||
|
||||
int client;
|
||||
|
||||
void clientgone()
|
||||
void
|
||||
clientgone(void)
|
||||
{
|
||||
fprintf(Log, "%s: Deleting monitor table entry %d, client gone\n", thedate(), client);
|
||||
fclose(Monitor[client].user);
|
||||
|
@ -46,15 +46,15 @@ static const char rcsid[] =
|
||||
|
||||
MONENTRY Monitor[MAXMON];
|
||||
|
||||
int find __P((char *, char *[]));
|
||||
void printstatus __P((FILE *, STATUS *));
|
||||
int find(char *, char *[]);
|
||||
void printstatus(FILE *, STATUS *);
|
||||
|
||||
/*
|
||||
* Process a user command
|
||||
*/
|
||||
|
||||
int
|
||||
user_command()
|
||||
user_command(void)
|
||||
{
|
||||
char h;
|
||||
char *m;
|
||||
@ -149,9 +149,7 @@ user_command()
|
||||
}
|
||||
|
||||
int
|
||||
find(s, tab)
|
||||
char *s;
|
||||
char *tab[];
|
||||
find(char *s, char *tab[])
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -162,9 +160,7 @@ char *tab[];
|
||||
}
|
||||
|
||||
void
|
||||
printstatus(f, s)
|
||||
FILE *f;
|
||||
STATUS *s;
|
||||
printstatus(FILE *f, STATUS *s)
|
||||
{
|
||||
fprintf(f, "%s:%d", s->onoff ? "On" : "Off", s->brightness);
|
||||
switch(s->selected) {
|
||||
|
@ -75,22 +75,20 @@ volatile sig_atomic_t hup_flag; /* received SIGHUP flag */
|
||||
volatile sig_atomic_t term_flag; /* received SIGTERM flag */
|
||||
volatile sig_atomic_t pipe_flag; /* received SIGPIPE flag */
|
||||
|
||||
void checkpoint_status __P((void));
|
||||
void dohup __P((void));
|
||||
void dopipe __P((void));
|
||||
void doterm __P((void));
|
||||
void initstatus __P((void));
|
||||
void logpacket __P((unsigned char *));
|
||||
void onhup __P((int));
|
||||
void onpipe __P((int));
|
||||
void onterm __P((int));
|
||||
void processpacket __P((unsigned char *));
|
||||
int user_command __P((void));
|
||||
void checkpoint_status(void);
|
||||
void dohup(void);
|
||||
void dopipe(void);
|
||||
void doterm(void);
|
||||
void initstatus(void);
|
||||
void logpacket(unsigned char *);
|
||||
void onhup(int);
|
||||
void onpipe(int);
|
||||
void onterm(int);
|
||||
void processpacket(unsigned char *);
|
||||
int user_command(void);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
const char *twpath = TWPATH;
|
||||
const char *sockpath = SOCKPATH;
|
||||
@ -322,7 +320,8 @@ char *argv[];
|
||||
/* Not reached */
|
||||
}
|
||||
|
||||
char *thedate(void)
|
||||
char *
|
||||
thedate(void)
|
||||
{
|
||||
char *cp, *cp1;
|
||||
time_t tod;
|
||||
@ -334,19 +333,22 @@ char *thedate(void)
|
||||
return(cp);
|
||||
}
|
||||
|
||||
void onhup(int signo)
|
||||
void
|
||||
onhup(int signo)
|
||||
{
|
||||
|
||||
hup_flag = 1;
|
||||
}
|
||||
|
||||
void onterm(int signo)
|
||||
void
|
||||
onterm(int signo)
|
||||
{
|
||||
|
||||
term_flag = 1;
|
||||
}
|
||||
|
||||
void onpipe(int signo)
|
||||
void
|
||||
onpipe(int signo)
|
||||
{
|
||||
|
||||
pipe_flag = 1;
|
||||
@ -356,7 +358,8 @@ void onpipe(int signo)
|
||||
* When SIGHUP received, close and reopen the Log file
|
||||
*/
|
||||
|
||||
void dohup(void)
|
||||
void
|
||||
dohup(void)
|
||||
{
|
||||
char logpath[MAXPATHLEN+1];
|
||||
|
||||
@ -376,7 +379,8 @@ void dohup(void)
|
||||
* When SIGTERM received, just exit normally
|
||||
*/
|
||||
|
||||
void doterm(void)
|
||||
void
|
||||
doterm(void)
|
||||
{
|
||||
fprintf(Log, "%s: SIGTERM received, shutting down\n", thedate());
|
||||
fclose(Log);
|
||||
@ -388,7 +392,8 @@ void doterm(void)
|
||||
* When SIGPIPE received, reset user connection
|
||||
*/
|
||||
|
||||
void dopipe(void)
|
||||
void
|
||||
dopipe(void)
|
||||
{
|
||||
fprintf(Log, "%s: SIGPIPE received, resetting user connection\n",
|
||||
thedate());
|
||||
|
@ -76,4 +76,4 @@ extern int status; /* Status file descriptor */
|
||||
extern int tw523; /* tw523 controller */
|
||||
extern MONENTRY Monitor[MAXMON];/* Monitor table */
|
||||
|
||||
extern char *thedate();
|
||||
extern char *thedate(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user