Skip to content

Commit 4e012ca

Browse files
committed
initial import
0 parents  commit 4e012ca

26 files changed

+2885
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
**/*~
2+
**/*.d
3+
**/*.o
4+
5+
**/.deps
6+
**/Makefile
7+
**/Makefile.in
8+
**/aclocal.m4
9+
**/.dirstamp
10+
**/autom4te.cache
11+
**/config.h
12+
**/config.h.in
13+
**/config.log
14+
**/config.status
15+
**/configure
16+
**/stamp-h1
17+
18+
table-socketmap

Makefile.am

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
noinst_PROGRAMS = table-socketmap
2+
3+
table_socketmap_SOURCES = table_socketmap.c dict.c log.c table_stdio.c util.c
4+
5+
AM_CFLAGS =
6+
LDADD = $(LIBOBJS)
7+
8+
smtpdir = ${prefix}/libexec/smtpd
9+
10+
install-exec-local: $(noinst_PROGRAMS)
11+
$(MKDIR_P) $(DESTDIR)$(smtpdir)
12+
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(noinst_PROGRAMS) $(DESTDIR)$(smtpdir)
13+
14+
README.md: table-socketmap.5
15+
mandoc -Tmarkdown -l table-socketmap.5 >README.md

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
TABLE\_SOCKETMAP(5) - File Formats Manual
2+
3+
# NAME
4+
5+
**table\_socketmap** - format description for smtpd socketmap tables
6+
7+
# DESCRIPTION
8+
9+
This manual page documents the file format of "socketmap" tables used by the
10+
smtpd(8)
11+
mail daemon.
12+
13+
The format described here applies to tables as defined in
14+
smtpd.conf(5).
15+
16+
# SOCKETMAP TABLE
17+
18+
A "socketmap" table uses a simple protocol.
19+
The client sends a single-line request and the server sends a single-line reply.
20+
21+
The table may be used for any kind of key-based lookup and replies are expected
22+
to follow the formats described in
23+
table(5).
24+
25+
# SEE ALSO
26+
27+
table(5),
28+
smtpd.conf(5),
29+
smtpctl(8),
30+
smtpd(8)
31+
32+
Nixpkgs - February 4, 2014

bootstrap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#! /bin/sh
2+
3+
autoreconf -vfi

compat.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include "config.h"
2+
3+
#include <stddef.h>
4+
#include <limits.h>
5+
6+
#ifndef UID_MAX
7+
#define UID_MAX UINT_MAX
8+
#endif
9+
#ifndef GID_MAX
10+
#define GID_MAX UINT_MAX
11+
#endif
12+
13+
#ifndef __dead
14+
#define __dead __attribute__((noreturn))
15+
#endif
16+
17+
#ifndef HAVE_ASPRINTF
18+
int asprintf(char **, const char *, ...);
19+
#endif
20+
21+
#ifndef HAVE_GETPROGNAME
22+
const char *getprogname(void);
23+
#endif
24+
25+
#ifndef HAVE_STRLCAT
26+
size_t strlcat(char *, const char *, size_t);
27+
#endif
28+
29+
#ifndef HAVE_STRLCPY
30+
size_t strlcpy(char *, const char *, size_t);
31+
#endif
32+
33+
#ifndef HAVE_STRSEP
34+
char *strsep(char **, const char *);
35+
#endif
36+
37+
#ifndef HAVE_STRTONUM
38+
long long strtonum(const char *, long long, long long, const char **);
39+
#endif

configure.ac

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
AC_INIT([table-socketmap], [0.1], [[email protected]])
2+
AC_CONFIG_AUX_DIR(etc)
3+
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
4+
AC_CONFIG_LIBOBJ_DIR(openbsd-compat)
5+
AC_PROG_CC
6+
AC_USE_SYSTEM_EXTENSIONS
7+
8+
AC_ARG_WITH([libbsd],
9+
AS_HELP_STRING([--with-libbsd],
10+
[Build with libbsd library (default: disabled)]))
11+
12+
AS_IF([test "x$with_libbsd" = "xyes"], [
13+
PKG_CHECK_MODULES([libbsd], [libbsd-overlay libbsd-ctor], [
14+
CFLAGS="$libbsd_CFLAGS $CFLAGS"
15+
LIBS="$libbsd_LIBS $LIBS"
16+
])
17+
])
18+
19+
AC_REPLACE_FUNCS([ \
20+
asprintf \
21+
getprogname \
22+
err \
23+
strlcat \
24+
strlcpy \
25+
strsep \
26+
strtonum \
27+
])
28+
29+
CFLAGS="$CFLAGS -I$srcdir/openbsd-compat"
30+
31+
AC_CHECK_HEADER([sys/tree.h], [], [
32+
CFLAGS="$CFLAGS -I$srcdir/openbsd-compat/tree"
33+
])
34+
35+
AC_DEFUN([CC_ADD_CHECK_FLAGS], [
36+
AC_MSG_CHECKING([if $CC supports $1 flag])
37+
old_CFLAGS="$CFLAGS"
38+
CFLAGS="$CFLAGS $1"
39+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
40+
AC_MSG_RESULT(yes)
41+
], [
42+
AC_MSG_RESULT(no)
43+
CFLAGS="$old_CFLAGS"
44+
])
45+
])
46+
CC_ADD_CHECK_FLAGS([-MMD])
47+
48+
AC_CONFIG_HEADERS([config.h])
49+
AC_CONFIG_FILES([
50+
Makefile
51+
])
52+
AC_OUTPUT

0 commit comments

Comments
 (0)