merge roken independence stuff
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8597 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
include $(top_srcdir)/Makefile.am.common
|
AUTOMAKE_OPTIONS = foreign no-dependencies
|
||||||
|
|
||||||
|
AM_CFLAGS += $(WFLAGS)
|
||||||
|
|
||||||
CLEANFILES = roken.h make-roken.c
|
CLEANFILES = roken.h make-roken.c
|
||||||
|
|
||||||
lib_LTLIBRARIES = libroken.la
|
lib_LTLIBRARIES = libroken.la
|
||||||
libroken_la_LDFLAGS = -version-info 8:1:3
|
libroken_la_LDFLAGS = -version-info @VERSION@:0:0
|
||||||
|
|
||||||
noinst_PROGRAMS = make-roken
|
noinst_PROGRAMS = make-roken
|
||||||
|
|
||||||
@@ -16,11 +18,15 @@ check_PROGRAMS = parse_bytes-test \
|
|||||||
|
|
||||||
TESTS = $(check_PROGRAMS)
|
TESTS = $(check_PROGRAMS)
|
||||||
|
|
||||||
getaddrinfo_test_LDADD = libroken.la
|
LIB_crypt = @LIB_crypt@
|
||||||
parse_bytes_test_LDADD = libroken.la
|
|
||||||
|
common_LDADD = libroken.la $(LIB_crypt)
|
||||||
|
|
||||||
strpftime_test_SOURCES = strpftime-test.c strftime.c strptime.c snprintf.c
|
strpftime_test_SOURCES = strpftime-test.c strftime.c strptime.c snprintf.c
|
||||||
snprintf_test_SOURCES = snprintf-test.c snprintf.c
|
snprintf_test_SOURCES = snprintf-test.c snprintf.c
|
||||||
snprintf_test_LDADD = -lm
|
snprintf_test_LDADD = $(common_LDADD) -lm
|
||||||
|
getaddrinfo_test_LDADD = $(common_LDADD)
|
||||||
|
parse_bytes_test_LDADD = $(common_LDADD)
|
||||||
|
|
||||||
libroken_la_SOURCES = \
|
libroken_la_SOURCES = \
|
||||||
base64.c \
|
base64.c \
|
||||||
@@ -131,10 +137,7 @@ EXTRA_libroken_la_SOURCES = \
|
|||||||
warnx.c \
|
warnx.c \
|
||||||
writev.c
|
writev.c
|
||||||
|
|
||||||
EXTRA_DIST = resource.h roken.awk roken.def roken.dsp roken.h.in \
|
EXTRA_DIST = roken.awk roken.h.in
|
||||||
roken.mak roken.rc
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
libroken_la_LIBADD = @LTLIBOBJS@
|
libroken_la_LIBADD = @LTLIBOBJS@
|
||||||
|
|
||||||
@@ -142,9 +145,8 @@ $(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h
|
|||||||
|
|
||||||
include_HEADERS = $(err_h) base64.h getarg.h \
|
include_HEADERS = $(err_h) base64.h getarg.h \
|
||||||
parse_bytes.h parse_time.h parse_units.h \
|
parse_bytes.h parse_time.h parse_units.h \
|
||||||
resolve.h roken.h roken-common.h
|
resolve.h roken.h roken-common.h \
|
||||||
|
$(err_h) $(fnmatch_h) $(glob_h) xdbm.h
|
||||||
build_HEADERZ = $(err_h) $(fnmatch_h) $(glob_h) xdbm.h
|
|
||||||
|
|
||||||
if have_err_h
|
if have_err_h
|
||||||
err_h =
|
err_h =
|
||||||
|
File diff suppressed because it is too large
Load Diff
36
lib/roken/acconfig.h
Normal file
36
lib/roken/acconfig.h
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
@BOTTOM@
|
||||||
|
|
||||||
|
#ifdef BROKEN_REALLOC
|
||||||
|
#define realloc(X, Y) isoc_realloc((X), (Y))
|
||||||
|
#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef VOID_RETSIGTYPE
|
||||||
|
#define SIGRETURN(x) return
|
||||||
|
#else
|
||||||
|
#define SIGRETURN(x) return (RETSIGTYPE)(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define RCSID(msg) \
|
||||||
|
static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
|
||||||
|
|
||||||
|
#undef PROTOTYPES
|
||||||
|
|
||||||
|
/* Maximum values on all known systems */
|
||||||
|
#define MaxHostNameLen (64+4)
|
||||||
|
#define MaxPathLen (1024+4)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define NDBM if you are using the 4.3 ndbm library (which is part of
|
||||||
|
* libc). If not defined, 4.2 dbm will be assumed.
|
||||||
|
*/
|
||||||
|
#if defined(HAVE_DBM_FIRSTKEY)
|
||||||
|
#define NDBM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defining this enables lots of useful (and used) extensions on
|
||||||
|
* glibc-based systems such as Linux
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
9
lib/roken/acinclude.m4
Normal file
9
lib/roken/acinclude.m4
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
dnl $Id$
|
||||||
|
dnl
|
||||||
|
dnl Only put things that for some reason can't live in the `cf'
|
||||||
|
dnl directory in this file.
|
||||||
|
dnl
|
||||||
|
|
||||||
|
dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
|
||||||
|
dnl
|
||||||
|
define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
|
518
lib/roken/configure.in
Normal file
518
lib/roken/configure.in
Normal file
@@ -0,0 +1,518 @@
|
|||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
AC_REVISION($Revision$)
|
||||||
|
AC_INIT(snprintf.c)
|
||||||
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
AM_INIT_AUTOMAKE(roken,9)
|
||||||
|
|
||||||
|
dnl options
|
||||||
|
|
||||||
|
berkeley_db=db
|
||||||
|
AC_ARG_WITH(berkeley-db,
|
||||||
|
[ --without-berkeley-db if you don't want berkeley db],[
|
||||||
|
if test "$withval" = no; then
|
||||||
|
berkeley_db=""
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl Checks for programs
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_AWK
|
||||||
|
AC_CYGWIN
|
||||||
|
AC_OBJEXT
|
||||||
|
AC_EXEEXT
|
||||||
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
|
AC_MIPS_ABI
|
||||||
|
CC="$CC $abi"
|
||||||
|
libdir="$libdir$abilibdirext"
|
||||||
|
|
||||||
|
dnl C characteristics
|
||||||
|
|
||||||
|
AC_C___ATTRIBUTE__
|
||||||
|
AC_C_INLINE
|
||||||
|
AC_C_CONST
|
||||||
|
AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
|
||||||
|
|
||||||
|
dnl C types
|
||||||
|
|
||||||
|
AC_TYPE_SIZE_T
|
||||||
|
AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
|
||||||
|
AC_TYPE_PID_T
|
||||||
|
AC_TYPE_UID_T
|
||||||
|
AC_HAVE_TYPE([long long])
|
||||||
|
|
||||||
|
AC_TYPE_SIGNAL
|
||||||
|
if test "$ac_cv_type_signal" = "void" ; then
|
||||||
|
AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
|
||||||
|
fi
|
||||||
|
AC_SUBST(VOID_RETSIGTYPE)
|
||||||
|
|
||||||
|
dnl Checks for header files.
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_HEADER_TIME
|
||||||
|
|
||||||
|
if test "$berkeley_db"; then
|
||||||
|
AC_CHECK_HEADERS([ \
|
||||||
|
db.h \
|
||||||
|
db_185.h \
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([\
|
||||||
|
arpa/nameser.h \
|
||||||
|
arpa/inet.h \
|
||||||
|
config.h \
|
||||||
|
crypt.h \
|
||||||
|
dbm.h \
|
||||||
|
db.h \
|
||||||
|
errno.h \
|
||||||
|
err.h \
|
||||||
|
dirent.h \
|
||||||
|
fcntl.h \
|
||||||
|
fnmatch.h \
|
||||||
|
grp.h \
|
||||||
|
ndbm.h \
|
||||||
|
netdb.h \
|
||||||
|
netinet/in.h \
|
||||||
|
netinet/in_systm.h \
|
||||||
|
paths.h \
|
||||||
|
pwd.h \
|
||||||
|
resolv.h \
|
||||||
|
rpcsvc/dbm.h \
|
||||||
|
rpcsvc/ypclnt.h \
|
||||||
|
shadow.h \
|
||||||
|
sys/ioctl.h \
|
||||||
|
sys/param.h \
|
||||||
|
sys/proc.h \
|
||||||
|
sys/resource.h \
|
||||||
|
sys/socket.h \
|
||||||
|
sys/stat.h \
|
||||||
|
sys/sysctl.h \
|
||||||
|
sys/time.h \
|
||||||
|
sys/tty.h \
|
||||||
|
sys/types.h \
|
||||||
|
sys/uio.h \
|
||||||
|
sys/utsname.h \
|
||||||
|
sys/wait.h \
|
||||||
|
syslog.h \
|
||||||
|
termios.h \
|
||||||
|
unistd.h \
|
||||||
|
userconf.h \
|
||||||
|
usersec.h \
|
||||||
|
winsock.h \
|
||||||
|
])
|
||||||
|
|
||||||
|
CHECK_NETINET_IP_AND_TCP
|
||||||
|
|
||||||
|
AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
|
||||||
|
AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
|
||||||
|
|
||||||
|
dnl Check for functions and libraries
|
||||||
|
|
||||||
|
AC_KRB_IPV6
|
||||||
|
|
||||||
|
AC_FIND_FUNC(socket, socket)
|
||||||
|
AC_FIND_FUNC(gethostbyname, nsl)
|
||||||
|
AC_FIND_FUNC(syslog, syslog)
|
||||||
|
AC_FIND_FUNC(gethostbyname2, inet6 ip6)
|
||||||
|
|
||||||
|
AC_FIND_FUNC(res_search, resolv,
|
||||||
|
[
|
||||||
|
#include <stdio.h>
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
#include <arpa/nameser.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_RESOLV_H
|
||||||
|
#include <resolv.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[0,0,0,0,0])
|
||||||
|
|
||||||
|
AC_FIND_FUNC(dn_expand, resolv,
|
||||||
|
[
|
||||||
|
#include <stdio.h>
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
#include <arpa/nameser.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_RESOLV_H
|
||||||
|
#include <resolv.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[0,0,0,0,0])
|
||||||
|
|
||||||
|
AC_BROKEN_SNPRINTF
|
||||||
|
AC_BROKEN_VSNPRINTF
|
||||||
|
|
||||||
|
AC_BROKEN_GLOB
|
||||||
|
if test "$ac_cv_func_glob_working" != yes; then
|
||||||
|
LIBOBJS="$LIBOBJS glob.o"
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
|
||||||
|
|
||||||
|
dnl these should happen after tests for *snprintf
|
||||||
|
|
||||||
|
AC_FIND_FUNC_NO_LIBS2(dbopen, $berkeley_db, [
|
||||||
|
#include <stdio.h>
|
||||||
|
#if defined(HAVE_DB_185_H)
|
||||||
|
#include <db_185.h>
|
||||||
|
#elif defined(HAVE_DB_H)
|
||||||
|
#include <db.h>
|
||||||
|
#endif
|
||||||
|
],[NULL, 0, 0, 0, NULL])
|
||||||
|
|
||||||
|
AC_FIND_FUNC_NO_LIBS(dbm_firstkey, $berkeley_db gdbm ndbm)
|
||||||
|
|
||||||
|
DBLIB="$LIB_dbopen"
|
||||||
|
if test "$LIB_dbopen" != "$LIB_dbm_firstkey"; then
|
||||||
|
DBLIB="$DBLIB $LIB_dbm_firstkey"
|
||||||
|
fi
|
||||||
|
AC_SUBST(DBLIB)dnl
|
||||||
|
|
||||||
|
AC_CHECK_FUNCS([ \
|
||||||
|
asnprintf \
|
||||||
|
asprintf \
|
||||||
|
cgetent \
|
||||||
|
vasnprintf \
|
||||||
|
vasprintf \
|
||||||
|
])
|
||||||
|
|
||||||
|
if test "$ac_cv_func_cgetent" = no; then
|
||||||
|
LIBOBJS="$LIBOBJS getcap.o"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_FUNC_GETLOGIN
|
||||||
|
|
||||||
|
AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
|
||||||
|
[#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif],
|
||||||
|
17)
|
||||||
|
if test "$ac_cv_func_hstrerror" = yes; then
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif],
|
||||||
|
hstrerror)
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl sigh, wish this could be done in a loop
|
||||||
|
if test "$ac_cv_func_asprintf" = yes; then
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>],
|
||||||
|
asprintf)dnl
|
||||||
|
fi
|
||||||
|
if test "$ac_cv_func_vasprintf" = yes; then
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>],
|
||||||
|
vasprintf)dnl
|
||||||
|
fi
|
||||||
|
if test "$ac_cv_func_asnprintf" = yes; then
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>],
|
||||||
|
asnprintf)dnl
|
||||||
|
fi
|
||||||
|
if test "$ac_cv_func_vasnprintf" = yes; then
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>],
|
||||||
|
vasnprintf)dnl
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_BROKEN([ \
|
||||||
|
chown \
|
||||||
|
copyhostent \
|
||||||
|
daemon \
|
||||||
|
err \
|
||||||
|
errx \
|
||||||
|
fchown \
|
||||||
|
flock \
|
||||||
|
fnmatch \
|
||||||
|
freeaddrinfo \
|
||||||
|
freehostent \
|
||||||
|
gai_strerror \
|
||||||
|
getaddrinfo \
|
||||||
|
getdtablesize \
|
||||||
|
getegid \
|
||||||
|
geteuid \
|
||||||
|
getgid \
|
||||||
|
gethostname \
|
||||||
|
getipnodebyaddr \
|
||||||
|
getipnodebyname \
|
||||||
|
getnameinfo \
|
||||||
|
getopt \
|
||||||
|
gettimeofday \
|
||||||
|
getuid \
|
||||||
|
getusershell \
|
||||||
|
inet_aton \
|
||||||
|
inet_ntop \
|
||||||
|
inet_pton \
|
||||||
|
initgroups \
|
||||||
|
innetgr \
|
||||||
|
iruserok \
|
||||||
|
lstat \
|
||||||
|
memmove \
|
||||||
|
mkstemp \
|
||||||
|
putenv \
|
||||||
|
rcmd \
|
||||||
|
readv \
|
||||||
|
recvmsg \
|
||||||
|
sendmsg \
|
||||||
|
setegid \
|
||||||
|
setenv \
|
||||||
|
seteuid \
|
||||||
|
strcasecmp \
|
||||||
|
strdup \
|
||||||
|
strerror \
|
||||||
|
strftime \
|
||||||
|
strlcat \
|
||||||
|
strlcpy \
|
||||||
|
strlwr \
|
||||||
|
strncasecmp \
|
||||||
|
strndup \
|
||||||
|
strnlen \
|
||||||
|
strptime \
|
||||||
|
strsep \
|
||||||
|
strtok_r \
|
||||||
|
strupr \
|
||||||
|
swab \
|
||||||
|
unsetenv \
|
||||||
|
verr \
|
||||||
|
verrx \
|
||||||
|
vsyslog \
|
||||||
|
vwarn \
|
||||||
|
vwarnx \
|
||||||
|
warn \
|
||||||
|
warnx \
|
||||||
|
writev \
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_NEED_PROTO([#include <stdlib.h>], setenv)
|
||||||
|
AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
|
||||||
|
AC_NEED_PROTO([#include <unistd.h>], gethostname)
|
||||||
|
AC_NEED_PROTO([#include <unistd.h>], mkstemp)
|
||||||
|
AC_NEED_PROTO([#include <unistd.h>], getusershell)
|
||||||
|
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif],
|
||||||
|
inet_aton)
|
||||||
|
|
||||||
|
AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
|
||||||
|
|
||||||
|
AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
|
||||||
|
ac_cv_func_realloc_broken=no
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return realloc(NULL, 17) == NULL;
|
||||||
|
}
|
||||||
|
],:, ac_cv_func_realloc_broken=yes, :)
|
||||||
|
])
|
||||||
|
if test "$ac_cv_func_realloc_broken" = yes ; then
|
||||||
|
AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl AC_KRB_FUNC_GETCWD_BROKEN
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks for prototypes and declarations
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_PROTO_COMPAT([
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
gethostbyname, struct hostent *gethostbyname(const char *))
|
||||||
|
|
||||||
|
AC_PROTO_COMPAT([
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
|
||||||
|
|
||||||
|
AC_PROTO_COMPAT([
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
getservbyname, struct servent *getservbyname(const char *, const char *))
|
||||||
|
|
||||||
|
AC_PROTO_COMPAT([
|
||||||
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
#include <syslog.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
openlog, void openlog(const char *, int, int))
|
||||||
|
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#ifdef HAVE_CRYPT_H
|
||||||
|
#include <crypt.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
crypt)
|
||||||
|
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#include <string.h>
|
||||||
|
],
|
||||||
|
strtok_r)
|
||||||
|
|
||||||
|
AC_NEED_PROTO([
|
||||||
|
#include <string.h>
|
||||||
|
],
|
||||||
|
strsep)
|
||||||
|
|
||||||
|
dnl variables
|
||||||
|
|
||||||
|
AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif],
|
||||||
|
h_errno)
|
||||||
|
|
||||||
|
AC_CHECK_VAR([#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif],
|
||||||
|
h_errlist)
|
||||||
|
|
||||||
|
AC_CHECK_VAR([#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif],
|
||||||
|
h_nerr)
|
||||||
|
|
||||||
|
AC_CHECK_VAR([#ifdef HAVE_ERR_H
|
||||||
|
#include <err.h>
|
||||||
|
#endif],[__progname])
|
||||||
|
|
||||||
|
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif], optarg)
|
||||||
|
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif], optind)
|
||||||
|
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif], opterr)
|
||||||
|
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif], optopt)
|
||||||
|
|
||||||
|
AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Check for fields in struct tm
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
|
||||||
|
AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl or do we have a variable `timezone' ?
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_CHECK_VAR(
|
||||||
|
[#include <time.h>],
|
||||||
|
timezone)
|
||||||
|
|
||||||
|
AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
|
||||||
|
AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
|
||||||
|
AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
|
||||||
|
AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
|
||||||
|
AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Check for struct winsize
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_KRB_STRUCT_WINSIZE
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Check for struct spwd
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_KRB_STRUCT_SPWD
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Check for sa_len in struct sockaddr
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>])
|
||||||
|
|
||||||
|
LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
|
||||||
|
AC_SUBST(LTLIBOBJS)
|
||||||
|
AC_OUTPUT(Makefile)
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1999 - 2000 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -122,7 +122,7 @@ main(int argc, char **argv)
|
|||||||
usage (0);
|
usage (0);
|
||||||
|
|
||||||
if (version_flag) {
|
if (version_flag) {
|
||||||
print_version (NULL);
|
fprintf (stderr, "%s from %s-%s)\n", __progname, PACKAGE, VERSION);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
251
lib/roken/install-sh
Executable file
251
lib/roken/install-sh
Executable file
@@ -0,0 +1,251 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||||
|
#
|
||||||
|
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
# documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
# the above copyright notice appear in all copies and that both that
|
||||||
|
# copyright notice and this permission notice appear in supporting
|
||||||
|
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
# publicity pertaining to distribution of the software without specific,
|
||||||
|
# written prior permission. M.I.T. makes no representations about the
|
||||||
|
# suitability of this software for any purpose. It is provided "as is"
|
||||||
|
# without express or implied warranty.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch. It can only install one file at a time, a restriction
|
||||||
|
# shared with many OS's install programs.
|
||||||
|
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit="${DOITPROG-}"
|
||||||
|
|
||||||
|
|
||||||
|
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||||
|
|
||||||
|
mvprog="${MVPROG-mv}"
|
||||||
|
cpprog="${CPPROG-cp}"
|
||||||
|
chmodprog="${CHMODPROG-chmod}"
|
||||||
|
chownprog="${CHOWNPROG-chown}"
|
||||||
|
chgrpprog="${CHGRPPROG-chgrp}"
|
||||||
|
stripprog="${STRIPPROG-strip}"
|
||||||
|
rmprog="${RMPROG-rm}"
|
||||||
|
mkdirprog="${MKDIRPROG-mkdir}"
|
||||||
|
|
||||||
|
transformbasename=""
|
||||||
|
transform_arg=""
|
||||||
|
instcmd="$mvprog"
|
||||||
|
chmodcmd="$chmodprog 0755"
|
||||||
|
chowncmd=""
|
||||||
|
chgrpcmd=""
|
||||||
|
stripcmd=""
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
mvcmd="$mvprog"
|
||||||
|
src=""
|
||||||
|
dst=""
|
||||||
|
dir_arg=""
|
||||||
|
|
||||||
|
while [ x"$1" != x ]; do
|
||||||
|
case $1 in
|
||||||
|
-c) instcmd="$cpprog"
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-d) dir_arg=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-m) chmodcmd="$chmodprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-s) stripcmd="$stripprog"
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
*) if [ x"$src" = x ]
|
||||||
|
then
|
||||||
|
src=$1
|
||||||
|
else
|
||||||
|
# this colon is to work around a 386BSD /bin/sh bug
|
||||||
|
:
|
||||||
|
dst=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ x"$src" = x ]
|
||||||
|
then
|
||||||
|
echo "install: no input file specified"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x"$dir_arg" != x ]; then
|
||||||
|
dst=$src
|
||||||
|
src=""
|
||||||
|
|
||||||
|
if [ -d $dst ]; then
|
||||||
|
instcmd=:
|
||||||
|
chmodcmd=""
|
||||||
|
else
|
||||||
|
instcmd=mkdir
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
|
||||||
|
if [ -f $src -o -d $src ]
|
||||||
|
then
|
||||||
|
true
|
||||||
|
else
|
||||||
|
echo "install: $src does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x"$dst" = x ]
|
||||||
|
then
|
||||||
|
echo "install: no destination specified"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; if your system
|
||||||
|
# does not like double slashes in filenames, you may need to add some logic
|
||||||
|
|
||||||
|
if [ -d $dst ]
|
||||||
|
then
|
||||||
|
dst="$dst"/`basename $src`
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
## this sed command emulates the dirname command
|
||||||
|
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||||
|
|
||||||
|
# Make sure that the destination directory exists.
|
||||||
|
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||||
|
|
||||||
|
# Skip lots of stat calls in the usual case.
|
||||||
|
if [ ! -d "$dstdir" ]; then
|
||||||
|
defaultIFS='
|
||||||
|
'
|
||||||
|
IFS="${IFS-${defaultIFS}}"
|
||||||
|
|
||||||
|
oIFS="${IFS}"
|
||||||
|
# Some sh's can't handle IFS=/ for some reason.
|
||||||
|
IFS='%'
|
||||||
|
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||||
|
IFS="${oIFS}"
|
||||||
|
|
||||||
|
pathcomp=''
|
||||||
|
|
||||||
|
while [ $# -ne 0 ] ; do
|
||||||
|
pathcomp="${pathcomp}${1}"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ ! -d "${pathcomp}" ] ;
|
||||||
|
then
|
||||||
|
$mkdirprog "${pathcomp}"
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
pathcomp="${pathcomp}/"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x"$dir_arg" != x ]
|
||||||
|
then
|
||||||
|
$doit $instcmd $dst &&
|
||||||
|
|
||||||
|
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||||
|
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||||
|
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||||
|
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||||
|
else
|
||||||
|
|
||||||
|
# If we're going to rename the final executable, determine the name now.
|
||||||
|
|
||||||
|
if [ x"$transformarg" = x ]
|
||||||
|
then
|
||||||
|
dstfile=`basename $dst`
|
||||||
|
else
|
||||||
|
dstfile=`basename $dst $transformbasename |
|
||||||
|
sed $transformarg`$transformbasename
|
||||||
|
fi
|
||||||
|
|
||||||
|
# don't allow the sed command to completely eliminate the filename
|
||||||
|
|
||||||
|
if [ x"$dstfile" = x ]
|
||||||
|
then
|
||||||
|
dstfile=`basename $dst`
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make a temp file name in the proper directory.
|
||||||
|
|
||||||
|
dsttmp=$dstdir/#inst.$$#
|
||||||
|
|
||||||
|
# Move or copy the file name to the temp name
|
||||||
|
|
||||||
|
$doit $instcmd $src $dsttmp &&
|
||||||
|
|
||||||
|
trap "rm -f ${dsttmp}" 0 &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits
|
||||||
|
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||||
|
|
||||||
|
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||||
|
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||||
|
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||||
|
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
|
||||||
|
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||||
|
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||||
|
|
||||||
|
fi &&
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
190
lib/roken/missing
Executable file
190
lib/roken/missing
Executable file
@@ -0,0 +1,190 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||||
|
|
||||||
|
# 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, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
# 02111-1307, USA.
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
-h|--h|--he|--hel|--help)
|
||||||
|
echo "\
|
||||||
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help display this help and exit
|
||||||
|
-v, --version output version information and exit
|
||||||
|
|
||||||
|
Supported PROGRAM values:
|
||||||
|
aclocal touch file \`aclocal.m4'
|
||||||
|
autoconf touch file \`configure'
|
||||||
|
autoheader touch file \`config.h.in'
|
||||||
|
automake touch all \`Makefile.in' files
|
||||||
|
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
flex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
lex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
makeinfo touch the output file
|
||||||
|
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||||
|
echo "missing - GNU libit 0.0"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
aclocal)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`acinclude.m4' or \`configure.in'. You might want
|
||||||
|
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||||
|
any GNU archive site."
|
||||||
|
touch aclocal.m4
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoconf)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`configure.in'. You might want to install the
|
||||||
|
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||||
|
archive site."
|
||||||
|
touch configure
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoheader)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`acconfig.h' or \`configure.in'. You might want
|
||||||
|
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||||
|
from any GNU archive site."
|
||||||
|
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
|
||||||
|
test -z "$files" && files="config.h"
|
||||||
|
touch_files=
|
||||||
|
for f in $files; do
|
||||||
|
case "$f" in
|
||||||
|
*:*) touch_files="$touch_files "`echo "$f" |
|
||||||
|
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||||
|
*) touch_files="$touch_files $f.in";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
touch $touch_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
automake)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
|
||||||
|
You might want to install the \`Automake' and \`Perl' packages.
|
||||||
|
Grab them from any GNU archive site."
|
||||||
|
find . -type f -name Makefile.am -print |
|
||||||
|
sed 's/\.am$/.in/' |
|
||||||
|
while read f; do touch "$f"; done
|
||||||
|
;;
|
||||||
|
|
||||||
|
bison|yacc)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a \`.y' file. You may need the \`Bison' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Bison' from any GNU archive site."
|
||||||
|
rm -f y.tab.c y.tab.h
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case "$LASTARG" in
|
||||||
|
*.y)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||||
|
if [ -f "$SRCFILE" ]; then
|
||||||
|
cp "$SRCFILE" y.tab.c
|
||||||
|
fi
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||||
|
if [ -f "$SRCFILE" ]; then
|
||||||
|
cp "$SRCFILE" y.tab.h
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if [ ! -f y.tab.h ]; then
|
||||||
|
echo >y.tab.h
|
||||||
|
fi
|
||||||
|
if [ ! -f y.tab.c ]; then
|
||||||
|
echo 'main() { return 0; }' >y.tab.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
lex|flex)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a \`.l' file. You may need the \`Flex' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Flex' from any GNU archive site."
|
||||||
|
rm -f lex.yy.c
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case "$LASTARG" in
|
||||||
|
*.l)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||||
|
if [ -f "$SRCFILE" ]; then
|
||||||
|
cp "$SRCFILE" lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if [ ! -f lex.yy.c ]; then
|
||||||
|
echo 'main() { return 0; }' >lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
makeinfo)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is missing on your system. You should only need it if
|
||||||
|
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||||
|
indirectly affecting the aspect of the manual. The spurious
|
||||||
|
call might also be the consequence of using a buggy \`make' (AIX,
|
||||||
|
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||||
|
the \`GNU make' package. Grab either from any GNU archive site."
|
||||||
|
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||||
|
if test -z "$file"; then
|
||||||
|
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||||
|
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||||
|
fi
|
||||||
|
touch $file
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||||
|
system. You might have modified some files without having the
|
||||||
|
proper tools for further handling them. Check the \`README' file,
|
||||||
|
it often tells you about the needed prerequirements for installing
|
||||||
|
this package. You may also peek at any GNU archive site, in case
|
||||||
|
some other package would contain this missing \`$1' program."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
40
lib/roken/mkinstalldirs
Executable file
40
lib/roken/mkinstalldirs
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# mkinstalldirs --- make directory hierarchy
|
||||||
|
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||||
|
# Created: 1993-05-16
|
||||||
|
# Public domain
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
errstatus=0
|
||||||
|
|
||||||
|
for file
|
||||||
|
do
|
||||||
|
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||||
|
shift
|
||||||
|
|
||||||
|
pathcomp=
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
pathcomp="$pathcomp$d"
|
||||||
|
case "$pathcomp" in
|
||||||
|
-* ) pathcomp=./$pathcomp ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test ! -d "$pathcomp"; then
|
||||||
|
echo "mkdir $pathcomp"
|
||||||
|
|
||||||
|
mkdir "$pathcomp" || lasterr=$?
|
||||||
|
|
||||||
|
if test ! -d "$pathcomp"; then
|
||||||
|
errstatus=$lasterr
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
pathcomp="$pathcomp/"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $errstatus
|
||||||
|
|
||||||
|
# mkinstalldirs ends here
|
@@ -1,3 +1,5 @@
|
|||||||
|
# $Id$
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
print "#include <stdio.h>"
|
print "#include <stdio.h>"
|
||||||
print "#ifdef HAVE_CONFIG_H"
|
print "#ifdef HAVE_CONFIG_H"
|
||||||
@@ -13,6 +15,8 @@ BEGIN {
|
|||||||
print "puts(\"\");"
|
print "puts(\"\");"
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
|
print "puts(\"#define ROKEN_VERSION \" VERSION );"
|
||||||
|
print "puts(\"\");"
|
||||||
print "puts(\"#endif /* __ROKEN_H__ */\");"
|
print "puts(\"#endif /* __ROKEN_H__ */\");"
|
||||||
print "exit(0);"
|
print "exit(0);"
|
||||||
print "}"
|
print "}"
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
LIBRARY roken BASE=0x68f0000
|
|
||||||
EXPORTS
|
|
||||||
gettimeofday
|
|
||||||
strcasecmp
|
|
||||||
strtok_r
|
|
||||||
snprintf
|
|
||||||
asprintf
|
|
||||||
vsnprintf
|
|
||||||
base64_decode
|
|
||||||
base64_encode
|
|
||||||
roken_concat
|
|
||||||
roken_vconcat
|
|
||||||
roken_vmconcat
|
|
||||||
roken_mconcat
|
|
||||||
getuid
|
|
||||||
dns_free_data
|
|
||||||
dns_lookup
|
|
@@ -1,156 +0,0 @@
|
|||||||
# Microsoft Developer Studio Project File - Name="roken" - Package Owner=<4>
|
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
|
||||||
# ** DO NOT EDIT **
|
|
||||||
|
|
||||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
|
||||||
|
|
||||||
CFG=roken - Win32 Release
|
|
||||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
|
||||||
!MESSAGE use the Export Makefile command and run
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE NMAKE /f "roken.mak".
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE You can specify a configuration when running NMAKE
|
|
||||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE NMAKE /f "roken.mak" CFG="roken - Win32 Release"
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE Possible choices for configuration are:
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE "roken - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
|
||||||
!MESSAGE "roken - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
|
||||||
!MESSAGE
|
|
||||||
|
|
||||||
# Begin Project
|
|
||||||
# PROP Scc_ProjName ""
|
|
||||||
# PROP Scc_LocalPath ""
|
|
||||||
CPP=cl.exe
|
|
||||||
MTL=midl.exe
|
|
||||||
RSC=rc.exe
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "roken - Win32 Release"
|
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
|
||||||
# PROP BASE Use_Debug_Libraries 0
|
|
||||||
# PROP BASE Output_Dir ".\Release"
|
|
||||||
# PROP BASE Intermediate_Dir ".\Release"
|
|
||||||
# PROP BASE Target_Dir ""
|
|
||||||
# PROP Use_MFC 0
|
|
||||||
# PROP Use_Debug_Libraries 0
|
|
||||||
# PROP Output_Dir ".\Release"
|
|
||||||
# PROP Intermediate_Dir ".\Release"
|
|
||||||
# PROP Ignore_Export_Lib 0
|
|
||||||
# PROP Target_Dir ""
|
|
||||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
|
||||||
# ADD CPP /nologo /MT /GX /O2 /I "..\krb" /I "..\des" /I "..\..\include" /I "..\..\include\win32" /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
|
|
||||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
|
||||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
# ADD BASE BSC32 /nologo
|
|
||||||
# ADD BSC32 /nologo
|
|
||||||
LINK32=link.exe
|
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x68e7780" /subsystem:windows /dll /machine:I386
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "roken - Win32 Debug"
|
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
|
||||||
# PROP BASE Use_Debug_Libraries 1
|
|
||||||
# PROP BASE Output_Dir ".\Debug"
|
|
||||||
# PROP BASE Intermediate_Dir ".\Debug"
|
|
||||||
# PROP BASE Target_Dir ""
|
|
||||||
# PROP Use_MFC 0
|
|
||||||
# PROP Use_Debug_Libraries 1
|
|
||||||
# PROP Output_Dir ".\Debug"
|
|
||||||
# PROP Intermediate_Dir ".\Debug"
|
|
||||||
# PROP Ignore_Export_Lib 0
|
|
||||||
# PROP Target_Dir ""
|
|
||||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
|
||||||
# ADD CPP /nologo /MDd /Gm /GX /Zi /Od /I "..\krb" /I "..\des" /I "..\..\include" /I "..\..\include\win32" /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
|
|
||||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
|
||||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
# ADD BASE BSC32 /nologo
|
|
||||||
# ADD BSC32 /nologo
|
|
||||||
LINK32=link.exe
|
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\roken.def"
|
|
||||||
# SUBTRACT LINK32 /pdb:none
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
# Begin Target
|
|
||||||
|
|
||||||
# Name "roken - Win32 Release"
|
|
||||||
# Name "roken - Win32 Debug"
|
|
||||||
# Begin Group "Source Files"
|
|
||||||
|
|
||||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\base64.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\concat.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\gettimeofday.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\getuid.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\resolve.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\roken.def
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "roken - Win32 Release"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "roken - Win32 Debug"
|
|
||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\snprintf.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\strcasecmp.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\strtok_r.c
|
|
||||||
# End Source File
|
|
||||||
# End Group
|
|
||||||
# Begin Group "Header Files"
|
|
||||||
|
|
||||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\resolve.h
|
|
||||||
# End Source File
|
|
||||||
# End Group
|
|
||||||
# Begin Group "Resource Files"
|
|
||||||
|
|
||||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\roken.rc
|
|
||||||
# End Source File
|
|
||||||
# End Group
|
|
||||||
# End Target
|
|
||||||
# End Project
|
|
@@ -1,316 +0,0 @@
|
|||||||
# Microsoft Developer Studio Generated NMAKE File, Based on roken.dsp
|
|
||||||
!IF "$(CFG)" == ""
|
|
||||||
CFG=roken - Win32 Release
|
|
||||||
!MESSAGE No configuration specified. Defaulting to roken - Win32 Release.
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
!IF "$(CFG)" != "roken - Win32 Release" && "$(CFG)" != "roken - Win32 Debug"
|
|
||||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
|
||||||
!MESSAGE You can specify a configuration when running NMAKE
|
|
||||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE NMAKE /f "roken.mak" CFG="roken - Win32 Release"
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE Possible choices for configuration are:
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE "roken - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
|
||||||
!MESSAGE "roken - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
|
||||||
!MESSAGE
|
|
||||||
!ERROR An invalid configuration is specified.
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
!IF "$(OS)" == "Windows_NT"
|
|
||||||
NULL=
|
|
||||||
!ELSE
|
|
||||||
NULL=nul
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
CPP=cl.exe
|
|
||||||
MTL=midl.exe
|
|
||||||
RSC=rc.exe
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "roken - Win32 Release"
|
|
||||||
|
|
||||||
OUTDIR=.\Release
|
|
||||||
INTDIR=.\Release
|
|
||||||
# Begin Custom Macros
|
|
||||||
OutDir=.\.\Release
|
|
||||||
# End Custom Macros
|
|
||||||
|
|
||||||
!IF "$(RECURSE)" == "0"
|
|
||||||
|
|
||||||
ALL : "$(OUTDIR)\roken.dll"
|
|
||||||
|
|
||||||
!ELSE
|
|
||||||
|
|
||||||
ALL : "$(OUTDIR)\roken.dll"
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
CLEAN :
|
|
||||||
-@erase "$(INTDIR)\base64.obj"
|
|
||||||
-@erase "$(INTDIR)\concat.obj"
|
|
||||||
-@erase "$(INTDIR)\gettimeofday.obj"
|
|
||||||
-@erase "$(INTDIR)\getuid.obj"
|
|
||||||
-@erase "$(INTDIR)\resolve.obj"
|
|
||||||
-@erase "$(INTDIR)\roken.res"
|
|
||||||
-@erase "$(INTDIR)\snprintf.obj"
|
|
||||||
-@erase "$(INTDIR)\strcasecmp.obj"
|
|
||||||
-@erase "$(INTDIR)\strtok_r.obj"
|
|
||||||
-@erase "$(INTDIR)\vc50.idb"
|
|
||||||
-@erase "$(OUTDIR)\roken.dll"
|
|
||||||
-@erase "$(OUTDIR)\roken.exp"
|
|
||||||
-@erase "$(OUTDIR)\roken.lib"
|
|
||||||
|
|
||||||
"$(OUTDIR)" :
|
|
||||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
|
||||||
|
|
||||||
CPP_PROJ=/nologo /MT /GX /O2 /I "..\krb" /I "..\des" /I "..\..\include" /I\
|
|
||||||
"..\..\include\win32" /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\
|
|
||||||
"HAVE_CONFIG_H" /Fp"$(INTDIR)\roken.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"\
|
|
||||||
/FD /c
|
|
||||||
CPP_OBJS=.\Release/
|
|
||||||
CPP_SBRS=.
|
|
||||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
|
|
||||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\roken.res" /d "NDEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\roken.bsc"
|
|
||||||
BSC32_SBRS= \
|
|
||||||
|
|
||||||
LINK32=link.exe
|
|
||||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
|
||||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\
|
|
||||||
/base:"0x68e7780" /subsystem:windows /dll /incremental:no\
|
|
||||||
/pdb:"$(OUTDIR)\roken.pdb" /machine:I386 /def:".\roken.def"\
|
|
||||||
/out:"$(OUTDIR)\roken.dll" /implib:"$(OUTDIR)\roken.lib"
|
|
||||||
DEF_FILE= \
|
|
||||||
".\roken.def"
|
|
||||||
LINK32_OBJS= \
|
|
||||||
"$(INTDIR)\base64.obj" \
|
|
||||||
"$(INTDIR)\concat.obj" \
|
|
||||||
"$(INTDIR)\gettimeofday.obj" \
|
|
||||||
"$(INTDIR)\getuid.obj" \
|
|
||||||
"$(INTDIR)\resolve.obj" \
|
|
||||||
"$(INTDIR)\roken.res" \
|
|
||||||
"$(INTDIR)\snprintf.obj" \
|
|
||||||
"$(INTDIR)\strcasecmp.obj" \
|
|
||||||
"$(INTDIR)\strtok_r.obj"
|
|
||||||
|
|
||||||
"$(OUTDIR)\roken.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
|
||||||
$(LINK32) @<<
|
|
||||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
|
||||||
<<
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "roken - Win32 Debug"
|
|
||||||
|
|
||||||
OUTDIR=.\Debug
|
|
||||||
INTDIR=.\Debug
|
|
||||||
# Begin Custom Macros
|
|
||||||
OutDir=.\.\Debug
|
|
||||||
# End Custom Macros
|
|
||||||
|
|
||||||
!IF "$(RECURSE)" == "0"
|
|
||||||
|
|
||||||
ALL : "$(OUTDIR)\roken.dll"
|
|
||||||
|
|
||||||
!ELSE
|
|
||||||
|
|
||||||
ALL : "$(OUTDIR)\roken.dll"
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
CLEAN :
|
|
||||||
-@erase "$(INTDIR)\base64.obj"
|
|
||||||
-@erase "$(INTDIR)\concat.obj"
|
|
||||||
-@erase "$(INTDIR)\gettimeofday.obj"
|
|
||||||
-@erase "$(INTDIR)\getuid.obj"
|
|
||||||
-@erase "$(INTDIR)\resolve.obj"
|
|
||||||
-@erase "$(INTDIR)\roken.res"
|
|
||||||
-@erase "$(INTDIR)\snprintf.obj"
|
|
||||||
-@erase "$(INTDIR)\strcasecmp.obj"
|
|
||||||
-@erase "$(INTDIR)\strtok_r.obj"
|
|
||||||
-@erase "$(INTDIR)\vc50.idb"
|
|
||||||
-@erase "$(INTDIR)\vc50.pdb"
|
|
||||||
-@erase "$(OUTDIR)\roken.dll"
|
|
||||||
-@erase "$(OUTDIR)\roken.exp"
|
|
||||||
-@erase "$(OUTDIR)\roken.ilk"
|
|
||||||
-@erase "$(OUTDIR)\roken.lib"
|
|
||||||
-@erase "$(OUTDIR)\roken.pdb"
|
|
||||||
|
|
||||||
"$(OUTDIR)" :
|
|
||||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
|
||||||
|
|
||||||
CPP_PROJ=/nologo /MDd /Gm /GX /Zi /Od /I "..\krb" /I "..\des" /I\
|
|
||||||
"..\..\include" /I "..\..\include\win32" /I "." /D "_DEBUG" /D "WIN32" /D\
|
|
||||||
"_WINDOWS" /D "HAVE_CONFIG_H" /Fp"$(INTDIR)\roken.pch" /YX /Fo"$(INTDIR)\\"\
|
|
||||||
/Fd"$(INTDIR)\\" /FD /c
|
|
||||||
CPP_OBJS=.\Debug/
|
|
||||||
CPP_SBRS=.
|
|
||||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
|
|
||||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\roken.res" /d "_DEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\roken.bsc"
|
|
||||||
BSC32_SBRS= \
|
|
||||||
|
|
||||||
LINK32=link.exe
|
|
||||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
|
||||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\
|
|
||||||
/subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\roken.pdb" /debug\
|
|
||||||
/machine:I386 /def:".\roken.def" /out:"$(OUTDIR)\roken.dll"\
|
|
||||||
/implib:"$(OUTDIR)\roken.lib"
|
|
||||||
LINK32_OBJS= \
|
|
||||||
"$(INTDIR)\base64.obj" \
|
|
||||||
"$(INTDIR)\concat.obj" \
|
|
||||||
"$(INTDIR)\gettimeofday.obj" \
|
|
||||||
"$(INTDIR)\getuid.obj" \
|
|
||||||
"$(INTDIR)\resolve.obj" \
|
|
||||||
"$(INTDIR)\roken.res" \
|
|
||||||
"$(INTDIR)\snprintf.obj" \
|
|
||||||
"$(INTDIR)\strcasecmp.obj" \
|
|
||||||
"$(INTDIR)\strtok_r.obj"
|
|
||||||
|
|
||||||
"$(OUTDIR)\roken.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
|
||||||
$(LINK32) @<<
|
|
||||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
|
||||||
<<
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
.c{$(CPP_OBJS)}.obj::
|
|
||||||
$(CPP) @<<
|
|
||||||
$(CPP_PROJ) $<
|
|
||||||
<<
|
|
||||||
|
|
||||||
.cpp{$(CPP_OBJS)}.obj::
|
|
||||||
$(CPP) @<<
|
|
||||||
$(CPP_PROJ) $<
|
|
||||||
<<
|
|
||||||
|
|
||||||
.cxx{$(CPP_OBJS)}.obj::
|
|
||||||
$(CPP) @<<
|
|
||||||
$(CPP_PROJ) $<
|
|
||||||
<<
|
|
||||||
|
|
||||||
.c{$(CPP_SBRS)}.sbr::
|
|
||||||
$(CPP) @<<
|
|
||||||
$(CPP_PROJ) $<
|
|
||||||
<<
|
|
||||||
|
|
||||||
.cpp{$(CPP_SBRS)}.sbr::
|
|
||||||
$(CPP) @<<
|
|
||||||
$(CPP_PROJ) $<
|
|
||||||
<<
|
|
||||||
|
|
||||||
.cxx{$(CPP_SBRS)}.sbr::
|
|
||||||
$(CPP) @<<
|
|
||||||
$(CPP_PROJ) $<
|
|
||||||
<<
|
|
||||||
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "roken - Win32 Release" || "$(CFG)" == "roken - Win32 Debug"
|
|
||||||
SOURCE=.\base64.c
|
|
||||||
DEP_CPP_BASE6=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
".\base64.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\base64.obj" : $(SOURCE) $(DEP_CPP_BASE6) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\concat.c
|
|
||||||
DEP_CPP_CONCA=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
"..\..\include\win32\roken.h"\
|
|
||||||
".\err.h"\
|
|
||||||
".\roken-common.h"\
|
|
||||||
{$(INCLUDE)}"sys\stat.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\concat.obj" : $(SOURCE) $(DEP_CPP_CONCA) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\gettimeofday.c
|
|
||||||
DEP_CPP_GETTI=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
"..\..\include\win32\roken.h"\
|
|
||||||
".\err.h"\
|
|
||||||
".\roken-common.h"\
|
|
||||||
{$(INCLUDE)}"sys\stat.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\gettimeofday.obj" : $(SOURCE) $(DEP_CPP_GETTI) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\getuid.c
|
|
||||||
DEP_CPP_GETUI=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
"..\..\include\win32\roken.h"\
|
|
||||||
".\err.h"\
|
|
||||||
".\roken-common.h"\
|
|
||||||
{$(INCLUDE)}"sys\stat.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\getuid.obj" : $(SOURCE) $(DEP_CPP_GETUI) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\resolve.c
|
|
||||||
DEP_CPP_RESOL=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
"..\..\include\win32\roken.h"\
|
|
||||||
".\err.h"\
|
|
||||||
".\resolve.h"\
|
|
||||||
".\roken-common.h"\
|
|
||||||
{$(INCLUDE)}"sys\stat.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\resolve.obj" : $(SOURCE) $(DEP_CPP_RESOL) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\snprintf.c
|
|
||||||
DEP_CPP_SNPRI=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
"..\..\include\win32\roken.h"\
|
|
||||||
".\err.h"\
|
|
||||||
".\roken-common.h"\
|
|
||||||
{$(INCLUDE)}"sys\stat.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\snprintf.obj" : $(SOURCE) $(DEP_CPP_SNPRI) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\strcasecmp.c
|
|
||||||
DEP_CPP_STRCA=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\strcasecmp.obj" : $(SOURCE) $(DEP_CPP_STRCA) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\strtok_r.c
|
|
||||||
DEP_CPP_STRTO=\
|
|
||||||
"..\..\include\win32\config.h"\
|
|
||||||
"..\..\include\win32\roken.h"\
|
|
||||||
".\err.h"\
|
|
||||||
".\roken-common.h"\
|
|
||||||
{$(INCLUDE)}"sys\stat.h"\
|
|
||||||
{$(INCLUDE)}"sys\types.h"\
|
|
||||||
|
|
||||||
|
|
||||||
"$(INTDIR)\strtok_r.obj" : $(SOURCE) $(DEP_CPP_STRTO) "$(INTDIR)"
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=.\roken.rc
|
|
||||||
|
|
||||||
"$(INTDIR)\roken.res" : $(SOURCE) "$(INTDIR)"
|
|
||||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
@@ -1,105 +0,0 @@
|
|||||||
//Microsoft Developer Studio generated resource script.
|
|
||||||
//
|
|
||||||
#include "resource.h"
|
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
|
||||||
//
|
|
||||||
#include "afxres.h"
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Swedish resources
|
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
|
|
||||||
#ifdef _WIN32
|
|
||||||
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
|
||||||
#pragma code_page(1252)
|
|
||||||
#endif //_WIN32
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// TEXTINCLUDE
|
|
||||||
//
|
|
||||||
|
|
||||||
1 TEXTINCLUDE DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
"resource.h\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
2 TEXTINCLUDE DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
"#include ""afxres.h""\r\n"
|
|
||||||
"\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
3 TEXTINCLUDE DISCARDABLE
|
|
||||||
BEGIN
|
|
||||||
"\r\n"
|
|
||||||
"\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _MAC
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Version
|
|
||||||
//
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION 1,0,0,1
|
|
||||||
PRODUCTVERSION 1,0,0,1
|
|
||||||
FILEFLAGSMASK 0x3fL
|
|
||||||
#ifdef _DEBUG
|
|
||||||
FILEFLAGS 0x1L
|
|
||||||
#else
|
|
||||||
FILEFLAGS 0x0L
|
|
||||||
#endif
|
|
||||||
FILEOS 0x40004L
|
|
||||||
FILETYPE 0x2L
|
|
||||||
FILESUBTYPE 0x0L
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "040904b0"
|
|
||||||
BEGIN
|
|
||||||
VALUE "CompanyName", "Royal Institute of Technology (KTH)\0"
|
|
||||||
VALUE "FileDescription", "roken\0"
|
|
||||||
VALUE "FileVersion", "4, 0, 9, 9\0"
|
|
||||||
VALUE "InternalName", "roken\0"
|
|
||||||
VALUE "LegalCopyright", "Copyright <20> 1996 - 1998 Royal Institute of Technology (KTH)\0"
|
|
||||||
VALUE "OriginalFilename", "roken.dll\0"
|
|
||||||
VALUE "ProductName", "KTH Kerberos\0"
|
|
||||||
VALUE "ProductVersion", "4,0,9,9\0"
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x409, 1200
|
|
||||||
END
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // !_MAC
|
|
||||||
|
|
||||||
#endif // Swedish resources
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
#endif // not APSTUDIO_INVOKED
|
|
||||||
|
|
@@ -43,11 +43,11 @@ RCSID("$Id$");
|
|||||||
#include <roken.h>
|
#include <roken.h>
|
||||||
|
|
||||||
enum format_flags {
|
enum format_flags {
|
||||||
minus_flag = 1,
|
minus_flag = 0x01,
|
||||||
plus_flag = 2,
|
plus_flag = 0x02,
|
||||||
space_flag = 4,
|
space_flag = 0x04,
|
||||||
alternate_flag = 8,
|
alternate_flag = 0x08,
|
||||||
zero_flag = 16
|
zero_flag = 0x10
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -118,13 +118,20 @@ as_append_char (struct state *state, unsigned char c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LONG_LONG
|
||||||
|
typedef unsigned long long ulong_type;
|
||||||
|
#else
|
||||||
|
typedef unsigned long ulong_type;
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
append_number(struct state *state,
|
append_number(struct state *state,
|
||||||
unsigned long num, unsigned base, char *rep,
|
ulong_type num, unsigned base, char *rep,
|
||||||
int width, int prec, int flags, int minusp)
|
int width, int prec, int flags, int minusp)
|
||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int i;
|
int i;
|
||||||
|
ulong_type orig_num = num;
|
||||||
|
|
||||||
/* given precision, ignore zero flag */
|
/* given precision, ignore zero flag */
|
||||||
if(prec != -1)
|
if(prec != -1)
|
||||||
@@ -148,7 +155,7 @@ append_number(struct state *state,
|
|||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
/* add length of alternate prefix (added later) to len */
|
/* add length of alternate prefix (added later) to len */
|
||||||
if(flags & alternate_flag && (base == 16 || base == 8))
|
if(orig_num && (flags & alternate_flag) && (base == 16 || base == 8))
|
||||||
len += base / 8;
|
len += base / 8;
|
||||||
/* pad with zeros */
|
/* pad with zeros */
|
||||||
if(flags & zero_flag){
|
if(flags & zero_flag){
|
||||||
@@ -162,10 +169,11 @@ append_number(struct state *state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* add alternate prefix */
|
/* add alternate prefix */
|
||||||
if(flags & alternate_flag && (base == 16 || base == 8)){
|
if(orig_num && (flags & alternate_flag) && (base == 16 || base == 8)){
|
||||||
if(base == 16)
|
if(base == 16) {
|
||||||
if((*state->append_char)(state, rep[10] + 23)) /* XXX */
|
if((*state->append_char)(state, rep[10] + 23)) /* XXX */
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
if((*state->append_char)(state, '0'))
|
if((*state->append_char)(state, '0'))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -207,6 +215,187 @@ append_number(struct state *state,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(NO_SNPRINTF_FLOAT) && 0
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* alternate -> always decimal point
|
||||||
|
* [Gg] -> don't remove trailing zeros
|
||||||
|
* zero/negative/space/plus
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int
|
||||||
|
append_double (struct state *state, double num, int c,
|
||||||
|
int width, int prec, int flags)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int len = 0;
|
||||||
|
int n;
|
||||||
|
int sign = 1;
|
||||||
|
double l;
|
||||||
|
int trail_zero = 1;
|
||||||
|
int dec_point = 0;
|
||||||
|
|
||||||
|
if (num < 0) {
|
||||||
|
sign = -1;
|
||||||
|
num = -num;
|
||||||
|
}
|
||||||
|
if (prec == -1)
|
||||||
|
prec = 6;
|
||||||
|
if (prec == 0 && tolower(c) == 'g')
|
||||||
|
prec = 1;
|
||||||
|
|
||||||
|
if (flags & alternate_flag)
|
||||||
|
dec_point = 1;
|
||||||
|
|
||||||
|
if (tolower(c) == 'g' || tolower(c) == 'e') {
|
||||||
|
l = log10 (num);
|
||||||
|
if (tolower (c) == 'g') {
|
||||||
|
if (l < -4.0 || l >= prec) {
|
||||||
|
c -= 'G' - 'E';
|
||||||
|
--prec;
|
||||||
|
} else {
|
||||||
|
c = 'f';
|
||||||
|
n = num / pow (10, (int)l);
|
||||||
|
do {
|
||||||
|
--prec;
|
||||||
|
n /= 10;
|
||||||
|
} while (n > 0);
|
||||||
|
}
|
||||||
|
if (!(flags & alternate_flag))
|
||||||
|
trail_zero = 0;
|
||||||
|
/* prec -= log10 (num + 1); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tolower(c) == 'e') {
|
||||||
|
int sign_n = 1;
|
||||||
|
double d;
|
||||||
|
|
||||||
|
n = l;
|
||||||
|
num = ((num * pow (10, n)) + 0.5) / pow (10, n);
|
||||||
|
l = log10 (num);
|
||||||
|
n = l;
|
||||||
|
num /= pow (10, n);
|
||||||
|
if (num >= 10)
|
||||||
|
abort ();
|
||||||
|
if (n < 0) {
|
||||||
|
n = -n;
|
||||||
|
sign_n = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
int digit = (int)(d + 0.5) % 10;
|
||||||
|
|
||||||
|
if ((*state->append_char)(state, "012345678"[digit]))
|
||||||
|
return 1;
|
||||||
|
++len;
|
||||||
|
d /= 10;
|
||||||
|
} while (d > 0);
|
||||||
|
if (len == 1) {
|
||||||
|
if ((*state->append_char)(state, '0'))
|
||||||
|
return 1;
|
||||||
|
++len;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sign_n < 0) {
|
||||||
|
if ((*state->append_char)(state, '-'))
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
if ((*state->append_char)(state, '+'))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
++len;
|
||||||
|
if ((*state->append_char)(state, c))
|
||||||
|
return 1;
|
||||||
|
++len;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (prec) {
|
||||||
|
double int_part, frac_part;
|
||||||
|
|
||||||
|
frac_part = modf (num, &int_part);
|
||||||
|
n = frac_part * pow (10, prec) + 0.5;
|
||||||
|
for (i = 0; i < prec; ++i) {
|
||||||
|
int digit = n % 10;
|
||||||
|
|
||||||
|
if (digit > 0 || trail_zero) {
|
||||||
|
if ((*state->append_char)(state, "0123456789"[digit]))
|
||||||
|
return 1;
|
||||||
|
++len;
|
||||||
|
trail_zero = 1;
|
||||||
|
dec_point = 1;
|
||||||
|
}
|
||||||
|
n /= 10;
|
||||||
|
}
|
||||||
|
n = int_part;
|
||||||
|
} else
|
||||||
|
n = num + 0.5;
|
||||||
|
|
||||||
|
if (dec_point) {
|
||||||
|
if ((*state->append_char)(state, '.'))
|
||||||
|
return 1;
|
||||||
|
++len;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
if ((*state->append_char)(state, "0123456789"[n % 10]))
|
||||||
|
return 1;
|
||||||
|
++len;
|
||||||
|
n /= 10;
|
||||||
|
} while (n > 0);
|
||||||
|
|
||||||
|
if (flags & zero_flag) {
|
||||||
|
width -= len;
|
||||||
|
if (sign < 0 || (flags & space_flag) || (flags & plus_flag))
|
||||||
|
width--;
|
||||||
|
while (width-- > 0) {
|
||||||
|
if((*state->append_char)(state, '0'))
|
||||||
|
return 1;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(sign < 0){
|
||||||
|
if((*state->append_char)(state, '-'))
|
||||||
|
return 1;
|
||||||
|
len++;
|
||||||
|
} else if(flags & plus_flag) {
|
||||||
|
if((*state->append_char)(state, '+'))
|
||||||
|
return 1;
|
||||||
|
len++;
|
||||||
|
} else if(flags & space_flag) {
|
||||||
|
if((*state->append_char)(state, ' '))
|
||||||
|
return 1;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
if(flags & minus_flag)
|
||||||
|
/* swap before padding with spaces */
|
||||||
|
for(i = 0; i < len / 2; i++){
|
||||||
|
char c = state->s[-i-1];
|
||||||
|
state->s[-i-1] = state->s[-len+i];
|
||||||
|
state->s[-len+i] = c;
|
||||||
|
}
|
||||||
|
width -= len;
|
||||||
|
while(width-- > 0){
|
||||||
|
if((*state->append_char)(state, ' '))
|
||||||
|
return 1;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
if(!(flags & minus_flag))
|
||||||
|
/* swap after padding with spaces */
|
||||||
|
for(i = 0; i < len / 2; i++){
|
||||||
|
char c = state->s[-i-1];
|
||||||
|
state->s[-i-1] = state->s[-len+i];
|
||||||
|
state->s[-len+i] = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* WANT_SNPRINTF_FLOAT */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
append_string (struct state *state,
|
append_string (struct state *state,
|
||||||
unsigned char *arg,
|
unsigned char *arg,
|
||||||
@@ -261,14 +450,26 @@ append_char(struct state *state,
|
|||||||
* This can't be made into a function...
|
* This can't be made into a function...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PARSE_INT_FORMAT(res, arg, unsig) \
|
#define PARSE_INT_FORMAT_VANILLA(res, arg, unsig) \
|
||||||
if (long_flag) \
|
if (long_arg == 1) \
|
||||||
res = (unsig long)va_arg(arg, unsig long); \
|
res = (unsig long)va_arg(arg, unsig long); \
|
||||||
else if (short_flag) \
|
else if (short_flag) \
|
||||||
res = (unsig short)va_arg(arg, unsig int); \
|
res = (unsig short)va_arg(arg, unsig int); \
|
||||||
else \
|
else \
|
||||||
res = (unsig int)va_arg(arg, unsig int)
|
res = (unsig int)va_arg(arg, unsig int)
|
||||||
|
|
||||||
|
#ifdef HAVE_LONG_LONG
|
||||||
|
#define PARSE_INT_FORMAT(res, arg, unsig) \
|
||||||
|
if (long_arg == 2) \
|
||||||
|
res = (unsig long long)va_arg(arg, unsig long long); \
|
||||||
|
else PARSE_INT_FORMAT_VANILLA(res, arg, unsig)
|
||||||
|
|
||||||
|
#else /* !HAVE_LONG_LONG */
|
||||||
|
#define PARSE_INT_FORMAT(res, arg, unsig) \
|
||||||
|
PARSE_INT_FORMAT_VANILLA(res, arg, unsig)
|
||||||
|
|
||||||
|
#endif /* HAVE_LONG_LONG */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zyxprintf - return 0 or -1
|
* zyxprintf - return 0 or -1
|
||||||
*/
|
*/
|
||||||
@@ -284,7 +485,7 @@ xyzprintf (struct state *state, const char *char_format, va_list ap)
|
|||||||
int flags = 0;
|
int flags = 0;
|
||||||
int width = 0;
|
int width = 0;
|
||||||
int prec = -1;
|
int prec = -1;
|
||||||
int long_flag = 0;
|
int long_arg = 0;
|
||||||
int short_flag = 0;
|
int short_flag = 0;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
@@ -341,7 +542,7 @@ xyzprintf (struct state *state, const char *char_format, va_list ap)
|
|||||||
short_flag = 1;
|
short_flag = 1;
|
||||||
c = *format++;
|
c = *format++;
|
||||||
} else if (c == 'l') {
|
} else if (c == 'l') {
|
||||||
long_flag = 1;
|
++long_arg;
|
||||||
c = *format++;
|
c = *format++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,6 +626,17 @@ xyzprintf (struct state *state, const char *char_format, va_list ap)
|
|||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if !defined(NO_SNPRINTF_FLOAT) && 0
|
||||||
|
case 'e' :
|
||||||
|
case 'E' :
|
||||||
|
case 'f' :
|
||||||
|
case 'g' :
|
||||||
|
case 'G' :
|
||||||
|
if (append_double (state, va_arg(ap, double), c,
|
||||||
|
width, prec, flags))
|
||||||
|
return -1;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case 'n' : {
|
case 'n' : {
|
||||||
int *arg = va_arg(ap, int*);
|
int *arg = va_arg(ap, int*);
|
||||||
*arg = state->s - state->str;
|
*arg = state->s - state->str;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1999 - 2000 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -246,9 +246,9 @@ socket_set_port (struct sockaddr *sa, int port)
|
|||||||
void
|
void
|
||||||
socket_set_debug (int sock)
|
socket_set_debug (int sock)
|
||||||
{
|
{
|
||||||
|
#if defined(SO_DEBUG) && defined(HAVE_SETSOCKOPT)
|
||||||
int on = 1;
|
int on = 1;
|
||||||
|
|
||||||
#if defined(SO_DEBUG) && defined(HAVE_SETSOCKOPT)
|
|
||||||
if (setsockopt (sock, SOL_SOCKET, SO_DEBUG, (void *) &on, sizeof (on)) < 0)
|
if (setsockopt (sock, SOL_SOCKET, SO_DEBUG, (void *) &on, sizeof (on)) < 0)
|
||||||
warn ("setsockopt SO_DEBUG (ignored)");
|
warn ("setsockopt SO_DEBUG (ignored)");
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1999 - 2000 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user