projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cscope.files was missing mts/smtp/*.
[mmh]
/
uip
/
mhlsbr.c
diff --git
a/uip/mhlsbr.c
b/uip/mhlsbr.c
index
420dbb6
..
6335463
100644
(file)
--- a/
uip/mhlsbr.c
+++ b/
uip/mhlsbr.c
@@
-2,8
+2,6
@@
/*
* mhlsbr.c -- main routines for nmh message lister
*
/*
* mhlsbr.c -- main routines for nmh message lister
*
- * $Id$
- *
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
@@
-15,7
+13,7
@@
#include <h/fmt_scan.h>
#include <h/tws.h>
#include <h/utils.h>
#include <h/fmt_scan.h>
#include <h/tws.h>
#include <h/utils.h>
-#include <setjmp.h>
+#include <h/m_setjmp.h>
#include <signal.h>
/*
#include <signal.h>
/*
@@
-136,11
+134,11
@@
static struct mcomp *fmthd = NULL;
static struct mcomp *fmttl = NULL;
static struct mcomp global = {
static struct mcomp *fmttl = NULL;
static struct mcomp global = {
- NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, BELL, 0
+ NULL, NULL, NULL, NULL, NULL, NULL, 0, -1, 80, -1, 40, BELL, NULL
};
static struct mcomp holder = {
};
static struct mcomp holder = {
- NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NOCOMPONENT, 0
+ NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NOCOMPONENT, NULL
};
struct pair {
};
struct pair {
@@
-220,13
+218,13
@@
static int mhldebug = 0;
static int ontty = NOTTY;
static int row;
static int ontty = NOTTY;
static int row;
-static int column;
+static unsigned int column;
static int lm;
static int llim;
static int ovoff;
static int term;
static int lm;
static int llim;
static int ovoff;
static int term;
-static int wid;
+static unsigned int wid;
static char *ovtxt;
static char *ovtxt;
@@
-273,9
+271,9
@@
static void putcomp (struct mcomp *, struct mcomp *, int);
static char *oneline (char *, long);
static void putstr (char *);
static void putch (char);
static char *oneline (char *, long);
static void putstr (char *);
static void putch (char);
-static RETSIGTYPE intrser (int);
-static RETSIGTYPE pipeser (int);
-static RETSIGTYPE quitser (int);
+static void intrser (int);
+static void pipeser (int);
+static void quitser (int);
static void face_format (struct mcomp *);
static int doface (struct mcomp *);
static void mhladios (char *, char *, ...);
static void face_format (struct mcomp *);
static int doface (struct mcomp *);
static void mhladios (char *, char *, ...);
@@
-794,11
+792,11
@@
parse (void)
static void
process (char *folder, char *fname, int ofilen, int ofilec)
{
static void
process (char *folder, char *fname, int ofilen, int ofilec)
{
- char *cp;
- FILE *fp;
+ char *cp = NULL;
+ FILE *fp = NULL;
struct mcomp *c1;
struct mcomp *c1;
- switch (setjmp (env)) {
+ switch (m_setjmp (env)) {
case OK:
if (fname) {
fp = mhl_action ? (*mhl_action) (fname) : fopen (fname, "r");
case OK:
if (fname) {
fp = mhl_action ? (*mhl_action) (fname) : fopen (fname, "r");
@@
-1277,9
+1275,9
@@
putcomp (struct mcomp *c1, struct mcomp *c2, int flag)
if (cchdr) {
if (flag == TWOCOMP)
count = (c1->c_cwidth >= 0) ? c1->c_cwidth
if (cchdr) {
if (flag == TWOCOMP)
count = (c1->c_cwidth >= 0) ? c1->c_cwidth
- : strlen (c2->c_name) + 2;
+ : (int) strlen (c2->c_name) + 2;
else
else
- count = (c1->c_cwidth >= 0) ? c1->c_cwidth
+ count = (c1->c_cwidth >= 0) ? (size_t) c1->c_cwidth
: strlen (c1->c_text ? c1->c_text : c1->c_name) + 2;
}
count += c1->c_offset;
: strlen (c1->c_text ? c1->c_text : c1->c_name) + 2;
}
count += c1->c_offset;
@@
-1446,12
+1444,10
@@
putch (char ch)
}
}
-static RETSIGTYPE
+static void
intrser (int i)
{
intrser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (SIGINT, intrser);
-#endif
+ NMH_UNUSED (i);
discard (stdout);
putchar ('\n');
discard (stdout);
putchar ('\n');
@@
-1459,23
+1455,19
@@
intrser (int i)
}
}
-static RETSIGTYPE
+static void
pipeser (int i)
{
pipeser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (SIGPIPE, pipeser);
-#endif
+ NMH_UNUSED (i);
done (NOTOK);
}
done (NOTOK);
}
-static RETSIGTYPE
+static void
quitser (int i)
{
quitser (int i)
{
-#ifndef RELIABLE_SIGNALS
- SIGNAL (SIGQUIT, quitser);
-#endif
+ NMH_UNUSED (i);
putchar ('\n');
fflush (stdout);
putchar ('\n');
fflush (stdout);
@@
-1517,10
+1509,7
@@
face_format (struct mcomp *c1)
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
-
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
+#include <arpa/inet.h>
static int
doface (struct mcomp *c1)
static int
doface (struct mcomp *c1)
@@
-1544,7
+1533,9
@@
bad_faceproc: ;
}
memset(&hints, 0, sizeof(hints));
}
memset(&hints, 0, sizeof(hints));
+#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_flags = AI_ADDRCONFIG;
+#endif
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
@@
-1687,11
+1678,11
@@
doface (struct mcomp *c1)
int
mhlsbr (int argc, char **argv, FILE *(*action)())
{
int
mhlsbr (int argc, char **argv, FILE *(*action)())
{
- SIGNAL_HANDLER istat, pstat, qstat;
- char *cp;
+ SIGNAL_HANDLER istat = NULL, pstat = NULL, qstat = NULL;
+ char *cp = NULL;
struct mcomp *c1;
struct mcomp *c1;
- switch (setjmp (mhlenv)) {
+ switch (m_setjmp (mhlenv)) {
case OK:
cp = invo_name;
sleepsw = 0; /* XXX */
case OK:
cp = invo_name;
sleepsw = 0; /* XXX */
@@
-1770,7
+1761,7
@@
m_popen (char *name)
if (pipe (pd) == NOTOK)
adios ("pipe", "unable to");
if (pipe (pd) == NOTOK)
adios ("pipe", "unable to");
- switch (m_pid = vfork ()) {
+ switch (m_pid = vfork()) {
case NOTOK:
adios ("fork", "unable to");
case NOTOK:
adios ("fork", "unable to");