libusual.git
14 years agotime: better autodetection on win32
Marko Kreen [Thu, 5 May 2011 18:23:02 +0000 (21:23 +0300)]
time: better autodetection on win32

Seems like the posix functions are slowly added to mingw/msvcrt
so we cannot blindly assume with #ifdef WIN32 whats there.

Add proper autodetection for gettimeofday(), localtime_r(), getrusage()

Remove double detection for recvmsg and sendmsg.

14 years agobase_win32: remove duplicate sigval/sigevent declaration
Marko Kreen [Thu, 5 May 2011 06:12:01 +0000 (09:12 +0300)]
base_win32: remove duplicate sigval/sigevent declaration

14 years agosocket: include <sys/uio.h> to get iovec
Marko Kreen [Fri, 29 Apr 2011 14:57:42 +0000 (17:57 +0300)]
socket: include <sys/uio.h> to get iovec

Needed on OpenBSD.  In addition to readv/writev, the
iovec is used also by sendmsg()/recvmsg().

Reported-by: Pierre-Emmanuel André
14 years agosignal: separate sigval from sigevent
Marko Kreen [Fri, 29 Apr 2011 14:56:12 +0000 (17:56 +0300)]
signal: separate sigval from sigevent

On OpenBSD sigval is defined but sigevent is not.

Tie sigval with siginfo's SI_QUEUE.

Reported-by: Pierre-Emmanuel André
14 years agoendian: ignore system Xtoh/htoX defines
Marko Kreen [Fri, 29 Apr 2011 14:52:57 +0000 (17:52 +0300)]
endian: ignore system Xtoh/htoX defines

At least OpenBSD defines only subset of them.  As this
may happen on other OS'es too, the best way to avoid
future problems is to ignore system defines completely.

Reported-by: Pierre-Emmanuel André
14 years agofind_modules.sh/awk: replace split() with index()+substr()
Marko Kreen [Wed, 20 Apr 2011 17:06:31 +0000 (20:06 +0300)]
find_modules.sh/awk: replace split() with index()+substr()

heirloom/oawk does not support split-by-regex, seems
thats too modern construct (post-1978).  Internet says
thats where Solaris is.

Also simplify quoting a little.

14 years agomake boot: install additional files needed for ACX_PTHREAD
Marko Kreen [Wed, 6 Apr 2011 14:27:02 +0000 (17:27 +0300)]
make boot: install additional files needed for ACX_PTHREAD

- move logic out to autogen.sh, more standard
- use libtoolize to fetch config.sub, config.guess, install-sh
- don't use autoreconf, it's broken in some autoconf versions

14 years agomake distclean now rips out config.status, too
Dimitri Fontaine [Wed, 6 Apr 2011 13:40:10 +0000 (15:40 +0200)]
make distclean now rips out config.status, too

14 years agonetdb: some cleanup
Marko Kreen [Sun, 27 Mar 2011 20:57:11 +0000 (23:57 +0300)]
netdb: some cleanup

- gaia_thread: simplify the lock loop
- gaia_lookup: pass proper sigval to function
- include <string.h>, for memcpy()
- depend on HAVE_PTHREAD not HAVE_PTHREAD_H - to avoid
  messing with non-threaded errno.

14 years agoAC_USUAL_GETADDRINFO_A: use LINK instead of COMPILE
Marko Kreen [Fri, 25 Mar 2011 23:09:43 +0000 (01:09 +0200)]
AC_USUAL_GETADDRINFO_A: use LINK instead of COMPILE

14 years agousual.m4: special handling for getaddrinfo_a()
Marko Kreen [Fri, 25 Mar 2011 21:17:43 +0000 (23:17 +0200)]
usual.m4: special handling for getaddrinfo_a()

AC_USUAL_GETADDRINFO_A:
- check glibc version
- setup pthreads

14 years agoAC_USUAL_LIBEVENT: check also for evdns_base_new
Marko Kreen [Fri, 25 Mar 2011 20:36:54 +0000 (22:36 +0200)]
AC_USUAL_LIBEVENT: check also for evdns_base_new

14 years agoAC_USUAL_PORT_CHECK: Use AC_USE_SYSTEM_EXTENSIONS
Marko Kreen [Fri, 25 Mar 2011 19:35:19 +0000 (21:35 +0200)]
AC_USUAL_PORT_CHECK: Use AC_USE_SYSTEM_EXTENSIONS

This gets rid of _GNU_SOURCE and __EXTENSIONS__

Unfortunately it does not handle _XPG4_2 and WINVER...

14 years agonetdb: non-blocking compat getaddrinfo_a()
Marko Kreen [Fri, 25 Mar 2011 07:13:56 +0000 (09:13 +0200)]
netdb: non-blocking compat getaddrinfo_a()

Lauch single thread that does lookups.  It must not multi-thread
as thread-safety of libc getaddrinfo() is uncertain.

14 years agonetdb: require glibc 2.9 for getaddrinfo_a()
Marko Kreen [Fri, 25 Mar 2011 07:13:35 +0000 (09:13 +0200)]
netdb: require glibc 2.9 for getaddrinfo_a()

14 years agonetdb: disable getaddrinfo_a() on older glibc
Marko Kreen [Wed, 23 Mar 2011 15:35:25 +0000 (17:35 +0200)]
netdb: disable getaddrinfo_a() on older glibc

RHEL/CentOS glibc 2.5 is broken

Debian's glibc 2.3 (etch) and 2.7 (lenny) work

14 years agofind_modules: replace $(cmd) with backticks, more portable
Marko Kreen [Sun, 20 Mar 2011 19:12:54 +0000 (21:12 +0200)]
find_modules: replace $(cmd) with backticks, more portable

14 years agousual.m4: turn on uninitialized variable warnings on clang
Marko Kreen [Fri, 4 Mar 2011 08:19:25 +0000 (10:19 +0200)]
usual.m4: turn on uninitialized variable warnings on clang

You need gcc-3.4 or clang 2.9 with -Wuninitialized-experimental
to get them..

14 years agoctype: expect worst on cross-compile
Marko Kreen [Wed, 2 Mar 2011 21:56:18 +0000 (23:56 +0200)]
ctype: expect worst on cross-compile

14 years agofileutil: load_file() fixes
Marko Kreen [Mon, 28 Feb 2011 20:01:36 +0000 (22:01 +0200)]
fileutil: load_file() fixes

- report actually read bytes.  Eg: different on win32
  due to dos line endings.

Reported-by: Rich Schaaf
- free buffer on error

14 years agoevent: fix debug code with new heap api
Marko Kreen [Mon, 28 Feb 2011 20:01:12 +0000 (22:01 +0200)]
event: fix debug code with new heap api

14 years agocfparser: fix docstring
Marko Kreen [Sun, 27 Feb 2011 18:46:11 +0000 (20:46 +0200)]
cfparser: fix docstring

14 years agoregex: replace switch with list
Marko Kreen [Sun, 27 Feb 2011 18:45:16 +0000 (20:45 +0200)]
regex: replace switch with list

14 years agoctype: new compat module
Marko Kreen [Sun, 27 Feb 2011 00:08:11 +0000 (02:08 +0200)]
ctype: new compat module

Make sure <ctype.h> functions accept 'char' values.

On arches where plain 'char' is signed, <ctype.h> functions
need to work on negative values.

Some OSes do it already (Linux), some don't (BSD, Windows).

14 years agoheap: internal api cleanup
Marko Kreen [Sat, 26 Feb 2011 23:57:08 +0000 (01:57 +0200)]
heap: internal api cleanup

14 years agogetopt: move optreset into function
Marko Kreen [Sat, 26 Feb 2011 23:56:14 +0000 (01:56 +0200)]
getopt: move optreset into function

14 years agolookup3: tests for big-endian
Marko Kreen [Sat, 26 Feb 2011 23:55:45 +0000 (01:55 +0200)]
lookup3: tests for big-endian

14 years agogitignore: gcov files
Marko Kreen [Sat, 26 Feb 2011 11:13:26 +0000 (13:13 +0200)]
gitignore: gcov files

14 years agosignal: compat sigevent struct
Marko Kreen [Sat, 26 Feb 2011 11:13:08 +0000 (13:13 +0200)]
signal: compat sigevent struct

14 years agosafeio: needs time.h
Marko Kreen [Sat, 26 Feb 2011 11:08:41 +0000 (13:08 +0200)]
safeio: needs time.h

14 years agoevent: use simpler sa_handler prototype
Marko Kreen [Sat, 26 Feb 2011 11:08:18 +0000 (13:08 +0200)]
event: use simpler sa_handler prototype

14 years agoUse FLEX_ARRAY instead of []
Marko Kreen [Sat, 26 Feb 2011 11:06:22 +0000 (13:06 +0200)]
Use FLEX_ARRAY instead of []

14 years agosocket: avoid bsd typedefs, instead define
Marko Kreen [Sat, 26 Feb 2011 11:03:22 +0000 (13:03 +0200)]
socket: avoid bsd typedefs, instead define

14 years agoregex: minor space saving
Marko Kreen [Thu, 24 Feb 2011 20:45:12 +0000 (22:45 +0200)]
regex: minor space saving

14 years agosocket_win32: add int <> SOCKET casting macros
Marko Kreen [Thu, 24 Feb 2011 20:24:56 +0000 (22:24 +0200)]
socket_win32: add int <> SOCKET casting macros

they can be made do something smart if needed

14 years agoaatree: fix test
Marko Kreen [Thu, 24 Feb 2011 20:14:47 +0000 (22:14 +0200)]
aatree: fix test

14 years agogetopt: new compat module
Marko Kreen [Thu, 24 Feb 2011 11:36:39 +0000 (13:36 +0200)]
getopt: new compat module

implementation from OpenBSD

14 years agoerr: add _PRINTF tags
Marko Kreen [Thu, 24 Feb 2011 11:36:24 +0000 (13:36 +0200)]
err: add _PRINTF tags

14 years agopgutil: avoid gperf use of long
Marko Kreen [Tue, 22 Feb 2011 19:06:46 +0000 (21:06 +0200)]
pgutil: avoid gperf use of long

14 years agoregex: allow undefined isblank
Marko Kreen [Tue, 22 Feb 2011 19:06:07 +0000 (21:06 +0200)]
regex: allow undefined isblank

14 years agoaatree: use uintptr_t instead of long for data
Marko Kreen [Tue, 22 Feb 2011 19:05:30 +0000 (21:05 +0200)]
aatree: use uintptr_t instead of long for data

14 years agotest_time: allow exact usleep
Marko Kreen [Tue, 15 Feb 2011 07:25:17 +0000 (09:25 +0200)]
test_time: allow exact usleep

14 years agowin32: WINVER is more proper thing to set than _WIN32_WINNT
Marko Kreen [Tue, 15 Feb 2011 06:57:20 +0000 (08:57 +0200)]
win32: WINVER is more proper thing to set than _WIN32_WINNT

14 years agolist,statlist: reverse list walking
Marko Kreen [Tue, 15 Feb 2011 06:56:49 +0000 (08:56 +0200)]
list,statlist: reverse list walking

14 years agofind_module: use awk for processing, seems more portable than sed
Marko Kreen [Tue, 15 Feb 2011 06:53:45 +0000 (08:53 +0200)]
find_module: use awk for processing, seems more portable than sed

14 years agotest_fileutil: use wb to write file
Marko Kreen [Tue, 15 Feb 2011 06:52:24 +0000 (08:52 +0200)]
test_fileutil: use wb to write file

14 years agotest: missing LDFLAGS from link
Marko Kreen [Tue, 15 Feb 2011 06:52:04 +0000 (08:52 +0200)]
test: missing LDFLAGS from link

14 years agosocket: inet_pton() and inet_ntop() from openbsd
Marko Kreen [Tue, 15 Feb 2011 06:51:39 +0000 (08:51 +0200)]
socket: inet_pton() and inet_ntop() from openbsd

14 years agobuild: allow several .c files per module
Marko Kreen [Tue, 15 Feb 2011 06:49:06 +0000 (08:49 +0200)]
build: allow several .c files per module

14 years agotest: fileutil, time, crc32 and lookup3 tests
Marko Kreen [Tue, 1 Feb 2011 12:37:12 +0000 (14:37 +0200)]
test: fileutil, time, crc32 and lookup3 tests

14 years agotest_string: parse_word_list() tests
Marko Kreen [Tue, 1 Feb 2011 12:36:34 +0000 (14:36 +0200)]
test_string: parse_word_list() tests

14 years agotest_netdb: add socket.h include
Marko Kreen [Tue, 1 Feb 2011 12:35:59 +0000 (14:35 +0200)]
test_netdb: add socket.h include

14 years agotest_mdict: test overwrite and delete
Marko Kreen [Tue, 1 Feb 2011 12:35:35 +0000 (14:35 +0200)]
test_mdict: test overwrite and delete

14 years agomakefile/sparse: add -Wno-transparent-union
Marko Kreen [Tue, 1 Feb 2011 12:35:01 +0000 (14:35 +0200)]
makefile/sparse: add -Wno-transparent-union

14 years agostring: allow empty strings in parse_word_list()
Marko Kreen [Tue, 1 Feb 2011 12:34:29 +0000 (14:34 +0200)]
string: allow empty strings in parse_word_list()

14 years agomdict: fix free on overwrite, add mdict_del()
Marko Kreen [Tue, 1 Feb 2011 12:33:23 +0000 (14:33 +0200)]
mdict: fix free on overwrite, add mdict_del()

14 years agofileutil: better error handling for foreach_line()
Marko Kreen [Tue, 1 Feb 2011 12:32:47 +0000 (14:32 +0200)]
fileutil: better error handling for foreach_line()

14 years agotest: decrease loop count in aatree/cbtree tests
Marko Kreen [Tue, 1 Feb 2011 12:31:43 +0000 (14:31 +0200)]
test: decrease loop count in aatree/cbtree tests

this should decrease regtest run time

14 years agopgutil: include keywords in kwlookup.g
Marko Kreen [Mon, 31 Jan 2011 17:16:06 +0000 (19:16 +0200)]
pgutil: include keywords in kwlookup.g

autogen does not work, because they keywords can be
removed from postgres, but we dont want to remove them
from here.

Currently list is union of 8.3 .. 9.1 keywords.

14 years agoendian: expand encdec functions to make them more dox-friendly
Marko Kreen [Mon, 31 Jan 2011 17:14:52 +0000 (19:14 +0200)]
endian: expand encdec functions to make them more dox-friendly

14 years agotest: shlist tests
Marko Kreen [Mon, 31 Jan 2011 09:53:09 +0000 (11:53 +0200)]
test: shlist tests

14 years agotest: strlist tests
Marko Kreen [Mon, 31 Jan 2011 09:51:19 +0000 (11:51 +0200)]
test: strlist tests

14 years agoshlist: couple new functions
Marko Kreen [Mon, 31 Jan 2011 09:50:17 +0000 (11:50 +0200)]
shlist: couple new functions

14 years agoshlist: fix shlist_prepend
Marko Kreen [Mon, 31 Jan 2011 09:49:52 +0000 (11:49 +0200)]
shlist: fix shlist_prepend

14 years agocxalloc: fix cx_strdup
Marko Kreen [Mon, 31 Jan 2011 09:48:33 +0000 (11:48 +0200)]
cxalloc: fix cx_strdup

14 years agotest: mdict tests
Marko Kreen [Fri, 28 Jan 2011 22:02:05 +0000 (00:02 +0200)]
test: mdict tests

14 years agomdict: fix urldecode memleak
Marko Kreen [Fri, 28 Jan 2011 22:00:04 +0000 (00:00 +0200)]
mdict: fix urldecode memleak

14 years agotest_endian: fix signedness warning
Marko Kreen [Thu, 27 Jan 2011 11:20:22 +0000 (13:20 +0200)]
test_endian: fix signedness warning

14 years agotest/: hashtab tests
Marko Kreen [Thu, 27 Jan 2011 11:03:18 +0000 (13:03 +0200)]
test/: hashtab tests

14 years agotest_utf8: add more tests
Marko Kreen [Thu, 27 Jan 2011 11:02:02 +0000 (13:02 +0200)]
test_utf8: add more tests

14 years agoutf8: make incoming char values unsigned
Marko Kreen [Thu, 27 Jan 2011 11:01:21 +0000 (13:01 +0200)]
utf8: make incoming char values unsigned

14 years agohashtab: fix thinko in hashtab_delete()
Marko Kreen [Thu, 27 Jan 2011 11:00:03 +0000 (13:00 +0200)]
hashtab: fix thinko in hashtab_delete()

14 years agologging: LG_STATS loglevel for liveness messages
Marko Kreen [Wed, 26 Jan 2011 12:54:32 +0000 (14:54 +0200)]
logging: LG_STATS loglevel for liveness messages

14 years agotest: <endian.h> tests
Marko Kreen [Wed, 26 Jan 2011 12:51:12 +0000 (14:51 +0200)]
test: <endian.h> tests

14 years agoMerge branch 'master' of git://github.com/markokr/libusual
Marko Kreen [Wed, 26 Jan 2011 12:34:26 +0000 (14:34 +0200)]
Merge branch 'master' of git://github.com/markokr/libusual

14 years agoendian: autoconf detection for enc/dec functions
Marko Kreen [Wed, 26 Jan 2011 12:31:47 +0000 (14:31 +0200)]
endian: autoconf detection for enc/dec functions

14 years agocfparser: new section callback
Marko Kreen [Wed, 26 Jan 2011 12:04:29 +0000 (14:04 +0200)]
cfparser: new section callback

14 years agostatlist: statlist_last()
Marko Kreen [Wed, 26 Jan 2011 12:04:16 +0000 (14:04 +0200)]
statlist: statlist_last()

14 years agousual.m4: -Wextra check uses wrong variable
Marko Kreen [Wed, 26 Jan 2011 11:09:07 +0000 (13:09 +0200)]
usual.m4: -Wextra check uses wrong variable

14 years agohashtab: cx conversion missed memset
Marko Kreen [Wed, 26 Jan 2011 11:08:46 +0000 (13:08 +0200)]
hashtab: cx conversion missed memset

14 years agoslab: cx conversion missed memset
Marko Kreen [Wed, 26 Jan 2011 11:08:03 +0000 (13:08 +0200)]
slab: cx conversion missed memset

14 years agosocket: poll compat fix
Marko Kreen [Fri, 21 Jan 2011 11:33:05 +0000 (13:33 +0200)]
socket: poll compat fix

14 years agogitignore more
Marko Kreen [Wed, 8 Dec 2010 15:26:31 +0000 (17:26 +0200)]
gitignore more

14 years agogitignore file
Marko Kreen [Fri, 3 Dec 2010 12:21:23 +0000 (14:21 +0200)]
gitignore file

14 years agocfparser: silently ignore CF_NO_RELOAD or CF_READONLY updates.
Marko Kreen [Tue, 30 Nov 2010 12:55:17 +0000 (14:55 +0200)]
cfparser: silently ignore CF_NO_RELOAD or CF_READONLY updates.

14 years agocfparser: clarify bit-checks
Marko Kreen [Tue, 30 Nov 2010 09:54:13 +0000 (11:54 +0200)]
cfparser: clarify bit-checks

14 years agoevent: signal_del/evtimer_del compat
Marko Kreen [Mon, 29 Nov 2010 16:23:35 +0000 (18:23 +0200)]
event: signal_del/evtimer_del compat

14 years agoevent: get_version and get_method functions
Marko Kreen [Mon, 29 Nov 2010 11:42:27 +0000 (13:42 +0200)]
event: get_version and get_method functions

14 years agodaemon: empty logfile means same as NULL
Marko Kreen [Mon, 29 Nov 2010 11:41:43 +0000 (13:41 +0200)]
daemon: empty logfile means same as NULL

14 years agom4/usual.m4: AC_USUAL_LIBEVENT_OPT macro, for optional libevent
Marko Kreen [Mon, 29 Nov 2010 11:41:08 +0000 (13:41 +0200)]
m4/usual.m4: AC_USUAL_LIBEVENT_OPT macro, for optional libevent

14 years agowin32 compat update
Marko Kreen [Wed, 24 Nov 2010 07:38:34 +0000 (09:38 +0200)]
win32 compat update

14 years agoattregex: lost interpretation.dat, compile regex locally
Marko Kreen [Wed, 24 Nov 2010 07:37:36 +0000 (09:37 +0200)]
attregex: lost interpretation.dat, compile regex locally

14 years agoCoupld portability fixes
Marko Kreen [Tue, 23 Nov 2010 13:28:42 +0000 (15:28 +0200)]
Coupld portability fixes

14 years agoFix couple bugs in regtests, makefile cleanup
Marko Kreen [Sat, 20 Nov 2010 11:38:39 +0000 (13:38 +0200)]
Fix couple bugs in regtests, makefile cleanup

Now the makefile does not depend on top-level makefile,
regtest is built as ordinary executable.

14 years agonetdb: compat getaddrinfo_a fixes
Marko Kreen [Mon, 22 Nov 2010 22:34:19 +0000 (00:34 +0200)]
netdb: compat getaddrinfo_a fixes

14 years agoheap: heap size and obj-by-index helpers
Marko Kreen [Mon, 22 Nov 2010 22:33:00 +0000 (00:33 +0200)]
heap: heap size and obj-by-index helpers

14 years agocfparser: API reorg, regtests
Marko Kreen [Thu, 18 Nov 2010 14:10:36 +0000 (16:10 +0200)]
cfparser: API reorg, regtests

Support both dynamic sections and dynamic keys.

Cleanup of both internal and external APIs.

14 years agodoc: mention netdb and heap
Marko Kreen [Thu, 4 Nov 2010 12:17:28 +0000 (14:17 +0200)]
doc: mention netdb and heap

14 years agologging: restore syslog and syslog_facility params
Marko Kreen [Wed, 17 Nov 2010 12:00:01 +0000 (14:00 +0200)]
logging: restore syslog and syslog_facility params

14 years agocfparser: filename params, with tilde expansion
Marko Kreen [Wed, 10 Nov 2010 15:44:41 +0000 (17:44 +0200)]
cfparser: filename params, with tilde expansion

Patch by Asko Tiidumaa, applied with minor modifications.