libusual.git
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.

14 years agoheap: fix few conversion bugs
Marko Kreen [Thu, 4 Nov 2010 12:04:07 +0000 (14:04 +0200)]
heap: fix few conversion bugs

14 years agopgsocket: handle connection lifetime
Marko Kreen [Wed, 3 Nov 2010 15:48:26 +0000 (17:48 +0200)]
pgsocket: handle connection lifetime

14 years agologging: fix die(), again
Marko Kreen [Tue, 12 Oct 2010 11:02:46 +0000 (14:02 +0300)]
logging: fix die(), again

14 years agonetdb: compat getaddrinfo_a()
Marko Kreen [Tue, 12 Oct 2010 10:50:15 +0000 (13:50 +0300)]
netdb: compat getaddrinfo_a()

14 years agobits: wrong header ifdef
Marko Kreen [Tue, 12 Oct 2010 10:48:53 +0000 (13:48 +0300)]
bits: wrong header ifdef

14 years agoheap: convert inline implemenatation to regular one
Marko Kreen [Tue, 12 Oct 2010 10:47:55 +0000 (13:47 +0300)]
heap: convert inline implemenatation to regular one

the minor performance advantages are not worth
more complex use.

14 years agotest/: base tests, test both compat and system code
Marko Kreen [Sat, 9 Oct 2010 12:03:44 +0000 (15:03 +0300)]
test/: base tests, test both compat and system code

14 years agobase: alignof()
Marko Kreen [Sat, 9 Oct 2010 12:02:53 +0000 (15:02 +0300)]
base: alignof()

14 years agoGive parent project list of files to include in distro
Marko Kreen [Sat, 9 Oct 2010 07:14:43 +0000 (10:14 +0300)]
Give parent project list of files to include in distro

14 years agotime: make sure USEC is same type as usec_t
Marko Kreen [Thu, 30 Sep 2010 05:04:36 +0000 (22:04 -0700)]
time: make sure USEC is same type as usec_t

14 years agomakefile: Show CC flags at the start of compilation
Marko Kreen [Tue, 28 Sep 2010 19:07:21 +0000 (12:07 -0700)]
makefile: Show CC flags at the start of compilation

14 years agoAllow override of system regex
Marko Kreen [Tue, 28 Sep 2010 19:07:02 +0000 (12:07 -0700)]
Allow override of system regex

14 years agobits: add ffs compat, minor test fixes
Marko Kreen [Tue, 28 Sep 2010 18:50:43 +0000 (11:50 -0700)]
bits: add ffs compat, minor test fixes

14 years agotest: fix few compat problems
Marko Kreen [Sun, 26 Sep 2010 04:04:46 +0000 (21:04 -0700)]
test: fix few compat problems

- include <usual/base.h> before system includes
- don't force poll() test, it can conflict with system includes

14 years agobase: malloc.h is needed only on darwin
Marko Kreen [Sun, 26 Sep 2010 04:03:47 +0000 (21:03 -0700)]
base: malloc.h is needed only on darwin

14 years agobase: define few magic names to make Solaris work
Marko Kreen [Sun, 26 Sep 2010 04:02:56 +0000 (21:02 -0700)]
base: define few magic names to make Solaris work

14 years agoconfigure: add few common libraries to build.
Marko Kreen [Sun, 26 Sep 2010 04:01:53 +0000 (21:01 -0700)]
configure: add few common libraries to build.

Does not matter for libusual.a but for test executables.

14 years agoDon't use -Wextra on older gcc.
Marko Kreen [Sat, 25 Sep 2010 12:17:18 +0000 (05:17 -0700)]
Don't use -Wextra on older gcc.

Check for -Wno-missing-field-initializers,
gcc without it would be too noisy.

14 years agobits: make fallback fls work for negative values
Marko Kreen [Sun, 26 Sep 2010 03:57:05 +0000 (20:57 -0700)]
bits: make fallback fls work for negative values

14 years agobits: move bit-arithmetics to separate file
Marko Kreen [Tue, 21 Sep 2010 04:24:38 +0000 (21:24 -0700)]
bits: move bit-arithmetics to separate file

14 years agoSome more doc work
Marko Kreen [Tue, 21 Sep 2010 03:53:49 +0000 (20:53 -0700)]
Some more doc work

14 years agostring: memrchr() definition was lost
Marko Kreen [Wed, 15 Sep 2010 13:11:52 +0000 (16:11 +0300)]
string: memrchr() definition was lost

14 years agoattregex: make it build
Marko Kreen [Wed, 15 Sep 2010 12:15:32 +0000 (15:15 +0300)]
attregex: make it build

14 years agoattregex: import AT&T Research regex regression tests
Marko Kreen [Wed, 15 Sep 2010 12:04:31 +0000 (15:04 +0300)]
attregex: import AT&T Research regex regression tests

Make sure <usual/regex.[ch]> stays POSIX-compliant.

Homepage: http://www2.research.att.com/~gsf/testregex/
Version:  2009-11-11
Authors:  Doug McIlroy & Glenn Fowler

14 years agoregex: remove non-standard error codes.
Marko Kreen [Wed, 15 Sep 2010 11:45:13 +0000 (14:45 +0300)]
regex: remove non-standard error codes.

REG_EEND and REG_ESIZE are not in POSIX, and are unused
by this implementation.

ECOLLATE is also unused, but it's standard so keep it.

14 years agotest make improvements
Marko Kreen [Tue, 14 Sep 2010 21:05:21 +0000 (00:05 +0300)]
test make improvements

14 years agoDoxygen-based API docs
Marko Kreen [Wed, 13 Jan 2010 07:32:09 +0000 (09:32 +0200)]
Doxygen-based API docs

14 years agologging: fix die() arg passing
Marko Kreen [Sun, 12 Sep 2010 21:11:10 +0000 (00:11 +0300)]
logging: fix die() arg passing

14 years agodict: small dict type, mainly for urlencode/decode
Marko Kreen [Mon, 9 Aug 2010 22:27:01 +0000 (01:27 +0300)]
dict: small dict type, mainly for urlencode/decode

14 years agocxalloc: customizable allocator framework
Marko Kreen [Fri, 23 Jul 2010 10:06:24 +0000 (13:06 +0300)]
cxalloc: customizable allocator framework

There is a need to sometimes have different allocation policy
to some generic data structure than usual.

Instead of having each of them having allocator abstraction
on their own and both simple and customisable API, lets
have simple generic allocation API.

Initialized will take another CxMem *cx argument, and when
no customization is needed, put USUAL_ALLOC there.

15 years agoevent: remove usage of zmalloc
Marko Kreen [Fri, 23 Jul 2010 10:05:27 +0000 (13:05 +0300)]
event: remove usage of zmalloc

15 years agoaatree: make NIL node const.
Marko Kreen [Sat, 11 Sep 2010 07:44:15 +0000 (10:44 +0300)]
aatree: make NIL node const.

It really should not be modified.

15 years agostring: undef basename, dirname before defining
Marko Kreen [Sat, 11 Sep 2010 07:43:26 +0000 (10:43 +0300)]
string: undef basename, dirname before defining

Helps with testing, otherwise OS defs conflict with ours.

15 years agoDraft tgz generation
Marko Kreen [Fri, 10 Sep 2010 10:26:22 +0000 (13:26 +0300)]
Draft tgz generation

15 years agopgutil: trim the kwlookup code
Marko Kreen [Wed, 8 Sep 2010 17:08:29 +0000 (20:08 +0300)]
pgutil: trim the kwlookup code

No reason to care about unreserved keywords or their exact types.

Only keep the pg_is_reserved_word().

15 years agopgutil: cleaner gperf code
Marko Kreen [Mon, 6 Sep 2010 05:25:43 +0000 (08:25 +0300)]
pgutil: cleaner gperf code

- stop inlining
- remove '#line' directives

15 years agosocket: WSAIoctl was called with wrong params
Marko Kreen [Mon, 6 Sep 2010 05:20:42 +0000 (08:20 +0300)]
socket: WSAIoctl was called with wrong params

15 years agobase: don't define posix_memalign, if it cannot be emulated
Marko Kreen [Mon, 6 Sep 2010 05:19:57 +0000 (08:19 +0300)]
base: don't define posix_memalign, if it cannot be emulated

15 years agoregex: win32 can have STRICT defined
Marko Kreen [Mon, 6 Sep 2010 05:19:14 +0000 (08:19 +0300)]
regex: win32 can have STRICT defined

15 years agotime: win32 can have usleep
Marko Kreen [Mon, 6 Sep 2010 05:17:29 +0000 (08:17 +0300)]
time: win32 can have usleep

15 years agopgsocket: log db errors
Marko Kreen [Fri, 3 Sep 2010 14:05:49 +0000 (17:05 +0300)]
pgsocket: log db errors

also downgrade query logging to noise

15 years agologging: tab-indent multi-line error messages
Marko Kreen [Fri, 3 Sep 2010 14:04:49 +0000 (17:04 +0300)]
logging: tab-indent multi-line error messages

15 years agoevent: fix wrong error code
Marko Kreen [Fri, 3 Sep 2010 14:04:18 +0000 (17:04 +0300)]
event: fix wrong error code

15 years agotest: draft test module for regex
Marko Kreen [Fri, 3 Sep 2010 11:07:38 +0000 (14:07 +0300)]
test: draft test module for regex

15 years agopgutil: include gperf generated code in git.
Marko Kreen [Fri, 3 Sep 2010 10:04:06 +0000 (13:04 +0300)]
pgutil: include gperf generated code in git.

It depends on 8.4+, so users with 8.3 cannot generate it by themselves.

15 years agopgutil: add few missing features to pg_parse_array()
Marko Kreen [Thu, 2 Sep 2010 11:34:53 +0000 (14:34 +0300)]
pgutil: add few missing features to pg_parse_array()

- ignore whitespace around values
- support NULL
- rename to pg_parse_array
- skip dimension definitions
- add regtests

15 years agopgutil: support NULL for quote_literal
Marko Kreen [Thu, 2 Sep 2010 11:28:02 +0000 (14:28 +0300)]
pgutil: support NULL for quote_literal

15 years agostrlist: allow storing NULL
Marko Kreen [Thu, 2 Sep 2010 11:25:16 +0000 (14:25 +0300)]
strlist: allow storing NULL

15 years agopgutil: move common postgres helper functions here.
Marko Kreen [Wed, 1 Sep 2010 14:26:48 +0000 (17:26 +0300)]
pgutil: move common postgres helper functions here.

15 years agologging: exit process in case logfile is not writable.
Marko Kreen [Tue, 31 Aug 2010 08:32:42 +0000 (11:32 +0300)]
logging: exit process in case logfile is not writable.

Otherwise configuration mistakes can be hard to diagnose.

15 years agodaemon: write pidfile twice, to be able to show errors to user
Marko Kreen [Tue, 31 Aug 2010 08:32:10 +0000 (11:32 +0300)]
daemon: write pidfile twice, to be able to show errors to user

15 years agodaemon: signal_pidfile()
Marko Kreen [Mon, 9 Aug 2010 22:17:58 +0000 (01:17 +0300)]
daemon: signal_pidfile()

15 years agosocket: Fix fd_set allocation on win32
Marko Kreen [Mon, 19 Jul 2010 13:52:35 +0000 (16:52 +0300)]
socket: Fix fd_set allocation on win32

15 years agosocket: win32 keepalive defs for mingw32
Marko Kreen [Mon, 19 Jul 2010 13:38:07 +0000 (16:38 +0300)]
socket: win32 keepalive defs for mingw32

15 years agoMove more portability goo over from pgbouncer.
Marko Kreen [Wed, 16 Jun 2010 09:24:32 +0000 (12:24 +0300)]
Move more portability goo over from pgbouncer.

FLEX_ARRAY, __func__, event_loopbreak.

15 years agorename old 'check' target to 'sparse'
Marko Kreen [Tue, 4 May 2010 11:26:35 +0000 (14:26 +0300)]
rename old 'check' target to 'sparse'

15 years agotest: new regtest based on tinytest
Marko Kreen [Fri, 22 Jan 2010 08:35:01 +0000 (10:35 +0200)]
test: new regtest based on tinytest

15 years agoregex: small fallback regex implementation
Marko Kreen [Tue, 6 Oct 2009 21:49:53 +0000 (00:49 +0300)]
regex: small fallback regex implementation

15 years agostrpool: pool for shared strings
Marko Kreen [Sat, 1 May 2010 20:27:39 +0000 (23:27 +0300)]
strpool: pool for shared strings

15 years agobase: sync Assert() with logging changes
Marko Kreen [Fri, 30 Apr 2010 18:55:57 +0000 (21:55 +0300)]
base: sync Assert() with logging changes

15 years agologging: avoid changing errno.
Marko Kreen [Mon, 19 Apr 2010 07:14:58 +0000 (10:14 +0300)]
logging: avoid changing errno.

So user can safely log syscall results without worrying about errno changing.

15 years agoFix warning flags.
Marko Kreen [Sat, 24 Apr 2010 11:53:12 +0000 (14:53 +0300)]
Fix warning flags.

-Wformat=2 should turn an more useful flags.
-Wstrict-overflow is too noisy.  And =1 is already turned on by -Wall.

15 years agoMakefile: check target for sparse checking
Marko Kreen [Mon, 12 Apr 2010 09:16:28 +0000 (12:16 +0300)]
Makefile: check target for sparse checking

15 years agologging: fix signed vs. unsigned cmp warning
Marko Kreen [Mon, 12 Apr 2010 09:14:49 +0000 (12:14 +0300)]
logging: fix signed vs. unsigned cmp warning

15 years agomove <sys/param.h> include into <base.h>
Marko Kreen [Mon, 12 Apr 2010 09:13:00 +0000 (12:13 +0300)]
move <sys/param.h> include into <base.h>

then we can detect system defined macros (ALIGN)

15 years agosocket: remove unneeded logging.h include
Marko Kreen [Mon, 12 Apr 2010 09:10:38 +0000 (12:10 +0300)]
socket: remove unneeded logging.h include

15 years agopgsocket: catch and ignore notices
Marko Kreen [Fri, 9 Apr 2010 13:01:47 +0000 (16:01 +0300)]
pgsocket: catch and ignore notices

default notice handler prints them to stderr, disable it

15 years agologging: customizable prefix, context info
Marko Kreen [Thu, 1 Apr 2010 11:54:18 +0000 (14:54 +0300)]
logging: customizable prefix, context info

15 years agoautoconf: make sure 'restrict' keyword is always available
Marko Kreen [Wed, 31 Mar 2010 12:58:06 +0000 (15:58 +0300)]
autoconf: make sure 'restrict' keyword is always available

15 years agoautoconf: Some gcc versions require AC_PROG_CC_STDC to provide std c.
Marko Kreen [Wed, 31 Mar 2010 12:48:13 +0000 (15:48 +0300)]
autoconf: Some gcc versions require AC_PROG_CC_STDC to provide std c.

In particular 4.1.2, to define __STDC_VERSION__

15 years agoautoconf: separate warning flags from CFLAGS int WFLAGS
Marko Kreen [Wed, 31 Mar 2010 12:02:07 +0000 (15:02 +0300)]
autoconf: separate warning flags from CFLAGS int WFLAGS

this allows easier CFLAGS customization in user program.

15 years agoutf8: fix problems with longer seqs
Marko Kreen [Tue, 30 Mar 2010 09:55:13 +0000 (12:55 +0300)]
utf8: fix problems with longer seqs

15 years agoslab: avoid shared structures in case of threaded program
Marko Kreen [Fri, 19 Mar 2010 13:41:45 +0000 (15:41 +0200)]
slab: avoid shared structures in case of threaded program

- use malloc() for slab headers
- dont keep shared list if _REENTRANT is defined