summaryrefslogtreecommitdiff
path: root/src/matchup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/matchup.c')
-rw-r--r--src/matchup.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/matchup.c b/src/matchup.c
index 5a01aac..fc318e8 100644
--- a/src/matchup.c
+++ b/src/matchup.c
@@ -1,6 +1,5 @@
#include <unistd.h>
-#include "alloc.h"
#include "buffer.h"
#include "case.h"
#include "exit.h"
@@ -14,32 +13,32 @@
#define WHO "matchup"
-void nomem()
+static void nomem()
{
logmsg(WHO, 111, FATAL, "out of memory");
}
-void die_read()
+static void die_read()
{
logmsg(WHO, 110, ERROR, "unable to read input: ");
}
-void die_write()
+static void die_write()
{
logmsg(WHO, 110, ERROR, "unable to write output: ");
}
-void die_write5()
+static void die_write5()
{
logmsg(WHO, 111, FATAL, "unable to write fd 5: ");
}
-void out(char *buf, int len)
+static void out(char *buf, int len)
{
if (buffer_put(buffer_1, buf, len) == -1) die_write();
}
-void outs(char *buf)
+static void outs(char *buf)
{
if (buffer_puts(buffer_1, buf) == -1) die_write();
}
@@ -47,12 +46,12 @@ void outs(char *buf)
char buf5[512];
buffer bo5 = BUFFER_INIT(write, 5, buf5, sizeof(buf5));
-void out5(char *buf, int len)
+static void out5(char *buf, int len)
{
if (buffer_put(&bo5, buf, len) == -1) die_write5();
}
-void outs5(char *buf)
+static void outs5(char *buf)
{
if (buffer_puts(&bo5, buf) == -1) die_write5();
}
@@ -77,7 +76,7 @@ ulongalloc numz = {0};
ulongalloc sender = {0};
ulongalloc birth = {0};
-int msg_find(unsigned long m)
+static int msg_find(unsigned long m)
{
int i;
for (i = 0; i < nummsg; ++i)
@@ -85,7 +84,7 @@ int msg_find(unsigned long m)
return -1;
}
-int msg_add(unsigned long m)
+static int msg_add(unsigned long m)
{
int i;
for (i = 0; i < nummsg; ++i)
@@ -104,7 +103,7 @@ int msg_add(unsigned long m)
return i;
}
-void msg_kill(int i)
+static void msg_kill(int i)
{
poolbytes -= str_len(pool.s + sender.u[i]) + 1;
poolbytes -= str_len(pool.s + birth.u[i]) + 1;
@@ -128,7 +127,7 @@ ulongalloc dchan = {0};
ulongalloc drecip = {0};
ulongalloc dstart = {0};
-int del_find(unsigned long d)
+static int del_find(unsigned long d)
{
int i;
for (i = 0; i < numdel; ++i)
@@ -136,7 +135,7 @@ int del_find(unsigned long d)
return -1;
}
-int del_add(unsigned long d)
+static int del_add(unsigned long d)
{
int i;
for (i = 0; i < numdel; ++i)
@@ -151,7 +150,7 @@ int del_add(unsigned long d)
return i;
}
-void del_kill(int i)
+static void del_kill(int i)
{
poolbytes -= str_len(pool.s + dchan.u[i]) + 1;
poolbytes -= str_len(pool.s + drecip.u[i]) + 1;
@@ -166,7 +165,7 @@ void del_kill(int i)
stralloc pool2 = {0};
-void garbage()
+static void garbage()
{
int i;
char *x;
@@ -212,13 +211,13 @@ int match;
#define FIELDS 20
int field[FIELDS];
-void clear()
+static void clear()
{
while (numdel > 0) del_kill(0);
garbage();
}
-void starting()
+static void starting()
{
unsigned long d;
unsigned long m;
@@ -247,7 +246,7 @@ void starting()
poolbytes += pool.len - dstart.u[dpos];
}
-void delivery()
+static void delivery()
{
unsigned long d;
unsigned long m;
@@ -324,7 +323,7 @@ void delivery()
garbage();
}
-void newmsg()
+static void newmsg()
{
unsigned long m;
int mpos;
@@ -336,7 +335,7 @@ void newmsg()
garbage();
}
-void endmsg()
+static void endmsg()
{
unsigned long m;
int mpos;
@@ -369,7 +368,7 @@ void endmsg()
garbage();
}
-void info()
+static void info()
{
unsigned long m;
int mpos;
@@ -397,7 +396,7 @@ void info()
poolbytes += pool.len - birth.u[mpos];
}
-void extra()
+static void extra()
{
unsigned long m;
int mpos;
@@ -411,7 +410,7 @@ void extra()
scan_ulong(line.s + field[5], &numd.u[mpos]);
}
-void pending()
+static void pending()
{
int i;